From ef5c714a38247d7bdbee5164867a399162ff73b9 Mon Sep 17 00:00:00 2001 From: Florian Riecker- de Vries <93703843+FlorianSDV@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:21:04 +0200 Subject: [PATCH] feat: add international mailbox support when shipping to belgium (#289) INT-584 --- .../Cart/Service/CartCalculationService.php | 4 +- .../Service/DeliveryOptionsService.php | 17 +-- .../General/PackageTypeCalculator.php | 6 +- .../Backend/Order/ExportOrderActionTest.php | 101 ++++++++++++++---- .../Service/CartCalculationServiceTest.php | 25 +++++ .../Service/DeliveryOptionsServiceTest.php | 35 ++++++ .../General/PackageTypeCalculatorTest.php | 25 ++--- ...t_custom_postnl_be_mailbox_package__1.json | 34 ++++++ ...national_mailbox__data_set_default__1.json | 30 ++++++ ...ional_mailbox__data_set_order_mode__1.json | 30 ++++++ ...national_mailbox__data_set_default__1.json | 30 ++++++ ...ional_mailbox__data_set_order_mode__1.json | 30 ++++++ ...national_mailbox__data_set_default__1.json | 2 +- ...ional_mailbox__data_set_order_mode__1.json | 2 +- ...ilbox_to_Belgium__data_set_default__1.json | 30 ++++++ ...ox_to_Belgium__data_set_order_mode__1.json | 30 ++++++ ...toms_declaration__data_set_default__1.json | 2 +- ...s_declaration__data_set_order_mode__1.json | 2 +- ...ryou123,_dhlforyou)__(false,_false)__1.txt | 1 + ...oryou123,_dhlforyou)__(false,_true)__1.txt | 1 + ...oryou123,_dhlforyou)__(true,_false)__1.txt | 1 + ...foryou123,_dhlforyou)__(true,_true)__1.txt | 1 + ...)__(BE)__(dpd,_dpd)__(false,_false)__1.txt | 1 + ...e)__(BE)__(dpd,_dpd)__(false,_true)__1.txt | 1 + ...e)__(BE)__(dpd,_dpd)__(true,_false)__1.txt | 1 + ...ie)__(BE)__(dpd,_dpd)__(true,_true)__1.txt | 1 + ...(postnl123,_postnl)__(false,_false)__1.txt | 1 + ..._(postnl123,_postnl)__(false,_true)__1.txt | 1 + ..._(postnl123,_postnl)__(true,_false)__1.txt | 1 + ...__(postnl123,_postnl)__(true,_true)__1.txt | 1 + ...ryou123,_dhlforyou)__(false,_false)__1.txt | 1 + ...oryou123,_dhlforyou)__(false,_true)__1.txt | 1 + ...oryou123,_dhlforyou)__(true,_false)__1.txt | 1 + ...foryou123,_dhlforyou)__(true,_true)__1.txt | 1 + ...)__(BE)__(dpd,_dpd)__(false,_false)__1.txt | 1 + ...t)__(BE)__(dpd,_dpd)__(false,_true)__1.txt | 1 + ...t)__(BE)__(dpd,_dpd)__(true,_false)__1.txt | 1 + ...et)__(BE)__(dpd,_dpd)__(true,_true)__1.txt | 1 + ...(postnl123,_postnl)__(false,_false)__1.txt | 1 + ..._(postnl123,_postnl)__(false,_true)__1.txt | 1 + ..._(postnl123,_postnl)__(true,_false)__1.txt | 1 + ...__(postnl123,_postnl)__(true,_true)__1.txt | 1 + ...ryou123,_dhlforyou)__(false,_false)__1.txt | 1 + ...oryou123,_dhlforyou)__(false,_true)__1.txt | 1 + ...oryou123,_dhlforyou)__(true,_false)__1.txt | 1 + ...foryou123,_dhlforyou)__(true,_true)__1.txt | 1 + ...)__(BE)__(dpd,_dpd)__(false,_false)__1.txt | 1 + ...l)__(BE)__(dpd,_dpd)__(false,_true)__1.txt | 1 + ...l)__(BE)__(dpd,_dpd)__(true,_false)__1.txt | 1 + ...el)__(BE)__(dpd,_dpd)__(true,_true)__1.txt | 1 + ...(postnl123,_postnl)__(false,_false)__1.txt | 1 + ..._(postnl123,_postnl)__(false,_true)__1.txt | 1 + ..._(postnl123,_postnl)__(true,_false)__1.txt | 1 + ...__(postnl123,_postnl)__(true,_true)__1.txt | 1 + 54 files changed, 423 insertions(+), 48 deletions(-) create mode 100644 tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_be_mailbox_package__1.json create mode 100644 tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json create mode 100644 tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json create mode 100644 tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json create mode 100644 tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json create mode 100644 tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_default__1.json create mode 100644 tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_order_mode__1.json create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt create mode 100644 tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt diff --git a/src/App/Cart/Service/CartCalculationService.php b/src/App/Cart/Service/CartCalculationService.php index b7261b6cd..cd84f880a 100644 --- a/src/App/Cart/Service/CartCalculationService.php +++ b/src/App/Cart/Service/CartCalculationService.php @@ -123,7 +123,7 @@ private function allowMailboxToCountry(?string $cc): bool return false; } - $countryIsUnique = $this->countryService->isUnique($cc); + $countryIsLocal = $this->countryService->isLocalCountry($cc); $allowInternationalMailbox = Settings::all()->carrier->contains(function (CarrierSettings $carrierSettings) { $allowInternationalMailbox = $carrierSettings->allowInternationalMailbox; $hasDeliveryOptions = $carrierSettings->deliveryOptionsEnabled; @@ -131,7 +131,7 @@ private function allowMailboxToCountry(?string $cc): bool return $allowInternationalMailbox && $hasDeliveryOptions; }); - return $countryIsUnique || $allowInternationalMailbox; + return $countryIsLocal || $allowInternationalMailbox; } /** diff --git a/src/App/DeliveryOptions/Service/DeliveryOptionsService.php b/src/App/DeliveryOptions/Service/DeliveryOptionsService.php index a40406eb0..1ccbc6b96 100644 --- a/src/App/DeliveryOptions/Service/DeliveryOptionsService.php +++ b/src/App/DeliveryOptions/Service/DeliveryOptionsService.php @@ -147,7 +147,10 @@ private function createCarrierSettings(Carrier $carrier, PdkCart $cart, string $ ? $carrierSettings['dropOffDelay'] : $cart->shippingMethod->minimumDropOffDelay; - if ($this->shouldUseInternationalMailboxPrice($packageType, $cart->shippingMethod->shippingAddress->cc)) { + $cc = $cart->shippingMethod->shippingAddress->cc ?? null; + if ( + $cc + && $this->shouldUseInternationalMailboxPrice($packageType, $cc)) { $carrierSettings->pricePackageTypeMailbox = $carrierSettings->priceInternationalMailbox; } @@ -250,16 +253,16 @@ function (Carrier $carrier) use ($cart, $weight, $packageType, $carrierSettings) } /** - * @param string $packageType - * @param null|string $cc + * @param string $packageType + * @param string $cc * * @return bool */ - private function shouldUseInternationalMailboxPrice(string $packageType, ?string $cc): bool + private function shouldUseInternationalMailboxPrice(string $packageType, string $cc): bool { - $isMailbox = $packageType === DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME; - $isNotUnique = $cc && ! $this->countryService->isUnique($cc); + $isMailbox = $packageType === DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME; + $isNotLocal = ! $this->countryService->isLocalCountry($cc); - return $isMailbox && $isNotUnique; + return $isMailbox && $isNotLocal; } } diff --git a/src/App/Order/Calculator/General/PackageTypeCalculator.php b/src/App/Order/Calculator/General/PackageTypeCalculator.php index f35ea9d38..a4ed6a317 100644 --- a/src/App/Order/Calculator/General/PackageTypeCalculator.php +++ b/src/App/Order/Calculator/General/PackageTypeCalculator.php @@ -71,11 +71,13 @@ private function isInternationalMailbox(Carrier $carrier): bool $schema->setCarrier($carrier); $isMailbox = $this->order->deliveryOptions->packageType === DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME; - $isNotUnique = ! $this->countryService->isUnique($this->order->shippingAddress->cc); + $isNotLocal = ! $this->countryService->isLocalCountry( + $this->order->shippingAddress->cc + ); $enabledInAccount = AccountSettings::hasCarrierSmallPackageContract(); $canHaveCarrierSmallPackageContract = $schema->canHaveCarrierSmallPackageContract(); $enabledInSettings = $carrierSettings->allowInternationalMailbox; - return $isMailbox && $isNotUnique && $enabledInAccount && $canHaveCarrierSmallPackageContract && $enabledInSettings; + return $isMailbox && $isNotLocal && $enabledInAccount && $canHaveCarrierSmallPackageContract && $enabledInSettings; } } diff --git a/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php b/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php index 07d375232..cf4e7bff2 100644 --- a/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php +++ b/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php @@ -5,6 +5,7 @@ namespace MyParcelNL\Pdk\App\Action\Backend\Order; +use MyParcelNL\Pdk\Account\Model\AccountGeneralSettings; use MyParcelNL\Pdk\App\Api\Backend\PdkBackendActions; use MyParcelNL\Pdk\App\Order\Collection\PdkOrderCollection; use MyParcelNL\Pdk\App\Order\Collection\PdkOrderCollectionFactory; @@ -13,6 +14,7 @@ use MyParcelNL\Pdk\Base\Support\Arr; use MyParcelNL\Pdk\Base\Support\Collection; use MyParcelNL\Pdk\Carrier\Model\Carrier; +use MyParcelNL\Pdk\Carrier\Model\CarrierCapabilities; use MyParcelNL\Pdk\Facade\Actions; use MyParcelNL\Pdk\Facade\Notifications; use MyParcelNL\Pdk\Facade\Pdk; @@ -35,6 +37,7 @@ use MyParcelNL\Pdk\Tests\Uses\UsesMockPdkInstance; use MyParcelNL\Pdk\Tests\Uses\UsesNotificationsMock; use MyParcelNL\Pdk\Tests\Uses\UsesSettingsMock; +use MyParcelNL\Pdk\Validation\Validator\CarrierSchema; use Symfony\Component\HttpFoundation\Response; use function MyParcelNL\Pdk\Tests\factory; use function MyParcelNL\Pdk\Tests\usesShared; @@ -284,35 +287,54 @@ ->and(Arr::pluck($responseShipments[0], 'id'))->each->toBeInt(); }); -it('exports international orders', function (PdkOrderCollectionFactory $factory, bool $orderMode) { - MockApi::enqueue( - ...$orderMode - ? [new ExamplePostOrdersResponse(), new ExamplePostOrderNotesResponse()] - : [new ExamplePostShipmentsResponse()] - ); +it( + 'exports international orders', + function ( + PdkOrderCollectionFactory $factory, + bool $accountHasCarrierSmallPackageContract, + bool $carrierHasInternationalMailboxAllowed, + bool $orderMode + ) { + MockApi::enqueue( + ...$orderMode + ? [new ExamplePostOrdersResponse(), new ExamplePostOrderNotesResponse()] + : [new ExamplePostShipmentsResponse()] + ); - factory(OrderSettings::class) - ->withConceptShipments(true) - ->store(); + $collection = $factory + ->store() + ->make(); + $fakeCarrier = $collection->first()->deliveryOptions->carrier; - $collection = $factory - ->store() - ->make(); + factory(CarrierSettings::class, $fakeCarrier->externalIdentifier) + ->withAllowInternationalMailbox($carrierHasInternationalMailboxAllowed) + ->store(); - $orderIds = $collection->pluck('externalIdentifier'); + factory(OrderSettings::class) + ->withConceptShipments(true) + ->store(); - Actions::execute(PdkBackendActions::EXPORT_ORDERS, ['orderIds' => $orderIds->toArray()]); + factory(AccountGeneralSettings::class) + ->withHasCarrierSmallPackageContract($accountHasCarrierSmallPackageContract) + ->store(); - $lastRequest = MockApi::ensureLastRequest(); - $stream = $lastRequest->getBody(); + $orderIds = $collection->pluck('externalIdentifier'); - assertMatchesJsonSnapshot($stream->getContents()); -}) + Actions::execute(PdkBackendActions::EXPORT_ORDERS, ['orderIds' => $orderIds->toArray()]); + + $lastRequest = MockApi::ensureLastRequest(); + $stream = $lastRequest->getBody(); + + assertMatchesJsonSnapshot($stream->getContents()); + } +) ->with([ 'without customs declaration' => [ function () { return factory(PdkOrderCollection::class)->push(factory(PdkOrder::class)->toTheUnitedStates()); }, + 'accountHasCarrierSmallPackageContract' => false, + 'carrierHasInternationalMailboxAllowed' => false, ], 'with customs declaration (deprecated)' => [ @@ -338,6 +360,35 @@ function () { ) ); }, + 'accountHasCarrierSmallPackageContract' => false, + 'carrierHasInternationalMailboxAllowed' => false, + ], + + 'custom postnl with international mailbox to Belgium' => [ + function () { + return factory(PdkOrderCollection::class)->push( + factory(PdkOrder::class) + ->toBelgium() + ->withDeliveryOptions( + factory(DeliveryOptions::class) + ->withCarrier( + factory(Carrier::class) + ->fromPostNL() + ->withContractId(123456) + ->withCapabilities( + factory(CarrierCapabilities::class) + ->withFeatures( + ['carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY] + ) + ->withPackageTypes([DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME]) + ) + ) + ->withPackageType(DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME) + ) + ); + }, + 'accountHasCarrierSmallPackageContract' => true, + 'carrierHasInternationalMailboxAllowed' => true, ], 'custom postnl with international mailbox' => [ @@ -351,14 +402,20 @@ function () { factory(Carrier::class) ->fromPostNL() ->withContractId(123456) - ->withCapabilities([ - 'internationalMailbox' => true, - ]) + ->withCapabilities( + factory(CarrierCapabilities::class) + ->withFeatures( + ['carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY] + ) + ->withPackageTypes([DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME]) + ) ) ->withPackageType(DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME) ) ); }, + 'accountHasCarrierSmallPackageContract' => true, + 'carrierHasInternationalMailboxAllowed' => true, ], 'postnl with international mailbox filtered out' => [ @@ -373,6 +430,8 @@ function () { ) ); }, + 'accountHasCarrierSmallPackageContract' => true, + 'carrierHasInternationalMailboxAllowed' => true, ], ]) ->with('orderModeToggle'); diff --git a/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php b/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php index d3c8923bb..8a0cba5f6 100644 --- a/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php +++ b/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php @@ -7,6 +7,7 @@ use MyParcelNL\Pdk\App\Cart\Contract\CartCalculationServiceInterface; use MyParcelNL\Pdk\App\Cart\Model\PdkCart; +use MyParcelNL\Pdk\Base\Service\CountryCodes; use MyParcelNL\Pdk\Base\Support\Arr; use MyParcelNL\Pdk\Carrier\Model\Carrier; use MyParcelNL\Pdk\Facade\Pdk; @@ -139,6 +140,16 @@ 'region' => 'Drenthe', 'state' => 'Current', ]; +const SHIPPING_ADDRESS_BE = [ + 'address1' => 'Adriaan Brouwerstraat 16', + 'address2' => 'Appartement B', + 'area' => 'Voor', + 'cc' => CountryCodes::CC_BE, + 'city' => 'Antwerpen', + 'postalCode' => '1000', + 'region' => 'Antwerpen', + 'state' => 'Current', +]; uses()->group('checkout'); usesShared(new UsesMockPdkInstance()); @@ -195,6 +206,20 @@ function (array $lines, array $shippingAddress, array $result, bool $allowIntern 'address' => SHIPPING_ADDRESS_NL, 'result' => [DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME, DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], ], + 'fits in mailbox BE, allowed' => [ + 'lines' => LINES_FITS_IN_MAILBOX, + 'address' => SHIPPING_ADDRESS_BE, + 'result' => [ + DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME, + DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME, + ], + 'allowInternationalMailbox' => true, + ], + 'fits in mailbox BE, not allowed' => [ + 'lines' => LINES_FITS_IN_MAILBOX, + 'address' => SHIPPING_ADDRESS_BE, + 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], + ], 'fits in mailbox EU, allowed' => [ 'lines' => LINES_FITS_IN_MAILBOX, 'address' => SHIPPING_ADDRESS_EU, diff --git a/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php b/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php index 07cf811c6..699c7a9e7 100644 --- a/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php +++ b/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php @@ -241,6 +241,41 @@ function ( }, ], + 'custom postnl: be mailbox package' => [ + 'cart' => [ + 'carrier' => [ + 'externalIdentifier' => 'postnl:123', + ], + 'shippingMethod' => [ + 'shippingAddress' => ['cc' => 'BE'], + 'allowedPackageTypes' => ['mailbox'], + ], + 'lines' => [ + [ + 'quantity' => 1, + 'product' => [ + 'weight' => 500, + 'isDeliverable' => true, + 'settings' => [ + ProductSettings::FIT_IN_MAILBOX => 5, + ProductSettings::PACKAGE_TYPE => DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME, + ], + ], + ], + ], + ], + 'carrierFactory' => function () { + return factory(Carrier::class)->withExternalIdentifier('postnl:123'); + }, + 'carrierSettingsFactory' => function () { + return function (CarrierSettingsFactory $factory) { + return $factory + ->withAllowInternationalMailbox(true) + ->withPriceInternationalMailbox(5); + }; + }, + ], + 'custom postnl: row mailbox package' => [ 'cart' => [ 'carrier' => [ diff --git a/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php b/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php index 48b0e1a39..ce1d6e1d1 100644 --- a/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php +++ b/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php @@ -42,23 +42,23 @@ ]; const ACCOUNT_FLAG_ON_CARRIER_SETTING_ON = [ - 'accountFlag' => true, - 'carrierSetting' => true, + 'accountHasCarrierSmallPackageContract' => true, + 'carrierHasInternationalMailboxAllowed' => true, ]; const ACCOUNT_FLAG_ON_CARRIER_SETTING_OFF = [ - 'accountFlag' => true, - 'carrierSetting' => false, + 'accountHasCarrierSmallPackageContract' => true, + 'carrierHasInternationalMailboxAllowed' => false, ]; const ACCOUNT_FLAG_OFF_CARRIER_SETTING_ON = [ - 'accountFlag' => false, - 'carrierSetting' => true, + 'accountHasCarrierSmallPackageContract' => false, + 'carrierHasInternationalMailboxAllowed' => true, ]; const ACCOUNT_FLAG_OFF_CARRIER_SETTING_OFF = [ - 'accountFlag' => false, - 'carrierSetting' => false, + 'accountHasCarrierSmallPackageContract' => false, + 'carrierHasInternationalMailboxAllowed' => false, ]; const CONFIG = [ @@ -71,6 +71,7 @@ const DESTINATION_INTERNATIONAL_COUNTRIES = [ CountryCodes::CC_FR, CountryCodes::CC_US, + CountryCodes::CC_BE, ]; usesShared(new UsesEachMockPdkInstance()); @@ -157,8 +158,8 @@ $country, $carrierExternalIdentifier, $carrierName, - $accountFlag, - $carrierSetting + $accountHasCarrierSmallPackageContract, + $carrierHasInternationalMailboxAllowed ) { mockPlatform($platform); mockPdkProperties([ @@ -173,7 +174,7 @@ ->make(); factory(CarrierSettings::class, $fakeCarrier->externalIdentifier) - ->withAllowInternationalMailbox($carrierSetting) + ->withAllowInternationalMailbox($carrierHasInternationalMailboxAllowed) ->store(); $order = factory(PdkOrder::class) @@ -189,7 +190,7 @@ ->make(); factory(AccountGeneralSettings::class) - ->withHasCarrierSmallPackageContract($accountFlag) + ->withHasCarrierSmallPackageContract($accountHasCarrierSmallPackageContract) ->store(); /** @var \MyParcelNL\Pdk\App\Order\Contract\PdkOrderOptionsServiceInterface $service */ diff --git a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_be_mailbox_package__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_be_mailbox_package__1.json new file mode 100644 index 000000000..32d5794b0 --- /dev/null +++ b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_be_mailbox_package__1.json @@ -0,0 +1,34 @@ +{ + "packageType": "mailbox", + "carrierSettings": { + "postnl:123": { + "allowDeliveryOptions": true, + "allowStandardDelivery": false, + "allowEveningDelivery": false, + "allowMondayDelivery": false, + "allowMorningDelivery": false, + "allowOnlyRecipient": false, + "allowPickupLocations": false, + "allowSameDayDelivery": false, + "allowSaturdayDelivery": false, + "allowSignature": false, + "priceEveningDelivery": 0, + "priceMorningDelivery": 0, + "priceOnlyRecipient": 0, + "pricePackageTypeDigitalStamp": 0, + "pricePackageTypeMailbox": 1.05, + "pricePackageTypePackageSmall": 0, + "pricePickup": 0, + "priceSameDayDelivery": 0, + "priceSignature": 0, + "priceStandardDelivery": 0, + "deliveryDaysWindow": 7, + "dropOffDelay": 0, + "cutoffTime": null, + "cutoffTimeSameDay": null, + "dropOffDays": [] + } + }, + "basePrice": 0, + "priceStandardDelivery": 0 +} diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json new file mode 100644 index 000000000..854b5ba76 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json @@ -0,0 +1,30 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "contract_id": 123456, + "general_settings": { + "save_recipient_address": 0 + }, + "options": { + "package_type": 1, + "delivery_type": 2 + }, + "physical_properties": { + "weight": 0 + }, + "recipient": { + "cc": "DE", + "city": "Berlin", + "company": "MyParcel", + "person": "Felicia Parcel", + "postal_code": "10117", + "street": "Musterstrasse 1", + "vat_number": "NL123456789B01" + }, + "reference_identifier": "PDK-1" + } + ] + } +} diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json new file mode 100644 index 000000000..854b5ba76 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(belgie)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json @@ -0,0 +1,30 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "contract_id": 123456, + "general_settings": { + "save_recipient_address": 0 + }, + "options": { + "package_type": 1, + "delivery_type": 2 + }, + "physical_properties": { + "weight": 0 + }, + "recipient": { + "cc": "DE", + "city": "Berlin", + "company": "MyParcel", + "person": "Felicia Parcel", + "postal_code": "10117", + "street": "Musterstrasse 1", + "vat_number": "NL123456789B01" + }, + "reference_identifier": "PDK-1" + } + ] + } +} diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json new file mode 100644 index 000000000..854b5ba76 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_default__1.json @@ -0,0 +1,30 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "contract_id": 123456, + "general_settings": { + "save_recipient_address": 0 + }, + "options": { + "package_type": 1, + "delivery_type": 2 + }, + "physical_properties": { + "weight": 0 + }, + "recipient": { + "cc": "DE", + "city": "Berlin", + "company": "MyParcel", + "person": "Felicia Parcel", + "postal_code": "10117", + "street": "Musterstrasse 1", + "vat_number": "NL123456789B01" + }, + "reference_identifier": "PDK-1" + } + ] + } +} diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json new file mode 100644 index 000000000..854b5ba76 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_(myparcel)__data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json @@ -0,0 +1,30 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "contract_id": 123456, + "general_settings": { + "save_recipient_address": 0 + }, + "options": { + "package_type": 1, + "delivery_type": 2 + }, + "physical_properties": { + "weight": 0 + }, + "recipient": { + "cc": "DE", + "city": "Berlin", + "company": "MyParcel", + "person": "Felicia Parcel", + "postal_code": "10117", + "street": "Musterstrasse 1", + "vat_number": "NL123456789B01" + }, + "reference_identifier": "PDK-1" + } + ] + } +} diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_default__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_default__1.json index 854b5ba76..e5b7fffe3 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_default__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_default__1.json @@ -8,7 +8,7 @@ "save_recipient_address": 0 }, "options": { - "package_type": 1, + "package_type": 2, "delivery_type": 2 }, "physical_properties": { diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json index 854b5ba76..e5b7fffe3 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox__data_set_order_mode__1.json @@ -8,7 +8,7 @@ "save_recipient_address": 0 }, "options": { - "package_type": 1, + "package_type": 2, "delivery_type": 2 }, "physical_properties": { diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_default__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_default__1.json new file mode 100644 index 000000000..6ae333204 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_default__1.json @@ -0,0 +1,30 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "contract_id": 123456, + "general_settings": { + "save_recipient_address": 0 + }, + "options": { + "package_type": 2, + "delivery_type": 2 + }, + "physical_properties": { + "weight": 0 + }, + "recipient": { + "cc": "BE", + "city": "Antwerpen", + "company": "MyParcel", + "person": "Felicia Parcel", + "postal_code": "1000", + "street": "Adriaan Brouwerstraat 16", + "vat_number": "NL123456789B01" + }, + "reference_identifier": "PDK-1" + } + ] + } +} diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_order_mode__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_order_mode__1.json new file mode 100644 index 000000000..6ae333204 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_custom_postnl_with_international_mailbox_to_Belgium__data_set_order_mode__1.json @@ -0,0 +1,30 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "contract_id": 123456, + "general_settings": { + "save_recipient_address": 0 + }, + "options": { + "package_type": 2, + "delivery_type": 2 + }, + "physical_properties": { + "weight": 0 + }, + "recipient": { + "cc": "BE", + "city": "Antwerpen", + "company": "MyParcel", + "person": "Felicia Parcel", + "postal_code": "1000", + "street": "Adriaan Brouwerstraat 16", + "vat_number": "NL123456789B01" + }, + "reference_identifier": "PDK-1" + } + ] + } +} diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_default__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_default__1.json index 4af7582f2..d9d9a1d22 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_default__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_default__1.json @@ -9,7 +9,7 @@ "items": [ { "amount": 1, - "classification": "", + "classification": "000000", "country": "NL", "description": "test", "item_value": { diff --git a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_order_mode__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_order_mode__1.json index 4af7582f2..d9d9a1d22 100644 --- a/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_order_mode__1.json +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_without_customs_declaration__data_set_order_mode__1.json @@ -9,7 +9,7 @@ "items": [ { "amount": 1, - "classification": "", + "classification": "000000", "country": "NL", "description": "test", "item_value": { diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_false)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_false)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(false,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_false)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_false)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(dpd,_dpd)__(true,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(false,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(dpd,_dpd)__(true,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(false,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(dpd,_dpd)__(true,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(false,_true)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_false)__1.txt @@ -0,0 +1 @@ +package \ No newline at end of file diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt new file mode 100644 index 000000000..eb6cbf15e --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(BE)__(postnl123,_postnl)__(true,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file