-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
369 lines (269 loc) · 7.58 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
# This schema does not include all the fields present in the ERP, only those that we need for webshop functionality
#
# Following https://www.apollographql.com/docs/technotes/TN0002-schema-naming-conventions/ for naming conventions
type Query {
"Returns information of the currently authenticated customer. Field can be null if currently authenticated user's email is not known in ERP."
customer: Customer
}
type Mutation {
"Updates the currently authenticated customer"
updateCustomer(input: CustomerInput!): UpdateCustomerOutput!
"Create a new CustomerAddress for the currently authorized customer"
createCustomerAddress(
input: CustomerAddressInput!
): CreateCustomerAddressOutput!
"Update the referenced CustomerAddress"
updateCustomerAddress(
id: Int!
input: CustomerAddressInput!
): UpdateCustomerAddressOutput!
"Delete the referenced CustomerAddress"
deleteCustomerAddress(id: Int!): Boolean
}
"ERP Customer entity"
type Customer {
"Internal Number (user-visible)"
internalNumber: String!
"Customer type"
customerType: CustomerType!
"Email (Magento: customer.email)"
email: String!
"Company name, if applicable"
companyName: String
"Title or prefix (Magento: customer.prefix)"
title: String
"First name (Magento: customer.firstname)"
firstName: String
"Last name prefix (Magento: customer.middlename)"
lastNamePrefix: String
"Last name (Magento: customer.lastname)"
lastName: String
"VAT number (Magento: customer.taxvat)"
vatNumber: String
"KVK number"
kvkNumber: String
"List of customer addresses (contacts)"
addresses: [CustomerAddress]
"The default invoice address (should also be present in the `addresses` field)"
defaultInvoiceAddress: CustomerAddress
"The default delivery address (should also be present in the `addresses` field)"
defaultDeliveryAddress: CustomerAddress
"List of the customer orders"
orders(pageSize: Int = 20, currentPage: Int = 1): OrderList
}
enum CustomerType {
COMPANY
PRIVATE
}
"ERP Customer address (contact) entity"
type CustomerAddress {
"Entity ID"
id: Int!
"Address type (invoice/delivery)"
customerAddressType: CustomerAddressType!
"Company (Magento: address.company)"
company: String
"Title (Magento: address.prefix)"
title: String
"First name (Magento: address.firstname)"
firstName: String
"Last name prefix (Magento: address.middlename)"
lastNamePrefix: String
"Last name (Magento: address.lastname)"
lastName: String
"Phone no. (Magento: address.telephone"
phone: String
"Street (Magento: address.street[0])"
street: String
"Street no. (Magento: address.street[1])"
streetNo: String
"Street no. suffix (Magento: address.street[2])"
streetNoSuffix: String
"Postal code (Magento: address.postcode)"
postalCode: String
"City (Magento: address.city)"
city: String
"Country ISO 3166-1 alpha-2 code (Magento: address.country_id)"
country: String
"VAT number (Magento: address.vat_id)"
vatNumber: String
}
type Package {
"The invoice number for this package"
invoiceNumber: Int
"The Track and Trace number for this package"
trackAndTraceNumber: String
}
enum CustomerAddressType {
INVOICE
DELIVERY
ORDER_CONTACT_2
CONTACT_PERSON_3
}
enum OrderStatus {
CREATED
PROFORMA_INVOICE
READY_TO_BE_SENT_TO_SUPPLIER
SENT_TO_THE_SUPPLIER
PARTIALLY_RECEIVED
READY_FOR_PARTIAL_DELIVERY
RECEIVED
READY_FOR_DELIVERY
SENT_TO_CUSTOMER
}
enum ShipmentType {
SHIPMENT_TO_CUSTOMER_ADDRESS
PICKUP_FROM_POSTNL_LOCATION
PICKUP_ORDER
}
enum PaymentMethodType {
CASH_ON_DELIVERY
ON_ACCOUNT
IN_ADVANCE_BY_BANK
CONTANT
CREDIT
IDEAL
CREDIT_CARD
CREDIT_APPROVAL
SOFORT
KLARNA
}
type OrderItem {
"Order item id"
id: ID!
"Product ID (sku in Magento)"
productId: String!
"Internal number (User-visible)"
internalNumber: String!
"Name of the product"
name: String!
"Price at which the product was sold"
sellingPrice: Float!
"Quantity of the product that was ordered"
orderedQuantity: Int!
"Quantity of the product that have been sent"
sentQuantity: Int!
"Order item id of the parent product, if any"
parentId: ID
}
type OrderAddress {
"Company (Magento: address.company)"
company: String
"Title (Magento: address.prefix)"
title: String
"First name (Magento: address.firstname)"
firstName: String
"Last name prefix (Magento: address.middlename)"
lastNamePrefix: String
"Last name (Magento: address.lastname)"
lastName: String
"Phone no. (Magento: address.telephone"
phone: String
"Street (Magento: address.street[0])"
street: String
"Street no. (Magento: address.street[1])"
streetNo: String
"Street no. suffix (Magento: address.street[2])"
streetNoSuffix: String
"Postal code (Magento: address.postcode)"
postalCode: String
"City (Magento: address.city)"
city: String
"Country ISO 3166-1 alpha-2 code (Magento: address.country_id)"
country: String
"VAT number (Magento: address.vat_id)"
vatNumber: String
}
type Order {
"Internal Number (user-visible)"
internalNumber: String!
"Current state of the order"
state: OrderStatus!
"Date and time at which the order was placed (format 2022-12-23 15:56)"
orderDate: String!
"The type of shipment for the order"
shipmentType: ShipmentType
"The type of shipment for the order"
paymentMethodType: PaymentMethodType
"The delivery address for the order"
deliveryAddress: OrderAddress!
"The invoice address for the order"
invoiceAddress: OrderAddress!
"Total value for the order"
grandTotal: Float!
"Total vat tax value for the order"
vatValue: Float!
"List of the order items"
items: [OrderItem]!
"List of packages"
packages: [Package]
}
type PageInfo {
currentPage: Int
pageSize: Int
totalPages: Int
totalCount: Int
}
type OrderList {
items: [Order]
pageInfo: PageInfo
}
"ERP Customer input"
input CustomerInput {
"Company name, if applicable"
companyName: String
"Title or prefix (Magento: customer.prefix)"
title: String
"First name (Magento: customer.firstname)"
firstName: String
"Last name prefix (Magento: customer.middlename)"
lastNamePrefix: String
"Last name (Magento: customer.lastname)"
lastName: String
"VAT number (Magento: customer.taxvat)"
vatNumber: String
"The default invoice address (should also be present in the `addresses` field)"
defaultInvoiceAddressId: Int
"The default delivery address (should also be present in the `addresses` field)"
defaultDeliveryAddressId: Int
}
type UpdateCustomerOutput {
customer: Customer
}
"ERP Customer address input"
input CustomerAddressInput {
"Address type (invoice/delivery)"
type: CustomerAddressType!
"Company (Magento: address.company)"
company: String
"Title (Magento: address.prefix)"
title: String
"First name (Magento: address.firstname)"
firstName: String
"Last name prefix (Magento: address.middlename)"
lastNamePrefix: String
"Last name (Magento: address.lastname)"
lastName: String
"Phone no. (Magento: address.telephone"
phone: String
"Street (Magento: address.street[0])"
street: String!
"Street no. (Magento: address.street[1])"
streetNo: String
"Street no. suffix (Magento: address.street[2])"
streetNoSuffix: String
"Postal code (Magento: address.postcode)"
postalCode: String
"City (Magento: address.city)"
city: String!
"Country ISO 3166-1 alpha-2 code (Magento: address.country_id)"
country: String!
"VAT number (Magento: address.vat_id)"
vatNumber: String
}
type CreateCustomerAddressOutput {
address: CustomerAddress
}
type UpdateCustomerAddressOutput {
address: CustomerAddress
}