From 80d7dd8b38d8887c55be723d40047117fa0dc683 Mon Sep 17 00:00:00 2001 From: Nabil Izzullah Date: Sat, 15 Jul 2023 17:55:33 +0700 Subject: [PATCH 1/2] KAV-353: SDK Update Lat Lng Request Pickup --- src/Models/RequestPickupData.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Models/RequestPickupData.php b/src/Models/RequestPickupData.php index 59cc157..2ab3608 100644 --- a/src/Models/RequestPickupData.php +++ b/src/Models/RequestPickupData.php @@ -14,4 +14,6 @@ class RequestPickupData extends ModelBase public array $packages; // PackageData of array(min:1 object) false Lihat penyusunan list paket berikut public string $schedule; // string false Lihat bagian #Pickup Schedules public ?string $platform_name = null; + public ?string $latitude = null; // string Latitude dari pengirim, diperlukan ketka menggunakan ekspedisi Lion Parcel. + public ?string $longitude = null; // string Latitude dari pengirim, diperlukan ketka menggunakan ekspedisi Lion Parcel. } From 725a3cd35f9615d37814072b47f1b21c9bde4cc1 Mon Sep 17 00:00:00 2001 From: Nabil Izzullah Date: Mon, 17 Jul 2023 15:35:41 +0700 Subject: [PATCH 2/2] KAV-353: Add Lat Lng Support for Lion Parcel --- src/Models/RequestPickupData.php | 4 ++-- .../RequestPickupServiceSuccessTest.php | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Models/RequestPickupData.php b/src/Models/RequestPickupData.php index 2ab3608..7af9c4b 100644 --- a/src/Models/RequestPickupData.php +++ b/src/Models/RequestPickupData.php @@ -14,6 +14,6 @@ class RequestPickupData extends ModelBase public array $packages; // PackageData of array(min:1 object) false Lihat penyusunan list paket berikut public string $schedule; // string false Lihat bagian #Pickup Schedules public ?string $platform_name = null; - public ?string $latitude = null; // string Latitude dari pengirim, diperlukan ketka menggunakan ekspedisi Lion Parcel. - public ?string $longitude = null; // string Latitude dari pengirim, diperlukan ketka menggunakan ekspedisi Lion Parcel. + public ?float $latitude; // float Latitude dari pengirim, diperlukan ketka menggunakan ekspedisi Lion Parcel. + public ?float $longitude; // float Latitude dari pengirim, diperlukan ketka menggunakan ekspedisi Lion Parcel. } diff --git a/tests/Services/Shipping/RequestPickupService/RequestPickupServiceSuccessTest.php b/tests/Services/Shipping/RequestPickupService/RequestPickupServiceSuccessTest.php index 0c32902..de84173 100644 --- a/tests/Services/Shipping/RequestPickupService/RequestPickupServiceSuccessTest.php +++ b/tests/Services/Shipping/RequestPickupService/RequestPickupServiceSuccessTest.php @@ -4,8 +4,11 @@ require_once(__DIR__.'/../ShippingMock.php'); +use KiriminAja\Base\Config\Cache\Mode; +use KiriminAja\Base\Config\KiriminAjaConfig; use KiriminAja\Models\PackageData; use KiriminAja\Models\RequestPickupData; +use KiriminAja\Services\KiriminAja; use KiriminAja\Services\Shipping\RequestPickupService; use KiriminAja\Services\Shipping\ShippingMock; use PHPUnit\Framework\TestCase; @@ -48,7 +51,9 @@ public function test() $pickup_object->phone = "082129627860"; $pickup_object->name = "dipaferdian"; $pickup_object->kecamatan_id = 5784; - $pickup_object->schedule = "2022-11-03 17:00:00"; + $pickup_object->latitude = -6.3493; + $pickup_object->longitude = 106.801376; + $pickup_object->schedule = "2023-07-17 17:00:00"; $pickup_object->zipcode = 16610; $pickup_object->platform_name = 'mitra'; $pickup_object->packages = []; @@ -66,15 +71,14 @@ public function test() $package_data->length = 8; $package_data->item_value = 275000; $package_data->shipping_cost = 65000; - $package_data->service = "sicepat"; - $package_data->service_type = "SIUNT"; + $package_data->service = "jne"; + $package_data->service_type = "REG"; $package_data->item_name = "Test item name"; $package_data->package_type_id = 1; $package_data->cod = 0; $package_data->note = 'test pickup request non cod'; $package_data->drop = true; $pickup_object->packages = [$package_data]; - $result = (new RequestPickupService($pickup_object))->call(); self::assertTrue($result->status);