/
scheme.gql
74 lines (66 loc) · 1.63 KB
/
scheme.gql
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
type Product @collection(name: "products") {
name: String!
description: String!
descriptionEn: String
price: Int!
boughtPrice: Int # Price at which the item was bought
waitingForCollect: Boolean
quantity: Int!
image: String! # Image URL
sexe: String!
size: String!
brand: String!
etat: String!
type: String!
tags: [String!]!
creation: Long # Timestamp as Int but was too big to fit in Int
favorite: Boolean!
composition: [String!]
}
type Customer @embedded {
firstName: String!
lastName: String!
address: Address!
telephone: String!
email: String!
}
type Request @collection(name: "requests") {
customer: Customer!
description: String!
done: Boolean
}
type Order @collection(name: "orders") {
customer: Customer!
line: [ProductLine!]!
stripeID: String!
total: Float!
done: Boolean
delivery: Boolean!
}
type Address @embedded {
street: String!
city: String!
country: String!
zipCode: String!
}
type ProductLine @embedded {
product: ID! # Product ID
quantity: Int!
}
type Promo @embedded {
fr: String!
en: String!
}
type WebsiteConfig @collection(name: "websiteConfig") {
locked: Boolean! # if the website is locked for pop up store
popUpAddress: Address! # Address of the pop up store
freeShipping: Int! # Minimum amount for free shipping
delayDelivery: String # (Optional) Delay for delivery as a message
promo: Promo! # Promo message
}
type Query {
allProducts: [Product!]! @index(name: "all_products")
allOrders: [Order!]! @index(name: "all_orders")
allRequest: [Request!]! @index(name: "all_requests")
allConfigs: [WebsiteConfig!]! @index(name: "website_config")
}