Skip to content

Commit fcec3c7

Browse files
author
Yevhen Sentiabov
authored
Merge pull request #274 from swnsma/Cart-Operations-Actualization-And-In-Store-Pickup-Support
Cart operations GraphQl Schema actualization and in store pickup support
2 parents 8d470b8 + 83c4232 commit fcec3c7

File tree

1 file changed

+52
-35
lines changed

1 file changed

+52
-35
lines changed
Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
1-
type Query {
2-
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput
1+
type Mutation {
32
setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput
3+
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput
44
setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput
55
}
66

77
input SetShippingMethodsOnCartInput {
8-
shipping_methods: [ShippingMethodForAddressInput!]!
8+
cart_id: String!
9+
shipping_methods: [ShippingMethodInput!]!
910
}
1011

11-
input ShippingMethodForAddressInput {
12-
cart_address_id: String!
13-
shipping_method_code: String!
12+
input ShippingMethodInput {
13+
carrier_code: String!
14+
method_code: String!
1415
}
1516

1617
input SetBillingAddressOnCartInput {
18+
cart_id: String!
19+
billing_address: BillingAddressInput!
20+
}
21+
22+
input BillingAddressInput {
1723
customer_address_id: Int
1824
address: CartAddressInput
25+
use_for_shipping: Boolean
1926
}
2027

2128
input SetShippingAddressesOnCartInput {
22-
customer_address_id: Int # Can be provided in one-page checkout and is required for multi-shipping checkout
23-
address: CartAddressInput
24-
cart_items: [CartItemQuantityInput!]
29+
cart_id: String!
30+
shipping_addresses: [ShippingAddressInput!]!
2531
}
2632

27-
input CartItemQuantityInput {
28-
cart_item_id: String!
29-
quantity: Float!
33+
input ShippingAddressInput {
34+
customer_address_id: Int # If provided then will be used address from address book
35+
address: CartAddressInput
36+
customer_notes: String
37+
pickup_location_code: String
3038
}
3139

3240
input CartAddressInput {
@@ -55,30 +63,32 @@ type SetBillingAddressOnCartOutput {
5563
}
5664

5765
type Cart {
58-
addresses: [CartAddress]!
66+
shipping_addresses: [ShippingCartAddress]!
67+
billing_address: BillingCartAddress!
5968
}
6069

61-
type CartAddress {
62-
firstname: String!
63-
lastname: String!
70+
interface CartAddressInterface {
71+
firstname: String
72+
lastname: String
6473
company: String
65-
street: [String!]!
66-
city: String!
74+
street: [String]
75+
city: String
6776
region: CartAddressRegion
6877
postcode: String
69-
country: CartAddressCountry!
70-
telephone: String!
71-
address_type: AdressTypeEnum!
72-
73-
selected_shipping_method: CheckoutShippingMethod
74-
available_shipping_methods: [CheckoutShippingMethod]!
78+
country: CartAddressCountry
79+
telephone: String
80+
}
7581

82+
type ShippingCartAddress implements CartAddressInterface {
83+
available_shipping_methods: [AvailableShippingMethod]
84+
selected_shipping_method: SelectedShippingMethod
7685
items_weight: Float
86+
cart_items: [CartItemQuantity]
87+
pickup_location_code: String
7788
customer_notes: String
78-
gift_cards_amount_used: Money
79-
applied_gift_cards: [CartGiftCard]
89+
}
8090

81-
cart_items: [CartItemQuantity]
91+
type BillingCartAddress implements CartAddressInterface {
8292
}
8393

8494
type CartItemQuantity {
@@ -96,15 +106,22 @@ type CartAddressRegion {
96106
label: String
97107
}
98108

99-
enum AdressTypeEnum {
100-
SHIPPING
101-
BILLING
109+
type SelectedShippingMethod {
110+
carrier_code: String
111+
method_code: String
112+
carrier_title: String
113+
method_title: String
114+
amount: Money
102115
}
103116

104-
type CheckoutShippingMethod {
105-
code: String
106-
label: String
107-
free_shipping: Boolean!
117+
type AvailableShippingMethod {
118+
carrier_code: String!
119+
carrier_title: String!
120+
method_code: String
121+
method_title: String
108122
error_message: String
109-
# TODO: Add more complex structure for shipping rates
123+
amount: Money!
124+
price_excl_tax: Money!
125+
price_incl_tax: Money!
126+
available: Boolean!
110127
}

0 commit comments

Comments
 (0)