From 8dc213eb0a114910a7d4961bbfd8095a4a803e23 Mon Sep 17 00:00:00 2001 From: Thijmen Wijers Date: Thu, 5 Oct 2023 09:16:14 +0200 Subject: [PATCH] feat(carriers): add dpd myparcel nl --- config/platform/myparcel.php | 19 ++++ config/schema/myparcel/order/dpd/base.json | 115 +++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 config/schema/myparcel/order/dpd/base.json diff --git a/config/platform/myparcel.php b/config/platform/myparcel.php index 0cef91de6..c820ed468 100644 --- a/config/platform/myparcel.php +++ b/config/platform/myparcel.php @@ -277,6 +277,25 @@ ], ], ], + [ + 'name' => Carrier::CARRIER_DPD_NAME, + 'capabilities' => [ + 'packageTypes' => [ + DeliveryOptions::PACKAGE_TYPE_PACKAGE_NAME, + ], + 'deliveryTypes' => [ + DeliveryOptions::DELIVERY_TYPE_STANDARD_NAME, + ], + 'shipmentOptions' => [ + 'ageCheck' => false, + 'onlyRecipient' => false, + 'return' => false, + ], + 'features' => [ + 'labelDescriptionLength' => 45, + ], + ], + ], ], ]; diff --git a/config/schema/myparcel/order/dpd/base.json b/config/schema/myparcel/order/dpd/base.json new file mode 100644 index 000000000..ab2a05eca --- /dev/null +++ b/config/schema/myparcel/order/dpd/base.json @@ -0,0 +1,115 @@ +{ + "description": "myparcel/order/dpd/base", + "type": "object", + "allOf": [ + { + "anyOf": [ + { + "properties": { + "deliveryOptions": { + "required": ["deliveryType", "pickupLocation"], + "properties": { + "deliveryType": { + "enum": ["standard", "pickup"] + }, + "pickupLocation": { + "properties": { + "locationCode": { + "type": "string", + "minLength": 1 + } + } + } + } + } + } + }, + { + "properties": { + "deliveryOptions": { + "properties": { + "deliveryType": { + "enum": ["standard", null] + } + } + } + } + }, + { + "properties": { + "deliveryOptions": { + "required": ["date", "email"], + "properties": { + "date": { + "type": "string", + "pattern": "^(20\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12]\\d|3[01]) ([01]\\d|2[0123]):([012345]\\d):([012345]\\d)$" + }, + "email": { + "type": "string", + "format": "email" + } + } + } + } + } + ] + } + ], + "properties": { + "physicalProperties": { + "properties": { + "weight": { + "note": "Do not put (low) maximum here, for it will be enforced regardless of largeFormat in anyOf" + } + } + }, + "recipient": { + "properties": { + "cc": { + "enum": [ + "AT", + "BE", + "BG", + "CZ", + "DE", + "DK", + "EE", + "ES", + "FI", + "FR", + "GR", + "HU", + "IT", + "LT", + "LU", + "LV", + "NL", + "PL", + "PT", + "RO", + "SE", + "SI", + "SK" + ] + } + } + }, + "deliveryOptions": { + "properties": { + "deliveryType": { + "enum": ["standard", null] + }, + "packageType": { + "enum": ["package", null] + }, + "shipmentOptions": { + "properties": { + "labelDescription": { + "maxLength": 50 + } + } + } + } + } + } +}