forked from i-love-flamingo/flamingo-commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
466 lines (410 loc) · 14.2 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
type Commerce_DecoratedCart {
cart: Commerce_Cart!
decoratedDeliveries: [Commerce_CartDecoratedDelivery!]
getDecoratedDeliveryByCode(deliveryCode: String!): Commerce_CartDecoratedDelivery
getAllPaymentRequiredItems: Commerce_Cart_PricedItems!
cartSummary: Commerce_Cart_Summary!
}
type Commerce_Cart_Summary {
discounts: Commerce_CartAppliedDiscounts!
sumAppliedDiscounts: Commerce_Price
sumAppliedGiftCards: Commerce_Price
sumGrandTotalWithGiftCards: Commerce_Price
sumTotalDiscountWithGiftCardsAmount: Commerce_Price
hasAppliedDiscounts: Boolean!
sumTaxes: Commerce_Cart_Taxes
sumPaymentSelectionCartSplitValueAmountByMethods(methods: [String!]): Commerce_Price
}
type Commerce_Cart {
id: ID!
entityID: String!
billingAddress: Commerce_CartAddress
purchaser: Commerce_CartPerson
deliveries: [Commerce_CartDelivery!]
additionalData: Commerce_CartAdditionalData!
paymentSelection: Commerce_Cart_PaymentSelection
belongsToAuthenticatedUser: Boolean!
authenticatedUserID: String!
appliedCouponCodes: [Commerce_CartCouponCode!]
defaultCurrency: String!
totalitems: [Commerce_CartTotalitem!]
itemCount: Int!
productCount: Int!
isPaymentSelected: Boolean!
grandTotal: Commerce_Price!
sumTotalTaxAmount: Commerce_Price!
subTotalNet: Commerce_Price!
appliedGiftCards: [Commerce_CartAppliedGiftCard!]
getDeliveryByCode(deliveryCode: String!): Commerce_CartDelivery
getDeliveryCodes: [String!]
getMainShippingEMail: String!
isEmpty: Boolean!
hasDeliveryForCode(deliveryCode: String!): Boolean!
getDeliveryByItemID(itemID: String!): Commerce_CartDelivery!
getByItemID(itemID: String!): Commerce_CartItem!
getTotalQty(marketPlaceCode: String!, variantCode: String!): Int
getByExternalReference(ref: String!): Commerce_CartItem!
getVoucherSavings: Commerce_Price!
getCartTeaser: Commerce_Cart_Teaser!
sumShippingNet: Commerce_Price!
sumShippingNetWithDiscounts: Commerce_Price!
sumShippingGrossWithDiscounts: Commerce_Price!
hasShippingCosts: Boolean!
allShippingTitles: [String!]
subTotalGross: Commerce_Price!
subTotalGrossWithDiscounts: Commerce_Price!
subTotalNetWithDiscounts: Commerce_Price!
sumTotalDiscountAmount: Commerce_Price!
sumNonItemRelatedDiscountAmount: Commerce_Price!
sumItemRelatedDiscountAmount: Commerce_Price!
hasAppliedCouponCode: Boolean!
getPaymentReference: String!
getTotalItemsByType(typeCode: String!): [Commerce_CartTotalitem!]
grandTotalCharges: Commerce_Price_Charges!
hasAppliedGiftCards: Boolean!
hasRemainingGiftCards: Boolean!
}
type Commerce_Cart_PricedItems {
cartItems: [Commerce_Cart_PricedCartItem!]
shippingItems: [Commerce_Cart_PricedShippingItem!]
totalItems: [Commerce_Cart_PricedTotalItem!]
}
type Commerce_Cart_PricedCartItem {
amount: Commerce_Price!
itemID: String!
}
type Commerce_Cart_PricedShippingItem {
amount: Commerce_Price!
deliveryInfoCode: String!
}
type Commerce_Cart_PricedTotalItem {
amount: Commerce_Price!
code: String!
}
type Commerce_Cart_Tax {
amount: Commerce_Price!
type: String!
rate: Float
}
type Commerce_Cart_Taxes {
items: [Commerce_Cart_Tax]!
getByType(taxType: String): Commerce_Cart_Tax!
}
type Commerce_Cart_Teaser {
productCount: Int
ItemCount: Int
DeliveryCodes: [String]
}
interface Commerce_Cart_PaymentSelection {
gateway: String!
totalValue: Commerce_Price!
cartSplit: [Commerce_Cart_PaymentSelection_Split!]
}
type Commerce_Cart_PaymentSelection_Split {
qualifier: Commerce_Cart_PaymentSelection_SplitQualifier!
charge: Commerce_Price_Charge!
}
type Commerce_Cart_PaymentSelection_SplitQualifier {
type: String!
method: String!
reference: String!
}
type Commerce_Cart_DefaultPaymentSelection implements Commerce_Cart_PaymentSelection {
gateway: String!
totalValue: Commerce_Price!
cartSplit: [Commerce_Cart_PaymentSelection_Split!]
}
type Commerce_CartDecoratedDelivery {
delivery: Commerce_CartDelivery!
decoratedItems: [Commerce_CartDecoratedItem!]
}
type Commerce_CartDelivery {
deliveryInfo: Commerce_CartDeliveryInfo
cartitems: [Commerce_CartItem!]
shippingItem: Commerce_CartShippingItem
subTotalGross: Commerce_Price
grandTotal: Commerce_Price
sumTotalTaxAmount: Commerce_Price
subTotalNet: Commerce_Price
sumTotalDiscountAmount: Commerce_Price
sumNonItemRelatedDiscountAmount: Commerce_Price
sumItemRelatedDiscountAmount: Commerce_Price
subTotalGrossWithDiscounts: Commerce_Price
subTotalNetWithDiscounts: Commerce_Price!
hasItems: Boolean!
}
type Commerce_CartDeliveryInfo {
code: String!
workflow: String!
method: String!
carrier: String!
deliveryLocation: Commerce_CartDeliveryLocation
desiredTime: Time
getAdditionalData(key: String!): String!
additionalDataKeys: [String!]
# additionalDeliveryInfos: map[string]json.RawMessage
# additionalDeliveryInfos: Map
# getAdditionalDeliveryInfo(key: String!): Map!
additionalDeliveryInfoKeys: [String!]
}
type Commerce_CartDeliveryLocation {
type: String!
address: Commerce_CartAddress
useBillingAddress: Boolean!
code: String!
}
type Commerce_CartShippingItem {
title: String!
priceNet: Commerce_Price
taxAmount: Commerce_Price
appliedDiscounts: Commerce_CartAppliedDiscounts!
totalWithDiscountInclTax: Commerce_Price!
tax: Commerce_Cart_Tax!
}
type Commerce_CartAppliedDiscounts {
items: [Commerce_CartAppliedDiscount!]
byCampaignCode(campaignCode: String): Commerce_CartAppliedDiscounts!
byType(filterType: String): Commerce_CartAppliedDiscounts!
}
type Commerce_CartAppliedDiscount {
campaignCode: String!
couponCode: String!
label: String!
applied: Commerce_Price!
type: String!
isItemRelated: Boolean!
sortOrder: Int!
}
type Commerce_CartDecoratedItem {
item: Commerce_CartItem
product: Commerce_Product
}
type Commerce_CartItem {
id: ID!
externalReference: String!
marketplaceCode: String!
variantMarketPlaceCode: String!
productName: String!
sourceID: String!
qty: Int!
additionalDataKeys: [String!]
additionalDataValues: [String!]
getAdditionalData(key: String!): String
hasAdditionalDataKey(key: String!): Boolean
singlePriceGross: Commerce_Price!
singlePriceNet: Commerce_Price!
rowPriceGross: Commerce_Price!
rowPriceNet: Commerce_Price!
appliedDiscounts: Commerce_CartAppliedDiscounts!
# rowTaxes: Commerce_Taxes!
}
type Commerce_CartAddress {
vat: String!
firstname: String!
lastname: String!
middleName: String!
title: String!
salutation: String!
street: String!
streetNr: String!
additionalAddressLines: [String!]
company: String!
city: String!
postCode: String!
state: String!
regionCode: String!
country: String!
countryCode: String!
telephone: String!
email: String!
}
type Commerce_CartPerson {
address: Commerce_CartAddress
personalDetails: Commerce_CartPersonalDetails!
existingCustomerData: Commerce_CartExistingCustomerData
}
type Commerce_CartExistingCustomerData {
id: ID!
}
type Commerce_CartPersonalDetails {
dateOfBirth: String!
passportCountry: String!
passportNumber: String!
nationality: String!
}
type Commerce_CartAdditionalData {
# customAttributes: Map
reservedOrderID: String!
}
type Commerce_CartTotalitem {
code: String!
title: String!
price: Commerce_Price!
type: String!
}
type Commerce_CartCouponCode {
code: String!
}
type Commerce_CartAppliedGiftCard {
code: String!
applied: Commerce_Price!
remaining: Commerce_Price!
hasRemaining: Boolean!
}
type Commerce_Cart_ValidationResult {
hasCommonError: Boolean!
commonErrorMessageKey: String!
itemResults: [Commerce_Cart_ItemValidationError!]
}
type Commerce_Cart_ItemValidationError {
itemID: String!
errorMessageKey: String!
}
type Commerce_Cart_QtyRestrictionResult {
isRestricted: Boolean!
maxAllowed: Int!
remainingDifference: Int!
restrictorName: String!
}
type Commerce_Cart_PlacedOrderInfo {
orderNumber: String!
deliveryCode: String!
}
type Commerce_Cart_BillingAddressForm {
"Billing address form data"
formData: Commerce_Cart_AddressForm
"Validation of supplied billing address, empty if address is valid"
validationInfo: Commerce_Cart_Form_ValidationInfo
"Shows if the request was successfully processed"
processed: Boolean
}
type Commerce_Cart_SelectedPaymentResult {
validationInfo: Commerce_Cart_Form_ValidationInfo
processed: Boolean
}
type Commerce_Cart_Form_ValidationInfo {
"Field specific validation errors"
fieldErrors: [Commerce_Cart_Form_FieldError!]
"General validation errors"
generalErrors: [Commerce_Cart_Form_Error!]
}
type Commerce_Cart_Form_Error {
"A key of the error message. Often used for translation"
messageKey: String!
"A speaking error label. Often used to show to end user - in case no translation exists"
defaultLabel: String!
}
type Commerce_Cart_Form_FieldError {
"A key of the error message. Often used for translation"
messageKey: String!
"A speaking error label. Often used to show to end user - in case no translation exists"
defaultLabel: String!
"Identifier for a form field"
fieldName: String!
}
type Commerce_Cart_AddressForm {
vat: String!
firstname: String!
lastname: String!
middleName: String!
title: String!
salutation: String!
street: String!
streetNr: String!
addressLine1: String!
addressLine2: String!
company: String!
city: String!
postCode: String!
state: String!
regionCode: String!
country: String!
countryCode: String!
phoneNumber: String!
email: String!
}
input Commerce_Cart_AddressFormInput {
vat: String
firstname: String!
lastname: String!
middleName: String
title: String
salutation: String
street: String
streetNr: String
addressLine1: String
addressLine2: String
company: String
city: String
postCode: String
state: String
regionCode: String
country: String
countryCode: String
phoneNumber: String
email: String!
}
input Commerce_Cart_DeliveryAddressInput {
"Unique delivery code to identify the delivery"
deliveryCode: String!
"Delivery address form data"
deliveryAddress: Commerce_Cart_AddressFormInput
"Should the data of the billing address be used for this delivery"
useBillingAddress: Boolean!
"Optional Shipping Method"
method: String
"Optional Shipping Method"
carrier: String
"Optional desired delivery date / time"
desiredTime: Time
}
type Commerce_Cart_DeliveryAddressForm {
"Unique delivery code to identify the delivery"
deliveryCode: String!
"Delivery address form data"
formData: Commerce_Cart_AddressForm
"Shows if the data of the billing address should be used for this delivery"
useBillingAddress: Boolean!
"Shipping Method"
method: String
"Shipping Carrier"
carrier: String
"Optional desired delivery date / time"
desiredTime: Time
"Validation of supplied delivery address, empty if address is valid"
validationInfo: Commerce_Cart_Form_ValidationInfo
"Shows if the request was successfully processed"
processed: Boolean
}
input Commerce_Cart_DeliveryShippingOption {
"Unique delivery code to identify an **existing** delivery"
deliveryCode: String!
"Shipping Method"
method: String!
"Shipping Carrier"
carrier: String!
}
extend type Query {
Commerce_Cart: Commerce_DecoratedCart!
Commerce_Cart_Validator: Commerce_Cart_ValidationResult!
"Commerce_Cart_QtyRestriction returns if the product is restricted in terms of the allowed quantity for the current cart and the given delivery"
Commerce_Cart_QtyRestriction(marketplaceCode: String!, variantCode: String, deliveryCode: String!): Commerce_Cart_QtyRestrictionResult!
}
extend type Mutation {
Commerce_AddToCart(marketplaceCode: ID!, qty: Int!, deliveryCode: String!): Commerce_DecoratedCart!
Commerce_DeleteCartDelivery(deliveryCode: String!): Commerce_DecoratedCart!
Commerce_DeleteItem(itemID: ID!, deliveryCode: String!): Commerce_DecoratedCart!
Commerce_UpdateItemQty(itemID: ID!, deliveryCode: String!, qty: Int!): Commerce_DecoratedCart!
"Adds/Updates the Billing Address of the current cart"
Commerce_Cart_UpdateBillingAddress(addressForm: Commerce_Cart_AddressFormInput): Commerce_Cart_BillingAddressForm!
Commerce_Cart_UpdateSelectedPayment(gateway: String!, method: String!): Commerce_Cart_SelectedPaymentResult!
Commerce_Cart_ApplyCouponCodeOrGiftCard(code: String!): Commerce_DecoratedCart
Commerce_Cart_RemoveGiftCard(giftCardCode: String!): Commerce_DecoratedCart
Commerce_Cart_RemoveCouponCode(couponCode: String!): Commerce_DecoratedCart
"Adds/Updates one/multiple Delivery Addresses"
Commerce_Cart_UpdateDeliveryAddresses(deliveryAdresses: [Commerce_Cart_DeliveryAddressInput!]): [Commerce_Cart_DeliveryAddressForm]!
"Adds/Updates one/multiple Delivery Addresses"
Commerce_Cart_UpdateDeliveryShippingOptions(shippingOptions: [Commerce_Cart_DeliveryShippingOption!]): [Commerce_Cart_DeliveryAddressForm]!
"Cleans current cart"
Commerce_Cart_Clean: Boolean!
}