diff --git a/README.md b/README.md
index 0ebf22b..862d555 100644
--- a/README.md
+++ b/README.md
@@ -91,17 +91,25 @@ DeliveryDayLimit object:
day_index: Int - Index of the day from today (from 0).
date_formatted: String - Date formatted using format selected in store configuration.
date: String - Date in standard Y-m-d format.
-extra_charge: Float - Extra charge for that day (may be overwritten by time limits extra charge).
-extra_charge_message: String - Extra charge formatted message.
+extra_charge: ExtraCharge - Extra charge for that day.
time_limits: [DeliveryTimeLimit] - Limits by time when available.
```
DeliveryTimeLimit object:
```
-from: String - Time from in hh:mm format.
-to: String - Time to in hh:mm format.
-extra_charge: String - Extra charge for that time slot.
+from: String - Time from in hh:mm format.
+to: String - Time to in hh:mm format.
+extra_charge: ExtraCharge - Extra charge for that time slot. Summed up with a surcharge from the delivery day settings.
+```
+
+ExtraCharge object:
+
+```
+amount: Float - Amount in selected currency (in cart currency).
+formatted: String - Formatted according selected locale (with currency symbol).
+currency_symbol: String - Currency symbol.
+currency_code: String - Currency code.
```
**Request:**
@@ -119,12 +127,21 @@ query ($magentoCartId: String!) {
day_index
date_formatted
date
- extra_charge
- extra_charge_message
+ extra_charge {
+ amount
+ formatted
+ currency_code
+ currency_symbol
+ }
time_limits {
from
to
- extra_charge
+ extra_charge {
+ amount
+ formatted
+ currency_code
+ currency_symbol
+ }
}
}
}
@@ -135,71 +152,91 @@ query ($magentoCartId: String!) {
```json
{
- "data": {
- "availableDeliveryDates": [
- {
- "method": "flatrate_flatrate",
- "day_limits": [
- {
- "day_index": 3,
- "date_formatted": "2022-05-11",
- "date": "2022-05-11",
- "extra_charge": 0,
- "extra_charge_message": "",
- "time_limits": [
- {
- "from": "10:00",
- "to": "12:00",
- "extra_charge": "US$2.00"
- },
- {
- "from": "14:00",
- "to": "16:00",
- "extra_charge": "US$5.00"
- },
- {
- "from": "17:05",
- "to": "23:30",
- "extra_charge": ""
- }
- ]
- },
- {
- "day_index": 4,
- "date_formatted": "2022-05-12",
- "date": "2022-05-12",
- "extra_charge": 0,
- "extra_charge_message": "",
- "time_limits": []
- },
- {
- "day_index": 5,
- "date_formatted": "2022-05-13",
- "date": "2022-05-13",
- "extra_charge": 0,
- "extra_charge_message": "",
- "time_limits": []
- },
- {
- "day_index": 8,
- "date_formatted": "2022-05-16 +US$15.00",
- "date": "2022-05-16",
- "extra_charge": 15,
- "extra_charge_message": " +US$15.00",
- "time_limits": []
- },
- {
- "day_index": 9,
- "date_formatted": "2022-05-17",
- "date": "2022-05-17",
- "extra_charge": 0,
- "extra_charge_message": "",
- "time_limits": []
- }
- ]
- }
+ "data": {
+ "availableDeliveryDates": [
+ {
+ "method": "flatrate_flatrate",
+ "day_limits": [
+ {
+ "day_index": 5,
+ "date_formatted": "14-June-2023",
+ "date": "2023-06-14",
+ "extra_charge": null,
+ "time_limits": [
+ {
+ "from": "09:00",
+ "to": "12:00",
+ "extra_charge": {
+ "amount": 0,
+ "formatted": "",
+ "currency_code": "EUR",
+ "currency_symbol": "€"
+ }
+ },
+ {
+ "from": "11:00",
+ "to": "16:00",
+ "extra_charge": {
+ "amount": 0,
+ "formatted": "",
+ "currency_code": "EUR",
+ "currency_symbol": "€"
+ }
+ },
+ {
+ "from": "15:00",
+ "to": "20:00",
+ "extra_charge": {
+ "amount": 4.5409,
+ "formatted": "€4.54",
+ "currency_code": "EUR",
+ "currency_symbol": "€"
+ }
+ }
+ ]
+ },
+ {
+ "day_index": 6,
+ "date_formatted": "15-June-2023",
+ "date": "2023-06-15",
+ "extra_charge": null,
+ "time_limits": [
+ {
+ "from": "09:00",
+ "to": "12:00",
+ "extra_charge": {
+ "amount": 0,
+ "formatted": "",
+ "currency_code": "EUR",
+ "currency_symbol": "€"
+ }
+ },
+ {
+ "from": "11:00",
+ "to": "16:00",
+ "extra_charge": {
+ "amount": 0,
+ "formatted": "",
+ "currency_code": "EUR",
+ "currency_symbol": "€"
+ }
+ },
+ {
+ "from": "15:00",
+ "to": "20:00",
+ "extra_charge": {
+ "amount": 4.5409,
+ "formatted": "€4.54",
+ "currency_code": "EUR",
+ "currency_symbol": "€"
+ }
+ }
+ ]
+ }
]
- }
+ }
+ ]
+ }
}
```
diff --git a/composer.json b/composer.json
index baae7b3..20a4edc 100755
--- a/composer.json
+++ b/composer.json
@@ -2,12 +2,12 @@
"name": "mageworx/module-deliverydate-graph-ql",
"description": "Graph QL Addon for MageWorx Delivery Date Extension",
"require": {
- "mageworx/module-deliverydate": ">=1.19",
+ "mageworx/module-deliverydate": ">=1.21",
"magento/framework": ">=103",
"magento/module-graph-ql": ">=100"
},
"type": "magento2-module",
- "version": "1.1.1",
+ "version": "1.2.0",
"license": [
"OSL-3.0",
"AFL-3.0"
diff --git a/etc/schema.graphqls b/etc/schema.graphqls
index 3ef7a34..ef28977 100644
--- a/etc/schema.graphqls
+++ b/etc/schema.graphqls
@@ -42,16 +42,20 @@ type DeliveryDayLimit {
day_index: Int @doc(description: "Index of the day from today (0).")
date_formatted: String @doc(description: "Date formatted using format selected in store configuration.")
date: String @doc(description: "Date in regular format Y-m-d.")
- extra_charge: Float @doc(description: "Extra charge for that day (may be overwritten by time extra charge).")
- extra_charge_message: String @doc(description: "Extra charge formatted message. May be set in the store configuration.")
+ extra_charge: ExtraCharge @doc(description: "Extra charge description.")
time_limits: [DeliveryTimeLimit] @doc(description: "Limits by time when available.")
}
type DeliveryTimeLimit {
from: String @doc(description: "Time from in hh:mm format.")
to: String @doc(description: "Time to in hh:mm format.")
- extra_charge: String @doc(description: "Extra charge for that time slot.")
+ extra_charge: ExtraCharge @doc(description: "Extra charge description.")
+}
+type ExtraCharge {
+ amount: Float @doc(description: "Extra charge amount in selected currency (cart currency).")
+ formatted: String @doc(description: "Extra charge formatted according selected locale (with currency symbol).")
+ currency_symbol: String @doc(description: "Extra charge currency symbol.")
+ currency_code: String @doc(description: "Extra charge currency code.")
}
-
input DeliveryDateInput @doc(description: "Defines the delivery data.") {
day: String! @doc(description: "A string that identifies a delivery day in standard format Y-m-d.")
time: String @doc(description: "A string that identifies a delivery time diapason in \"12:00_23:59\" fromat. Must be a valid time.")