diff --git a/config/platform/flespakket.php b/config/platform/flespakket.php index 01e7f0962..e7772cb84 100644 --- a/config/platform/flespakket.php +++ b/config/platform/flespakket.php @@ -6,6 +6,7 @@ use MyParcelNL\Pdk\Carrier\Model\Carrier; use MyParcelNL\Pdk\Settings\Model\CheckoutSettings; use MyParcelNL\Pdk\Shipment\Model\DeliveryOptions; +use MyParcelNL\Pdk\Validation\Validator\CarrierSchema; return [ 'name' => 'flespakket', @@ -61,7 +62,8 @@ ], ], 'features' => [ - 'labelDescriptionLength' => 45, + 'labelDescriptionLength' => 45, + 'carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY, ], ], 'returnCapabilities' => [ diff --git a/config/platform/myparcel.php b/config/platform/myparcel.php index 4f4194bfa..d03fe946d 100644 --- a/config/platform/myparcel.php +++ b/config/platform/myparcel.php @@ -6,6 +6,7 @@ use MyParcelNL\Pdk\Carrier\Model\Carrier; use MyParcelNL\Pdk\Settings\Model\CheckoutSettings; use MyParcelNL\Pdk\Shipment\Model\DeliveryOptions; +use MyParcelNL\Pdk\Validation\Validator\CarrierSchema; return [ 'name' => 'myparcel', @@ -62,8 +63,9 @@ ], ], 'features' => [ - 'labelDescriptionLength' => 45, - 'multiCollo' => true, + 'labelDescriptionLength' => 45, + 'carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY, + 'multiCollo' => true, ], ], 'returnCapabilities' => [ diff --git a/src/Account/Model/AccountGeneralSettings.php b/src/Account/Model/AccountGeneralSettings.php index 5ef061ddd..f77092e0c 100644 --- a/src/Account/Model/AccountGeneralSettings.php +++ b/src/Account/Model/AccountGeneralSettings.php @@ -10,18 +10,21 @@ * @property bool $isTest * @property bool $orderMode * @property bool $hasCarrierContract + * @property bool $hasCarrierSmallPackageContract */ class AccountGeneralSettings extends Model { public $attributes = [ - 'isTest' => false, - 'orderMode' => false, - 'hasCarrierContract' => false, + 'isTest' => false, + 'orderMode' => false, + 'hasCarrierContract' => false, + 'hasCarrierSmallPackageContract' => false, ]; public $casts = [ - 'isTest' => 'bool', - 'orderMode' => 'bool', - 'hasCarrierContract' => 'bool', + 'isTest' => 'bool', + 'orderMode' => 'bool', + 'hasCarrierContract' => 'bool', + 'hasCarrierSmallPackageContract' => 'bool', ]; } diff --git a/src/Account/Model/Shop.php b/src/Account/Model/Shop.php index abb5ecd83..17d6a7f33 100644 --- a/src/Account/Model/Shop.php +++ b/src/Account/Model/Shop.php @@ -102,6 +102,7 @@ public function toStorableArray(): array 'label', 'primary', 'optional', + 'type', ], Arrayable::STORABLE_NULL); }); diff --git a/src/Account/Service/AccountSettingsService.php b/src/Account/Service/AccountSettingsService.php index 619e2644a..a8ef9ddf5 100644 --- a/src/Account/Service/AccountSettingsService.php +++ b/src/Account/Service/AccountSettingsService.php @@ -99,6 +99,17 @@ public function hasAccount(): bool return null !== $this->getAccount(); } + /** + * @return bool + * @noinspection PhpUnused + */ + public function hasCarrierSmallPackageContract(): bool + { + $account = $this->getAccount(); + + return $account ? $account->generalSettings->hasCarrierSmallPackageContract : false; + } + /** * @param string $feature * diff --git a/src/App/Cart/Service/CartCalculationService.php b/src/App/Cart/Service/CartCalculationService.php index 4650b8f6f..b7261b6cd 100644 --- a/src/App/Cart/Service/CartCalculationService.php +++ b/src/App/Cart/Service/CartCalculationService.php @@ -7,9 +7,12 @@ use MyParcelNL\Pdk\App\Cart\Contract\CartCalculationServiceInterface; use MyParcelNL\Pdk\App\Cart\Model\PdkCart; use MyParcelNL\Pdk\App\ShippingMethod\Model\PdkShippingMethod; +use MyParcelNL\Pdk\Base\Contract\CountryServiceInterface; use MyParcelNL\Pdk\Base\Service\WeightService; use MyParcelNL\Pdk\Base\Support\Arr; use MyParcelNL\Pdk\Facade\Pdk; +use MyParcelNL\Pdk\Facade\Settings; +use MyParcelNL\Pdk\Settings\Model\CarrierSettings; use MyParcelNL\Pdk\Shipment\Collection\PackageTypeCollection; use MyParcelNL\Pdk\Shipment\Model\DeliveryOptions; use MyParcelNL\Pdk\Shipment\Model\PackageType; @@ -17,6 +20,19 @@ class CartCalculationService implements CartCalculationServiceInterface { + /** + * @var \MyParcelNL\Pdk\Base\Contract\CountryServiceInterface + */ + private $countryService; + + /** + * @param \MyParcelNL\Pdk\Base\Contract\CountryServiceInterface $countryService + */ + public function __construct(CountryServiceInterface $countryService) + { + $this->countryService = $countryService; + } + /** * @param \MyParcelNL\Pdk\App\Cart\Model\PdkCart $cart * @@ -28,7 +44,6 @@ public function calculateAllowedPackageTypes(PdkCart $cart): PackageTypeCollecti ->sortBySize(true) ->filter(function (PackageType $packageType) use ($cart) { $packageTypeName = $packageType->name; - if (DeliveryOptions::DEFAULT_PACKAGE_TYPE_NAME === $packageTypeName) { return true; } @@ -37,7 +52,11 @@ public function calculateAllowedPackageTypes(PdkCart $cart): PackageTypeCollecti && $this->isWeightUnderPackageTypeLimit($cart, $packageType); if (DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME === $packageTypeName) { - return $allowed && $this->calculateMailboxPercentage($cart) <= 100.0; + $cc = $cart->shippingMethod->shippingAddress->cc; + + return $allowed + && $this->allowMailboxToCountry($cc) + && $this->calculateMailboxPercentage($cart) <= 100.0; } return $allowed; @@ -98,6 +117,23 @@ protected function hasDeliveryOptions(PdkCart $cart): bool return $anyItemIsDeliverable && ! $deliveryOptionsDisabled; } + private function allowMailboxToCountry(?string $cc): bool + { + if ($cc === null) { + return false; + } + + $countryIsUnique = $this->countryService->isUnique($cc); + $allowInternationalMailbox = Settings::all()->carrier->contains(function (CarrierSettings $carrierSettings) { + $allowInternationalMailbox = $carrierSettings->allowInternationalMailbox; + $hasDeliveryOptions = $carrierSettings->deliveryOptionsEnabled; + + return $allowInternationalMailbox && $hasDeliveryOptions; + }); + + return $countryIsUnique || $allowInternationalMailbox; + } + /** * @param \MyParcelNL\Pdk\App\Cart\Model\PdkCart $cart * @param \MyParcelNL\Pdk\Shipment\Model\PackageType $packageType diff --git a/src/App/DeliveryOptions/Service/DeliveryOptionsService.php b/src/App/DeliveryOptions/Service/DeliveryOptionsService.php index 692f57f0b..7dbe5d0bb 100644 --- a/src/App/DeliveryOptions/Service/DeliveryOptionsService.php +++ b/src/App/DeliveryOptions/Service/DeliveryOptionsService.php @@ -7,6 +7,7 @@ use MyParcelNL\Pdk\App\Cart\Model\PdkCart; use MyParcelNL\Pdk\App\DeliveryOptions\Contract\DeliveryOptionsServiceInterface; use MyParcelNL\Pdk\App\Tax\Contract\TaxServiceInterface; +use MyParcelNL\Pdk\Base\Contract\CountryServiceInterface; use MyParcelNL\Pdk\Base\Contract\CurrencyServiceInterface; use MyParcelNL\Pdk\Base\Contract\WeightServiceInterface; use MyParcelNL\Pdk\Base\Support\Collection; @@ -47,6 +48,11 @@ class DeliveryOptionsService implements DeliveryOptionsServiceInterface 'priceStandardDelivery' => CarrierSettings::PRICE_DELIVERY_TYPE_STANDARD, ]; + /** + * @var \MyParcelNL\Pdk\Base\Contract\CountryServiceInterface + */ + private $countryService; + /** * @var \MyParcelNL\Pdk\Base\Contract\CurrencyServiceInterface */ @@ -68,20 +74,24 @@ class DeliveryOptionsService implements DeliveryOptionsServiceInterface private $taxService; /** + * @param \MyParcelNL\Pdk\Base\Contract\CountryServiceInterface $countryService + * @param \MyParcelNL\Pdk\Base\Contract\CurrencyServiceInterface $currencyService * @param \MyParcelNL\Pdk\Shipment\Contract\DropOffServiceInterface $dropOffService * @param \MyParcelNL\Pdk\App\Tax\Contract\TaxServiceInterface $taxService * @param \MyParcelNL\Pdk\Validation\Repository\SchemaRepository $schemaRepository */ public function __construct( + CountryServiceInterface $countryService, + CurrencyServiceInterface $currencyService, DropOffServiceInterface $dropOffService, TaxServiceInterface $taxService, - SchemaRepository $schemaRepository, - CurrencyServiceInterface $currencyService + SchemaRepository $schemaRepository ) { + $this->countryService = $countryService; + $this->currencyService = $currencyService; $this->dropOffService = $dropOffService; $this->taxService = $taxService; $this->schemaRepository = $schemaRepository; - $this->currencyService = $currencyService; } /** @@ -110,8 +120,7 @@ public function createAllCarrierSettings(PdkCart $cart): array foreach ($carriers->all() as $carrier) { $identifier = $carrier->externalIdentifier; - $settings['carrierSettings'][$identifier] = - $this->createCarrierSettings($carrier, $cart); + $settings['carrierSettings'][$identifier] = $this->createCarrierSettings($carrier, $cart, $packageType); } return $settings; @@ -124,7 +133,7 @@ public function createAllCarrierSettings(PdkCart $cart): array * @return array * @throws \MyParcelNL\Pdk\Base\Exception\InvalidCastException */ - private function createCarrierSettings(Carrier $carrier, PdkCart $cart): array + private function createCarrierSettings(Carrier $carrier, PdkCart $cart, string $packageType): array { $carrierSettings = new CarrierSettings( Settings::get(sprintf('%s.%s', CarrierSettings::ID, $carrier->externalIdentifier)) @@ -140,6 +149,10 @@ private function createCarrierSettings(Carrier $carrier, PdkCart $cart): array ? $carrierSettings['dropOffDelay'] : $cart->shippingMethod->minimumDropOffDelay; + if ($this->shouldUseInternationalMailboxPrice($packageType, $cart->shippingMethod->shippingAddress->cc)) { + $carrierSettings->pricePackageTypeMailbox = $carrierSettings->priceInternationalMailbox; + } + $settings = $this->getBaseSettings($carrierSettings, $cart); return array_merge( @@ -238,4 +251,18 @@ function (Carrier $carrier) use ($cart, $weight, $packageType, $carrierSettings) return [DeliveryOptions::DEFAULT_PACKAGE_TYPE_NAME, $allCarriers]; } + + /** + * @param string $packageType + * @param null|string $cc + * + * @return bool + */ + private function shouldUseInternationalMailboxPrice(string $packageType, ?string $cc): bool + { + $isMailbox = $packageType === DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME; + $isNotUnique = $cc && ! $this->countryService->isUnique($cc); + + return $isMailbox && $isNotUnique; + } } diff --git a/src/App/Order/Calculator/General/PackageTypeCalculator.php b/src/App/Order/Calculator/General/PackageTypeCalculator.php index 35bae155c..f35ea9d38 100644 --- a/src/App/Order/Calculator/General/PackageTypeCalculator.php +++ b/src/App/Order/Calculator/General/PackageTypeCalculator.php @@ -7,8 +7,12 @@ use MyParcelNL\Pdk\App\Order\Calculator\AbstractPdkOrderOptionCalculator; use MyParcelNL\Pdk\App\Order\Model\PdkOrder; use MyParcelNL\Pdk\Base\Contract\CountryServiceInterface; +use MyParcelNL\Pdk\Carrier\Model\Carrier; +use MyParcelNL\Pdk\Facade\AccountSettings; use MyParcelNL\Pdk\Facade\Pdk; +use MyParcelNL\Pdk\Facade\Settings; use MyParcelNL\Pdk\Shipment\Model\DeliveryOptions; +use MyParcelNL\Pdk\Validation\Validator\CarrierSchema; final class PackageTypeCalculator extends AbstractPdkOrderOptionCalculator { @@ -29,18 +33,49 @@ public function __construct(PdkOrder $order) public function calculate(): void { + // All package types are allowed when shipping within the local country. if ($this->countryService->isLocalCountry($this->order->shippingAddress->cc)) { return; } + // Letters are allowed outside the local country as well. if (DeliveryOptions::PACKAGE_TYPE_LETTER_NAME === $this->order->deliveryOptions->packageType) { return; } + // Small packages are allowed outside the local country as well. if (DeliveryOptions::PACKAGE_TYPE_PACKAGE_SMALL_NAME === $this->order->deliveryOptions->packageType) { return; } + $carrier = $this->order->deliveryOptions->carrier; + + if ($this->isInternationalMailbox($carrier)) { + return; + } + $this->order->deliveryOptions->packageType = DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME; } + + /** + * @param \MyParcelNL\Pdk\Carrier\Model\Carrier $carrier + * + * @return bool + */ + private function isInternationalMailbox(Carrier $carrier): bool + { + $carrierSettings = Settings::all()->carrier->get($carrier->externalIdentifier); + + /** @var \MyParcelNL\Pdk\Validation\Validator\CarrierSchema $schema */ + $schema = Pdk::get(CarrierSchema::class); + $schema->setCarrier($carrier); + + $isMailbox = $this->order->deliveryOptions->packageType === DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME; + $isNotUnique = ! $this->countryService->isUnique($this->order->shippingAddress->cc); + $enabledInAccount = AccountSettings::hasCarrierSmallPackageContract(); + $canHaveCarrierSmallPackageContract = $schema->canHaveCarrierSmallPackageContract(); + $enabledInSettings = $carrierSettings->allowInternationalMailbox; + + return $isMailbox && $isNotUnique && $enabledInAccount && $canHaveCarrierSmallPackageContract && $enabledInSettings; + } } diff --git a/src/Carrier/Model/Carrier.php b/src/Carrier/Model/Carrier.php index 80e6752d7..721a90847 100644 --- a/src/Carrier/Model/Carrier.php +++ b/src/Carrier/Model/Carrier.php @@ -17,6 +17,7 @@ * @property null|int $contractId * @property bool $enabled * @property bool $primary + * @property bool $isCustom * @property bool $isDefault * @property bool $optional * @property null|string $label @@ -154,6 +155,15 @@ public function getExternalIdentifierAttribute(): string return $identifier ?: '?'; } + /** + * @return bool + * @noinspection PhpUnused + */ + public function getIsCustomAttribute(): bool + { + return ! $this->isDefault; + } + /** * @return bool * @noinspection PhpUnused diff --git a/src/Facade/AccountSettings.php b/src/Facade/AccountSettings.php index d30e76c61..57c7da0f1 100644 --- a/src/Facade/AccountSettings.php +++ b/src/Facade/AccountSettings.php @@ -16,8 +16,9 @@ * @method static CarrierCollection getCarriers() * @method static null|Shop getShop() * @method static bool hasCarrier(string $name) - * @method static bool hasTaxFields() + * @method static bool hasCarrierSmallPackageContract() * @method static bool hasSubscriptionFeature(string $feature) + * @method static bool hasTaxFields() * @method static bool usesOrderMode() * @see \MyParcelNL\Pdk\Account\Contract\AccountSettingsServiceInterface */ diff --git a/src/Frontend/View/CarrierSettingsItemView.php b/src/Frontend/View/CarrierSettingsItemView.php index 71e437569..edf496330 100644 --- a/src/Frontend/View/CarrierSettingsItemView.php +++ b/src/Frontend/View/CarrierSettingsItemView.php @@ -6,6 +6,7 @@ use MyParcelNL\Pdk\Base\Contract\CurrencyServiceInterface; use MyParcelNL\Pdk\Carrier\Model\Carrier; +use MyParcelNL\Pdk\Facade\AccountSettings; use MyParcelNL\Pdk\Facade\Pdk; use MyParcelNL\Pdk\Frontend\Form\Builder\FormAfterUpdateBuilder; use MyParcelNL\Pdk\Frontend\Form\Builder\FormOperationBuilder; @@ -143,6 +144,22 @@ private function createInsuranceElement(string $name): InteractiveElement ); } + /** + * @return array + */ + private function createInternationalMailboxFields(): array + { + if (! AccountSettings::hasCarrierSmallPackageContract() + || ! $this->carrierSchema->canHaveCarrierSmallPackageContract()) { + return []; + } + + return $this->createSettingWithPriceFields( + CarrierSettings::ALLOW_INTERNATIONAL_MAILBOX, + CarrierSettings::PRICE_INTERNATIONAL_MAILBOX + ); + } + /** * @param string $allowSetting * @param string $priceSetting @@ -463,6 +480,8 @@ private function getPackageTypeFields(): array CarrierSettings::PRICE_PACKAGE_TYPE_MAILBOX, Components::INPUT_CURRENCY ); + + $fields[] = $this->createInternationalMailboxFields(); } if (in_array(DeliveryOptions::PACKAGE_TYPE_DIGITAL_STAMP_NAME, $allowedPackageTypes, true)) { diff --git a/src/Settings/Model/CarrierSettings.php b/src/Settings/Model/CarrierSettings.php index 287af70f9..c09744efa 100644 --- a/src/Settings/Model/CarrierSettings.php +++ b/src/Settings/Model/CarrierSettings.php @@ -56,6 +56,8 @@ * @property float $pricePackageTypeDigitalStamp * @property float $pricePackageTypeMailbox * @property float $priceSignature + * @property float $allowInternationalMailbox + * @property float $priceInternationalMailbox */ class CarrierSettings extends AbstractSettingsModel { @@ -67,54 +69,56 @@ class CarrierSettings extends AbstractSettingsModel /** * Settings in this category. */ - public const ALLOW_DELIVERY_OPTIONS = 'allowDeliveryOptions'; - public const ALLOW_STANDARD_DELIVERY = 'allowStandardDelivery'; - public const ALLOW_EVENING_DELIVERY = 'allowEveningDelivery'; - public const ALLOW_MONDAY_DELIVERY = 'allowMondayDelivery'; - public const ALLOW_MORNING_DELIVERY = 'allowMorningDelivery'; - public const ALLOW_ONLY_RECIPIENT = 'allowOnlyRecipient'; - public const ALLOW_PICKUP_LOCATIONS = 'allowPickupLocations'; - public const ALLOW_SAME_DAY_DELIVERY = 'allowSameDayDelivery'; - public const ALLOW_SATURDAY_DELIVERY = 'allowSaturdayDelivery'; - public const ALLOW_SIGNATURE = 'allowSignature'; - public const CUTOFF_TIME = 'cutoffTime'; - public const CUTOFF_TIME_SAME_DAY = 'cutoffTimeSameDay'; - public const DEFAULT_PACKAGE_TYPE = 'defaultPackageType'; - public const DELIVERY_DAYS_WINDOW = 'deliveryDaysWindow'; - public const DELIVERY_OPTIONS_CUSTOM_CSS = 'deliveryOptionsCustomCss'; - public const DELIVERY_OPTIONS_ENABLED = 'deliveryOptionsEnabled'; - public const DELIVERY_OPTIONS_ENABLED_FOR_BACKORDERS = 'deliveryOptionsEnabledForBackorders'; - public const DIGITAL_STAMP_DEFAULT_WEIGHT = 'digitalStampDefaultWeight'; - public const DROP_OFF_DELAY = 'dropOffDelay'; - public const DROP_OFF_POSSIBILITIES = 'dropOffPossibilities'; - public const EXPORT_AGE_CHECK = 'exportAgeCheck'; - public const EXPORT_HIDE_SENDER = 'exportHideSender'; - public const EXPORT_INSURANCE = 'exportInsurance'; - public const EXPORT_INSURANCE_FROM_AMOUNT = 'exportInsuranceFromAmount'; - public const EXPORT_INSURANCE_PRICE_PERCENTAGE = 'exportInsurancePricePercentage'; - public const EXPORT_INSURANCE_UP_TO = 'exportInsuranceUpTo'; - public const EXPORT_INSURANCE_UP_TO_EU = 'exportInsuranceUpToEu'; - public const EXPORT_INSURANCE_UP_TO_ROW = 'exportInsuranceUpToRow'; - public const EXPORT_INSURANCE_UP_TO_UNIQUE = 'exportInsuranceUpToUnique'; - public const EXPORT_LARGE_FORMAT = 'exportLargeFormat'; - public const EXPORT_ONLY_RECIPIENT = 'exportOnlyRecipient'; - public const EXPORT_RETURN = 'exportReturn'; - public const EXPORT_RETURN_LARGE_FORMAT = 'exportReturnLargeFormat'; - public const EXPORT_RETURN_PACKAGE_TYPE = 'exportReturnPackageType'; - public const EXPORT_SIGNATURE = 'exportSignature'; - public const EXPORT_TRACKED = 'exportTracked'; - public const PRICE_DELIVERY_TYPE_EVENING = 'priceDeliveryTypeEvening'; - public const PRICE_DELIVERY_TYPE_MONDAY = 'priceDeliveryTypeMonday'; - public const PRICE_DELIVERY_TYPE_MORNING = 'priceDeliveryTypeMorning'; - public const PRICE_DELIVERY_TYPE_PICKUP = 'priceDeliveryTypePickup'; - public const PRICE_DELIVERY_TYPE_SAME_DAY = 'priceDeliveryTypeSameDay'; - public const PRICE_DELIVERY_TYPE_SATURDAY = 'priceDeliveryTypeSaturday'; - public const PRICE_DELIVERY_TYPE_STANDARD = 'priceDeliveryTypeStandard'; - public const PRICE_ONLY_RECIPIENT = 'priceOnlyRecipient'; - public const PRICE_PACKAGE_TYPE_DIGITAL_STAMP = 'pricePackageTypeDigitalStamp'; - public const PRICE_PACKAGE_TYPE_MAILBOX = 'pricePackageTypeMailbox'; - public const PRICE_PACKAGE_TYPE_PACKAGE_SMALL = 'pricePackageTypePackageSmall'; - public const PRICE_SIGNATURE = 'priceSignature'; + public const ALLOW_DELIVERY_OPTIONS = 'allowDeliveryOptions'; + public const ALLOW_STANDARD_DELIVERY = 'allowStandardDelivery'; + public const ALLOW_EVENING_DELIVERY = 'allowEveningDelivery'; + public const ALLOW_MONDAY_DELIVERY = 'allowMondayDelivery'; + public const ALLOW_MORNING_DELIVERY = 'allowMorningDelivery'; + public const ALLOW_ONLY_RECIPIENT = 'allowOnlyRecipient'; + public const ALLOW_PICKUP_LOCATIONS = 'allowPickupLocations'; + public const ALLOW_SAME_DAY_DELIVERY = 'allowSameDayDelivery'; + public const ALLOW_SATURDAY_DELIVERY = 'allowSaturdayDelivery'; + public const ALLOW_SIGNATURE = 'allowSignature'; + public const CUTOFF_TIME = 'cutoffTime'; + public const CUTOFF_TIME_SAME_DAY = 'cutoffTimeSameDay'; + public const DEFAULT_PACKAGE_TYPE = 'defaultPackageType'; + public const DELIVERY_DAYS_WINDOW = 'deliveryDaysWindow'; + public const DELIVERY_OPTIONS_CUSTOM_CSS = 'deliveryOptionsCustomCss'; + public const DELIVERY_OPTIONS_ENABLED = 'deliveryOptionsEnabled'; + public const DELIVERY_OPTIONS_ENABLED_FOR_BACKORDERS = 'deliveryOptionsEnabledForBackorders'; + public const DIGITAL_STAMP_DEFAULT_WEIGHT = 'digitalStampDefaultWeight'; + public const DROP_OFF_DELAY = 'dropOffDelay'; + public const DROP_OFF_POSSIBILITIES = 'dropOffPossibilities'; + public const EXPORT_AGE_CHECK = 'exportAgeCheck'; + public const EXPORT_HIDE_SENDER = 'exportHideSender'; + public const EXPORT_INSURANCE = 'exportInsurance'; + public const EXPORT_INSURANCE_FROM_AMOUNT = 'exportInsuranceFromAmount'; + public const EXPORT_INSURANCE_PRICE_PERCENTAGE = 'exportInsurancePricePercentage'; + public const EXPORT_INSURANCE_UP_TO = 'exportInsuranceUpTo'; + public const EXPORT_INSURANCE_UP_TO_EU = 'exportInsuranceUpToEu'; + public const EXPORT_INSURANCE_UP_TO_ROW = 'exportInsuranceUpToRow'; + public const EXPORT_INSURANCE_UP_TO_UNIQUE = 'exportInsuranceUpToUnique'; + public const EXPORT_LARGE_FORMAT = 'exportLargeFormat'; + public const EXPORT_ONLY_RECIPIENT = 'exportOnlyRecipient'; + public const EXPORT_RETURN = 'exportReturn'; + public const EXPORT_RETURN_LARGE_FORMAT = 'exportReturnLargeFormat'; + public const EXPORT_RETURN_PACKAGE_TYPE = 'exportReturnPackageType'; + public const EXPORT_SIGNATURE = 'exportSignature'; + public const EXPORT_TRACKED = 'exportTracked'; + public const PRICE_DELIVERY_TYPE_EVENING = 'priceDeliveryTypeEvening'; + public const PRICE_DELIVERY_TYPE_MONDAY = 'priceDeliveryTypeMonday'; + public const PRICE_DELIVERY_TYPE_MORNING = 'priceDeliveryTypeMorning'; + public const PRICE_DELIVERY_TYPE_PICKUP = 'priceDeliveryTypePickup'; + public const PRICE_DELIVERY_TYPE_SAME_DAY = 'priceDeliveryTypeSameDay'; + public const PRICE_DELIVERY_TYPE_SATURDAY = 'priceDeliveryTypeSaturday'; + public const PRICE_DELIVERY_TYPE_STANDARD = 'priceDeliveryTypeStandard'; + public const PRICE_ONLY_RECIPIENT = 'priceOnlyRecipient'; + public const PRICE_PACKAGE_TYPE_DIGITAL_STAMP = 'pricePackageTypeDigitalStamp'; + public const PRICE_PACKAGE_TYPE_MAILBOX = 'pricePackageTypeMailbox'; + public const PRICE_PACKAGE_TYPE_PACKAGE_SMALL = 'pricePackageTypePackageSmall'; + public const PRICE_SIGNATURE = 'priceSignature'; + public const ALLOW_INTERNATIONAL_MAILBOX = 'allowInternationalMailbox'; + public const PRICE_INTERNATIONAL_MAILBOX = 'priceInternationalMailbox'; protected $attributes = [ 'id' => self::ID, @@ -165,6 +169,8 @@ class CarrierSettings extends AbstractSettingsModel self::PRICE_PACKAGE_TYPE_DIGITAL_STAMP => 0, self::PRICE_PACKAGE_TYPE_MAILBOX => 0, self::PRICE_SIGNATURE => 0, + self::ALLOW_INTERNATIONAL_MAILBOX => false, + self::PRICE_INTERNATIONAL_MAILBOX => 0, ]; protected $casts = [ @@ -215,6 +221,8 @@ class CarrierSettings extends AbstractSettingsModel self::PRICE_PACKAGE_TYPE_DIGITAL_STAMP => 'float', self::PRICE_PACKAGE_TYPE_MAILBOX => 'float', self::PRICE_SIGNATURE => 'float', + self::ALLOW_INTERNATIONAL_MAILBOX => 'bool', + self::PRICE_INTERNATIONAL_MAILBOX => 'float', ]; /** diff --git a/src/Validation/Validator/CarrierSchema.php b/src/Validation/Validator/CarrierSchema.php index 87743fb67..3a394430a 100644 --- a/src/Validation/Validator/CarrierSchema.php +++ b/src/Validation/Validator/CarrierSchema.php @@ -22,6 +22,11 @@ class CarrierSchema implements DeliveryOptionsValidatorInterface { + /** + * Used for features to indicate that the feature is only available for custom contracts. + */ + public const FEATURE_CUSTOM_CONTRACT_ONLY = 'featureCustomContractOnly'; + /** * @var array */ @@ -62,6 +67,11 @@ public function canHaveAgeCheck(): bool return $this->canHave(AgeCheckDefinition::class); } + public function canHaveCarrierSmallPackageContract(): bool + { + return $this->canHaveFeature('carrierSmallPackageContract'); + } + public function canHaveDirectReturn(): bool { return $this->canHave(DirectReturnDefinition::class); @@ -104,7 +114,7 @@ public function canHaveMorningDelivery(): bool public function canHaveMultiCollo(): bool { - return (bool) $this->getFeature('multiCollo'); + return $this->canHaveFeature('multiCollo'); } public function canHaveOnlyRecipient(): bool @@ -191,6 +201,22 @@ public function setCarrier(Carrier $carrier): self return $this; } + /** + * @param string $feature + * + * @return bool + */ + protected function canHaveFeature(string $feature): bool + { + $value = $this->getFeature($feature); + + if (self::FEATURE_CUSTOM_CONTRACT_ONLY === $value) { + return $this->carrier->isCustom; + } + + return (bool) $value; + } + /** * @param string $packageType * diff --git a/tests/Api/Response/ExampleGetAccountsResponse.php b/tests/Api/Response/ExampleGetAccountsResponse.php index 7b72a40c4..c0dc62e7a 100644 --- a/tests/Api/Response/ExampleGetAccountsResponse.php +++ b/tests/Api/Response/ExampleGetAccountsResponse.php @@ -25,21 +25,22 @@ protected function getDefaultResponseContent(): array 'email' => 'felicia@myparcel.nl', 'phone' => '06123456789', 'general_settings' => [ - 'is_test' => 1, - 'order_mode' => 1, - 'affiliate_bcc' => 1, - 'affiliate_fee' => [ + 'is_test' => 1, + 'order_mode' => 1, + 'affiliate_bcc' => 1, + 'affiliate_fee' => [ 'amount' => 10, 'currency' => 'EUR', ], - 'order_settings' => [ + 'order_settings' => [ 'shipment_label' => 'none', ], - 'has_carrier_contract' => 0, - 'show_cumulio_dashboard' => 0, - 'allow_printerless_return' => 1, - 'has_carrier_mail_contract' => 0, - 'use_mfa' => 0, + 'show_cumulio_dashboard' => 0, + 'allow_printerless_return' => 1, + 'has_carrier_contract' => 0, + 'has_carrier_mail_contract' => 0, + 'has_carrier_small_package_contract' => 0, + 'use_mfa' => 0, ], 'additional_info' => [ 'ecommerce_platform' => '17', diff --git a/tests/Unit/Account/Service/AccountSettingsServiceTest.php b/tests/Unit/Account/Service/AccountSettingsServiceTest.php index 947cc9b18..f0dc65818 100644 --- a/tests/Unit/Account/Service/AccountSettingsServiceTest.php +++ b/tests/Unit/Account/Service/AccountSettingsServiceTest.php @@ -124,4 +124,29 @@ expect($result)->toBeTrue(); }); +it('checks account small package contract', function () { + TestBootstrapper::hasAccount(); + + factory(Account::class) + ->withGeneralSettings([ + 'hasCarrierSmallPackageContract' => true, + ]) + ->store(); + + $result = AccountSettings::hasCarrierSmallPackageContract(); + + expect($result)->toBeTrue(); + + TestBootstrapper::hasAccount(); + + factory(Account::class) + ->withGeneralSettings([ + 'hasCarrierSmallPackageContract' => false, + ]) + ->store(); + + $result = AccountSettings::hasCarrierSmallPackageContract(); + + expect($result)->toBeFalse(); +}); diff --git a/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php b/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php index 46508af0f..07d375232 100644 --- a/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php +++ b/tests/Unit/App/Action/Backend/Order/ExportOrderActionTest.php @@ -78,7 +78,7 @@ ]); $lastRequest = MockApi::ensureLastRequest(); - + assertMatchesJsonSnapshot( $lastRequest->getBody() ->getContents() @@ -339,6 +339,41 @@ function () { ); }, ], + + 'custom postnl with international mailbox' => [ + function () { + return factory(PdkOrderCollection::class)->push( + factory(PdkOrder::class) + ->toGermany() + ->withDeliveryOptions( + factory(DeliveryOptions::class) + ->withCarrier( + factory(Carrier::class) + ->fromPostNL() + ->withContractId(123456) + ->withCapabilities([ + 'internationalMailbox' => true, + ]) + ) + ->withPackageType(DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME) + ) + ); + }, + ], + + 'postnl with international mailbox filtered out' => [ + function () { + return factory(PdkOrderCollection::class)->push( + factory(PdkOrder::class) + ->toGermany() + ->withDeliveryOptions( + factory(DeliveryOptions::class) + ->withCarrier(factory(Carrier::class)->fromPostNL()) + ->withPackageType(DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME) + ) + ); + }, + ], ]) ->with('orderModeToggle'); diff --git a/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php b/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php index 123576d8d..d3c8923bb 100644 --- a/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php +++ b/tests/Unit/App/Cart/Service/CartCalculationServiceTest.php @@ -8,8 +8,11 @@ use MyParcelNL\Pdk\App\Cart\Contract\CartCalculationServiceInterface; use MyParcelNL\Pdk\App\Cart\Model\PdkCart; use MyParcelNL\Pdk\Base\Support\Arr; +use MyParcelNL\Pdk\Carrier\Model\Carrier; use MyParcelNL\Pdk\Facade\Pdk; +use MyParcelNL\Pdk\Settings\Model\CarrierSettings; use MyParcelNL\Pdk\Settings\Model\OrderSettings; +use MyParcelNL\Pdk\Settings\Model\Settings; use MyParcelNL\Pdk\Shipment\Model\DeliveryOptions; use MyParcelNL\Pdk\Tests\Uses\UsesMockPdkInstance; use MyParcelNL\Pdk\Types\Service\TriStateService; @@ -115,7 +118,7 @@ ], ]; -const SHIPPING_ADDRESS = [ +const SHIPPING_ADDRESS_NL = [ 'address1' => 'Straatnaam 2', 'address2' => 'Appartement B', 'area' => 'Voor', @@ -126,6 +129,17 @@ 'state' => 'Current', ]; +const SHIPPING_ADDRESS_EU = [ + 'address1' => 'Straatnaam 2', + 'address2' => 'Appartement B', + 'area' => 'Voor', + 'cc' => 'FR', + 'city' => 'Stad', + 'postalCode' => '1000 BB', + 'region' => 'Drenthe', + 'state' => 'Current', +]; + uses()->group('checkout'); usesShared(new UsesMockPdkInstance()); @@ -151,42 +165,74 @@ ], ]); -it('calculates allowed package types', function (array $lines, array $result) { - factory(OrderSettings::class) - ->withEmptyMailboxWeight(200) - ->store(); +it( + 'calculates allowed package types', + function (array $lines, array $shippingAddress, array $result, bool $allowInternationalMailbox = false) { + factory(Settings::class) + ->withCarrierPostNl( + factory(CarrierSettings::class, Carrier::CARRIER_POSTNL_NAME) + ->withAllowInternationalMailbox($allowInternationalMailbox) + ->withDeliveryOptionsEnabled(true) + ) + ->withOrder( + factory(OrderSettings::class) + ->withEmptyMailboxWeight(200) + ) + ->store(); - /** @var \MyParcelNL\Pdk\App\Cart\Contract\CartCalculationServiceInterface $service */ - $service = Pdk::get(CartCalculationServiceInterface::class); + /** @var \MyParcelNL\Pdk\App\Cart\Contract\CartCalculationServiceInterface $service */ + $service = Pdk::get(CartCalculationServiceInterface::class); - $allowedPackageTypes = $service->calculateAllowedPackageTypes(new PdkCart(['lines' => $lines])); + $allowedPackageTypes = $service->calculateAllowedPackageTypes( + new PdkCart(['lines' => $lines, 'shippingMethod' => ['shippingAddress' => $shippingAddress]]) + ); - expect(Arr::pluck($allowedPackageTypes->toArray(), 'name'))->toEqual($result); -})->with([ + expect(Arr::pluck($allowedPackageTypes->toArray(), 'name'))->toEqual($result); + } +)->with([ 'fits in mailbox' => [ - 'lines' => LINES_FITS_IN_MAILBOX, - 'result' => [DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME, DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], + 'lines' => LINES_FITS_IN_MAILBOX, + 'address' => SHIPPING_ADDRESS_NL, + 'result' => [DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME, DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], + ], + 'fits in mailbox EU, allowed' => [ + 'lines' => LINES_FITS_IN_MAILBOX, + 'address' => SHIPPING_ADDRESS_EU, + 'result' => [ + DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME, + DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME, + ], + 'allowInternationalMailbox' => true, + ], + 'fits in mailbox EU, not allowed' => [ + 'lines' => LINES_FITS_IN_MAILBOX, + 'address' => SHIPPING_ADDRESS_EU, + 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], ], 'one item does not fit in mailbox' => [ - 'lines' => LINES_DONT_FIT_MAILBOX, - 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], + 'lines' => LINES_DONT_FIT_MAILBOX, + 'address' => SHIPPING_ADDRESS_NL, + 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], ], 'items exceeding mailbox weight' => [ - 'lines' => LINES_EXCEEDING_MAILBOX_MAXIMUM_WEIGHT, - 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], + 'lines' => LINES_EXCEEDING_MAILBOX_MAXIMUM_WEIGHT, + 'address' => SHIPPING_ADDRESS_NL, + 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], ], 'total exceeding mailbox weight' => [ - 'lines' => TOTAL_EXCEEDING_MAILBOX_MAXIMUM_WEIGHT, - 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], + 'lines' => TOTAL_EXCEEDING_MAILBOX_MAXIMUM_WEIGHT, + 'address' => SHIPPING_ADDRESS_NL, + 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], ], 'items exceeding mailbox size' => [ - 'lines' => LINES_EXCEEDING_MAILBOX_SIZE, - 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], + 'lines' => LINES_EXCEEDING_MAILBOX_SIZE, + 'address' => SHIPPING_ADDRESS_NL, + 'result' => [DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], ], ]); it('calculates shipping method in cart', function (array $lines, array $result) { - $cart = new PdkCart(['lines' => $lines, 'shippingMethod' => ['shippingAddress' => SHIPPING_ADDRESS]]); + $cart = new PdkCart(['lines' => $lines, 'shippingMethod' => ['shippingAddress' => SHIPPING_ADDRESS_NL]]); expect($cart->shippingMethod->toArray())->toEqual($result); })->with([ @@ -220,7 +266,7 @@ ], 'hasDeliveryOptions' => true, 'minimumDropOffDelay' => TriStateService::INHERIT, - 'shippingAddress' => SHIPPING_ADDRESS, + 'shippingAddress' => SHIPPING_ADDRESS_NL, ], ], @@ -257,7 +303,7 @@ 'id' => DeliveryOptions::DEFAULT_PACKAGE_TYPE_ID, ], ], - 'shippingAddress' => SHIPPING_ADDRESS, + 'shippingAddress' => SHIPPING_ADDRESS_NL, ], ], @@ -281,7 +327,7 @@ 'hasDeliveryOptions' => false, 'minimumDropOffDelay' => 0, 'allowedPackageTypes' => [], - 'shippingAddress' => SHIPPING_ADDRESS, + 'shippingAddress' => SHIPPING_ADDRESS_NL, ], ], ]); diff --git a/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php b/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php index 3d7b0472c..07cf811c6 100644 --- a/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php +++ b/tests/Unit/App/DeliveryOptions/Service/DeliveryOptionsServiceTest.php @@ -5,46 +5,57 @@ namespace MyParcelNL\Pdk\App\DeliveryOptions\Service; +use MyParcelNL\Pdk\Account\Model\Shop; use MyParcelNL\Pdk\App\Cart\Model\PdkCart; use MyParcelNL\Pdk\App\DeliveryOptions\Contract\DeliveryOptionsServiceInterface; +use MyParcelNL\Pdk\Carrier\Collection\CarrierCollection; use MyParcelNL\Pdk\Carrier\Model\Carrier; +use MyParcelNL\Pdk\Carrier\Model\CarrierFactory; use MyParcelNL\Pdk\Facade\Pdk; -use MyParcelNL\Pdk\Settings\Contract\PdkSettingsRepositoryInterface; use MyParcelNL\Pdk\Settings\Model\CarrierSettings; +use MyParcelNL\Pdk\Settings\Model\CarrierSettingsFactory; use MyParcelNL\Pdk\Settings\Model\ProductSettings; use MyParcelNL\Pdk\Shipment\Model\DeliveryOptions; -use MyParcelNL\Pdk\Tests\Bootstrap\MockSettingsRepository; -use MyParcelNL\Pdk\Tests\Bootstrap\TestBootstrapper; use MyParcelNL\Pdk\Tests\Uses\UsesMockPdkInstance; -use function DI\autowire; +use function MyParcelNL\Pdk\Tests\factory; use function MyParcelNL\Pdk\Tests\usesShared; use function Spatie\Snapshots\assertMatchesJsonSnapshot; uses()->group('checkout'); -usesShared( - new UsesMockPdkInstance([ - PdkSettingsRepositoryInterface::class => autowire(MockSettingsRepository::class)->constructor([ - CarrierSettings::ID => [ - Carrier::CARRIER_POSTNL_NAME => [ - CarrierSettings::DELIVERY_OPTIONS_ENABLED => true, - CarrierSettings::ALLOW_DELIVERY_OPTIONS => true, - ], - ], - ]), - ]) -); +usesShared(new UsesMockPdkInstance()); + +it( + 'creates carrier settings', + function ( + array $cart, + CarrierFactory $carrierFactory = null, + callable $carrierSettingsFactoryCb = null + ) { + $fakeCarrier = ($carrierFactory ?? factory(Carrier::class)->withName(Carrier::CARRIER_POSTNL_NAME)) + ->make(); + + $carrierSettingsFactory = factory(CarrierSettings::class, $fakeCarrier->externalIdentifier) + ->withDeliveryOptions(); -it('creates carrier settings', function (array $cart) { - TestBootstrapper::hasAccount(); + if ($carrierSettingsFactoryCb) { + $carrierSettingsFactory = $carrierSettingsFactoryCb($carrierSettingsFactory); + } - /** @var \MyParcelNL\Pdk\App\DeliveryOptions\Contract\DeliveryOptionsServiceInterface $service */ - $service = Pdk::get(DeliveryOptionsServiceInterface::class); + $carrierSettingsFactory->store(); - $carrierSettings = $service->createAllCarrierSettings(new PdkCart($cart)); + factory(Shop::class) + ->withCarriers(factory(CarrierCollection::class)->push($carrierFactory)) + ->store(); - assertMatchesJsonSnapshot(json_encode($carrierSettings)); -})->with([ + /** @var \MyParcelNL\Pdk\App\DeliveryOptions\Contract\DeliveryOptionsServiceInterface $service */ + $service = Pdk::get(DeliveryOptionsServiceInterface::class); + + $carrierSettings = $service->createAllCarrierSettings(new PdkCart($cart)); + + assertMatchesJsonSnapshot(json_encode($carrierSettings)); + } +)->with([ 'simple' => [ 'cart' => [ 'carrier' => ['name' => 'postnl'], @@ -173,4 +184,96 @@ ], ], ], + + 'international mailbox that becomes package for non-custom postnl' => [ + 'cart' => [ + 'carrier' => ['name' => 'postnl'], + 'shippingMethod' => [ + 'shippingAddress' => ['cc' => 'FR'], + ], + 'lines' => [ + [ + 'quantity' => 1, + 'product' => [ + 'weight' => 500, + 'isDeliverable' => true, + 'settings' => [ + ProductSettings::PACKAGE_TYPE => DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME, + ], + ], + ], + ], + ], + ], + + 'custom postnl: eu mailbox package' => [ + 'cart' => [ + 'carrier' => [ + 'externalIdentifier' => 'postnl:123', + ], + 'shippingMethod' => [ + 'shippingAddress' => ['cc' => 'FR'], + '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' => [ + 'externalIdentifier' => 'postnl:123', + ], + 'shippingMethod' => [ + 'shippingAddress' => ['cc' => 'KH'], + 'allowedPackageTypes' => [DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME], + ], + '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); + }; + }, + ], ]); + diff --git a/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php b/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php index 27fde3c51..48b0e1a39 100644 --- a/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php +++ b/tests/Unit/App/Order/Calculator/General/PackageTypeCalculatorTest.php @@ -5,6 +5,7 @@ namespace MyParcelNL\Pdk\App\Order\Calculator\General; +use MyParcelNL\Pdk\Account\Model\AccountGeneralSettings; use MyParcelNL\Pdk\App\Order\Model\PdkOrder; use MyParcelNL\Pdk\App\Order\Model\ShippingAddress; use MyParcelNL\Pdk\App\Order\Service\PdkOrderOptionsService; @@ -13,18 +14,84 @@ use MyParcelNL\Pdk\Carrier\Model\CarrierCapabilities; use MyParcelNL\Pdk\Facade\Pdk; use MyParcelNL\Pdk\Facade\Platform; +use MyParcelNL\Pdk\Settings\Model\CarrierSettings; use MyParcelNL\Pdk\Shipment\Model\DeliveryOptions; -use MyParcelNL\Pdk\Tests\Bootstrap\MockPdkFactory; +use MyParcelNL\Pdk\Tests\Uses\UsesEachMockPdkInstance; use function MyParcelNL\Pdk\Tests\factory; +use function MyParcelNL\Pdk\Tests\mockPdkProperties; +use function MyParcelNL\Pdk\Tests\mockPlatform; +use function MyParcelNL\Pdk\Tests\usesShared; +use function Spatie\Snapshots\assertMatchesSnapshot; -it('calculates package type', function (string $platform, array $options, string $result) { - MockPdkFactory::create(['platform' => $platform, 'orderCalculators' => [PackageTypeCalculator::class]]); +const CARRIER_POSTNL = [ + 'carrierExternalIdentifier' => 'postnl:123', + 'carrierName' => 'postnl', +]; +const CARRIER_DHL_FOR_YOU = [ + 'carrierExternalIdentifier' => 'dhlforyou:123', + 'carrierName' => 'dhlforyou', +]; +const CARRIER_DPD = [ + 'carrierExternalIdentifier' => 'dpd', + 'carrierName' => 'dpd', +]; +const CARRIERS = [ + CARRIER_POSTNL, + CARRIER_DHL_FOR_YOU, + CARRIER_DPD, +]; + +const ACCOUNT_FLAG_ON_CARRIER_SETTING_ON = [ + 'accountFlag' => true, + 'carrierSetting' => true, +]; + +const ACCOUNT_FLAG_ON_CARRIER_SETTING_OFF = [ + 'accountFlag' => true, + 'carrierSetting' => false, +]; + +const ACCOUNT_FLAG_OFF_CARRIER_SETTING_ON = [ + 'accountFlag' => false, + 'carrierSetting' => true, +]; + +const ACCOUNT_FLAG_OFF_CARRIER_SETTING_OFF = [ + 'accountFlag' => false, + 'carrierSetting' => false, +]; + +const CONFIG = [ + ACCOUNT_FLAG_ON_CARRIER_SETTING_ON, + ACCOUNT_FLAG_ON_CARRIER_SETTING_OFF, + ACCOUNT_FLAG_OFF_CARRIER_SETTING_ON, + ACCOUNT_FLAG_OFF_CARRIER_SETTING_OFF, +]; + +const DESTINATION_INTERNATIONAL_COUNTRIES = [ + CountryCodes::CC_FR, + CountryCodes::CC_US, +]; + +usesShared(new UsesEachMockPdkInstance()); + +it('calculates package type', function ( + string $platform, + array $options, + string $result +) { + mockPlatform($platform); + mockPdkProperties([ + 'orderCalculators' => [PackageTypeCalculator::class], + ]); $fakeCarrier = factory(Carrier::class) ->withCapabilities(factory(CarrierCapabilities::class)->withAllOptions()); $order = factory(PdkOrder::class) - ->withShippingAddress(factory(ShippingAddress::class)->withCc($options['cc'] ?? Platform::get('localCountry'))) + ->withShippingAddress( + factory(ShippingAddress::class)->withCc($options['cc'] ?? Platform::get('localCountry')) + ) ->withDeliveryOptions( factory(DeliveryOptions::class) ->withCarrier($fakeCarrier) @@ -38,16 +105,17 @@ $newOrder = $service->calculate($order); expect($newOrder->deliveryOptions->packageType)->toBe($result); -}) +} +) ->with('platforms') ->with([ 'local country, package type package' => [ - 'options' => ['packageType' => DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME,], + 'options' => ['packageType' => DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME], 'result' => DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME, ], 'local country, package type letter' => [ - 'options' => ['packageType' => DeliveryOptions::PACKAGE_TYPE_LETTER_NAME,], + 'options' => ['packageType' => DeliveryOptions::PACKAGE_TYPE_LETTER_NAME], 'result' => DeliveryOptions::PACKAGE_TYPE_LETTER_NAME, ], @@ -83,3 +151,54 @@ 'result' => DeliveryOptions::PACKAGE_TYPE_PACKAGE_SMALL_NAME, ], ]); + +it('calculates international mailbox', function ( + $platform, + $country, + $carrierExternalIdentifier, + $carrierName, + $accountFlag, + $carrierSetting +) { + mockPlatform($platform); + mockPdkProperties([ + 'orderCalculators' => [PackageTypeCalculator::class], + ]); + + $fakeCarrier = factory(Carrier::class) + ->withExternalIdentifier($carrierExternalIdentifier) + ->withCapabilities( + factory(CarrierCapabilities::class)->fromCarrier($carrierName) + ) + ->make(); + + factory(CarrierSettings::class, $fakeCarrier->externalIdentifier) + ->withAllowInternationalMailbox($carrierSetting) + ->store(); + + $order = factory(PdkOrder::class) + ->withShippingAddress( + factory(ShippingAddress::class)->withCc($country) + ) + ->withDeliveryOptions( + factory(DeliveryOptions::class) + ->withCarrier($fakeCarrier) + ->withPackageType(DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME) + ->withAllShipmentOptions() + ) + ->make(); + + factory(AccountGeneralSettings::class) + ->withHasCarrierSmallPackageContract($accountFlag) + ->store(); + + /** @var \MyParcelNL\Pdk\App\Order\Contract\PdkOrderOptionsServiceInterface $service */ + $service = Pdk::get(PdkOrderOptionsService::class); + $newOrder = $service->calculate($order); + + assertMatchesSnapshot((string) $newOrder->deliveryOptions->packageType); +}) + ->with('platforms') + ->with(DESTINATION_INTERNATIONAL_COUNTRIES) + ->with(CARRIERS) + ->with(CONFIG); diff --git a/tests/Unit/Frontend/View/CarrierSettingsItemViewTest.php b/tests/Unit/Frontend/View/CarrierSettingsItemViewTest.php index 6a0876b09..d7cdeea8c 100644 --- a/tests/Unit/Frontend/View/CarrierSettingsItemViewTest.php +++ b/tests/Unit/Frontend/View/CarrierSettingsItemViewTest.php @@ -6,6 +6,7 @@ namespace MyParcelNL\Pdk\Frontend\View; +use MyParcelNL\Pdk\Account\Model\AccountGeneralSettings; use MyParcelNL\Pdk\Base\Contract\Arrayable; use MyParcelNL\Pdk\Base\Support\Arr; use MyParcelNL\Pdk\Carrier\Model\Carrier; @@ -18,6 +19,7 @@ use MyParcelNL\Pdk\Shipment\Model\ShipmentOptions; use MyParcelNL\Pdk\Tests\Bootstrap\MockCarrierSchema; use MyParcelNL\Pdk\Tests\Uses\UsesMockPdkInstance; +use MyParcelNL\Pdk\Validation\Validator\CarrierSchema; use function MyParcelNL\Pdk\Tests\factory; use function MyParcelNL\Pdk\Tests\usesShared; @@ -41,7 +43,7 @@ function getViewSettings(CarrierFactory $carrierFactory): array usesShared(new UsesMockPdkInstance()); it('shows settings based on capabilities', function (CarrierCapabilitiesFactory $capabilitiesFactory, array $expected) { - $emptySettings = getViewSettings(factory(Carrier::class)->withCapabilities([])); + $emptySettings = getViewSettings(factory(Carrier::class)->withCapabilities([])); $settingsWithCapabilities = getViewSettings(factory(Carrier::class)->withCapabilities($capabilitiesFactory)); expect($emptySettings)->not->toContain(...$expected) @@ -192,3 +194,76 @@ function () { ], ], ]); + +it( + 'shows international mailbox settings based on capabilities', + function ( + CarrierCapabilitiesFactory $capabilitiesFactory, + bool $accountHasCarrierSmallPackageContract, + ?string $carrierExternalIdentifier, + bool $shouldHaveInternationalMailbox + ) { + factory(AccountGeneralSettings::class) + ->withHasCarrierSmallPackageContract($accountHasCarrierSmallPackageContract) + ->store(); + + $settingsWithCapabilities = getViewSettings( + factory(Carrier::class) + ->withCapabilities($capabilitiesFactory) + ->withExternalIdentifier($carrierExternalIdentifier) + ); + + $internationalMailboxFields = [ + 'allowInternationalMailbox', + 'priceInternationalMailbox', + ]; + $contains = ! array_diff($internationalMailboxFields, $settingsWithCapabilities); + + expect($contains)->toBe($shouldHaveInternationalMailbox); + } +)->with([ + 'package type: international-mailbox, contract on, custom carrier' => [ + function () { + return factory(CarrierCapabilities::class) + ->withFeatures(['carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY]) + ->withPackageTypes([DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME]); + }, + 'accountHasCarrierSmallPackageContract' => true, + 'externalIdentifier' => 'postnl:12345', + 'shouldHaveInternationalMailbox' => true, + ], + + 'package type: international-mailbox, contract off, custom carrier' => [ + function () { + return factory(CarrierCapabilities::class) + ->withFeatures(['carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY]) + ->withPackageTypes([DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME]); + }, + 'accountHasCarrierSmallPackageContract' => false, + 'externalIdentifier' => 'postnl:12345', + 'shouldHaveInternationalMailbox' => false, + ], + 'package type: international-mailbox, contract on, normal carrier' => [ + function () { + return factory(CarrierCapabilities::class) + ->withFeatures(['carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY]) + ->withPackageTypes([DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME]); + }, + 'accountHasCarrierSmallPackageContract' => true, + 'externalIdentifier' => 'postnl', + 'shouldHaveInternationalMailbox' => false, + + ], + + 'package type: international-mailbox, contract off, normal carrier' => [ + function () { + return factory(CarrierCapabilities::class) + ->withFeatures(['carrierSmallPackageContract' => CarrierSchema::FEATURE_CUSTOM_CONTRACT_ONLY]) + ->withPackageTypes([DeliveryOptions::PACKAGE_TYPE_MAILBOX_NAME]); + }, + 'accountHasCarrierSmallPackageContract' => false, + 'externalIdentifier' => 'postnl', + 'shouldHaveInternationalMailbox' => false, + + ], +]); diff --git a/tests/__snapshots__/AbstractSettingsRepositoryTest__it_retrieves_all_categories_and_fields__1.json b/tests/__snapshots__/AbstractSettingsRepositoryTest__it_retrieves_all_categories_and_fields__1.json index 491e4153f..bfd90fcb6 100644 --- a/tests/__snapshots__/AbstractSettingsRepositoryTest__it_retrieves_all_categories_and_fields__1.json +++ b/tests/__snapshots__/AbstractSettingsRepositoryTest__it_retrieves_all_categories_and_fields__1.json @@ -94,7 +94,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "dhl": { "id": "dhl", @@ -145,7 +147,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "bpost": { "id": "bpost", @@ -196,7 +200,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 } } } diff --git a/tests/__snapshots__/AccountTest__it_creates_storable_array__1.json b/tests/__snapshots__/AccountTest__it_creates_storable_array__1.json index 6ed4741c8..34bee2e5d 100644 --- a/tests/__snapshots__/AccountTest__it_creates_storable_array__1.json +++ b/tests/__snapshots__/AccountTest__it_creates_storable_array__1.json @@ -13,7 +13,8 @@ "generalSettings": { "isTest": false, "orderMode": false, - "hasCarrierContract": false + "hasCarrierContract": false, + "hasCarrierSmallPackageContract": false }, "shops": [ { @@ -40,7 +41,8 @@ "externalIdentifier": "postnl", "enabled": true, "optional": false, - "primary": false + "primary": false, + "type": "main" } ] } diff --git a/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(flespakket)__1.json b/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(flespakket)__1.json index b6e49da0a..7e3fa5a24 100644 --- a/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(flespakket)__1.json +++ b/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(flespakket)__1.json @@ -11,7 +11,8 @@ "capabilities": { "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { - "labelDescriptionLength": 45 + "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly" }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp"], "shipmentOptions": { diff --git a/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(myparcel)__1.json b/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(myparcel)__1.json index 5f87da7d8..6ed429e1f 100644 --- a/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(myparcel)__1.json +++ b/tests/__snapshots__/CarrierTest__it_instantiates_carriers_from_name_with_(myparcel)__1.json @@ -12,6 +12,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_multiple_orders__1.json b/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_multiple_orders__1.json index c95795dda..9e115d81b 100644 --- a/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_multiple_orders__1.json +++ b/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_multiple_orders__1.json @@ -17,6 +17,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], @@ -125,6 +126,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_single_order__1.json b/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_single_order__1.json index 1f1d5faef..2b3188b3f 100644 --- a/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_single_order__1.json +++ b/tests/__snapshots__/ContextServiceTest__it_gets_context_data_with_data_set_single_order__1.json @@ -17,6 +17,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/CreateReturnShipmentsTest__it_creates_return_shipment_with_data_set_simple_domestic_shipment__1.json b/tests/__snapshots__/CreateReturnShipmentsTest__it_creates_return_shipment_with_data_set_simple_domestic_shipment__1.json index 755b6333d..ebc94dfaf 100644 --- a/tests/__snapshots__/CreateReturnShipmentsTest__it_creates_return_shipment_with_data_set_simple_domestic_shipment__1.json +++ b/tests/__snapshots__/CreateReturnShipmentsTest__it_creates_return_shipment_with_data_set_simple_domestic_shipment__1.json @@ -51,6 +51,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_eu_mailbox_package__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_eu_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_eu_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__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_row_mailbox_package__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_custom_postnl_row_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_row_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__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_international_mailbox_that_becomes_package__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_international_mailbox_that_becomes_package__1.json new file mode 100644 index 000000000..ae31736f2 --- /dev/null +++ b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_international_mailbox_that_becomes_package__1.json @@ -0,0 +1,35 @@ +{ + "packageType": "package", + "carrierSettings": { + "postnl": { + "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": 0, + "pricePackageTypePackageSmall": 0, + "pricePickup": 0, + "priceSameDayDelivery": 0, + "priceSignature": 0, + "priceStandardDelivery": 0, + "priceInternationalMailbox": 0, + "deliveryDaysWindow": 7, + "dropOffDelay": 0, + "cutoffTime": null, + "cutoffTimeSameDay": null, + "dropOffDays": [] + } + }, + "basePrice": 0, + "priceStandardDelivery": 0 +} diff --git a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_international_mailbox_that_becomes_package_for_non-custom_postnl__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_international_mailbox_that_becomes_package_for_non-custom_postnl__1.json new file mode 100644 index 000000000..7188f65ab --- /dev/null +++ b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_international_mailbox_that_becomes_package_for_non-custom_postnl__1.json @@ -0,0 +1,34 @@ +{ + "packageType": "package", + "carrierSettings": { + "postnl": { + "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": 0, + "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__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package__1.json index 13cb5cc15..7188f65ab 100644 --- a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package__1.json +++ b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package__1.json @@ -1,5 +1,5 @@ { - "packageType": "mailbox", + "packageType": "package", "carrierSettings": { "postnl": { "allowDeliveryOptions": true, diff --git a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package_with_fit_in_mailbox__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package_with_fit_in_mailbox__1.json index 13cb5cc15..7188f65ab 100644 --- a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package_with_fit_in_mailbox__1.json +++ b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_carrier_settings_with_data_set_mailbox_package_with_fit_in_mailbox__1.json @@ -1,5 +1,5 @@ { - "packageType": "mailbox", + "packageType": "package", "carrierSettings": { "postnl": { "allowDeliveryOptions": true, diff --git a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_international_mailbox_carrier_settings_with_data_set_european_international_mailbox_package__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_international_mailbox_carrier_settings_with_data_set_european_international_mailbox_package__1.json new file mode 100644 index 000000000..f06c1341b --- /dev/null +++ b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_international_mailbox_carrier_settings_with_data_set_european_international_mailbox_package__1.json @@ -0,0 +1,35 @@ +{ + "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, + "priceInternationalMailbox": 1.05, + "deliveryDaysWindow": 7, + "dropOffDelay": 0, + "cutoffTime": null, + "cutoffTimeSameDay": null, + "dropOffDays": [] + } + }, + "basePrice": 0, + "priceStandardDelivery": 0 +} diff --git a/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_international_mailbox_carrier_settings_with_data_set_rest_of_world_international_mailbox_package__1.json b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_international_mailbox_carrier_settings_with_data_set_rest_of_world_international_mailbox_package__1.json new file mode 100644 index 000000000..f06c1341b --- /dev/null +++ b/tests/__snapshots__/DeliveryOptionsServiceTest__it_creates_international_mailbox_carrier_settings_with_data_set_rest_of_world_international_mailbox_package__1.json @@ -0,0 +1,35 @@ +{ + "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, + "priceInternationalMailbox": 1.05, + "deliveryDaysWindow": 7, + "dropOffDelay": 0, + "cutoffTime": null, + "cutoffTimeSameDay": null, + "dropOffDays": [] + } + }, + "basePrice": 0, + "priceStandardDelivery": 0 +} 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 new file mode 100644 index 000000000..854b5ba76 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_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_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 new file mode 100644 index 000000000..854b5ba76 --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_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_postnl_with_international_mailbox_filtered_out__data_set_default__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_postnl_with_international_mailbox_filtered_out__data_set_default__1.json new file mode 100644 index 000000000..5492d2a5d --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_postnl_with_international_mailbox_filtered_out__data_set_default__1.json @@ -0,0 +1,29 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "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_postnl_with_international_mailbox_filtered_out__data_set_order_mode__1.json b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_postnl_with_international_mailbox_filtered_out__data_set_order_mode__1.json new file mode 100644 index 000000000..5492d2a5d --- /dev/null +++ b/tests/__snapshots__/ExportOrderActionTest__it_exports_international_orders_with_data_set_postnl_with_international_mailbox_filtered_out__data_set_order_mode__1.json @@ -0,0 +1,29 @@ +{ + "data": { + "shipments": [ + { + "carrier": 1, + "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__/ExportReturnActionTest__it_exports_return_with_data_set_insurance__1.json b/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_insurance__1.json index 758583440..573fea395 100644 --- a/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_insurance__1.json +++ b/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_insurance__1.json @@ -17,6 +17,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], @@ -281,6 +282,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_no_return_capabilities__1.json b/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_no_return_capabilities__1.json index d47dd3ff5..075901bf2 100644 --- a/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_no_return_capabilities__1.json +++ b/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_no_return_capabilities__1.json @@ -17,6 +17,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], @@ -280,6 +281,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_simple_orders__1.json b/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_simple_orders__1.json index fc40c9ef2..e8f44cb35 100644 --- a/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_simple_orders__1.json +++ b/tests/__snapshots__/ExportReturnActionTest__it_exports_return_with_data_set_simple_orders__1.json @@ -17,6 +17,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], @@ -282,6 +283,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_init_script__1.json b/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_init_script__1.json index 8947eeac5..5260bcb89 100644 --- a/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_init_script__1.json +++ b/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_init_script__1.json @@ -227,7 +227,8 @@ "generalSettings": { "isTest": false, "orderMode": false, - "hasCarrierContract": false + "hasCarrierContract": false, + "hasCarrierSmallPackageContract": false }, "shops": [ { @@ -453,7 +454,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 } } }, diff --git a/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_box__1.json b/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_box__1.json index 85070c217..ad4d94778 100644 --- a/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_box__1.json +++ b/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_box__1.json @@ -17,6 +17,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_list_column__1.json b/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_list_column__1.json index fd237fff4..677749956 100644 --- a/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_list_column__1.json +++ b/tests/__snapshots__/FrontendRenderServiceTest__it_renders_component_with_data_set_order_list_column__1.json @@ -17,6 +17,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dpd,_dpd)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dpd,_dpd)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dpd,_dpd)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(dpd,_dpd)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(postnl123,_postnl)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(postnl123,_postnl)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(postnl123,_postnl)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(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_(belgie)__(FR)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(postnl123,_postnl)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(FR)__(postnl123,_postnl)__(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_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dpd,_dpd)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dpd,_dpd)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dpd,_dpd)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(dpd,_dpd)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(postnl123,_postnl)__(false,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(postnl123,_postnl)__(false,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(postnl123,_postnl)__(true,_false)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(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_(belgie)__(US)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(postnl123,_postnl)__(true,_true)__1.txt new file mode 100644 index 000000000..597acc768 --- /dev/null +++ b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(belgie)__(US)__(postnl123,_postnl)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(FR)__(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)__(FR)__(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)__(US)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(flespakket)__(US)__(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)__(US)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(FR)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(FR)__(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)__(FR)__(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)__(US)__(dhlforyou123,_dhlforyou)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(dhlforyou123,_dhlforyou)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(dhlforyou123,_dhlforyou)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(dhlforyou123,_dhlforyou)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(dpd,_dpd)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(false,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(false,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(true,_false)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(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)__(US)__(postnl123,_postnl)__(true,_true)__1.txt b/tests/__snapshots__/PackageTypeCalculatorTest__it_calculates_international_mailbox_with_(myparcel)__(US)__(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)__(US)__(postnl123,_postnl)__(true,_true)__1.txt @@ -0,0 +1 @@ +mailbox \ No newline at end of file diff --git a/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_containing_many_attributes__1.json b/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_containing_many_attributes__1.json index b8361de04..f59a56266 100644 --- a/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_containing_many_attributes__1.json +++ b/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_containing_many_attributes__1.json @@ -14,6 +14,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_with_pickup__1.json b/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_with_pickup__1.json index b8361de04..f59a56266 100644 --- a/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_with_pickup__1.json +++ b/tests/__snapshots__/PdkOrderTest__it_creates_pdk_order_from_fulfilment_order_with_data_set_one_order_with_pickup__1.json @@ -14,6 +14,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(flespakket)__1.json b/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(flespakket)__1.json index b6e49da0a..7e3fa5a24 100644 --- a/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(flespakket)__1.json +++ b/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(flespakket)__1.json @@ -11,7 +11,8 @@ "capabilities": { "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { - "labelDescriptionLength": 45 + "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly" }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp"], "shipmentOptions": { diff --git a/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(myparcel)__1.json b/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(myparcel)__1.json index 5f87da7d8..6ed429e1f 100644 --- a/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(myparcel)__1.json +++ b/tests/__snapshots__/PlatformManagerTest__it_gets_carriers_with_(myparcel)__1.json @@ -12,6 +12,7 @@ "deliveryTypes": ["morning", "standard", "evening", "pickup"], "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true }, "packageTypes": ["package", "mailbox", "letter", "digital_stamp", "package_small"], diff --git a/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(flespakket)__1.json b/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(flespakket)__1.json index a676c5d4b..a350f6aa8 100644 --- a/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(flespakket)__1.json +++ b/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(flespakket)__1.json @@ -26,7 +26,8 @@ "insurance": [0, 10000, 25000, 50000, 100000, 150000, 200000, 250000, 300000, 350000, 400000, 450000, 500000] }, "features": { - "labelDescriptionLength": 45 + "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly" } }, "returnCapabilities": { diff --git a/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(myparcel)__1.json b/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(myparcel)__1.json index 642c1a962..5c3dbfa4d 100644 --- a/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(myparcel)__1.json +++ b/tests/__snapshots__/PlatformManagerTest__it_retrieves_config_for_each_platform_with_(myparcel)__1.json @@ -27,6 +27,7 @@ }, "features": { "labelDescriptionLength": 45, + "carrierSmallPackageContract": "featureCustomContractOnly", "multiCollo": true } }, diff --git a/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(belgie)__1.json b/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(belgie)__1.json index cc1e19303..5e01c87aa 100644 --- a/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(belgie)__1.json +++ b/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(belgie)__1.json @@ -91,7 +91,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "postnl": { "id": "carrier", @@ -185,7 +187,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "bpost": { "id": "carrier", @@ -279,7 +283,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "dpd": { "id": "carrier", @@ -373,6 +379,8 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 } } diff --git a/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(flespakket)__1.json b/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(flespakket)__1.json index 80164cb03..16153d9fc 100644 --- a/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(flespakket)__1.json +++ b/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(flespakket)__1.json @@ -91,7 +91,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "postnl": { "id": "carrier", @@ -185,6 +187,8 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 } } diff --git a/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(myparcel)__1.json b/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(myparcel)__1.json index 9c5ead103..d908c7721 100644 --- a/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(myparcel)__1.json +++ b/tests/__snapshots__/SettingsManagerTest__it_retrieves_default_carrier_settings_with_(myparcel)__1.json @@ -91,7 +91,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "postnl": { "id": "carrier", @@ -185,7 +187,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "dpd": { "id": "carrier", @@ -279,7 +283,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "ups": { "id": "carrier", @@ -373,7 +379,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "dhlforyou": { "id": "carrier", @@ -467,7 +475,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "dhlparcelconnect": { "id": "carrier", @@ -561,7 +571,9 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 }, "dhleuroplus": { "id": "carrier", @@ -655,6 +667,8 @@ "priceOnlyRecipient": 0, "pricePackageTypeDigitalStamp": 0, "pricePackageTypeMailbox": 0, - "priceSignature": 0 + "priceSignature": 0, + "allowInternationalMailbox": false, + "priceInternationalMailbox": 0 } } diff --git a/tests/factories/Account/Model/AccountGeneralSettingsFactory.php b/tests/factories/Account/Model/AccountGeneralSettingsFactory.php index 2ce9225d7..eb9e55348 100644 --- a/tests/factories/Account/Model/AccountGeneralSettingsFactory.php +++ b/tests/factories/Account/Model/AccountGeneralSettingsFactory.php @@ -13,6 +13,7 @@ * @template T of AccountGeneralSettings * @method AccountGeneralSettings make() * @method $this withHasCarrierContract(bool $hasCarrierContract) + * @method $this withHasCarrierSmallPackageContract(bool $hasCarrierSmallPackageContract) * @method $this withIsTest(bool $isTest) * @method $this withOrderMode(bool $orderMode) */ diff --git a/tests/factories/Settings/Model/CarrierSettingsFactory.php b/tests/factories/Settings/Model/CarrierSettingsFactory.php index be01aba20..210fd1813 100644 --- a/tests/factories/Settings/Model/CarrierSettingsFactory.php +++ b/tests/factories/Settings/Model/CarrierSettingsFactory.php @@ -55,6 +55,8 @@ * @method $this withPricePackageTypeDigitalStamp(float $pricePackageTypeDigitalStamp) * @method $this withPricePackageTypeMailbox(float $pricePackageTypeMailbox) * @method $this withPriceSignature(float $priceSignature) + * @method $this withAllowInternationalMailbox(bool $allowInternationalMailbox) + * @method $this withPriceInternationalMailbox(float $priceInternationalMailbox) */ final class CarrierSettingsFactory extends AbstractSettingsModelFactory { @@ -75,6 +77,13 @@ public function getModel(): string return CarrierSettings::class; } + public function withDeliveryOptions(): self + { + return $this + ->withDeliveryOptionsEnabled(true) + ->withAllowDeliveryOptions(true); + } + /** * @param string $id *