Skip to content

Commit b47b417

Browse files
authored
Merge pull request #420 from magento-honey-badgers/MC-35987-order-namspace
Update customer order schema
2 parents 21c26f7 + 0582d72 commit b47b417

File tree

1 file changed

+58
-23
lines changed

1 file changed

+58
-23
lines changed

design-documents/graph-ql/coverage/customer/customer-orders.md

Lines changed: 58 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ type CustomerOrder {
7272
invoices: [Invoice] @doc("invoice list for the order")
7373
credit_memos: [CreditMemo] @doc("credit memo list for the order")
7474
shipments: [OrderShipment] @doc("shipment list for the order")
75-
payment_methods: [PaymentMethod] @doc("payment details for the order")
75+
payment_methods: [OrderPaymentMethod] @doc("payment details for the order")
7676
shipping_address: OrderAddress @doc("shipping address for the order")
7777
billing_address: OrderAddress @doc("billing address for the order")
7878
carrier: String @doc("shipping carrier for the order delivery")
7979
shipping_method: String @doc("shipping method for the order")
80-
comments: [CommentItem] @doc("comments on the order")
80+
comments: [SalesCommentItem] @doc("comments on the order")
8181
}
8282
```
8383

@@ -114,13 +114,6 @@ type BundleOrderItem implements OrderItemInterface {
114114
bundle_options: [ItemSelectedBundleOption] @doc("A list of bundle options that are assigned to the bundle product")
115115
}
116116

117-
type GiftCardOrderItem implements OrderItemInterface {
118-
gift_card_amount: Money! @doc("Amount of value on gift card")
119-
gift_card_sender: String @doc("Name of gift card sender")
120-
gift_card_recipient: String @doc("Name of gift card recipient")
121-
gift_card_message: String @doc("Message accompanying gift card")
122-
}
123-
124117
type ItemSelectedBundleOption {
125118
id: ID! @doc(description: "The unique identifier of the option")
126119
label: String! @doc(description: "The label of the option")
@@ -135,9 +128,30 @@ type ItemSelectedBundleOptionValue {
135128
price: Money! @doc("Option value price. price for single quantity")
136129
}
137130

131+
type DownloadableOrderItem implements OrderItemInterface {
132+
downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are ordered from the downloadable product")
133+
}
134+
135+
type DownloadableItemsLinks @doc(description: "DownloadableProductLinks defines characteristics of a downloadable product") {
136+
title: String @doc(description: "The display name of the link")
137+
sort_order: Int @doc(description: "A number indicating the sort order")
138+
uid: ID! @doc(description: "A string that encodes option details.")
139+
}
140+
141+
type GiftCardOrderItem implements OrderItemInterface {
142+
gift_card: GiftCardItem @doc(description: "Selected gift card properties for an order item")
143+
}
144+
type GiftCardItem {
145+
sender_name: String @doc(description: "Entered gift card sender name")
146+
sender_email: String @doc(description: "Entered gift card sender email")
147+
recipient_name: String @doc(description: "Entered gift card recipient name")
148+
recipient_email: String @doc(description: "Entered gift card recipient email")
149+
message: String @doc(description: "Entered gift card message intended for the recipient")
150+
}
151+
138152
@doc("Represents order item options like selected or entered")
139153
type OrderItemOption {
140-
id: String! @doc("name of the option")
154+
label: String! @doc("name of the option")
141155
value: String! @doc("value of the option")
142156
}
143157
```
@@ -147,7 +161,7 @@ To provide more customization for different payment solutions, the payment metho
147161

148162
```graphql
149163
@doc("Payment method used to pay for the order")
150-
type PaymentMethod {
164+
type OrderPaymentMethod {
151165
name: String! @doc("payment method name for e.g Braintree, Authorize etc.")
152166
type: String! @doc("payment method type used to pay for the order for e.g Credit Card, PayPal etc.")
153167
additional_data: [KeyValue] @doc("additional data per payment method type")
@@ -179,7 +193,11 @@ type ShippingHandling {
179193
amount_including_tax: Money @doc("shipping amount including tax")
180194
amount_excluding_tax: Money @doc("shipping amount excluding tax")
181195
taxes: [TaxItem] @doc("shipping taxes details")
182-
discounts: [Discount] @doc("The applied discounts to the shipping)
196+
discounts: [ShippingDiscount] @doc("The applied discounts to the shipping)
197+
}
198+
199+
type ShippingDiscount @doc(description:"Defines an individual shipping discount. This discount can be applied to shipping.") {
200+
amount: Money! @doc(description:"The amount of the discount")
183201
}
184202
185203
@doc("Tax item details")
@@ -201,7 +219,7 @@ type Invoice {
201219
number: String! @doc("sequential invoice number")
202220
total: InvoiceTotal @doc("invoice total amount details")
203221
items: [InvoiceItemInterface] @doc("invoiced product details")
204-
comments: [CommentItem] @doc("comments on the invoice")
222+
comments: [SalesCommentItem] @doc("comments on the invoice")
205223
}
206224
207225
@doc("Invoice item details")
@@ -222,6 +240,14 @@ type BundleInvoiceItem implements InvoiceItemInterface {
222240
bundle_options: [ItemSelectedBundleOption] @doc("A list of bundle options that are assigned to the bundle product")
223241
}
224242
243+
type DownloadableInvoiceItem implements InvoiceItemInterface {
244+
downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are invoiced from the downloadable product")
245+
}
246+
247+
type GiftCardInvoiceItem implements InvoiceItemInterface {
248+
gift_card: GiftCardItem @doc(description: "Selected gift card properties for an invoice item")
249+
}
250+
225251
@doc("Invoice total amount details")
226252
type InvoiceTotal {
227253
subtotal: Money! @doc("subtotal amount excluding, shipping, discounts and tax")
@@ -238,16 +264,16 @@ type InvoiceTotal {
238264
## Refund Type Schema
239265
240266
The credit memo entity will have the similar to the order and invoice schema:
241-
The `id` will be a `base64_encode_encode(increment_id)` which in future can be replaced by UUID.
267+
The `id` will be a `base64encode(increment_id)` which in future can be replaced by UUID.
242268
243269
```graphql
244270
@doc("Credit memo details")
245271
type CreditMemo {
246272
id: ID! @doc("the ID of the credit memo, used for API purposes")
247273
number: String! @doc("sequential credit memo number")
248-
items: [CreditMemoItem] @doc("items refunded")
274+
items: [CreditMemoItemInterface] @doc("items refunded")
249275
total: CreditMemoTotal @doc("refund total amount details")
250-
comments: [CommentItem] @doc("comments on the credit memo")
276+
comments: [SalesCommentItem] @doc("comments on the credit memo")
251277
}
252278
253279
@doc("Credit memo item details")
@@ -268,6 +294,14 @@ type BundleCreditMemoItem implements CreditMemoIntemInterface {
268294
bundle_options: [ItemSelectedBundleOption]
269295
}
270296
297+
type DownloadableCreditMemoItem implements CreditMemoItemInterface {
298+
downloadable_links: [DownloadableItemsLinks] @doc(description: "A list of downloadable links that are refunded from the downloadable product")
299+
}
300+
301+
type GiftCardCreditMemoItem implements CreditMemoItemInterface {
302+
gift_card: GiftCardItem @doc(description: "Selected gift card properties for a credit memo item")
303+
}
304+
271305
@doc("Credit memo price details")
272306
type CreditMemoTotal {
273307
subtotal: Money! @doc("subtotal amount excluding, shipping, discounts and tax")
@@ -287,8 +321,8 @@ type OrderShipment {
287321
id: ID! @doc("the ID of the shipment, used for API purposes")
288322
number: String! @doc("sequential credit shipment number")
289323
tracking: [ShipmentTracking] @doc("shipment tracking details")
290-
items: [ShipmentItem] @doc("items included in the shipment")
291-
comments: [CommentItem] @doc("comments on the shipment")
324+
items: [ShipmentItemInterface] @doc("items included in the shipment")
325+
comments: [SalesCommentItem] @doc("comments on the shipment")
292326
}
293327
294328
@doc("Order shipment item details")
@@ -308,6 +342,10 @@ type BundleShipmentItem implements ShipmentItemInterface {
308342
bundle_options: [ItemSelectedBundleOption]
309343
}
310344
345+
type GiftCardShipmentItem implements ShipmentItemInterface {
346+
gift_card: GiftCardItem @doc(description: "Selected gift card properties for a shipment item")
347+
}
348+
311349
@doc("Order shipment tracking details")
312350
type ShipmentTracking {
313351
title: String! @doc("shipment tracking title")
@@ -316,10 +354,9 @@ type ShipmentTracking {
316354
}
317355
```
318356
319-
320-
## CommentItem type
357+
## SalesCommentItem type
321358
```graphql
322-
type CommentItem {
359+
type SalesCommentItem {
323360
timestamp: String! @doc("The timestamp of the comment")
324361
message: String! @doc("the comment message")
325362
}
@@ -345,8 +382,6 @@ type OrderAddress @doc(description: "OrderAddress contains detailed information
345382
suffix: String @doc(description: "A value such as Sr., Jr., or III")
346383
vat_id: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)")
347384
}
348-
349-
350385
```
351386
352387
## Additional Types

0 commit comments

Comments
 (0)