From 20b74e6e6062eda5215358b4d24300bec127693d Mon Sep 17 00:00:00 2001 From: Thijmen Wijers <106662400+wthijmen@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:15:36 +0200 Subject: [PATCH] fix: remove instabox (#478) --- src/Helper/MyParcelCollection.php | 3 +- src/Model/Carrier/CarrierInstabox.php | 40 --------- src/Model/Consignment/InstaboxConsignment.php | 82 ------------------- .../InstaboxConsignmentValidator.php | 29 ------- test/Model/Fulfilment/OrderCollectionTest.php | 2 +- .../CarrierConfigurationServiceTest.php | 1 - 6 files changed, 2 insertions(+), 155 deletions(-) delete mode 100644 src/Model/Carrier/CarrierInstabox.php delete mode 100644 src/Model/Consignment/InstaboxConsignment.php delete mode 100644 src/Validator/Consignment/InstaboxConsignmentValidator.php diff --git a/src/Helper/MyParcelCollection.php b/src/Helper/MyParcelCollection.php index 805f641c..fd6d024a 100644 --- a/src/Helper/MyParcelCollection.php +++ b/src/Helper/MyParcelCollection.php @@ -22,7 +22,6 @@ use MyParcelNL\Sdk\src\Exception\ApiException; use MyParcelNL\Sdk\src\Exception\MissingFieldException; use MyParcelNL\Sdk\src\Factory\ConsignmentFactory; -use MyParcelNL\Sdk\src\Model\Carrier\CarrierInstabox; use MyParcelNL\Sdk\src\Model\Carrier\CarrierUPS; use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; use MyParcelNL\Sdk\src\Model\Consignment\BaseConsignment; @@ -830,7 +829,7 @@ private function getNewCollectionFromResult($result): self $consignment = ConsignmentFactory::createByCarrierId($shipment['carrier_id'])->setApiKey($apiKey); //TODO: MY-32524 Make AbstractConsignmentAdapter for carrier specific exceptions - if (CarrierInstabox::ID === $shipment['carrier_id'] || CarrierUPS::ID === $shipment['carrier_id']) { + if (CarrierUPS::ID === $shipment['carrier_id']) { $shipment['barcode'] = $shipment['barcode'] ?: $shipment['external_identifier']; } diff --git a/src/Model/Carrier/CarrierInstabox.php b/src/Model/Carrier/CarrierInstabox.php deleted file mode 100644 index 8ff73406..00000000 --- a/src/Model/Carrier/CarrierInstabox.php +++ /dev/null @@ -1,40 +0,0 @@ -getCarrierId() */ - public const CARRIER_ID = 5; - /** @deprecated use $this->getCarrierName() */ - public const CARRIER_NAME = 'instabox'; - - /** - * @var string - */ - protected $carrierClass = CarrierInstabox::class; - - /** - * @var string - */ - protected $validatorClass = InstaboxConsignmentValidator::class; - - /** - * @return string[] - */ - public function getAllowedDeliveryTypes(): array - { - return [ - self::DELIVERY_TYPE_STANDARD_NAME, - ]; - } - - /** - * @return string[] - */ - public function getAllowedExtraOptions(): array - { - return [ - self::EXTRA_OPTION_DELIVERY_DATE, - ]; - } - - /** - * @return string[] - */ - public function getAllowedPackageTypes(): array - { - return [ - self::PACKAGE_TYPE_PACKAGE_NAME, - self::PACKAGE_TYPE_MAILBOX_NAME, - ]; - } - - /** - * @return string[] - */ - public function getAllowedShipmentOptions(): array - { - return [ - self::SHIPMENT_OPTION_AGE_CHECK, - self::SHIPMENT_OPTION_LARGE_FORMAT, - self::SHIPMENT_OPTION_ONLY_RECIPIENT, - self::SHIPMENT_OPTION_RETURN, - self::SHIPMENT_OPTION_SAME_DAY_DELIVERY, - ]; - } - - /** - * @return string - */ - public function getLocalCountryCode(): string - { - return self::CC_NL; - } -} diff --git a/src/Validator/Consignment/InstaboxConsignmentValidator.php b/src/Validator/Consignment/InstaboxConsignmentValidator.php deleted file mode 100644 index cb1e7b67..00000000 --- a/src/Validator/Consignment/InstaboxConsignmentValidator.php +++ /dev/null @@ -1,29 +0,0 @@ - 'NL', 'city' => 'Leiden', 'location_code' => 'ed14eb91-7374-4dcc-a41d-34c0d3e45c01', - 'location_name' => 'Instabox', + 'location_name' => 'Dropoff', 'number' => '2', 'number_suffix' => 'H', 'postal_code' => '2321 TD', diff --git a/test/Services/CarrierConfigurationServiceTest.php b/test/Services/CarrierConfigurationServiceTest.php index 1faa59fc..dbb34177 100644 --- a/test/Services/CarrierConfigurationServiceTest.php +++ b/test/Services/CarrierConfigurationServiceTest.php @@ -5,7 +5,6 @@ namespace MyParcelNL\Sdk\Test\Services; use MyParcelNL\Sdk\src\Model\Account\Shop; -use MyParcelNL\Sdk\src\Model\Carrier\CarrierInstabox; use MyParcelNL\Sdk\src\Services\Web\AccountWebService; use MyParcelNL\Sdk\src\Services\Web\CarrierConfigurationWebService; use MyParcelNL\Sdk\Test\Bootstrap\TestCase;