-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
156 lines (149 loc) · 3.12 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
type Query {
queryTest: String!
items(restaurantID: ID!):[Item!]
todayOrders(restaurantID: ID!): [Order!]
itemAllLang(restaurantID: ID!): [ItemTwoLang!]
}
type Mutation{
createOrder(order:inputOrder): String
createItem(data: CreateItemInput!, file: Upload): Item! # 新增一道菜,要自動生成 id 給他
updateItem(id: String!, data: UpdateItemInput!, file: Upload): Item! # 更新某道菜的資訊
deleteItem(id: String!): Item! # 刪除某道菜
singleUpload(file: Upload!): File!
updateOrderItemState(orderId: String!, itemId: String!, state: String!): String!
}
type Subscription{
order(restaurantId: String!): [Order!] # 等待新的訂單進來
}
type OrderSubscriptionPayload{
mutation: MutationType!
data: OrderKitchen!
}
type OrderKitchen{
id: String!
tableNo: String!
totalPrice: Int!
time: String!
items: [Item!]
}
type ItemKitchen{
id: String!
name: String!
status: String!
orderItemInfo: OrderItemInfo!
}
input UpdateStatus{
itemID: ID!
newStatus: Status!
}
type ItemTwoLang{
id: ID!
name: String!
description: String!
price: Int!
status: String!
img: String! # 可以是檔案路徑或網址
comments: [Comment!] # 先放著,以後如果要做給餐廳看所有評論的介面可以拿這個資料
orderItemInfo: OrderItemInfo # 值為null時表示不是在點菜的時候拿這道菜的資訊
type: String!
englishName: String!
englishDescription: String!
englishType: String!
type: String!
}
type Item{
id: ID!
name: String!
description: String!
price: Int!
status: String!
img: String! # 可以是檔案路徑或網址
comments: [Comment!] # 先放著,以後如果要做給餐廳看所有評論的介面可以拿這個資料
orderItemInfo: OrderItemInfo # 值為null時表示不是在點菜的時候拿這道菜的資訊
type: String!
}
input CreateItemInput{
name: String!
description: String!,
price: Int!
img: String!,
type: String!,
englishName: String!,
englishDescription: String!
englishType: String!
}
input UpdateItemInput{
name: String!
description: String!,
price: Int!
img: String!,
type: String!,
englishName: String!,
englishDescription: String!
englishType: String!
}
enum Status{
RAW
DOING
DONE
}
enum MutationType{
CREATED
UPDATED
DELETED
}
input inputOrder{
id: String
tableNo: String
totalPrice: Int
time: String
items: [inputItem]
}
input inputItem{
id:String
name: String
price: Int
quantity: Int
note: String
status: String
}
type Order{
id: ID!
tableNo: String!
items: [Item!]!
totalPrice: Int!
time: String!
customerId: String!
customerName: String!
arrivedTime: String!
isTakeOut: String!
}
type orderItem{
id:String
name: String
price: Int
quantity: Int
note: String
status: String
}
type Restaurant{
id: ID
name: String
address: String
img_url: String
description: String
}
type OrderItemInfo{
quantity: Int!
note: String
state: String!
}
type Comment{
name: String
content: String!
time: String!
}
scalar Upload
type File{
url:String!
}