@feedmepos/mf-order-setting 0.0.96 → 0.0.97
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-BH8SkCOF.js → DisplaySystemView-CxzAm858.js} +4 -4
- package/dist/{FoodCourtInvitationsView-3cA0Z-5m.js → FoodCourtInvitationsView-6IJ_90WH.js} +3 -3
- package/dist/{FoodCourtOrderSettingsView-DysrLZJD.js → FoodCourtOrderSettingsView-tuN-AjyH.js} +1 -1
- package/dist/{FoodCourtOrdersView-CbZqHIXO.js → FoodCourtOrdersView-BZDV86qZ.js} +3 -3
- package/dist/{FoodCourtStallsView-CTZzPUQ6.js → FoodCourtStallsView-C81eYjyf.js} +2 -2
- package/dist/{FoodCourtStatusView-C71y7ghx.js → FoodCourtStatusView-CIzXFmpX.js} +1 -1
- package/dist/{KioskDevicesView-BJpbuSzp.js → KioskDevicesView-B9_5ynuL.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-CQFpwn28.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-Bbvhl393.js} +5 -5
- package/dist/{KioskSettingView-CJxhMf7N.js → KioskSettingView-BgAH6D4b.js} +3 -3
- package/dist/{KioskView-BZsdRID1.js → KioskView-bVLcdUIs.js} +6 -6
- package/dist/{OrderSettingsView-gnyXaJjf.js → OrderSettingsView-DFCvkYlF.js} +14891 -14867
- package/dist/{app-CeEFBB-w.js → app-CXM7Y8ue.js} +923 -919
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-zBHHlxAP.js → dayjs.min-BL2ytaWE.js} +1 -1
- package/dist/{featureFlag-BTY_R78k.js → featureFlag-DG1avUtJ.js} +1 -1
- package/dist/frontend/mf-order/src/app.d.ts +12 -8
- package/dist/frontend/mf-order/src/main.d.ts +12 -8
- package/dist/frontend/mf-order/src/views/order-settings/queue/auto-cancel-minutes.d.ts +9 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-D5nv3ncu.js → index-Bkqum66F.js} +2 -2
- package/dist/{index-601eG3_R.js → index-BzCugL7s.js} +1 -1
- package/dist/{index-BtudnkMi.js → index-C10eL5h0.js} +1 -1
- package/dist/{index-DLDihONy.js → index-C6PdYrNb.js} +1 -1
- package/dist/{index-CGiWgTn1.js → index-CqjGIBhA.js} +4 -4
- package/dist/{index-BeBZTUcq.js → index-DNaVtem4.js} +1 -1
- package/dist/{order.dto-JM_fmWnQ.js → order.dto-BVxGQISl.js} +2 -2
- package/package.json +1 -1
- package/src/locales/en-US.json +3 -2
- package/src/locales/ja-JP.json +3 -2
- package/src/locales/th-TH.json +3 -2
- package/src/locales/zh-CN.json +3 -2
- package/src/views/order-settings/queue/QueueSetting.vue +47 -17
- package/src/views/order-settings/queue/auto-cancel-minutes.spec.ts +44 -0
- package/src/views/order-settings/queue/auto-cancel-minutes.ts +20 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as n, s as a, a as r, r as e } from "./index-
|
|
2
|
-
import "./order.dto-
|
|
1
|
+
import { g as n, s as a, a as r, r as e } from "./index-BzCugL7s.js";
|
|
2
|
+
import "./order.dto-BVxGQISl.js";
|
|
3
3
|
async function i() {
|
|
4
4
|
const t = await e().get("/order-settings");
|
|
5
5
|
return n(t);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var dn = Object.defineProperty;
|
|
2
2
|
var pn = (e, t, n) => t in e ? dn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var je = (e, t, n) => pn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { e as Ct } from "./app-
|
|
4
|
+
import { e as Ct } from "./app-CXM7Y8ue.js";
|
|
5
5
|
import { useCoreStore as Y } from "@feedmepos/mf-common";
|
|
6
6
|
function Ut(e, t) {
|
|
7
7
|
return function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Le, j as ea } from "./app-
|
|
1
|
+
import { c as Le, j as ea } from "./app-CXM7Y8ue.js";
|
|
2
2
|
function Ct(me) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + me + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as H, ref as V, resolveComponent as R, openBlock as f, createElementBlock as T, createElementVNode as v, toDisplayString as S, createVNode as b, unref as x, createBlock as z, computed as U, watch as oe, onMounted as re, withCtx as N, createTextVNode as se, createCommentVNode as E, Fragment as ie, renderList as le, renderSlot as ae } from "vue";
|
|
2
|
-
import { e as g } from "./app-
|
|
2
|
+
import { e as g } from "./app-CXM7Y8ue.js";
|
|
3
3
|
import { useDialog as ue } from "@feedmepos/ui-library";
|
|
4
4
|
import { useI18n as Y, useCoreStore as ne } from "@feedmepos/mf-common";
|
|
5
5
|
import { defineStore as de } from "pinia";
|
|
6
|
-
import { r as F, g as a, b as O, a as Q } from "./index-
|
|
7
|
-
import "./order.dto-
|
|
8
|
-
import { a as q } from "./index-
|
|
6
|
+
import { r as F, g as a, b as O, a as Q } from "./index-BzCugL7s.js";
|
|
7
|
+
import "./order.dto-BVxGQISl.js";
|
|
8
|
+
import { a as q } from "./index-C6PdYrNb.js";
|
|
9
9
|
const ce = /* @__PURE__ */ H({
|
|
10
10
|
__name: "OfflinePaymentTypeDialogContent",
|
|
11
11
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as M, e as _, w as ce, c as E, i as gc, j as Iu } from "./app-
|
|
2
|
-
import { a as st } from "./index-
|
|
1
|
+
import { k as M, e as _, w as ce, c as E, i as gc, j as Iu } from "./app-CXM7Y8ue.js";
|
|
2
|
+
import { a as st } from "./index-C6PdYrNb.js";
|
|
3
3
|
var e = M();
|
|
4
4
|
const pe = e.z.enum([
|
|
5
5
|
"CREATING",
|
package/package.json
CHANGED
package/src/locales/en-US.json
CHANGED
|
@@ -289,8 +289,9 @@
|
|
|
289
289
|
"externalCatalogRequired": "Select a catalog for {orderTypes} on {platform}.",
|
|
290
290
|
"auto": "Auto",
|
|
291
291
|
"autoCalledLimit": "Auto Called Limit",
|
|
292
|
-
"
|
|
293
|
-
"
|
|
292
|
+
"autoCancelCalledMinutesRule": "Enter whole minutes from 1 to 1440",
|
|
293
|
+
"autoCancelCalledQueue": "Auto-cancel called queue",
|
|
294
|
+
"autoCancelCalledQueueDescription": "Cancel a called queue not seated within the set minutes",
|
|
294
295
|
"autoCloseBill": "Auto close bill",
|
|
295
296
|
"autoCloseBillSublabel": "Automatically close the bill once the order is accepted. An unpaid bill stays open until it is settled.",
|
|
296
297
|
"autoIntegration": "Auto Integration",
|
package/src/locales/ja-JP.json
CHANGED
|
@@ -515,8 +515,9 @@
|
|
|
515
515
|
"queueSettings": "順番待ち設定",
|
|
516
516
|
"enableQueueOrder": "順番待ち事前注文を有効にする",
|
|
517
517
|
"autoCalledLimit": "自動呼び出し制限",
|
|
518
|
-
"
|
|
519
|
-
"
|
|
518
|
+
"autoCancelCalledMinutesRule": "1〜1440の整数で分を入力してください",
|
|
519
|
+
"autoCancelCalledQueue": "呼び出し済みの順番待ちを自動キャンセル",
|
|
520
|
+
"autoCancelCalledQueueDescription": "設定した時間内に着席しない呼び出し済みの順番待ちをキャンセルします",
|
|
520
521
|
"duration": "時間",
|
|
521
522
|
"disableRemoteQueue": "リモート順番待ちを無効にする",
|
|
522
523
|
"allowOverrideQueueCode": "整理番号の上書きを許可",
|
package/src/locales/th-TH.json
CHANGED
|
@@ -617,8 +617,9 @@
|
|
|
617
617
|
"queueSettings": "การตั้งค่าคิว",
|
|
618
618
|
"enableQueueOrder": "เปิดใช้งานการสั่งอาหารล่วงหน้าระหว่างรอคิว",
|
|
619
619
|
"autoCalledLimit": "จำนวนครั้งในการเรียกคิวอัตโนมัติ",
|
|
620
|
-
"
|
|
621
|
-
"
|
|
620
|
+
"autoCancelCalledMinutesRule": "กรอกจำนวนนาทีเป็นจำนวนเต็ม 1 ถึง 1440",
|
|
621
|
+
"autoCancelCalledQueue": "ยกเลิกคิวที่เรียกแล้วอัตโนมัติ",
|
|
622
|
+
"autoCancelCalledQueueDescription": "ยกเลิกคิวที่เรียกแล้วแต่ยังไม่ได้นั่งภายในเวลาที่กำหนด",
|
|
622
623
|
"duration": "ระยะเวลา",
|
|
623
624
|
"disableRemoteQueue": "ปิดการรับคิวออนไลน์",
|
|
624
625
|
"allowOverrideQueueCode": "อนุญาตให้แก้ไขรหัสคิว",
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -619,8 +619,9 @@
|
|
|
619
619
|
"queueSettings": "排队设置",
|
|
620
620
|
"enableQueueOrder": "启用排队预点单",
|
|
621
621
|
"autoCalledLimit": "自动呼叫限制",
|
|
622
|
-
"
|
|
623
|
-
"
|
|
622
|
+
"autoCancelCalledMinutesRule": "请输入 1 到 1440 的整数分钟",
|
|
623
|
+
"autoCancelCalledQueue": "自动取消已叫号排队",
|
|
624
|
+
"autoCancelCalledQueueDescription": "已叫号但在设定时间内未入座的排队将被取消",
|
|
624
625
|
"duration": "持续时间",
|
|
625
626
|
"disableRemoteQueue": "禁用远程排队",
|
|
626
627
|
"allowOverrideQueueCode": "允许覆盖排队号码",
|
|
@@ -18,6 +18,13 @@ import { useDialog } from '@feedmepos/ui-library'
|
|
|
18
18
|
import PresetRemarksSheet from './PresetRemarksSheet.vue'
|
|
19
19
|
import { clampPaxBand, isPaxBandValid, MAX_PAX, nextCodeSettingBand } from './code-setting-band'
|
|
20
20
|
import { autoSendFromSelectValue, autoSendSelectValue } from '../auto-send-kitchen'
|
|
21
|
+
import {
|
|
22
|
+
AUTO_CANCEL_DEFAULT_MINUTES,
|
|
23
|
+
AUTO_CANCEL_MAX_MINUTES,
|
|
24
|
+
AUTO_CANCEL_MIN_MINUTES,
|
|
25
|
+
isAutoCancelMinutesValid,
|
|
26
|
+
isAutoCancelOn
|
|
27
|
+
} from './auto-cancel-minutes'
|
|
21
28
|
|
|
22
29
|
const { t } = useI18n()
|
|
23
30
|
const { showSuccess, showError } = useSnackbarFunctions()
|
|
@@ -33,6 +40,13 @@ const presetRemarks = ref<string[]>([])
|
|
|
33
40
|
const allowOverrideQueueCode = ref<boolean>(false)
|
|
34
41
|
/** Re-mounts the Pax Max fields after a clamp, so a field already at the cap shows it again. */
|
|
35
42
|
const paxMaxRenderKey = ref(0)
|
|
43
|
+
/** Its own state, so typing 0 or clearing the minutes keeps the field open with an error instead of switching off. */
|
|
44
|
+
const autoCancelEnabled = ref(false)
|
|
45
|
+
const autoCancelRules = [
|
|
46
|
+
() =>
|
|
47
|
+
isAutoCancelMinutesValid(queueSettings.value.autoCancelCalledMinutes) ||
|
|
48
|
+
t('order.autoCancelCalledMinutesRule')
|
|
49
|
+
]
|
|
36
50
|
|
|
37
51
|
const Dialog = useDialog()
|
|
38
52
|
const { availability: pushAvailability } = usePushAvailability()
|
|
@@ -58,7 +72,7 @@ async function readOrderSetting(): Promise<OrderSettingsDto> {
|
|
|
58
72
|
|
|
59
73
|
async function updateOrderSetting() {
|
|
60
74
|
clampPaxBands()
|
|
61
|
-
const problem = validatePaxBands() ?? validateEstimates()
|
|
75
|
+
const problem = validatePaxBands() ?? validateEstimates() ?? validateAutoCancel()
|
|
62
76
|
if (problem) {
|
|
63
77
|
showError(problem)
|
|
64
78
|
return
|
|
@@ -91,6 +105,7 @@ async function init() {
|
|
|
91
105
|
normalizeEstimates()
|
|
92
106
|
}
|
|
93
107
|
clampPaxBands()
|
|
108
|
+
autoCancelEnabled.value = isAutoCancelOn(queueSettings.value.autoCancelCalledMinutes)
|
|
94
109
|
|
|
95
110
|
// Load restaurant settings for preset remarks
|
|
96
111
|
await startAsyncCallWithErr(async () => {
|
|
@@ -111,10 +126,17 @@ function updateQueueSetting<K extends keyof FdoOrderQueueSettings>(
|
|
|
111
126
|
queueSettings.value[key] = value
|
|
112
127
|
}
|
|
113
128
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
129
|
+
function enableAutoCancel(on: boolean) {
|
|
130
|
+
autoCancelEnabled.value = on
|
|
131
|
+
// Off is an explicit 0: a save that leaves the field out keeps the stored minutes (queue-field-inherit.ts).
|
|
132
|
+
updateQueueSetting('autoCancelCalledMinutes', on ? AUTO_CANCEL_DEFAULT_MINUTES : 0)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function validateAutoCancel(): string | null {
|
|
136
|
+
return autoCancelEnabled.value &&
|
|
137
|
+
!isAutoCancelMinutesValid(queueSettings.value.autoCancelCalledMinutes)
|
|
138
|
+
? t('order.autoCancelCalledMinutesRule')
|
|
139
|
+
: null
|
|
118
140
|
}
|
|
119
141
|
|
|
120
142
|
function addCodeSetting() {
|
|
@@ -452,18 +474,26 @@ async function saveAllowOverrideQueueCode(value: boolean) {
|
|
|
452
474
|
"
|
|
453
475
|
/>
|
|
454
476
|
</div>
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
477
|
+
</div>
|
|
478
|
+
|
|
479
|
+
<FmSwitch
|
|
480
|
+
:model-value="autoCancelEnabled"
|
|
481
|
+
@update:model-value="enableAutoCancel"
|
|
482
|
+
:label="t('order.autoCancelCalledQueue')"
|
|
483
|
+
:sublabel="t('order.autoCancelCalledQueueDescription')"
|
|
484
|
+
label-placement="right"
|
|
485
|
+
/>
|
|
486
|
+
<div v-if="autoCancelEnabled" class="grid grid-cols-1 md:grid-cols-2 gap-5 ml-5">
|
|
487
|
+
<FmStepperField
|
|
488
|
+
:model-value="queueSettings.autoCancelCalledMinutes ?? null"
|
|
489
|
+
:label="t('order.minutes')"
|
|
490
|
+
@update:model-value="(v: number) => updateQueueSetting('autoCancelCalledMinutes', v)"
|
|
491
|
+
:show-steppers="true"
|
|
492
|
+
:min="AUTO_CANCEL_MIN_MINUTES"
|
|
493
|
+
:max="AUTO_CANCEL_MAX_MINUTES"
|
|
494
|
+
:max-fraction-digits="0"
|
|
495
|
+
:rules="autoCancelRules"
|
|
496
|
+
/>
|
|
467
497
|
</div>
|
|
468
498
|
|
|
469
499
|
<FmSwitch
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
AUTO_CANCEL_DEFAULT_MINUTES,
|
|
4
|
+
isAutoCancelMinutesValid,
|
|
5
|
+
isAutoCancelOn
|
|
6
|
+
} from './auto-cancel-minutes'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The portal's on/off switch and minutes field must read the stored value the way
|
|
10
|
+
* queue-backend does (`autoCancelDelayMs`: anything but a positive number is off),
|
|
11
|
+
* and must never let a negative, zero or fractional minute count be saved while on
|
|
12
|
+
* (ITS-002481: a merchant could type -1 into the old number box).
|
|
13
|
+
*/
|
|
14
|
+
describe('isAutoCancelOn', () => {
|
|
15
|
+
it('is on only for a positive number of minutes', () => {
|
|
16
|
+
expect(isAutoCancelOn(1)).toBe(true)
|
|
17
|
+
expect(isAutoCancelOn(60)).toBe(true)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('is off for 0, null, absent and negative values', () => {
|
|
21
|
+
expect(isAutoCancelOn(0)).toBe(false)
|
|
22
|
+
expect(isAutoCancelOn(null)).toBe(false)
|
|
23
|
+
expect(isAutoCancelOn(undefined)).toBe(false)
|
|
24
|
+
expect(isAutoCancelOn(-1)).toBe(false)
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
describe('isAutoCancelMinutesValid', () => {
|
|
29
|
+
it('accepts whole minutes from 1 to 1440', () => {
|
|
30
|
+
expect(isAutoCancelMinutesValid(1)).toBe(true)
|
|
31
|
+
expect(isAutoCancelMinutesValid(AUTO_CANCEL_DEFAULT_MINUTES)).toBe(true)
|
|
32
|
+
expect(isAutoCancelMinutesValid(1440)).toBe(true)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('refuses zero, negatives, fractions, values over a day and empty input', () => {
|
|
36
|
+
expect(isAutoCancelMinutesValid(0)).toBe(false)
|
|
37
|
+
expect(isAutoCancelMinutesValid(-1)).toBe(false)
|
|
38
|
+
expect(isAutoCancelMinutesValid(1.5)).toBe(false)
|
|
39
|
+
expect(isAutoCancelMinutesValid(1441)).toBe(false)
|
|
40
|
+
expect(isAutoCancelMinutesValid(null)).toBe(false)
|
|
41
|
+
expect(isAutoCancelMinutesValid(undefined)).toBe(false)
|
|
42
|
+
expect(isAutoCancelMinutesValid(Number.NaN)).toBe(false)
|
|
43
|
+
})
|
|
44
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Minutes a fresh auto-cancel starts at: Gepuklah's calls are usually seated within an hour (ITS-002481). */
|
|
2
|
+
export const AUTO_CANCEL_DEFAULT_MINUTES = 60
|
|
3
|
+
/** The range queue-backend's timer takes: at least a minute, at most a day. */
|
|
4
|
+
export const AUTO_CANCEL_MIN_MINUTES = 1
|
|
5
|
+
export const AUTO_CANCEL_MAX_MINUTES = 1440
|
|
6
|
+
|
|
7
|
+
/** On when a positive number of minutes is stored; 0, null and absent all mean off, as on the server. */
|
|
8
|
+
export function isAutoCancelOn(minutes: number | null | undefined): boolean {
|
|
9
|
+
return typeof minutes === 'number' && minutes > 0
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Whether `minutes` can be saved while auto-cancel is on: a whole number from 1 to 1440. */
|
|
13
|
+
export function isAutoCancelMinutesValid(minutes: number | null | undefined): boolean {
|
|
14
|
+
return (
|
|
15
|
+
typeof minutes === 'number' &&
|
|
16
|
+
Number.isInteger(minutes) &&
|
|
17
|
+
minutes >= AUTO_CANCEL_MIN_MINUTES &&
|
|
18
|
+
minutes <= AUTO_CANCEL_MAX_MINUTES
|
|
19
|
+
)
|
|
20
|
+
}
|