@feedmepos/mf-order-setting 0.0.95 → 0.0.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/{DisplaySystemView-rCw3DE0u.js → DisplaySystemView-BH8SkCOF.js} +4 -4
  2. package/dist/FoodCourtInvitationsView-3cA0Z-5m.js +383 -0
  3. package/dist/FoodCourtOrderSettingsView-DysrLZJD.js +294 -0
  4. package/dist/FoodCourtOrdersView-CbZqHIXO.js +544 -0
  5. package/dist/FoodCourtStallsView-CTZzPUQ6.js +635 -0
  6. package/dist/FoodCourtStatusView-C71y7ghx.js +113 -0
  7. package/dist/{KioskDevicesView-B4dgvMq_.js → KioskDevicesView-BJpbuSzp.js} +1 -1
  8. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-B-Oi8ZLq.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CQFpwn28.js} +7 -6
  9. package/dist/{KioskSettingView-DXx6wQQQ.js → KioskSettingView-CJxhMf7N.js} +3 -3
  10. package/dist/{KioskView-BmSHCl13.js → KioskView-BZsdRID1.js} +6 -6
  11. package/dist/{OrderSettingsView-9NOSAxLf.js → OrderSettingsView-gnyXaJjf.js} +10631 -10601
  12. package/dist/{app-y20uA-tu.js → app-CeEFBB-w.js} +4484 -3672
  13. package/dist/app.js +1 -1
  14. package/dist/dayjs.min-zBHHlxAP.js +285 -0
  15. package/dist/{featureFlag-GHmH1G2d.js → featureFlag-BTY_R78k.js} +1 -1
  16. package/dist/food-court-member-piX3gesl.js +212 -0
  17. package/dist/frontend/mf-order/src/api/food-court/index.d.ts +269 -0
  18. package/dist/frontend/mf-order/src/api/food-court/invitation.d.ts +55 -0
  19. package/dist/frontend/mf-order/src/app.d.ts +676 -0
  20. package/dist/frontend/mf-order/src/main.d.ts +676 -0
  21. package/dist/frontend/mf-order/src/stores/business/index.d.ts +3 -3
  22. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +6 -0
  23. package/dist/frontend/mf-order/src/utils/constants/route.d.ts +4 -0
  24. package/dist/frontend/mf-order/src/views/food-court/FoodCourtInvitationsView.vue.d.ts +2 -0
  25. package/dist/frontend/mf-order/src/views/food-court/FoodCourtOrdersView.vue.d.ts +2 -0
  26. package/dist/frontend/mf-order/src/views/food-court/FoodCourtStallsView.vue.d.ts +2 -0
  27. package/dist/frontend/mf-order/src/views/food-court/FoodCourtStatusView.vue.d.ts +2 -0
  28. package/dist/frontend/mf-order/src/views/food-court/food-court-member.d.ts +150 -0
  29. package/dist/frontend/mf-order/src/views/food-court/food-court-order.d.ts +66 -0
  30. package/dist/frontend/mf-order/src/views/food-court/invitations/JoinFoodCourtCard.vue.d.ts +13 -0
  31. package/dist/frontend/mf-order/src/views/food-court/invitations/MembershipRowActions.vue.d.ts +11 -0
  32. package/dist/frontend/mf-order/src/views/food-court/orders/FoodCourtOrderSheet.vue.d.ts +16 -0
  33. package/dist/frontend/mf-order/src/views/food-court/stalls/EditStallSheet.vue.d.ts +15 -0
  34. package/dist/frontend/mf-order/src/views/food-court/stalls/GenerateJoinCodeSheet.vue.d.ts +21 -0
  35. package/dist/frontend/mf-order/src/views/food-court/stalls/StallAssignmentFields.vue.d.ts +16 -0
  36. package/dist/frontend/mf-order/src/views/food-court/stalls/StallRowActions.vue.d.ts +11 -0
  37. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{index-CmdP_QXF.js → index-601eG3_R.js} +1 -1
  39. package/dist/index-BeBZTUcq.js +122 -0
  40. package/dist/index-BtudnkMi.js +1065 -0
  41. package/dist/{index-BlG6mIU4.js → index-CGiWgTn1.js} +38 -37
  42. package/dist/{index-wMygvJpP.js → index-D5nv3ncu.js} +2 -2
  43. package/dist/index-DLDihONy.js +25142 -0
  44. package/dist/order.dto-JM_fmWnQ.js +14842 -0
  45. package/dist/package/entity/food-court/food-court.do.d.ts +1 -1
  46. package/dist/package/entity/food-court/food-court.dto.d.ts +7 -7
  47. package/dist/package/entity/food-court/order-v2.dto.d.ts +4 -4
  48. package/dist/package/entity/order-platform/order-platform.dto.d.ts +190 -92
  49. package/dist/package/entity/order-setting/order-setting.do.d.ts +10 -0
  50. package/dist/package/entity/order-setting/order-setting.dto.d.ts +20 -0
  51. package/dist/package/entity/order-setting/queue/queue.do.d.ts +22 -0
  52. package/dist/package/entity/order-setting/queue/queue.dto.d.ts +7 -0
  53. package/dist/package/entity/queue/queue.do.d.ts +1 -0
  54. package/dist/package/entity/queue/queue.dto.d.ts +8 -8
  55. package/dist/package/entity/restaurant/restaurant.dto.d.ts +20 -0
  56. package/dist/search-BAPEUu1R.js +15 -0
  57. package/dist/useFoodCourtContext-2p5sJMcB.js +16 -0
  58. package/package.json +3 -3
  59. package/src/api/food-court/index.ts +357 -0
  60. package/src/api/food-court/invitation.ts +81 -0
  61. package/src/locales/en-US.json +171 -2
  62. package/src/locales/ja-JP.json +171 -2
  63. package/src/locales/th-TH.json +171 -2
  64. package/src/locales/zh-CN.json +171 -2
  65. package/src/router/routes.ts +44 -0
  66. package/src/utils/constants/route.ts +8 -0
  67. package/src/views/food-court/FoodCourtInvitationsView.vue +187 -0
  68. package/src/views/food-court/FoodCourtOrdersView.vue +263 -0
  69. package/src/views/food-court/FoodCourtStallsView.vue +369 -0
  70. package/src/views/food-court/FoodCourtStatusView.vue +111 -0
  71. package/src/views/food-court/food-court-member.spec.ts +339 -0
  72. package/src/views/food-court/food-court-member.ts +397 -0
  73. package/src/views/food-court/food-court-order.spec.ts +137 -0
  74. package/src/views/food-court/food-court-order.ts +206 -0
  75. package/src/views/food-court/invitations/JoinFoodCourtCard.vue +201 -0
  76. package/src/views/food-court/invitations/MembershipRowActions.vue +19 -0
  77. package/src/views/food-court/orders/FoodCourtOrderSheet.vue +226 -0
  78. package/src/views/food-court/stalls/EditStallSheet.vue +91 -0
  79. package/src/views/food-court/stalls/GenerateJoinCodeSheet.vue +281 -0
  80. package/src/views/food-court/stalls/StallAssignmentFields.vue +36 -0
  81. package/src/views/food-court/stalls/StallRowActions.vue +31 -0
  82. package/src/views/order-settings/OrderSettingsView.vue +2 -4
  83. package/src/views/order-settings/dine-in/DineInSetting.vue +1 -4
  84. package/src/views/order-settings/queue/QueueSetting.vue +27 -0
  85. package/src/views/order-settings/reservation/ReservationSetting.vue +8 -0
  86. package/dist/FoodCourtOrderSettingsView-DUQXCKzB.js +0 -323
  87. package/dist/index-CUI1lL9F.js +0 -1347
  88. package/dist/order.dto-CyHtvyly.js +0 -38829
@@ -1,4 +1,5 @@
1
1
  import { baseClientInstance, getData } from '@/api'
2
+ import type { FdoDinero } from '@feedmepos/core/entity'
2
3
 
3
4
  /**
4
5
  * A food court's order settings on order-backend's portal API, for Food Court
@@ -53,3 +54,359 @@ export const FoodCourtOrderSettingApi = {
53
54
  )
54
55
  }
55
56
  }
57
+
58
+ /** A membership row's stored state. */
59
+ export type FoodCourtMemberStatus = 'INVITED' | 'ACTIVE' | 'DECLINED' | 'REVOKED' | 'REMOVED'
60
+
61
+ /** The court's own stall number and display name for a member (KDI-4919). */
62
+ export interface FoodCourtStall {
63
+ unitNo: string | null
64
+ /** Null: the court shows the outlet's own name. */
65
+ displayName: string | null
66
+ }
67
+
68
+ /**
69
+ * One restaurant's row in a court (`FdoFoodCourtMemberV2`, foodcourt-service).
70
+ * A restaurant keeps ONE row per court for life: approving its join request
71
+ * after a decline, cancel, leave or remove puts the same row (same `_id`)
72
+ * back to ACTIVE. INVITED rows are left from invitations before join codes.
73
+ */
74
+ export interface FoodCourtMember {
75
+ _id: string
76
+ restaurantId: string
77
+ status: FoodCourtMemberStatus
78
+ stall: FoodCourtStall | null
79
+ invitedBy: string | null
80
+ invitedAt: string | null
81
+ inviteExpiresAt: string | null
82
+ joinedAt: string | null
83
+ removedAt: string | null
84
+ /** Off: the owner paused the stall; it takes no court orders. */
85
+ visible: boolean
86
+ /** The court owner's own note; left out of the stall's view. */
87
+ remark?: string | null
88
+ history: { status: FoodCourtMemberStatus; at: string | null; by: string | null }[]
89
+ }
90
+
91
+ /** A restaurant as foodcourt-service names it: its own name and its business's. */
92
+ export interface FoodCourtRestaurantSummary {
93
+ _id: string
94
+ name: string
95
+ businessName: string
96
+ }
97
+
98
+ /** One row of the owner's member list, with its restaurant (null once deleted). */
99
+ export interface FoodCourtMemberListItem {
100
+ member: FoodCourtMember
101
+ restaurant: FoodCourtRestaurantSummary | null
102
+ }
103
+
104
+ export interface FoodCourtUpdateMemberReq {
105
+ memberId: string
106
+ /** Replaces both fields; INVITED or ACTIVE rows. Blank, or the outlet's own name, is stored null. */
107
+ stall?: FoodCourtStall | null
108
+ /** ACTIVE rows only: false = Deactivate, true = Activate. */
109
+ visible?: boolean
110
+ }
111
+
112
+ export type FoodCourtStatus = 'ACTIVE' | 'INACTIVE'
113
+
114
+ /** The court's own Active / Inactive switch (KDI-4915 AC2-4). */
115
+ export interface FoodCourtStatusView {
116
+ status: FoodCourtStatus
117
+ /** The court's payout account is approved and enabled: it can be activated. */
118
+ payoutReady: boolean
119
+ }
120
+
121
+ /**
122
+ * foodcourt-service through the portal host: the ingress rewrites
123
+ * `/foodcourt-v2/<path>` to its `/api/portal/foodcourts/<path>`.
124
+ */
125
+ export const foodCourtServiceClientInstance = (foodCourtId: string) =>
126
+ baseClientInstance(`/foodcourt-v2/${foodCourtId}`)
127
+
128
+ /** Food Court Operations › Stalls: the court owner manages its members. */
129
+ export const FoodCourtMemberApi = {
130
+ /** Every row of the court, any status, in court order. */
131
+ async listMembers(foodCourtId: string): Promise<FoodCourtMemberListItem[]> {
132
+ return getData<FoodCourtMemberListItem[]>(
133
+ await foodCourtServiceClientInstance(foodCourtId).get('/members')
134
+ )
135
+ },
136
+ async updateMember(
137
+ foodCourtId: string,
138
+ body: FoodCourtUpdateMemberReq
139
+ ): Promise<FoodCourtMember> {
140
+ return getData<FoodCourtMember>(
141
+ await foodCourtServiceClientInstance(foodCourtId).post('/members/update', body)
142
+ )
143
+ },
144
+ /** Cancel a legacy pending invitation (an INVITED row from before join codes). */
145
+ async revokeInvite(foodCourtId: string, memberId: string): Promise<FoodCourtMember> {
146
+ return getData<FoodCourtMember>(
147
+ await foodCourtServiceClientInstance(foodCourtId).post('/members/revoke-invite', { memberId })
148
+ )
149
+ },
150
+ /** Remove an active stall from the court. */
151
+ async removeMember(foodCourtId: string, memberId: string): Promise<FoodCourtMember> {
152
+ return getData<FoodCourtMember>(
153
+ await foodCourtServiceClientInstance(foodCourtId).post('/members/remove', { memberId })
154
+ )
155
+ }
156
+ }
157
+
158
+ /**
159
+ * A join code's state. EXPIRED is worked out on read: an OPEN code past
160
+ * `expiresAt`. A PENDING request never expires; the owner decides it.
161
+ */
162
+ export type FoodCourtJoinCodeStatus =
163
+ 'OPEN' | 'PENDING' | 'APPROVED' | 'DECLINED' | 'CANCELLED' | 'EXPIRED'
164
+
165
+ /**
166
+ * A single-use code the court owner gives a stall (KDI-4915 join by code). The
167
+ * stall redeems it for one of its outlets, which makes it PENDING; the owner
168
+ * then approves (the outlet joins) or declines. The code itself is shown only
169
+ * once, when it is created.
170
+ */
171
+ export interface FoodCourtJoinCode {
172
+ _id: string
173
+ status: FoodCourtJoinCodeStatus
174
+ /** The stall number and display name the stall joins with; null = none set. */
175
+ stall: FoodCourtStall | null
176
+ createdAt: string
177
+ /** createdAt + 7 days. */
178
+ expiresAt: string
179
+ /** The outlet that redeemed the code; null before a request. */
180
+ restaurantId: string | null
181
+ requestedAt: string | null
182
+ decidedAt: string | null
183
+ /** The member row an approval created or reused. */
184
+ memberId: string | null
185
+ }
186
+
187
+ /** One code of the owner's list, with the outlet that asked to join (null before a request). */
188
+ export interface FoodCourtJoinCodeListItem {
189
+ joinCode: FoodCourtJoinCode
190
+ restaurant: FoodCourtRestaurantSummary | null
191
+ }
192
+
193
+ export interface FoodCourtCreateJoinCodeRes {
194
+ /** `ABCDE-FGHJK`. Returned only here: the service keeps a hash, never the code. */
195
+ code: string
196
+ joinCode: FoodCourtJoinCode
197
+ }
198
+
199
+ /** Several codes made at once: all OPEN and blank (no stall), with the same expiry. */
200
+ export interface FoodCourtCreateJoinCodesRes {
201
+ /** One entry per code, in creation order. */
202
+ codes: FoodCourtCreateJoinCodeRes[]
203
+ }
204
+
205
+ /**
206
+ * Food Court Operations › Stalls: the court owner's join codes. Cancel answers
207
+ * 400 JOIN_CODE_NOT_OPEN; approve and decline 400 JOIN_REQUEST_NOT_PENDING,
208
+ * approve also 409 MEMBER_EXISTS; an unknown code 404 JOIN_CODE_NOT_FOUND.
209
+ */
210
+ export const FoodCourtJoinCodeApi = {
211
+ /** Every code of the court, any status, newest first. */
212
+ async listJoinCodes(foodCourtId: string): Promise<FoodCourtJoinCodeListItem[]> {
213
+ return getData<FoodCourtJoinCodeListItem[]>(
214
+ await foodCourtServiceClientInstance(foodCourtId).get('/join-codes')
215
+ )
216
+ },
217
+ /** Null `stall`: the code carries no stall number or display name. */
218
+ async createJoinCode(
219
+ foodCourtId: string,
220
+ stall: FoodCourtStall | null
221
+ ): Promise<FoodCourtCreateJoinCodeRes> {
222
+ return getData<FoodCourtCreateJoinCodeRes>(
223
+ await foodCourtServiceClientInstance(foodCourtId).post('/join-codes', stall ? { stall } : {})
224
+ )
225
+ },
226
+ /**
227
+ * `count` blank codes (a whole number, 1 to 50) in one go, all or none.
228
+ * Each code is returned only here, as with one; a bad count is 400
229
+ * INVALID_REQUEST.
230
+ */
231
+ async createJoinCodes(foodCourtId: string, count: number): Promise<FoodCourtCreateJoinCodesRes> {
232
+ return getData<FoodCourtCreateJoinCodesRes>(
233
+ await foodCourtServiceClientInstance(foodCourtId).post('/join-codes', { count })
234
+ )
235
+ },
236
+ /** An OPEN code (expired included) can no longer be redeemed. */
237
+ async cancelJoinCode(foodCourtId: string, joinCodeId: string): Promise<FoodCourtJoinCode> {
238
+ return getData<FoodCourtJoinCode>(
239
+ await foodCourtServiceClientInstance(foodCourtId).post('/join-codes/cancel', { joinCodeId })
240
+ )
241
+ },
242
+ /** The requesting outlet joins as an ACTIVE stall: answers its member row. */
243
+ async approveJoinRequest(foodCourtId: string, joinCodeId: string): Promise<FoodCourtMember> {
244
+ return getData<FoodCourtMember>(
245
+ await foodCourtServiceClientInstance(foodCourtId).post('/join-codes/approve', { joinCodeId })
246
+ )
247
+ },
248
+ /** The code is used up; the stall needs a new one to ask again. */
249
+ async declineJoinRequest(foodCourtId: string, joinCodeId: string): Promise<FoodCourtJoinCode> {
250
+ return getData<FoodCourtJoinCode>(
251
+ await foodCourtServiceClientInstance(foodCourtId).post('/join-codes/decline', { joinCodeId })
252
+ )
253
+ }
254
+ }
255
+
256
+ /** Food Court Operations › Food Court: the court's Active / Inactive status. */
257
+ export const FoodCourtStatusApi = {
258
+ async getStatus(foodCourtId: string): Promise<FoodCourtStatusView> {
259
+ return getData<FoodCourtStatusView>(
260
+ await foodCourtServiceClientInstance(foodCourtId).get('/status')
261
+ )
262
+ },
263
+ /**
264
+ * ACTIVE without a ready payout account is refused (400 PAYOUT_ACCOUNT_NOT_READY,
265
+ * or PAYOUT_ACCOUNT_UNAVAILABLE while payment-service is down).
266
+ */
267
+ async updateStatus(foodCourtId: string, status: FoodCourtStatus): Promise<FoodCourtStatusView> {
268
+ return getData<FoodCourtStatusView>(
269
+ await foodCourtServiceClientInstance(foodCourtId).put('/status', { status })
270
+ )
271
+ }
272
+ }
273
+
274
+ /** A court order's state (`F_FOOD_COURT_ORDER_STATUS`). DRAFT is a cart not checked out yet. */
275
+ export type FoodCourtOrderStatus = 'DRAFT' | 'PENDING_PAYMENT' | 'PAID' | 'CANCELLED'
276
+
277
+ /** One row of the court's order list (`FdtoFoodCourtOrderSummary`, order-backend). */
278
+ export interface FoodCourtOrderSummary {
279
+ _id: string
280
+ /** The court number ("FC-121"); null until paid. */
281
+ orderNumber?: string | null
282
+ /** When the order was opened. */
283
+ createdAt: string
284
+ paidAt?: string | null
285
+ status: FoodCourtOrderStatus
286
+ /** The sum of the stall amounts; zero before checkout. */
287
+ total: FdoDinero
288
+ /** How the customer paid, as printed ("Visa", "TNG eWallet"). */
289
+ paymentMethod?: string | null
290
+ stallCount: number
291
+ }
292
+
293
+ export interface FoodCourtOrderListQuery {
294
+ /** ISO time with offset; orders opened from here. */
295
+ from: string
296
+ /** ISO time with offset, exclusive. */
297
+ to: string
298
+ status: FoodCourtOrderStatus[]
299
+ /** 0-based. */
300
+ page: number
301
+ /** 1 to 100. */
302
+ limit: number
303
+ }
304
+
305
+ /** A page of the list. The backend gives no total count, only whether a next page exists. */
306
+ export interface FoodCourtOrderListRes {
307
+ items: FoodCourtOrderSummary[]
308
+ page: number
309
+ limit: number
310
+ hasMore: boolean
311
+ }
312
+
313
+ /** One stall's slice of a court order, as stored at checkout (`FdoFoodCourtOrderStall`). */
314
+ export interface FoodCourtOrderStall {
315
+ orderId: string
316
+ restaurantId: string
317
+ /** Stall number, snapshot at order time. */
318
+ unitNo?: string | null
319
+ /** Stall name shown to the customer, snapshot at order time. */
320
+ displayName?: string | null
321
+ /** This stall's share of the court payment. */
322
+ amount: FdoDinero
323
+ }
324
+
325
+ /**
326
+ * The parts of a stall bill (`FdoBill`, @feedmepos/core) the order detail
327
+ * shows. Typed narrowly on purpose: the full bill is large and only read here.
328
+ */
329
+ export interface FoodCourtBillSubItem {
330
+ name: string
331
+ quantity: number
332
+ price?: FdoDinero | null
333
+ subItems?: FoodCourtBillSubItem[]
334
+ }
335
+
336
+ export interface FoodCourtBillItem {
337
+ product: { name: string }
338
+ quantity: number
339
+ remark?: string | null
340
+ status?: string | null
341
+ nettTotal?: FdoDinero | null
342
+ subItems?: FoodCourtBillSubItem[]
343
+ }
344
+
345
+ export interface FoodCourtBillTax {
346
+ name: string
347
+ inclusive?: boolean | null
348
+ total: FdoDinero
349
+ }
350
+
351
+ export interface FoodCourtBill {
352
+ _id: string
353
+ /** The stall's bill number, once its POS accepted the order. */
354
+ seqNumber?: string | null
355
+ status: string
356
+ items: Record<string, FoodCourtBillItem>
357
+ grossTotal: FdoDinero
358
+ adjustedTotal?: FdoDinero | null
359
+ nettTaxes?: Record<string, FoodCourtBillTax> | null
360
+ rounding?: FdoDinero | null
361
+ nettTotal: FdoDinero
362
+ }
363
+
364
+ /** A stall order inside the court receipt (`FdoOrder`), with its bill. */
365
+ export interface FoodCourtStallOrder {
366
+ _id: string
367
+ restaurant: string
368
+ /** The stall order's state: NEW until the stall POS accepts, then ACCEPTED, or DECLINED. */
369
+ status: string
370
+ billId?: string | null
371
+ orderAt: string
372
+ bill?: FoodCourtBill | null
373
+ }
374
+
375
+ /**
376
+ * One court order as its whole-court receipt (`FdtoFoodCourtOrder`,
377
+ * order-backend): the same shape the court kiosk prints.
378
+ */
379
+ export interface FoodCourtOrderReceipt {
380
+ _id: string
381
+ foodCourtId: string
382
+ stalls: FoodCourtOrderStall[]
383
+ status: FoodCourtOrderStatus
384
+ payment?: { type: string; paidAt?: string | null; method?: string | null } | null
385
+ orderNumber?: string | null
386
+ /** Every stall's order, in the order of `stalls`. */
387
+ pf_orders: FoodCourtStallOrder[]
388
+ paymentMethod?: string | null
389
+ total: FdoDinero
390
+ }
391
+
392
+ /**
393
+ * Food Court Operations › Orders (KDI-4941): the court's orders on
394
+ * order-backend's portal API (ordering-service#2188), owner or FeedMe admin only.
395
+ */
396
+ export const FoodCourtOrderApi = {
397
+ async listOrders(
398
+ foodCourtId: string,
399
+ query: FoodCourtOrderListQuery
400
+ ): Promise<FoodCourtOrderListRes> {
401
+ return getData<FoodCourtOrderListRes>(
402
+ await foodCourtClientInstance(foodCourtId).get('/orders', {
403
+ params: { ...query, status: query.status.join(',') }
404
+ })
405
+ )
406
+ },
407
+ async getOrder(foodCourtId: string, orderId: string): Promise<FoodCourtOrderReceipt> {
408
+ return getData<FoodCourtOrderReceipt>(
409
+ await foodCourtClientInstance(foodCourtId).get(`/orders/${orderId}`)
410
+ )
411
+ }
412
+ }
@@ -0,0 +1,81 @@
1
+ import { baseClientInstance, getData } from '@/api'
2
+ import {
3
+ foodCourtServiceClientInstance,
4
+ type FoodCourtJoinCode,
5
+ type FoodCourtMember,
6
+ type FoodCourtStall
7
+ } from '@/api/food-court'
8
+
9
+ /** A court's address as its profile stores it; only line1, city and state are shown. */
10
+ export interface FoodCourtAddress {
11
+ line1?: string | null
12
+ line2?: string | null
13
+ city?: string | null
14
+ state?: string | null
15
+ postcode?: string | null
16
+ country?: string | null
17
+ }
18
+
19
+ /**
20
+ * One court that has a row for the restaurant, as the restaurant (the stall)
21
+ * sees it in Restaurant Operation › Food Courts (KDI-4915). The row comes
22
+ * without the court owner's remark.
23
+ */
24
+ export interface FoodCourtMembership {
25
+ foodCourtId: string
26
+ profile: { name?: string | null; address?: FoodCourtAddress | null } | null
27
+ member: FoodCourtMember
28
+ }
29
+
30
+ /** What a join code opens, before the stall asks to join: the court's name and address only. */
31
+ export interface FoodCourtJoinCodePreview {
32
+ foodCourtId: string
33
+ name: string
34
+ address: FoodCourtAddress | null
35
+ /** The stall number and display name the court set on the code; null = none. */
36
+ stall: FoodCourtStall | null
37
+ expiresAt: string
38
+ }
39
+
40
+ export interface FoodCourtJoinCodeRedeemRes {
41
+ foodCourtId: string
42
+ name: string
43
+ /** PENDING: the court owner approves or declines it. */
44
+ joinCode: FoodCourtJoinCode
45
+ }
46
+
47
+ const joinCodeClientInstance = () => baseClientInstance('/foodcourt-v2/join-codes')
48
+
49
+ /**
50
+ * The stall side of foodcourt-service. Memberships and leave are keyed by the
51
+ * stall's own restaurant: only a user who can manage that restaurant may read
52
+ * them or leave. Preview and redeem answer 404 JOIN_CODE_INVALID, 400
53
+ * JOIN_CODE_EXPIRED / JOIN_CODE_USED and 429 TOO_MANY_ATTEMPTS; redeem also 403
54
+ * RESTAURANT_NOT_MANAGEABLE and 409 MEMBER_EXISTS / JOIN_REQUEST_EXISTS.
55
+ */
56
+ export const FoodCourtInvitationApi = {
57
+ /** One item per court that has a row for this restaurant. */
58
+ async listMemberships(restaurantId: string): Promise<FoodCourtMembership[]> {
59
+ return getData<FoodCourtMembership[]>(
60
+ await baseClientInstance(`/restaurants/${restaurantId}/foodcourt-memberships`).get('')
61
+ )
62
+ },
63
+ /** Leave a food court this restaurant has joined; rejoining needs a new join code. */
64
+ async leaveFoodCourt(foodCourtId: string, memberId: string): Promise<FoodCourtMember> {
65
+ return getData<FoodCourtMember>(
66
+ await foodCourtServiceClientInstance(foodCourtId).post('/members/leave', { memberId })
67
+ )
68
+ },
69
+ /** Which court a code belongs to. A wrong code counts as a failed attempt. */
70
+ async previewJoinCode(code: string): Promise<FoodCourtJoinCodePreview> {
71
+ return getData<FoodCourtJoinCodePreview>(
72
+ await joinCodeClientInstance().post('/preview', { code })
73
+ )
74
+ },
75
+ /** Ask to join the code's court as `restaurantId`; the owner then approves or declines. */
76
+ async redeemJoinCode(code: string, restaurantId: string): Promise<FoodCourtJoinCodeRedeemRes> {
77
+ return getData<FoodCourtJoinCodeRedeemRes>(
78
+ await joinCodeClientInstance().post('/redeem', { code, restaurantId })
79
+ )
80
+ }
81
+ }
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "order": {
3
3
  "foodCourt": {
4
+ "orders": {
5
+ "title": "Orders",
6
+ "subtitle": "Orders placed through the food court only. Orders made directly at a stall are not included.",
7
+ "loadFailed": "Couldn't load the orders.",
8
+ "empty": "No orders in this period.",
9
+ "columnOrderNo": "Order No.",
10
+ "columnDate": "Date",
11
+ "columnStalls": "Stalls",
12
+ "columnPayment": "Paid by",
13
+ "columnTotal": "Total",
14
+ "columnStatus": "Status",
15
+ "allStatuses": "All statuses",
16
+ "statusPaid": "Paid",
17
+ "statusPendingPayment": "Pending payment",
18
+ "statusCancelled": "Cancelled",
19
+ "statusDraft": "Not checked out",
20
+ "previous": "Previous",
21
+ "next": "Next",
22
+ "page": "Page {page}",
23
+ "perPage": "Items per page",
24
+ "detailTitle": "Order detail",
25
+ "orderTitle": "Order {number}",
26
+ "noNumber": "No number yet",
27
+ "date": "Date",
28
+ "paidBy": "Paid by",
29
+ "orderId": "Order ID",
30
+ "billNo": "Bill no.",
31
+ "notBilled": "Not billed yet",
32
+ "itemCount": "{count} item(s)",
33
+ "noItems": "The stall's items are not available.",
34
+ "subtotal": "Subtotal",
35
+ "discount": "Discount",
36
+ "rounding": "Rounding",
37
+ "stallTotal": "Stall total",
38
+ "netTotal": "Net total",
39
+ "stallAccepted": "Accepted",
40
+ "stallWaiting": "Waiting for stall",
41
+ "stallDeclined": "Declined",
42
+ "stallRefunded": "Refunded",
43
+ "stallVoided": "Voided",
44
+ "stallUnknown": "Unknown",
45
+ "close": "Close",
46
+ "detailLoadFailed": "Couldn't load this order."
47
+ },
4
48
  "qrOrdering": "QR Ordering",
5
49
  "qrOrderingSublabel": "Customers order from every stall by scanning the food court QR. When off, every stall shows \"Not taking orders now\". The food court kiosk is not affected.",
6
50
  "acceptedPaymentOnline": "Customers pay online (E-payment) once for the whole food court order.",
@@ -15,7 +59,129 @@
15
59
  "retry": "Retry",
16
60
  "currentNumberRule": "Enter a whole number from 0 to {max}",
17
61
  "nextNumber": "Next order: {number}",
18
- "saved": "Food court setting updated"
62
+ "saved": "Food court setting updated",
63
+ "noFoodCourtSelected": "Select a food court to manage it.",
64
+ "status": {
65
+ "title": "Food Court",
66
+ "section": "Status",
67
+ "operation": "Food court operation",
68
+ "operationSublabel": "Allow customers to order from any participating stall across all channels.",
69
+ "payoutHint": "To activate the food court, its payout account must be approved first.",
70
+ "offWarning": "Turning this off stops all new orders.",
71
+ "loadFailed": "Couldn't load the food court status.",
72
+ "activated": "Food court is now active",
73
+ "deactivated": "Food court is now inactive"
74
+ },
75
+ "stalls": {
76
+ "title": "Stalls",
77
+ "searchPlaceholder": "Search stalls",
78
+ "loadFailed": "Couldn't load the stalls.",
79
+ "noMatch": "No stalls match your search.",
80
+ "empty": "No stalls yet. Generate a join code to get started.",
81
+ "columnNo": "No.",
82
+ "columnStall": "Stall",
83
+ "columnStatus": "Status",
84
+ "statusActive": "Active",
85
+ "statusInactive": "Inactive",
86
+ "statusDeclined": "Declined",
87
+ "actionDeactivate": "Deactivate",
88
+ "actionActivate": "Activate",
89
+ "actionRemove": "Remove",
90
+ "actionCancelInvite": "Cancel invitation",
91
+ "deactivateTitle": "Deactivate this stall?",
92
+ "deactivateMessage": "{stall} won't be able to receive new orders while deactivated. You can reactivate them anytime.",
93
+ "removeTitle": "Remove this stall?",
94
+ "removeMessage": "{stall} will leave this food court and stop receiving its orders. To add them back, give them a new join code.",
95
+ "cancelInviteTitle": "Cancel this invitation?",
96
+ "cancelInviteMessage": "{stall} will no longer be able to accept this invitation.",
97
+ "deactivated": "Stall deactivated",
98
+ "activated": "Stall activated",
99
+ "removed": "Stall removed",
100
+ "inviteCancelled": "Invitation cancelled",
101
+ "updated": "Stall updated",
102
+ "editTitle": "Edit stall",
103
+ "stallNumber": "Stall number",
104
+ "displayName": "Stall display name",
105
+ "displayNameHint": "You can rename it for this food court.",
106
+ "generateJoinCode": "Generate join code",
107
+ "statusInvited": "Invited",
108
+ "statusPendingApproval": "Pending approval",
109
+ "statusCodeIssued": "Code issued",
110
+ "actionApprove": "Approve",
111
+ "actionDecline": "Decline",
112
+ "actionCancelCode": "Cancel code",
113
+ "declineRequestTitle": "Decline this request?",
114
+ "declineRequestMessage": "{stall} won't join this food court, and the code is used up. To let them ask again, give them a new join code.",
115
+ "cancelCodeTitle": "Cancel this join code?",
116
+ "cancelCodeMessage": "The code will stop working. A stall that hasn't used it yet will need a new one.",
117
+ "requestApproved": "Stall approved and added",
118
+ "requestDeclined": "Request declined",
119
+ "codeCancelled": "Join code cancelled",
120
+ "codeNoStall": "Not used yet",
121
+ "requestedBy": "Requested by {outlet}",
122
+ "codeExpires": "Expires {date}",
123
+ "generateTitle": "Generate join codes",
124
+ "generateIntro": "Generate a code for one stall. The stall enters it in Restaurant Operation › Food Courts to ask to join, and you approve the request here. You can set the stall number and display name it joins with now or later.",
125
+ "generateCode": "Generate code",
126
+ "codeTitle": "Join code",
127
+ "codeShareHint": "Share it with the stall. It works once, for 7 days. This is the only time the code is shown.",
128
+ "codeForStall": "For {stall}",
129
+ "codeDone": "Done",
130
+ "joinCode": "Join code",
131
+ "codeCount": "How many?",
132
+ "codeCountHint": "Up to 50 codes at a time.",
133
+ "generateCodes": "Generate {count} codes",
134
+ "generateIntroMany": "Generate one code for each stall. Each stall enters its code in Restaurant Operation › Food Courts to ask to join, and you approve each request here. Codes made together carry no stall number or display name: set them by editing each stall once you approve it.",
135
+ "codesTitle": "Join codes",
136
+ "codesShareHint": "Give each stall one code. Each works once, for 7 days. This is the only time the codes are shown.",
137
+ "copyAll": "Copy all",
138
+ "joinCodes": "Join codes"
139
+ },
140
+ "invitations": {
141
+ "title": "Food Courts",
142
+ "noRestaurant": "Select a restaurant to manage its food courts.",
143
+ "loadFailed": "Couldn't load your food courts.",
144
+ "searchPlaceholder": "Search food courts",
145
+ "noMatch": "No food courts match your search.",
146
+ "empty": "This restaurant hasn't joined a food court yet.",
147
+ "unnamedCourt": "Food court",
148
+ "columnFoodCourt": "Food Court",
149
+ "columnLocation": "Location",
150
+ "columnStatus": "Status",
151
+ "statusDeclined": "Declined",
152
+ "statusCancelled": "Cancelled",
153
+ "statusLeft": "Left",
154
+ "leave": "Leave food court",
155
+ "leaveTitle": "Leave this food court?",
156
+ "leaveMessage": "You will stop receiving orders from {court}. To rejoin, ask the food court for a new join code.",
157
+ "leaveConfirm": "Leave",
158
+ "left": "You left the food court",
159
+ "stallBadge": "Stall {number}",
160
+ "columnJoined": "Joined",
161
+ "statusJoined": "Joined",
162
+ "statusInvited": "Invited",
163
+ "listTitle": "Your food courts",
164
+ "joinTitle": "Join a food court",
165
+ "joinIntro": "Enter the join code the food court gave you.",
166
+ "joinCode": "Join code",
167
+ "preview": "Preview",
168
+ "joinAsStall": "You join as {stall}",
169
+ "requestToJoin": "Request to join as {restaurant}",
170
+ "useAnotherCode": "Use another code",
171
+ "requestSent": "Request sent",
172
+ "requestSentDetail": "{court} will approve it. Once it does, the food court appears in your list below.",
173
+ "joinAnother": "Join another food court"
174
+ },
175
+ "joinErrors": {
176
+ "malformed": "Enter the 10-character code, like ABCDE-FGHJK. Codes never use 0, 1, I, L or O.",
177
+ "invalid": "This code doesn't match any food court. Check it and try again.",
178
+ "expired": "This code has expired. Ask the food court for a new one.",
179
+ "used": "This code has already been used or cancelled. Ask the food court for a new one.",
180
+ "tooManyAttempts": "Too many wrong codes. Wait up to 15 minutes, then try again.",
181
+ "memberExists": "This restaurant is already a stall in this food court.",
182
+ "requestExists": "This restaurant has already asked to join this food court. Wait for the food court to approve it.",
183
+ "notManageable": "You can't manage this restaurant, so you can't ask for it to join a food court."
184
+ }
19
185
  },
20
186
  "waitEstimateMinutesHeader": "Estimated wait",
21
187
  "waitEstimateMinutesUnit": "min",
@@ -85,7 +251,7 @@
85
251
  "acceptQueue": "Accept queue",
86
252
  "acceptQueueSublabel": "Customer can use queue in FeedMe app",
87
253
  "acceptReservation": "Accept reservation",
88
- "acceptReservationSublabel": "Customers can book a table. FeedMe admin only",
254
+ "acceptReservationSublabel": "Customers can book a table",
89
255
  "actiavteFeedmeExpress": "Activate FeedMe Express",
90
256
  "activated": "Activated",
91
257
  "activatedDate": "Activated date",
@@ -123,6 +289,8 @@
123
289
  "externalCatalogRequired": "Select a catalog for {orderTypes} on {platform}.",
124
290
  "auto": "Auto",
125
291
  "autoCalledLimit": "Auto Called Limit",
292
+ "autoCancelCalledMinutes": "Auto-cancel called queue after (minutes)",
293
+ "autoCancelCalledMinutesHint": "Counts from when the queue is called. A party not seated by then is cancelled. Set it longer than your usual wait between calling and seating. 0 = off.",
126
294
  "autoCloseBill": "Auto close bill",
127
295
  "autoCloseBillSublabel": "Automatically close the bill once the order is accepted. An unpaid bill stays open until it is settled.",
128
296
  "autoIntegration": "Auto Integration",
@@ -239,6 +407,7 @@
239
407
  "disabled": "Disabled",
240
408
  "disableRemoteQueue": "Disable Remote Queue",
241
409
  "disableSMS": "Disable notifications",
410
+ "queueNotifyOnCancel": "Notify customer when a queue is cancelled",
242
411
  "discountCampaign": "Discount Campaign",
243
412
  "discountRule": {
244
413
  "add": "Add discount rule",