Skip to content

Commit 02bf365

Browse files
committed
feat: add ExpressService, InstantService, and InstantVehicle enums
1 parent 2141837 commit 02bf365

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

src/Enums/ExpressService.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace KiriminAja\Enums;
4+
5+
enum ExpressService: string
6+
{
7+
case Tiki = "tiki";
8+
case Pos = "posindonesia";
9+
case Paxel = "paxel";
10+
case Ninja = "ninja";
11+
case RPX = "rpx";
12+
case LionParcel = "lion";
13+
case JTCargo = "jtcargo";
14+
case SentralCargo = "sentral";
15+
case AnterAja = "anteraja";
16+
case NCS = "ncs";
17+
case Sicepat = "sicepat";
18+
case SAP = "sap";
19+
case IDExpress = "idx";
20+
case JNE = "jne";
21+
case JNT = "jnt";
22+
case SPX = "spx";
23+
}

src/Enums/InstantService.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace KiriminAja\Enums;
4+
5+
enum InstantService: string
6+
{
7+
case GrabExpress = "grab_express";
8+
case Borzo = "borzo";
9+
case GoSend = "gosend";
10+
}

src/Enums/InstantVehicle.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace KiriminAja\Enums;
4+
5+
enum InstantVehicle: string
6+
{
7+
case Bike = "motor";
8+
case Car = "mobil";
9+
}

tests/Services/Shipping/PriceService/PriceServiceFailedTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
require_once(__DIR__.'/../ShippingMock.php');
66

7+
use KiriminAja\Enums\ExpressService;
78
use KiriminAja\Models\ShippingPriceData;
89
use KiriminAja\Services\Shipping\PriceService;
910
use KiriminAja\Services\Shipping\ShippingMock;
@@ -28,7 +29,7 @@ public function testFailedService()
2829
$shipping_price_object->weight = 1000;
2930
$shipping_price_object->insurance = 1;
3031
$shipping_price_object->item_value = 100000;
31-
$shipping_price_object->courier = ['jne'];
32+
$shipping_price_object->courier = [ExpressService::JNE->value, 'other'];
3233

3334
(new ShippingMock())->shippingMock()
3435
->shouldReceive([

tests/Services/Shipping/PriceService/PriceServiceSuccessTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
require_once(__DIR__.'/../ShippingMock.php');
66

7+
use KiriminAja\Enums\ExpressService;
78
use KiriminAja\Models\ShippingPriceData;
89
use KiriminAja\Services\Shipping\PriceService;
910
use KiriminAja\Services\Shipping\ShippingMock;
@@ -58,7 +59,7 @@ public function test()
5859
$shipping_price_object->weight = 1000;
5960
$shipping_price_object->insurance = 1;
6061
$shipping_price_object->item_value = 100000;
61-
$shipping_price_object->courier = ['jne'];
62+
$shipping_price_object->courier = [ExpressService::JNE->value, 'other'];
6263

6364
$result = (new PriceService($shipping_price_object))->call();
6465

0 commit comments

Comments
 (0)