@feedmepos/mf-order-setting 0.0.100 → 0.0.102
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.
- package/dist/{DisplaySystemView-bnG_JNDd.js → DisplaySystemView-jnt6letY.js} +4 -4
- package/dist/{FoodCourtInvitationsView-DbuetF4z.js → FoodCourtInvitationsView-DoynqFWB.js} +4 -4
- package/dist/{FoodCourtOrderSettingsView-BXgApCVG.js → FoodCourtOrderSettingsView-DYZLhTHy.js} +1 -1
- package/dist/{FoodCourtOrdersView-K0iC1arR.js → FoodCourtOrdersView-CAPOycT3.js} +3 -3
- package/dist/{FoodCourtStallsView-DijfdyBw.js → FoodCourtStallsView-CRMTt5BB.js} +2 -2
- package/dist/{FoodCourtStatusView-DTriHcSD.js → FoodCourtStatusView-C-b-eI-8.js} +1 -1
- package/dist/{KioskDevicesView-d2SWWkhC.js → KioskDevicesView-B0U9JxRl.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DA6c96uZ.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-V3ai4FVI.js} +5 -5
- package/dist/{KioskSettingView-I7Hgzrvr.js → KioskSettingView-rdom_aS8.js} +3 -3
- package/dist/{KioskView-B_lLNsaU.js → KioskView-DOON9zR6.js} +6 -6
- package/dist/{OrderSettingsView-8OS93YGL.js → OrderSettingsView-BBCnekaj.js} +10959 -10953
- package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-K0oCZMt8.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-DjoTyV6m.js} +1 -1
- package/dist/{app-qdN8kXAM.js → app-Dvk30CIa.js} +511 -507
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-C-IKwmsU.js → dayjs.min-DUFHhM7O.js} +1 -1
- package/dist/{featureFlag-z_-AhzUC.js → featureFlag-BvcirzHS.js} +1 -1
- package/dist/frontend/mf-order/src/api/order-setting/index.d.ts +3 -1
- package/dist/frontend/mf-order/src/api/order-setting/queue-counter.d.ts +14 -0
- package/dist/frontend/mf-order/src/app.d.ts +4 -0
- package/dist/frontend/mf-order/src/main.d.ts +4 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-BxK-mqfV.js → index-C4n5H7t3.js} +1 -1
- package/dist/index-C5n6lil6.js +39 -0
- package/dist/{index-DjtNAyFp.js → index-CGxCWKHB.js} +4 -4
- package/dist/{index-BK-RT8YN.js → index-CW4VlFWz.js} +1 -1
- package/dist/{index-WSlqpTW2.js → index-CaHG3M7C.js} +1 -1
- package/dist/{index-DfsaaxdM.js → index-ILnighyU.js} +1 -1
- package/dist/{order.dto-BTF8MlM5.js → order.dto-Cb_gh3iB.js} +1119 -1116
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +236 -2
- package/dist/package/entity/order-setting/queue/queue.dto.d.ts +263 -0
- package/package.json +1 -1
- package/src/api/order-setting/index.ts +4 -2
- package/src/api/order-setting/queue-counter.spec.ts +74 -0
- package/src/api/order-setting/queue-counter.ts +34 -0
- package/src/locales/en-US.json +1 -0
- package/src/locales/ja-JP.json +1 -0
- package/src/locales/th-TH.json +1 -0
- package/src/locales/zh-CN.json +1 -0
- package/src/views/order-settings/queue/QueueSetting.source.spec.ts +29 -0
- package/src/views/order-settings/queue/QueueSetting.vue +22 -1
- package/src/views/order-settings/reservation/ReservationSetting.vue +710 -715
- package/src/views/order-settings/reservation/reservation-pos-note.spec.ts +42 -0
- package/dist/index-DeUtM1Z8.js +0 -24
package/src/locales/ja-JP.json
CHANGED
|
@@ -556,6 +556,7 @@
|
|
|
556
556
|
"paxMaxHint": "最大 {max} 人",
|
|
557
557
|
"reservation": "予約",
|
|
558
558
|
"reservationStatus": "予約ステータス",
|
|
559
|
+
"reservationNeedsPosV8": "メイン POS は POS v8 {min} 以降が必要です。POS v7 は予約に対応していません。",
|
|
559
560
|
"reservationAvailability": "予約受付期間",
|
|
560
561
|
"notificationSettings": "通知設定",
|
|
561
562
|
"smsEnabled": "SMS通知を有効にする",
|
package/src/locales/th-TH.json
CHANGED
|
@@ -652,6 +652,7 @@
|
|
|
652
652
|
"paxMaxHint": "สูงสุด {max} คน",
|
|
653
653
|
"reservation": "การจอง",
|
|
654
654
|
"reservationStatus": "สถานะการจอง",
|
|
655
|
+
"reservationNeedsPosV8": "ต้องใช้ POS v8 {min} ขึ้นไปเป็น Main POS โดย POS v7 ไม่รองรับการจอง",
|
|
655
656
|
"reservationAvailability": "ช่วงเวลาที่เปิดรับจอง",
|
|
656
657
|
"notificationSettings": "การตั้งค่าการแจ้งเตือน",
|
|
657
658
|
"smsEnabled": "เปิดใช้งานการแจ้งเตือนผ่าน SMS",
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -654,6 +654,7 @@
|
|
|
654
654
|
"paxMaxHint": "最多 {max} 人",
|
|
655
655
|
"reservation": "预订",
|
|
656
656
|
"reservationStatus": "预订状态",
|
|
657
|
+
"reservationNeedsPosV8": "主 POS 需为 POS v8 {min} 或更高版本。POS v7 不支持预订。",
|
|
657
658
|
"reservationAvailability": "预订开放时间",
|
|
658
659
|
"notificationSettings": "通知设置",
|
|
659
660
|
"smsEnabled": "启用短信通知",
|
|
@@ -34,3 +34,32 @@ describe('QueueSetting pax cap wiring (ITS-002270)', () => {
|
|
|
34
34
|
expect(sfc).toMatch(/:helper-text="t\('order\.paxMaxHint', \{ max: MAX_PAX \}\)"/)
|
|
35
35
|
})
|
|
36
36
|
})
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A save sends a segment's running number only when the merchant typed one, or, for a
|
|
40
|
+
* segment with no id, after a removal (those are matched by position). The strip itself
|
|
41
|
+
* is tested in `api/order-setting/queue-counter.spec.ts`; this pins the page's side of it.
|
|
42
|
+
*/
|
|
43
|
+
describe('QueueSetting running-number wiring', () => {
|
|
44
|
+
it('records a typed Current Number by id, or by position without one', () => {
|
|
45
|
+
expect(body('updateCodeSetting')).toMatch(
|
|
46
|
+
/if \(key === 'current'\) editedCurrent\.add\(setting\.id \?\? index\)/
|
|
47
|
+
)
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('records that a segment was removed', () => {
|
|
51
|
+
expect(body('removeCodeSetting')).toMatch(/segmentRemoved = true/)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('forgets both after the settings are read again', () => {
|
|
55
|
+
expect(body('init')).toMatch(
|
|
56
|
+
/await readOrderSetting\(\)[\s\S]*editedCurrent\.clear\(\)\n\s+segmentRemoved = false/
|
|
57
|
+
)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it('keeps the number only for an edited segment, or one with no id after a removal', () => {
|
|
61
|
+
expect(body('updateOrderSetting')).toMatch(
|
|
62
|
+
/\(segment, index\) =>\s+editedCurrent\.has\(segment\.id \?\? index\) \|\| \(!segment\.id && segmentRemoved\)/
|
|
63
|
+
)
|
|
64
|
+
})
|
|
65
|
+
})
|
|
@@ -50,6 +50,19 @@ const allowOverrideQueueCode = ref<boolean>(false)
|
|
|
50
50
|
const paxMaxRenderKey = ref(0)
|
|
51
51
|
/** Its own state, so typing 0 or clearing the minutes keeps the field open with an error instead of switching off. */
|
|
52
52
|
const autoCancelEnabled = ref(false)
|
|
53
|
+
/**
|
|
54
|
+
* Segments whose Current Number the merchant typed since the page loaded, by id (by
|
|
55
|
+
* position for a segment with no id yet). Only these send their running number on save:
|
|
56
|
+
* the others still show the number from when the page opened, and queues created since
|
|
57
|
+
* then have moved it on.
|
|
58
|
+
*/
|
|
59
|
+
const editedCurrent = new Set<string | number>()
|
|
60
|
+
/**
|
|
61
|
+
* Set when a segment is removed. The backend matches segments without an id to the stored
|
|
62
|
+
* ones by position, so after a removal each of them sends its own number, or it would take
|
|
63
|
+
* the stored number of the segment that used to be in its place.
|
|
64
|
+
*/
|
|
65
|
+
let segmentRemoved = false
|
|
53
66
|
const autoCancelRules = [
|
|
54
67
|
() =>
|
|
55
68
|
isAutoCancelMinutesValid(queueSettings.value.autoCancelCalledMinutes) ||
|
|
@@ -97,7 +110,9 @@ async function updateOrderSetting() {
|
|
|
97
110
|
OrderSettingUpdateDto.parse({
|
|
98
111
|
...orderSettingDefault.value,
|
|
99
112
|
queueSettings: queueSettings.value
|
|
100
|
-
})
|
|
113
|
+
}),
|
|
114
|
+
(segment, index) =>
|
|
115
|
+
editedCurrent.has(segment.id ?? index) || (!segment.id && segmentRemoved)
|
|
101
116
|
)
|
|
102
117
|
}
|
|
103
118
|
await init()
|
|
@@ -109,6 +124,10 @@ async function init() {
|
|
|
109
124
|
if (currentRestaurant.value) {
|
|
110
125
|
queueSettings.value = { ...defaultQueueSetting }
|
|
111
126
|
orderSettingDefault.value = await readOrderSetting()
|
|
127
|
+
// After the read: init runs twice on open (mount + the immediate watch), and an edit
|
|
128
|
+
// made between the two reads is overwritten by the second, so it must be forgotten too.
|
|
129
|
+
editedCurrent.clear()
|
|
130
|
+
segmentRemoved = false
|
|
112
131
|
if (orderSettingDefault.value?.queueSettings) {
|
|
113
132
|
queueSettings.value = { ...defaultQueueSetting, ...orderSettingDefault.value.queueSettings }
|
|
114
133
|
normalizeEstimates()
|
|
@@ -248,6 +267,7 @@ function validatePaxBands(): string | null {
|
|
|
248
267
|
}
|
|
249
268
|
|
|
250
269
|
function removeCodeSetting(index: number) {
|
|
270
|
+
segmentRemoved = true
|
|
251
271
|
queueSettings.value.codeSettings?.splice(index, 1)
|
|
252
272
|
}
|
|
253
273
|
|
|
@@ -436,6 +456,7 @@ function updateCodeSetting(index: number, key: string, value: any) {
|
|
|
436
456
|
if (capped) paxMaxRenderKey.value++
|
|
437
457
|
} else {
|
|
438
458
|
setting[key] = value
|
|
459
|
+
if (key === 'current') editedCurrent.add(setting.id ?? index)
|
|
439
460
|
}
|
|
440
461
|
}
|
|
441
462
|
}
|