@feedmepos/mf-order-setting 0.0.108 → 0.0.109

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 (57) hide show
  1. package/dist/{DisplaySystemView-ChGTO4v2.js → DisplaySystemView-hHA7fMQR.js} +4 -4
  2. package/dist/{FoodCourtInvitationsView-F1LiGOR8.js → FoodCourtInvitationsView-C_x0pvnB.js} +4 -4
  3. package/dist/{FoodCourtOrderSettingsView-D5M5kFAl.js → FoodCourtOrderSettingsView-BMRJe6tf.js} +1 -1
  4. package/dist/FoodCourtOrdersView-DlGJnMOd.js +1433 -0
  5. package/dist/{FoodCourtStallsView-jz1xnZus.js → FoodCourtStallsView-BAzlMqlj.js} +2 -2
  6. package/dist/{FoodCourtStatusView-DC3qHL1L.js → FoodCourtStatusView-CRkk2f66.js} +1 -1
  7. package/dist/{KioskDevicesView-B9w4izOk.js → KioskDevicesView-COuR39YQ.js} +1 -1
  8. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-XJm-f2JF.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CAcDjPbk.js} +5 -5
  9. package/dist/{KioskSettingView-Bmfvz0Kz.js → KioskSettingView-DsIzIbYf.js} +3 -3
  10. package/dist/{KioskView-B0WlDEsG.js → KioskView-B1sn-D6k.js} +8 -8
  11. package/dist/{OrderSettingsView-BF89-eSB.js → OrderSettingsView-BvYGRXfI.js} +10 -10
  12. package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-BqPQnAVb.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-COUKtg5k.js} +1 -1
  13. package/dist/{app-B4ew9SMz.js → app-utsChJtE.js} +71 -15
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-BsZk4QHK.js → dayjs.min-C9WrpSe-.js} +1 -1
  16. package/dist/{featureFlag-CFlCo4uv.js → featureFlag-CHPFyNAw.js} +1 -1
  17. package/dist/frontend/mf-order/src/api/food-court/index.d.ts +29 -2
  18. package/dist/frontend/mf-order/src/app.d.ts +56 -0
  19. package/dist/frontend/mf-order/src/main.d.ts +56 -0
  20. package/dist/frontend/mf-order/src/views/food-court/food-court-order.d.ts +12 -1
  21. package/dist/frontend/mf-order/src/views/food-court/orders/FoodCourtOrderSheet.vue.d.ts +3 -1
  22. package/dist/frontend/mf-order/src/views/food-court/orders/FoodCourtReceiptDialog.vue.d.ts +17 -0
  23. package/dist/frontend/mf-order/src/views/food-court/orders/food-court-receipt.d.ts +20 -0
  24. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  25. package/dist/index--4Q-LHMq.js +6854 -0
  26. package/dist/{index-D0vTvoQN.js → index-BaABuG0J.js} +1 -1
  27. package/dist/{index-Z1ZA897U.js → index-CVxg__RB.js} +1 -1
  28. package/dist/index-Ck6Ef5sR.js +5 -0
  29. package/dist/{index-C6c28uBZ.js → index-D349Zd9k.js} +35 -23
  30. package/dist/{index-DLeX1p1o.js → index-DC8V_7zz.js} +2 -2
  31. package/dist/{index-D4_zVJPi.js → index-DVJkdWEG.js} +4 -4
  32. package/dist/index-iSsU83r4.js +46278 -0
  33. package/dist/{order.dto-DrlhCvYK.js → order.dto-D4yp5hGF.js} +47 -43
  34. package/dist/package/entity/alert/suggestion.dto.d.ts +2 -2
  35. package/dist/package/entity/food-court/order-v2.dto.d.ts +5 -5
  36. package/dist/package/entity/kiosk/kiosk.do.d.ts +16 -16
  37. package/dist/package/entity/kiosk/kiosk.dto.d.ts +19 -19
  38. package/dist/package/entity/order/order.do.d.ts +3 -3
  39. package/dist/package/entity/order/order.dto.d.ts +10 -10
  40. package/dist/package/entity/order/order.enum.d.ts +1 -1
  41. package/dist/package/entity/order-platform/deliveroo/deliveroo.menu.dto.d.ts +30 -30
  42. package/dist/{useInternalUser-BaSqwN4K.js → useInternalUser-CeoNePyw.js} +1 -1
  43. package/package.json +4 -1
  44. package/src/api/food-court/index.ts +42 -4
  45. package/src/locales/en-US.json +15 -1
  46. package/src/locales/ja-JP.json +15 -1
  47. package/src/locales/th-TH.json +15 -1
  48. package/src/locales/zh-CN.json +15 -1
  49. package/src/views/food-court/FoodCourtOrdersView.vue +135 -16
  50. package/src/views/food-court/food-court-order.spec.ts +16 -1
  51. package/src/views/food-court/food-court-order.ts +23 -1
  52. package/src/views/food-court/orders/FoodCourtOrderSheet.vue +29 -11
  53. package/src/views/food-court/orders/FoodCourtReceiptDialog.vue +113 -0
  54. package/src/views/food-court/orders/food-court-receipt.spec.ts +43 -0
  55. package/src/views/food-court/orders/food-court-receipt.ts +49 -0
  56. package/vite.config.ts +13 -0
  57. package/dist/FoodCourtOrdersView-BQrESoTH.js +0 -1190
@@ -320,6 +320,19 @@ export interface FoodCourtOrderSummary {
320
320
  /** How the customer paid, as printed ("Visa", "TNG eWallet"). */
321
321
  paymentMethod?: string | null
322
322
  stallCount: number
323
+ /**
324
+ * The stalls in the order, in checkout order (KDI-4941). Absent from an
325
+ * order-backend before KDI-4941's list filters.
326
+ */
327
+ stalls?: FoodCourtOrderListStall[]
328
+ }
329
+
330
+ /** A stall in a list row. */
331
+ export interface FoodCourtOrderListStall {
332
+ restaurantId: string
333
+ unitNo: string | null
334
+ /** The court's name for the stall at checkout, else the outlet's own name; null when unknown. */
335
+ name: string | null
323
336
  }
324
337
 
325
338
  export interface FoodCourtOrderListQuery {
@@ -332,6 +345,14 @@ export interface FoodCourtOrderListQuery {
332
345
  page: number
333
346
  /** 1 to 100. */
334
347
  limit: number
348
+ /** Only orders with one of these stalls (restaurant ids). */
349
+ restaurantId?: string[]
350
+ /**
351
+ * A court or stall order id (found in any date or status), or, inside the
352
+ * other filters, an FC number, stall bill id or stall bill number. With a
353
+ * search the date range may span at most 31 days (SEARCH_RANGE_TOO_LONG).
354
+ */
355
+ search?: string
335
356
  }
336
357
 
337
358
  /** A page of the list. The backend gives no total count, only whether a next page exists. */
@@ -419,6 +440,10 @@ export interface FoodCourtOrderReceipt {
419
440
  pf_orders: FoodCourtStallOrder[]
420
441
  paymentMethod?: string | null
421
442
  total: FdoDinero
443
+ /** Each stall outlet's own profile, by restaurant id: its name when the court gave the stall none. */
444
+ stallProfiles?: Record<string, { name?: string | null } | null>
445
+ /** The whole-court receipt page in Feeds (the receipt's QR code), no sign-in needed. */
446
+ receiptQrUrl?: string | null
422
447
  }
423
448
 
424
449
  /**
@@ -432,7 +457,12 @@ export const FoodCourtOrderApi = {
432
457
  ): Promise<FoodCourtOrderListRes> {
433
458
  return getData<FoodCourtOrderListRes>(
434
459
  await foodCourtClientInstance(foodCourtId).get('/orders', {
435
- params: { ...query, status: query.status.join(',') }
460
+ params: {
461
+ ...query,
462
+ status: query.status.join(','),
463
+ restaurantId: query.restaurantId?.length ? query.restaurantId.join(',') : undefined,
464
+ search: query.search?.trim() || undefined
465
+ }
436
466
  })
437
467
  )
438
468
  },
@@ -442,7 +472,8 @@ export const FoodCourtOrderApi = {
442
472
  )
443
473
  },
444
474
  /**
445
- * Every order the list's filters match, one row per stall order (KDI-4942).
475
+ * Every order the list's filters match, one row per stall order (KDI-4942);
476
+ * with stalls picked, only those stalls' rows (KDI-4941).
446
477
  * Refused (400) past 31 days with code EXPORT_RANGE_TOO_LONG, or past 50,000
447
478
  * rows with EXPORT_TOO_MANY_ROWS.
448
479
  */
@@ -452,13 +483,20 @@ export const FoodCourtOrderApi = {
452
483
  ): Promise<FoodCourtOrderExport> {
453
484
  return getData<FoodCourtOrderExport>(
454
485
  await foodCourtClientInstance(foodCourtId).get('/order-export', {
455
- params: { ...query, status: query.status.join(',') }
486
+ params: {
487
+ ...query,
488
+ status: query.status.join(','),
489
+ restaurantId: query.restaurantId?.length ? query.restaurantId.join(',') : undefined
490
+ }
456
491
  })
457
492
  )
458
493
  }
459
494
  }
460
495
 
461
- export type FoodCourtOrderExportQuery = Pick<FoodCourtOrderListQuery, 'from' | 'to' | 'status'>
496
+ export type FoodCourtOrderExportQuery = Pick<
497
+ FoodCourtOrderListQuery,
498
+ 'from' | 'to' | 'status' | 'restaurantId'
499
+ >
462
500
 
463
501
  /**
464
502
  * One stall order of the export (`FdtoFoodCourtOrderExportRow`, order-backend).
@@ -159,7 +159,21 @@
159
159
  "exportEmpty": "No data to export for the selected filters",
160
160
  "exportIncomplete": "Exported, but the bill details of {count} stall(s) couldn't be read, so their bill columns are empty. Try again later.",
161
161
  "exportRangeTooLong": "Export up to {days} days at a time. Pick a shorter date range.",
162
- "exportTooManyRows": "Too many orders to export at once (more than {rows} stall orders). Pick a shorter date range."
162
+ "exportTooManyRows": "Too many orders to export at once (more than {rows} stall orders). Pick a shorter date range.",
163
+ "allStalls": "All stalls",
164
+ "moreStalls": "+{count} more",
165
+ "searchPlaceholder": "Search FC no., order ID or bill no.",
166
+ "noMatch": "No orders match \"{search}\" in this period. An order ID is found on any date.",
167
+ "searchRangeTooLong": "Search up to {days} days at a time, or search by order ID.",
168
+ "statusGuide": "Status guide",
169
+ "statusPaidHelp": "The customer has paid. The order has been sent to each stall's POS, and each stall accepts its part.",
170
+ "statusPendingPaymentHelp": "The customer checked out and started paying, but the payment is not confirmed yet. A failed or unfinished payment stays here, and the customer can pay again. If a payment still succeeds, the order becomes Paid.",
171
+ "statusCancelledHelp": "The customer cancelled the order before paying, so no stall received it. If a payment still succeeds later, the order becomes Paid.",
172
+ "statusGuideNote": "Carts that were never checked out are not listed. A refund is made per stall, on that stall's own bill: the stall shows Refunded in the order detail.",
173
+ "viewReceipt": "View receipt",
174
+ "receiptTitle": "Receipt",
175
+ "downloadReceipt": "Download",
176
+ "receiptUnavailable": "This receipt can't be shown: {reason}"
163
177
  },
164
178
  "qrOrdering": "QR Ordering",
165
179
  "qrOrderingSublabel": "Customers order from every stall by scanning the food court QR. When off, customers see \"This food court isn't taking orders right now\" and every stall shows \"Unavailable\". The food court kiosk is not affected.",
@@ -48,7 +48,21 @@
48
48
  "exportEmpty": "選択したフィルターでエクスポートするデータがありません",
49
49
  "exportIncomplete": "エクスポートしましたが、{count} 店舗の伝票の詳細を読み込めなかったため、その伝票の列は空です。後でもう一度お試しください。",
50
50
  "exportRangeTooLong": "一度にエクスポートできるのは {days} 日分までです。期間を短くしてください。",
51
- "exportTooManyRows": "注文が多すぎて一度にエクスポートできません(店舗の注文 {rows} 件超)。期間を短くしてください。"
51
+ "exportTooManyRows": "注文が多すぎて一度にエクスポートできません(店舗の注文 {rows} 件超)。期間を短くしてください。",
52
+ "allStalls": "すべての店舗",
53
+ "moreStalls": "他{count}件",
54
+ "searchPlaceholder": "FC番号、注文ID、伝票番号で検索",
55
+ "noMatch": "この期間に「{search}」に一致する注文はありません。注文IDはどの日付でも検索できます。",
56
+ "searchRangeTooLong": "一度に検索できるのは{days}日までです。または注文IDで検索してください。",
57
+ "statusGuide": "ステータスの説明",
58
+ "statusPaidHelp": "お客様の支払いが完了しました。注文は各店舗のPOSに送られ、各店舗が自分の分を受け付けます。",
59
+ "statusPendingPaymentHelp": "お客様が会計を始めましたが、支払いはまだ確認されていません。失敗した支払いや未完了の支払いはこの状態のままで、お客様は再度支払えます。支払いが後で成功した場合は「支払済み」になります。",
60
+ "statusCancelledHelp": "お客様が支払い前に注文を取り消したため、どの店舗にも送られていません。後で支払いが成功した場合は「支払済み」になります。",
61
+ "statusGuideNote": "会計していないカートは表示されません。返金は店舗ごとに、その店舗の伝票で行われます。返金された店舗は注文詳細で「返金済み」と表示されます。",
62
+ "viewReceipt": "レシートを表示",
63
+ "receiptTitle": "レシート",
64
+ "downloadReceipt": "ダウンロード",
65
+ "receiptUnavailable": "このレシートは表示できません: {reason}"
52
66
  },
53
67
  "qrOrdering": "QR注文",
54
68
  "qrOrderingSublabel": "お客様はフードコートのQRを読み取って各店舗に注文できます。オフにすると、お客様には「このフードコートは現在注文を受け付けていません」と表示され、すべての店舗が「利用不可」になります。フードコートのキオスクには影響しません。",
@@ -159,7 +159,21 @@
159
159
  "exportEmpty": "ไม่มีข้อมูลให้ส่งออกตามตัวกรองที่เลือก",
160
160
  "exportIncomplete": "ส่งออกแล้ว แต่อ่านรายละเอียดบิลของร้าน {count} ร้านไม่ได้ คอลัมน์บิลของร้านเหล่านั้นจึงว่างอยู่ โปรดลองอีกครั้งภายหลัง",
161
161
  "exportRangeTooLong": "ส่งออกได้ครั้งละไม่เกิน {days} วัน โปรดเลือกช่วงวันที่ให้สั้นลง",
162
- "exportTooManyRows": "คำสั่งซื้อมากเกินกว่าจะส่งออกในครั้งเดียว (เกิน {rows} คำสั่งซื้อของร้าน) โปรดเลือกช่วงวันที่ให้สั้นลง"
162
+ "exportTooManyRows": "คำสั่งซื้อมากเกินกว่าจะส่งออกในครั้งเดียว (เกิน {rows} คำสั่งซื้อของร้าน) โปรดเลือกช่วงวันที่ให้สั้นลง",
163
+ "allStalls": "ทุกร้าน",
164
+ "moreStalls": "+อีก {count} ร้าน",
165
+ "searchPlaceholder": "ค้นหาเลข FC, รหัสคำสั่งซื้อ หรือเลขบิล",
166
+ "noMatch": "ไม่มีคำสั่งซื้อที่ตรงกับ \"{search}\" ในช่วงนี้ ค้นหาด้วยรหัสคำสั่งซื้อได้ทุกวันที่",
167
+ "searchRangeTooLong": "ค้นหาได้ครั้งละไม่เกิน {days} วัน หรือค้นหาด้วยรหัสคำสั่งซื้อ",
168
+ "statusGuide": "คำอธิบายสถานะ",
169
+ "statusPaidHelp": "ลูกค้าชำระเงินแล้ว คำสั่งซื้อถูกส่งไปยัง POS ของแต่ละร้าน และแต่ละร้านรับส่วนของตนเอง",
170
+ "statusPendingPaymentHelp": "ลูกค้าเช็กเอาต์และเริ่มชำระเงินแล้ว แต่ยังไม่ได้รับการยืนยันการชำระเงิน การชำระเงินที่ล้มเหลวหรือยังไม่เสร็จจะอยู่ในสถานะนี้ และลูกค้าชำระใหม่ได้ หากการชำระเงินสำเร็จภายหลัง คำสั่งซื้อจะเป็นชำระแล้ว",
171
+ "statusCancelledHelp": "ลูกค้ายกเลิกคำสั่งซื้อก่อนชำระเงิน จึงไม่มีร้านใดได้รับคำสั่งซื้อ หากการชำระเงินสำเร็จภายหลัง คำสั่งซื้อจะเป็นชำระแล้ว",
172
+ "statusGuideNote": "ตะกร้าที่ไม่ได้เช็กเอาต์จะไม่แสดง การคืนเงินทำแยกตามร้านบนบิลของร้านนั้น ร้านที่คืนเงินแล้วจะแสดงว่าคืนเงินแล้วในรายละเอียดคำสั่งซื้อ",
173
+ "viewReceipt": "ดูใบเสร็จ",
174
+ "receiptTitle": "ใบเสร็จ",
175
+ "downloadReceipt": "ดาวน์โหลด",
176
+ "receiptUnavailable": "แสดงใบเสร็จนี้ไม่ได้: {reason}"
163
177
  },
164
178
  "qrOrdering": "สั่งอาหารผ่าน QR",
165
179
  "qrOrderingSublabel": "ลูกค้าสั่งอาหารจากทุกร้านได้โดยสแกน QR ของศูนย์อาหาร เมื่อปิด ลูกค้าจะเห็น \"ศูนย์อาหารนี้ยังไม่รับคำสั่งซื้อในขณะนี้\" และทุกร้านจะแสดง \"ไม่พร้อมให้บริการ\" ตู้คีออสก์ของศูนย์อาหารไม่ได้รับผลกระทบ",
@@ -48,7 +48,21 @@
48
48
  "exportEmpty": "所选筛选条件下没有可导出的数据",
49
49
  "exportIncomplete": "已导出,但有 {count} 个档口的账单明细无法读取,其账单栏位为空。请稍后再试。",
50
50
  "exportRangeTooLong": "每次最多导出 {days} 天,请缩短日期范围。",
51
- "exportTooManyRows": "订单太多,无法一次导出(超过 {rows} 个档口订单)。请缩短日期范围。"
51
+ "exportTooManyRows": "订单太多,无法一次导出(超过 {rows} 个档口订单)。请缩短日期范围。",
52
+ "allStalls": "所有档口",
53
+ "moreStalls": "另外 {count} 个",
54
+ "searchPlaceholder": "搜索 FC 编号、订单 ID 或账单号",
55
+ "noMatch": "此期间没有与“{search}”匹配的订单。订单 ID 可在任何日期找到。",
56
+ "searchRangeTooLong": "每次最多搜索 {days} 天,或按订单 ID 搜索。",
57
+ "statusGuide": "状态说明",
58
+ "statusPaidHelp": "顾客已付款。订单已发送到各档口的 POS,由各档口接受自己的部分。",
59
+ "statusPendingPaymentHelp": "顾客已结账并开始付款,但付款尚未确认。付款失败或未完成时保持此状态,顾客可以再次付款。如果之后付款成功,订单会变为已支付。",
60
+ "statusCancelledHelp": "顾客在付款前取消了订单,因此没有档口收到订单。如果之后付款成功,订单会变为已支付。",
61
+ "statusGuideNote": "未结账的购物车不会列出。退款按档口进行,在该档口自己的账单上处理;已退款的档口在订单详情中显示为已退款。",
62
+ "viewReceipt": "查看收据",
63
+ "receiptTitle": "收据",
64
+ "downloadReceipt": "下载",
65
+ "receiptUnavailable": "无法显示此收据:{reason}"
52
66
  },
53
67
  "qrOrdering": "扫码点餐",
54
68
  "qrOrderingSublabel": "顾客扫描美食广场二维码即可向每个档口点餐。关闭后,顾客会看到“这个美食广场目前暂停接单”,每个档口显示“暂不可用”。美食广场自助点餐机不受影响。",
@@ -8,8 +8,30 @@
8
8
  <div v-if="!foodCourtId" class="px-[1.5rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary">
9
9
  {{ t('order.foodCourt.noFoodCourtSelected') }}
10
10
  </div>
11
- <div v-else class="px-[1.5rem] flex flex-col gap-4">
11
+ <div v-else class="px-[1.5rem] flex flex-col gap-12">
12
12
  <div class="flex items-center gap-3 flex-wrap">
13
+ <FmSearch
14
+ v-model="searchInput"
15
+ class="w-[360px]"
16
+ :placeholder="t('order.foodCourt.orders.searchPlaceholder')"
17
+ />
18
+ <FmButton
19
+ class="ml-auto"
20
+ variant="tertiary"
21
+ prepend-icon="info"
22
+ :label="t('order.foodCourt.orders.statusGuide')"
23
+ @click="showStatusGuide = !showStatusGuide"
24
+ />
25
+ <FmButton
26
+ variant="secondary"
27
+ prepend-icon="download"
28
+ :label="t('order.foodCourt.orders.export')"
29
+ :loading="isExporting"
30
+ @click="onExport"
31
+ />
32
+ </div>
33
+ <!-- Top-aligned: a picked stall shows as a chip under its box, which must not push the other filters down. -->
34
+ <div class="flex items-start gap-3 flex-wrap">
13
35
  <FmDateRangePicker v-model="dateRange" show-predefined-range>
14
36
  <template #trigger-button>
15
37
  <FmChip :label="dateRangeLabel" icon="calendar_today" />
@@ -22,15 +44,30 @@
22
44
  :items="statusItems"
23
45
  :placeholder="t('order.foodCourt.orders.allStatuses')"
24
46
  />
25
- <FmButton
26
- class="ml-auto"
27
- variant="secondary"
28
- prepend-icon="download"
29
- :label="t('order.foodCourt.orders.export')"
30
- :loading="isExporting"
31
- @click="onExport"
47
+ <FmSelect
48
+ v-model="stallIds"
49
+ class="min-w-[280px] max-w-[420px]"
50
+ multiselect
51
+ :items="stallItems"
52
+ :placeholder="t('order.foodCourt.orders.allStalls')"
32
53
  />
33
54
  </div>
55
+ <FmCard v-if="showStatusGuide" variant="outlined">
56
+ <div class="p-16 flex flex-col gap-12">
57
+ <span class="fm-typo-en-body-lg-600">{{ t('order.foodCourt.orders.statusGuide') }}</span>
58
+ <div v-for="entry in COURT_ORDER_STATUS_HELP" :key="entry.status" class="flex items-start gap-12">
59
+ <FmChip
60
+ class="shrink-0 min-w-[140px]"
61
+ :variant="COURT_ORDER_STATUS_CHIP[entry.status].variant"
62
+ :label="t(COURT_ORDER_STATUS_CHIP[entry.status].labelKey)"
63
+ />
64
+ <span class="fm-typo-en-body-md-400 text-fm-color-typo-secondary">{{ t(entry.helpKey) }}</span>
65
+ </div>
66
+ <span class="fm-typo-en-body-sm-400 text-fm-color-typo-tertiary">
67
+ {{ t('order.foodCourt.orders.statusGuideNote') }}
68
+ </span>
69
+ </div>
70
+ </FmCard>
34
71
  <div v-if="loadFailed" class="py-4 flex flex-col gap-3 items-start">
35
72
  <span class="fm-typo-en-body-md-400">{{ t('order.foodCourt.orders.loadFailed') }}</span>
36
73
  <FmButton variant="secondary" :label="t('order.foodCourt.retry')" @click="load" />
@@ -48,7 +85,7 @@
48
85
  @row-click="onRowClick"
49
86
  />
50
87
  <div v-else class="text-center py-8 text-fm-color-typo-tertiary fm-typo-en-body-md-400">
51
- {{ t('order.foodCourt.orders.empty') }}
88
+ {{ search ? t('order.foodCourt.orders.noMatch', { search }) : t('order.foodCourt.orders.empty') }}
52
89
  </div>
53
90
  <div class="flex items-center justify-between gap-3 flex-wrap pb-6">
54
91
  <div class="flex items-center gap-2">
@@ -98,14 +135,18 @@ import { components, type ColumnDef } from '@feedmepos/ui-library'
98
135
  import { useSnackbarFunctions } from '@/components/snackbar'
99
136
  import { useFoodCourtId } from '@/composables/useFoodCourtContext'
100
137
  import {
138
+ FoodCourtMemberApi,
101
139
  FoodCourtOrderApi,
140
+ type FoodCourtMemberListItem,
102
141
  type FoodCourtOrderStatus,
103
142
  type FoodCourtOrderSummary
104
143
  } from '@/api/food-court'
105
144
  import { errorMessage } from './food-court-member'
106
145
  import {
107
146
  COURT_ORDER_STATUS_CHIP,
147
+ COURT_ORDER_STATUS_HELP,
108
148
  ORDER_LIST_STATUSES,
149
+ stallLabel,
109
150
  formatMoney,
110
151
  formatOrderTime,
111
152
  orderListWindow
@@ -138,6 +179,17 @@ const dateRange = ref<{ startDate: string | null; endDate: string | null }>({
138
179
  })
139
180
  /** Empty = every status the list offers. */
140
181
  const statuses = ref<FoodCourtOrderStatus[]>([])
182
+ /** Empty = every stall. Restaurant ids. */
183
+ const stallIds = ref<string[]>([])
184
+ const showStatusGuide = ref(false)
185
+ /** What the user types; `search` follows it after a short pause. */
186
+ const searchInput = ref('')
187
+ const search = ref('')
188
+ let searchTimer: ReturnType<typeof setTimeout> | undefined
189
+ watch(searchInput, (value) => {
190
+ clearTimeout(searchTimer)
191
+ searchTimer = setTimeout(() => (search.value = value.trim()), 400)
192
+ })
141
193
  const page = ref(0)
142
194
  const limit = ref(25)
143
195
 
@@ -152,6 +204,45 @@ const statusItems = computed(() =>
152
204
  value: status
153
205
  }))
154
206
  )
207
+ /**
208
+ * The stall filter: every stall the court has had, also ones that left, so
209
+ * their old orders can still be found. The court's name first, else the
210
+ * outlet's own; the unit number in front.
211
+ */
212
+ const members = ref<FoodCourtMemberListItem[]>([])
213
+ const stallItems = computed(() =>
214
+ members.value
215
+ .map(({ member, restaurant }) => ({
216
+ label: stallLabel({
217
+ restaurantId: member.restaurantId,
218
+ unitNo: member.stall?.unitNo || null,
219
+ name: member.stall?.displayName || restaurant?.name || null
220
+ }),
221
+ value: member.restaurantId
222
+ }))
223
+ .sort((a, b) => a.label.localeCompare(b.label, undefined, { numeric: true }))
224
+ )
225
+
226
+ /** The court whose stalls are in `members`; null until a read succeeds. */
227
+ let membersOf: string | null = null
228
+
229
+ async function loadMembers(): Promise<void> {
230
+ const id = foodCourtId.value
231
+ if (!id || membersOf === id) return
232
+ try {
233
+ const list = await FoodCourtMemberApi.listMembers(id)
234
+ if (id !== foodCourtId.value) return
235
+ members.value = list
236
+ membersOf = id
237
+ } catch {
238
+ // The filter is optional: the list still works without it, and the next list load tries again.
239
+ }
240
+ }
241
+ watch(foodCourtId, () => {
242
+ members.value = []
243
+ membersOf = null
244
+ })
245
+
155
246
  const limitItems = [10, 25, 50, 100].map((n) => ({ label: String(n), value: n }))
156
247
 
157
248
  const dateRangeLabel = computed(() => {
@@ -179,17 +270,24 @@ async function load(): Promise<void> {
179
270
  ...orderListWindow(dateRange.value),
180
271
  status: statuses.value.length ? statuses.value : ORDER_LIST_STATUSES,
181
272
  page: page.value,
182
- limit: limit.value
273
+ limit: limit.value,
274
+ restaurantId: stallIds.value,
275
+ search: search.value
183
276
  })
184
277
  if (call !== latest) return
185
278
  rows.value = res.items
186
279
  hasMore.value = res.hasMore
280
+ // After the list, not on mount: on a cold start the session is restored only by then.
281
+ void loadMembers()
187
282
  } catch (e) {
188
283
  if (call !== latest) return
189
284
  rows.value = []
190
285
  hasMore.value = false
191
286
  loadFailed.value = true
192
- showError(errorMessage(e))
287
+ const code = e instanceof SvcCompanyApiError ? e.code : undefined
288
+ if (code === 'SEARCH_RANGE_TOO_LONG')
289
+ showError(t('order.foodCourt.orders.searchRangeTooLong', { days: 31 }))
290
+ else showError(errorMessage(e))
193
291
  } finally {
194
292
  if (call === latest) isLoading.value = false
195
293
  }
@@ -197,7 +295,8 @@ async function load(): Promise<void> {
197
295
 
198
296
  /**
199
297
  * Export (KDI-4942): every order the current filters match, not just this page,
200
- * one row per stall order, as an xlsx. Nothing to export is a notice, not an
298
+ * one row per stall order, as an xlsx. With stalls picked, only their rows. The
299
+ * search box does not narrow the export. Nothing to export is a notice, not an
201
300
  * error; the backend refuses past 31 days or 50,000 rows.
202
301
  */
203
302
  const isExporting = ref(false)
@@ -209,8 +308,13 @@ async function onExport(): Promise<void> {
209
308
  // One copy of the filters for the request and the file name: the picker stays usable meanwhile.
210
309
  const range = { ...dateRange.value }
211
310
  const status = statuses.value.length ? [...statuses.value] : ORDER_LIST_STATUSES
311
+ const restaurantId = [...stallIds.value]
212
312
  try {
213
- const res = await FoodCourtOrderApi.exportOrders(id, { ...orderListWindow(range), status })
313
+ const res = await FoodCourtOrderApi.exportOrders(id, {
314
+ ...orderListWindow(range),
315
+ status,
316
+ restaurantId
317
+ })
214
318
  if (!res.rows.length) {
215
319
  showWarning(t('order.foodCourt.orders.exportEmpty'))
216
320
  return
@@ -232,7 +336,7 @@ async function onExport(): Promise<void> {
232
336
 
233
337
  // A new court or filter starts again from the first page.
234
338
  watch(
235
- [foodCourtId, dateRange, statuses, limit],
339
+ [foodCourtId, dateRange, statuses, stallIds, search, limit],
236
340
  () => {
237
341
  if (page.value === 0) load()
238
342
  else page.value = 0
@@ -279,9 +383,24 @@ const columns = computed<ColumnDef<FoodCourtOrderSummary>[]>(() => [
279
383
  {
280
384
  id: 'stalls',
281
385
  header: () => t('order.foodCourt.orders.columnStalls'),
282
- cell: ({ row }) => String(row.original.stallCount),
386
+ cell: ({ row }) => {
387
+ const stalls = row.original.stalls
388
+ if (!stalls) return String(row.original.stallCount)
389
+ if (!stalls.length) return '-'
390
+ const labels = stalls.map(stallLabel)
391
+ return h('div', { class: 'flex flex-col', title: labels.join('\n') }, [
392
+ ...labels.slice(0, 2).map((label) => h('span', { class: 'truncate' }, label)),
393
+ labels.length > 2
394
+ ? h(
395
+ 'span',
396
+ { class: 'text-fm-color-typo-tertiary' },
397
+ t('order.foodCourt.orders.moreStalls', { count: labels.length - 2 })
398
+ )
399
+ : null
400
+ ])
401
+ },
283
402
  enableSorting: false,
284
- meta: { width: '96px' }
403
+ meta: { width: '280px' }
285
404
  },
286
405
  {
287
406
  id: 'paymentMethod',
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
  import dayjs from 'dayjs'
3
3
  import type { FoodCourtBill, FoodCourtOrderReceipt, FoodCourtStallOrder } from '@/api/food-court'
4
- import { orderListWindow, stallOrderChip, stallOrderViews } from './food-court-order'
4
+ import { orderListWindow, stallLabel, stallOrderChip, stallOrderViews } from './food-court-order'
5
5
 
6
6
  const rm = (amount: number) => ({ amount, precision: 2, currency: 'MYR' }) as const
7
7
 
@@ -134,4 +134,19 @@ describe('stallOrderViews', () => {
134
134
  expect(views).toHaveLength(2)
135
135
  expect(views[1].order).toBeNull()
136
136
  })
137
+
138
+ it("names a stall the court never named by the outlet's own name, not its id (#FC-018)", () => {
139
+ const views = stallOrderViews(
140
+ receipt({ stallProfiles: { r2: { name: 'FC Demo Teh Tarik Bar' }, r1: { name: 'Own name' } } })
141
+ )
142
+ expect(views.map((v) => v.name)).toEqual(['FC Demo Teh Tarik Bar', 'Nasi Bar'])
143
+ })
144
+ })
145
+
146
+ describe('stallLabel', () => {
147
+ it('puts the unit number in front of the name', () => {
148
+ expect(stallLabel({ restaurantId: 'r1', unitNo: '5', name: 'Cafe Run' })).toBe('5 · Cafe Run')
149
+ expect(stallLabel({ restaurantId: 'r1', unitNo: null, name: 'Cafe Run' })).toBe('Cafe Run')
150
+ expect(stallLabel({ restaurantId: 'r1', unitNo: null, name: null })).toBe('r1')
151
+ })
137
152
  })
@@ -4,6 +4,7 @@ import type { FdoDinero } from '@feedmepos/core/entity'
4
4
  import type {
5
5
  FoodCourtBill,
6
6
  FoodCourtBillSubItem,
7
+ FoodCourtOrderListStall,
7
8
  FoodCourtOrderReceipt,
8
9
  FoodCourtOrderStatus,
9
10
  FoodCourtStallOrder
@@ -23,6 +24,23 @@ export const COURT_ORDER_STATUS_CHIP: Record<FoodCourtOrderStatus, StatusChip> =
23
24
  DRAFT: { variant: 'neutral', labelKey: 'order.foodCourt.orders.statusDraft' }
24
25
  }
25
26
 
27
+ /**
28
+ * What each court order status means (Hsin Ling's question, KDI-4941), in the
29
+ * list's order, shown in the Orders page's status guide. There is no Refunded
30
+ * court status yet: a refund today is per stall, on that stall's own bill.
31
+ */
32
+ export const COURT_ORDER_STATUS_HELP: { status: FoodCourtOrderStatus; helpKey: string }[] = [
33
+ { status: 'PAID', helpKey: 'order.foodCourt.orders.statusPaidHelp' },
34
+ { status: 'PENDING_PAYMENT', helpKey: 'order.foodCourt.orders.statusPendingPaymentHelp' },
35
+ { status: 'CANCELLED', helpKey: 'order.foodCourt.orders.statusCancelledHelp' }
36
+ ]
37
+
38
+ /** A stall's name for the list, with its unit number in front when it has one ("5 · Cafe Run"). */
39
+ export function stallLabel(stall: FoodCourtOrderListStall): string {
40
+ const name = stall.name || stall.restaurantId
41
+ return stall.unitNo ? `${stall.unitNo} · ${name}` : name
42
+ }
43
+
26
44
  /**
27
45
  * A stall order's chip. A refunded or voided bill wins over the order state;
28
46
  * otherwise NEW = the stall POS has not accepted it yet.
@@ -195,7 +213,11 @@ export function stallOrderViews(receipt: FoodCourtOrderReceipt): StallOrderView[
195
213
  return {
196
214
  key: stall.orderId,
197
215
  unitNo: stall.unitNo || null,
198
- name: stall.displayName || stall.restaurantId,
216
+ // A stall the court never named has no display name: show the outlet's own name (#FC-018).
217
+ name:
218
+ stall.displayName ||
219
+ receipt.stallProfiles?.[String(stall.restaurantId)]?.name ||
220
+ stall.restaurantId,
199
221
  amount: stall.amount,
200
222
  order,
201
223
  items,
@@ -11,8 +11,8 @@
11
11
  <span class="fm-typo-en-body-md-400">{{ t('order.foodCourt.orders.detailLoadFailed') }}</span>
12
12
  <FmButton variant="secondary" :label="t('order.foodCourt.retry')" @click="load" />
13
13
  </div>
14
- <div v-else-if="receipt" class="flex flex-col gap-4">
15
- <FmCard variant="outlined" class="p-4 flex flex-col gap-3">
14
+ <div v-else-if="receipt" class="flex flex-col gap-12">
15
+ <FmCard variant="outlined" class="p-16 flex flex-col gap-12">
16
16
  <div class="flex items-center justify-between gap-2">
17
17
  <span class="fm-typo-en-title-sm-600">
18
18
  {{
@@ -40,7 +40,7 @@
40
40
  v-for="stall in stalls"
41
41
  :key="stall.key"
42
42
  variant="outlined"
43
- class="p-4 flex flex-col gap-3"
43
+ class="p-16 flex flex-col gap-12"
44
44
  >
45
45
  <div class="flex items-center justify-between gap-2">
46
46
  <div class="flex items-center gap-2 min-w-0">
@@ -121,20 +121,31 @@
121
121
  </template>
122
122
  </FmCard>
123
123
 
124
- <FmCard variant="outlined" class="p-4 flex items-center justify-between">
124
+ <FmCard variant="outlined" class="p-16 flex items-center justify-between">
125
125
  <span class="fm-typo-en-title-sm-600">{{ t('order.foodCourt.orders.netTotal') }}</span>
126
126
  <span class="fm-typo-en-title-sm-600">{{ formatMoney(receipt.total) }}</span>
127
127
  </FmCard>
128
128
  </div>
129
129
  <template #side-sheet-footer>
130
- <FmButton
131
- variant="secondary"
132
- :label="t('order.foodCourt.orders.close')"
133
- size="lg"
134
- @click="emit('update:modelValue', false)"
135
- />
130
+ <div class="flex gap-3">
131
+ <FmButton
132
+ v-if="receipt && receipt.status === 'PAID'"
133
+ variant="primary"
134
+ prepend-icon="receipt_long"
135
+ :label="t('order.foodCourt.orders.viewReceipt')"
136
+ size="lg"
137
+ @click="showReceipt = true"
138
+ />
139
+ <FmButton
140
+ variant="secondary"
141
+ :label="t('order.foodCourt.orders.close')"
142
+ size="lg"
143
+ @click="emit('update:modelValue', false)"
144
+ />
145
+ </div>
136
146
  </template>
137
147
  </FmSideSheet>
148
+ <FoodCourtReceiptDialog v-model="showReceipt" :receipt="receipt" />
138
149
  </template>
139
150
 
140
151
  <script setup lang="ts">
@@ -150,11 +161,14 @@ import {
150
161
  stallOrderChip,
151
162
  stallOrderViews
152
163
  } from '../food-court-order'
164
+ import FoodCourtReceiptDialog from './FoodCourtReceiptDialog.vue'
153
165
 
154
166
  /**
155
167
  * Orders › Order detail (KDI-4941, Figma 1.11): one court order as its
156
168
  * whole-court receipt, one card per stall with that stall's items and bill.
157
- * Refund and receipt download are not built yet.
169
+ * View receipt shows the printed whole-court receipt (the court kiosk's
170
+ * printout, KDI-4934). Refund is not built yet: who bears a court refund is
171
+ * still open with product.
158
172
  */
159
173
  const props = defineProps<{
160
174
  modelValue: boolean
@@ -187,6 +201,9 @@ const orderFields = computed(() => {
187
201
  ]
188
202
  })
189
203
 
204
+ /** View receipt: the printed whole-court receipt, as Restaurant Operation › Receipts shows a bill. */
205
+ const showReceipt = ref(false)
206
+
190
207
  function toggle(key: string): void {
191
208
  const next = new Set(expanded.value)
192
209
  if (next.has(key)) next.delete(key)
@@ -218,6 +235,7 @@ async function load(): Promise<void> {
218
235
  watch(
219
236
  () => [props.foodCourtId, props.orderId] as const,
220
237
  () => {
238
+ showReceipt.value = false
221
239
  receipt.value = null
222
240
  load()
223
241
  },