@feedmepos/mf-order-setting 0.0.22 → 0.0.23

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 (44) hide show
  1. package/dist/{KioskDevicesView-C6YmdLKc.js → KioskDevicesView-BdJCcotz.js} +1 -1
  2. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DiLHpWbm.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-DUPfN7ti.js} +2 -2
  3. package/dist/KioskSettingView-BChhriPk.js +782 -0
  4. package/dist/KioskView-DPU-oQ1H.js +426 -0
  5. package/dist/{OrderSettingsView-D_bGK-3J.js → OrderSettingsView-BOiflwB_.js} +14 -11
  6. package/dist/{app-C5qwExhL.js → app-CaYWSLe1.js} +17 -13
  7. package/dist/app.js +1 -1
  8. package/dist/{dayjs.min-kEC9G7bx.js → dayjs.min-8NyoNely.js} +1 -1
  9. package/dist/frontend/mf-order/src/app.d.ts +4 -0
  10. package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +13 -0
  11. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +168 -12
  12. package/dist/frontend/mf-order/src/stores/order-setting/mapper.d.ts +2 -1
  13. package/dist/frontend/mf-order/src/views/kiosk/settings/KioskInstructionSection.vue.d.ts +15 -0
  14. package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPickAtCounterSection.vue.d.ts +4 -3
  15. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  16. package/dist/{index-C_53CwBa.js → index-B7GFhkAE.js} +2 -2
  17. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +16 -16
  18. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +6 -6
  19. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +115 -0
  20. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +225 -0
  21. package/dist/package/entity/order-setting/kiosk/kiosk.enum.d.ts +3 -0
  22. package/dist/package/entity/order-setting/order-setting.do.d.ts +138 -8
  23. package/dist/package/entity/order-setting/order-setting.dto.d.ts +276 -16
  24. package/dist/package/entity/order-setting/sequence/sequence.do.d.ts +4 -4
  25. package/dist/package/entity/order-setting/sequence/sequence.dto.d.ts +4 -4
  26. package/dist/package/entity/payment/payment.enum.d.ts +2 -0
  27. package/dist/package/entity/restaurant/restaurant.dto.d.ts +136 -6
  28. package/dist/package/entity/websocket/websocket.dto.d.ts +288 -0
  29. package/dist/{queue.do-Vog69wnQ.js → queue.do-CIyIpp22.js} +4536 -4517
  30. package/package.json +1 -1
  31. package/src/locales/en-US.json +3 -2
  32. package/src/locales/zh-CN.json +2 -0
  33. package/src/modules/order-setting/kiosk/interface.ts +16 -0
  34. package/src/stores/order-setting/mapper.ts +58 -7
  35. package/src/views/kiosk/settings/KioskDineInSection.vue +4 -5
  36. package/src/views/kiosk/settings/KioskDisplayStandSection.vue +36 -0
  37. package/src/views/kiosk/settings/KioskInstructionSection.vue +40 -0
  38. package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +30 -19
  39. package/src/views/kiosk/settings/KioskPickAtCounterSection.vue +45 -7
  40. package/src/views/kiosk/settings/KioskSettingView.vue +15 -3
  41. package/src/views/kiosk/settings/KioskTakeawaySection.vue +38 -4
  42. package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +3 -8
  43. package/dist/KioskSettingView-D-muNxlb.js +0 -649
  44. package/dist/KioskView-kcjjk4fF.js +0 -371
@@ -1,371 +0,0 @@
1
- import { defineComponent as I, computed as f, openBlock as d, createElementBlock as p, normalizeClass as Q, toDisplayString as c, unref as r, createCommentVNode as y, createElementVNode as n, Fragment as X, renderList as Z, ref as w, defineAsyncComponent as ee, watch as te, resolveComponent as T, createVNode as S, withCtx as ae, withDirectives as ne, vShow as se, createBlock as R } from "vue";
2
- import { u as oe, _ as le } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-DiLHpWbm.js";
3
- import { useI18n as $, useCoreStore as re } from "@feedmepos/mf-common";
4
- import { F as U, a as ie, b as de } from "./queue.do-Vog69wnQ.js";
5
- import { useDialog as ce, useSnackbar as pe, useBreakpoints as ue } from "@feedmepos/ui-library";
6
- import { defineStore as me } from "pinia";
7
- import { O as V, c as B } from "./index-C_53CwBa.js";
8
- const ye = {
9
- key: 0,
10
- class: "fm-typo-en-title-sm-600"
11
- }, fe = {
12
- key: 1,
13
- class: "my-[0.25rem]"
14
- }, ve = { class: "flex flex-col gap-1" }, _e = { class: "flex flex-col gap-1" }, ge = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ke = { class: "fm-typo-en-body-lg-600" }, he = { key: 0 }, Se = { key: 1 }, be = { key: 0 }, Pe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Te = { class: "fm-typo-en-body-lg-600 block" }, we = { key: 1 }, xe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ke = { class: "fm-typo-en-body-lg-600 block" }, Ie = { key: 2 }, $e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ce = { class: "fm-typo-en-body-lg-600 block" }, Fe = { key: 3 }, Oe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, qe = { class: "fm-typo-en-body-lg-600 block" }, De = { key: 0 }, A = /* @__PURE__ */ I({
15
- __name: "KioskSummary",
16
- props: {
17
- restaurantId: {},
18
- devices: {},
19
- kioskOrderSetting: {},
20
- dialogType: { type: Boolean }
21
- },
22
- setup(t) {
23
- const { t: e } = $(), o = t, i = f(() => {
24
- var a;
25
- return (a = o.kioskOrderSetting) != null && a.dineIn.enabled ? e("order.activated") : e("order.deactivated");
26
- }), s = f(() => {
27
- var a;
28
- return (a = o.kioskOrderSetting) != null && a.takeaway.enabled ? e("order.activated") : e("order.deactivated");
29
- }), l = f(() => {
30
- var a, m;
31
- return (a = o.kioskOrderSetting) != null && a.dineIn.displayStand ? e("order.tableService") : (m = o.kioskOrderSetting) != null && m.dineIn && !o.kioskOrderSetting.dineIn.displayStand ? e("order.pickAtCounter") : e("order.unknown");
32
- }), k = f(() => {
33
- var a;
34
- return ((a = o.kioskOrderSetting) == null ? void 0 : a.paymentSetting.paymentTypes.includes(U.enum.cash)) ?? !1;
35
- }), v = f(() => {
36
- var m, _;
37
- const a = [];
38
- if ((m = o.kioskOrderSetting) == null || m.paymentSetting.paymentTypes.forEach((g) => {
39
- g === U.enum.ePayment && a.push(e("order.ePayment"));
40
- }), a.length > 0 && Object.keys(o.kioskOrderSetting.paymentSetting.ePaymentTypes).length !== 0) {
41
- const g = (_ = o.kioskOrderSetting) == null ? void 0 : _.paymentSetting.ePaymentTypes;
42
- (g.card.terminal || g.card.nfc) && a.push(e("order.bankCard")), (g.eWallet.scanPay || g.eWallet.qrPay) && a.push(e("order.eWallet"));
43
- }
44
- return a.join(", ");
45
- });
46
- return (a, m) => (d(), p("div", {
47
- class: Q(a.dialogType ? "" : ["p-[1.5rem] border fm-corner-radius-lg flex flex-col gap-5 fixed ml-40 w-[320px]"])
48
- }, [
49
- a.dialogType ? y("", !0) : (d(), p("span", ye, c(r(e)("order.kioskSummary")), 1)),
50
- a.dialogType ? y("", !0) : (d(), p("hr", fe)),
51
- n("div", ve, [
52
- n("div", _e, [
53
- n("span", ge, c(r(e)("order.kioskDisplay")), 1),
54
- n("div", ke, [
55
- a.devices.length > 0 ? (d(), p("div", he, [
56
- (d(!0), p(X, null, Z(a.devices, (_) => (d(), p("li", {
57
- class: "block",
58
- key: _.machineId
59
- }, c(_.name), 1))), 128))
60
- ])) : (d(), p("div", Se, "-"))
61
- ]),
62
- i.value === r(e)("order.activated") ? (d(), p("div", be, [
63
- n("span", Pe, c(r(e)("order.dineIn")), 1),
64
- n("div", Te, [
65
- n("div", null, c(i.value), 1)
66
- ])
67
- ])) : y("", !0),
68
- i.value === r(e)("order.activated") && l.value !== r(e)("order.unknown") ? (d(), p("div", we, [
69
- n("span", xe, c(r(e)("order.dineInType")), 1),
70
- n("div", Ke, [
71
- n("div", null, c(l.value), 1)
72
- ])
73
- ])) : y("", !0),
74
- s.value === r(e)("order.activated") ? (d(), p("div", Ie, [
75
- n("span", $e, c(r(e)("order.takeaway")), 1),
76
- n("div", Ce, [
77
- n("div", null, c(s.value), 1)
78
- ])
79
- ])) : y("", !0),
80
- v.value || k.value ? (d(), p("div", Fe, [
81
- n("span", Oe, c(r(e)("order.acceptedPayment")), 1),
82
- n("div", qe, [
83
- k.value ? (d(), p("div", De, c(r(e)("order.offlinePayment")), 1)) : y("", !0),
84
- n("div", null, c(v.value), 1)
85
- ])
86
- ])) : y("", !0)
87
- ])
88
- ])
89
- ], 2));
90
- }
91
- }), Re = { class: "flex flex-col gap-5 pb-6" }, Ue = { class: "fm-typo-en-body-md-400 block" }, Ve = { class: "fm-typo-en-title-md-600" }, Be = /* @__PURE__ */ I({
92
- __name: "KioskOtpDialog",
93
- props: {
94
- otp: {}
95
- },
96
- setup(t) {
97
- const { t: e } = $();
98
- return (o, i) => (d(), p("div", Re, [
99
- n("span", Ue, c(r(e)("order.bindDeviceMessage")), 1),
100
- n("div", Ve, c(o.otp), 1)
101
- ]));
102
- }
103
- }), N = {
104
- enabled: !1,
105
- prefix: null,
106
- padDigit: 0,
107
- standSlotRange: {
108
- min: 1,
109
- max: 10
110
- }
111
- }, M = {
112
- enabled: !1
113
- }, Ae = {
114
- dineIn: {
115
- enabled: !1,
116
- pickUp: M,
117
- sequenceNumber: ie.parse({}),
118
- displayStand: N
119
- },
120
- takeaway: {
121
- enabled: !1
122
- },
123
- paymentSetting: {
124
- paymentTypes: [],
125
- offlinePaymentTypes: [],
126
- ePaymentTypes: {
127
- card: {
128
- terminal: !1,
129
- nfc: !1
130
- },
131
- eWallet: {
132
- qrPay: !1,
133
- scanPay: !1
134
- }
135
- }
136
- },
137
- menuItem: {
138
- showAllOnly: !1
139
- }
140
- }, Ee = (t) => {
141
- var e;
142
- return {
143
- kiosk: Ne(t.kioskSettings, (e = t.sequenceSettings) == null ? void 0 : e.kioskDineIn)
144
- };
145
- }, Ne = (t, e) => {
146
- var o, i, s, l;
147
- return {
148
- dineIn: Me(e ?? {
149
- current: 0,
150
- prefix: "#K"
151
- }, t.dineIn ?? void 0),
152
- takeaway: {
153
- enabled: (t == null ? void 0 : t.canTakeaway) ?? !1
154
- },
155
- paymentSetting: {
156
- paymentTypes: ((o = t == null ? void 0 : t.paymentSetting) == null ? void 0 : o.paymentTypes) ?? [],
157
- offlinePaymentTypes: ((i = t == null ? void 0 : t.paymentSetting) == null ? void 0 : i.offlinePaymentTypes) ?? [],
158
- ePaymentTypes: ((s = t == null ? void 0 : t.paymentSetting) == null ? void 0 : s.ePaymentTypes) ?? de.parse({
159
- card: {
160
- terminal: !1,
161
- nfc: !1
162
- },
163
- eWallet: {
164
- qrPay: !1,
165
- scanPay: !1
166
- }
167
- })
168
- },
169
- menuItem: {
170
- showAllOnly: ((l = t.menuItem) == null ? void 0 : l.showAllOnly) ?? !1
171
- }
172
- };
173
- }, Me = (t, e) => ({
174
- enabled: !!e,
175
- sequenceNumber: t,
176
- pickUp: (e == null ? void 0 : e.pickUp) ?? M,
177
- displayStand: e != null && e.displayStand ? {
178
- enabled: e.displayStand.enabled,
179
- standSlotRange: e.displayStand.standSlotRange,
180
- prefix: e.displayStand.prefix,
181
- padDigit: e.displayStand.padDigit
182
- } : N
183
- }), We = (t) => {
184
- const e = (s) => ({
185
- requiredSlot: !!s.displayStand,
186
- displayStand: s.displayStand,
187
- pickUp: s.pickUp
188
- }), o = (s) => ({
189
- canTakeaway: t.takeaway.enabled,
190
- dineIn: s,
191
- menuItem: t.menuItem,
192
- paymentSetting: i(t.paymentSetting)
193
- }), i = (s) => ({
194
- paymentTypes: s.paymentTypes,
195
- offlinePaymentTypes: s.offlinePaymentTypes,
196
- ePaymentTypes: s.ePaymentTypes
197
- });
198
- return t.dineIn.enabled ? {
199
- kioskSettings: o(e(t.dineIn)),
200
- kioskDineIn: t.dineIn.sequenceNumber
201
- } : {
202
- kioskSettings: o()
203
- };
204
- }, E = {
205
- convertOrderSettingDto: Ee,
206
- toOrderKioskSettingsDto: We
207
- }, je = me("orderSetting", () => {
208
- const t = w({});
209
- async function e() {
210
- const l = await V.getOrderSetting();
211
- i(l);
212
- }
213
- async function o() {
214
- if (t.value.orderSetting && t.value.kiosk) {
215
- const { _id: l, ...k } = t.value.orderSetting, v = E.toOrderKioskSettingsDto(t.value.kiosk), a = {
216
- ...k,
217
- kioskSettings: v.kioskSettings
218
- }, m = await V.updateOrderSetting(a);
219
- i(m);
220
- }
221
- }
222
- function i(l) {
223
- t.value.orderSetting = l, t.value.kiosk = E.convertOrderSettingDto(l).kiosk;
224
- }
225
- function s(l) {
226
- t.value.kiosk = l;
227
- }
228
- return {
229
- state: t,
230
- getSetting: e,
231
- updateKioskSetting: o,
232
- setKioskOrderSetting: s
233
- };
234
- }), He = { class: "py-[1.5rem]" }, Le = { class: "flex px-[1.5rem]" }, Ye = { class: "flex-[2_2_0%]" }, ze = { class: "pt-[1.5rem]" }, Ge = { class: "flex flex-col gap-10" }, Je = { class: "flex flex-col gap-2" }, Qe = { class: "fm-typo-en-title-sm-600" }, Xe = { class: "fm-typo-en-title-sm-400" }, Ze = {
235
- key: 0,
236
- class: "flex-[1_1_0%]"
237
- }, rt = /* @__PURE__ */ I({
238
- __name: "KioskView",
239
- setup(t) {
240
- var q, D;
241
- const { t: e } = $(), o = ee(
242
- () => import("./KioskSettingView-D-muNxlb.js")
243
- ), i = w("device"), s = oe(), l = je(), k = ce(), { currentRestaurant: v, restaurants: a, changeRestaurant: m } = re(), _ = pe(), g = ue(), C = f(() => g.breakpoints.value.xs), b = w(((q = v.value) == null ? void 0 : q._id) ?? void 0), W = f(() => a.value.map((u) => ({
244
- label: u.profile.name,
245
- value: u._id
246
- }))), P = w(((D = v.value) == null ? void 0 : D._id) ?? "");
247
- function j() {
248
- var u;
249
- k.open({
250
- title: B(e("order.kioskSummary")),
251
- contentComponent: A,
252
- contentComponentProps: {
253
- restaurantId: (u = v.value) == null ? void 0 : u._id,
254
- devices: s.state.devices,
255
- kioskOrderSetting: l.state.kiosk,
256
- dialogType: !0
257
- }
258
- });
259
- }
260
- async function F(u) {
261
- const h = a.value.find((x) => x._id == u);
262
- await m(h), await l.getSetting(), await s.getDevices(), b.value = u, P.value = u;
263
- }
264
- const H = f(() => [
265
- {
266
- label: e("order.deviceBinding"),
267
- value: "device"
268
- },
269
- {
270
- label: e("order.settings"),
271
- value: "setting"
272
- }
273
- ]), O = f(() => s.state.devices);
274
- async function L() {
275
- await s.requestOtp(), k.open({
276
- title: B(e("order.bindDevice")),
277
- contentComponent: Be,
278
- contentComponentProps: {
279
- otp: s.state.otp
280
- }
281
- });
282
- }
283
- async function Y(u) {
284
- try {
285
- l.setKioskOrderSetting(u), await l.updateKioskSetting(), _.open({
286
- title: e("order.kioskSettingSuccess"),
287
- type: "success"
288
- });
289
- } catch {
290
- _.open({
291
- title: e("order.kioskSettingFailed"),
292
- type: "error"
293
- });
294
- }
295
- }
296
- return te(
297
- () => a.value.length,
298
- async (u) => {
299
- b.value === void 0 && a.value.length > 0 && await F(a.value[0]._id);
300
- },
301
- { immediate: !0 }
302
- ), (u, h) => {
303
- const x = T("FmButton"), z = T("FmPageHead"), G = T("FmTabs"), J = T("FmSelect");
304
- return d(), p("div", He, [
305
- S(z, {
306
- title: r(e)("order.kiosk")
307
- }, {
308
- append: ae(() => [
309
- ne(S(x, {
310
- icon: "info",
311
- variant: "tertiary",
312
- onClick: j
313
- }, null, 512), [
314
- [se, C.value]
315
- ])
316
- ]),
317
- _: 1
318
- }, 8, ["title"]),
319
- n("div", Le, [
320
- n("div", Ye, [
321
- S(G, {
322
- "model-value": i.value,
323
- "onUpdate:modelValue": h[0] || (h[0] = (K) => i.value = K),
324
- items: H.value
325
- }, null, 8, ["model-value", "items"]),
326
- n("div", ze, [
327
- n("div", Ge, [
328
- n("div", Je, [
329
- n("span", Qe, c(r(e)("order.activateLocation")), 1),
330
- n("span", Xe, c(r(e)("order.selectRestaurant")) + ": ", 1),
331
- S(J, {
332
- class: "w-1/2",
333
- modelValue: b.value,
334
- "onUpdate:modelValue": [
335
- h[1] || (h[1] = (K) => b.value = K),
336
- F
337
- ],
338
- items: W.value,
339
- placeholder: r(e)("order.selectItem")
340
- }, null, 8, ["modelValue", "items", "placeholder"])
341
- ]),
342
- i.value == "device" ? (d(), R(le, {
343
- key: 0,
344
- devices: O.value,
345
- "request-otp": L
346
- }, null, 8, ["devices"])) : y("", !0),
347
- i.value == "setting" ? (d(), R(r(o), {
348
- key: `KioskSettingView-${P.value}`,
349
- "restaurant-id": P.value,
350
- onUpdateKioskOrderSetting: Y,
351
- form: r(l).state.kiosk ?? r(Ae)
352
- }, null, 8, ["restaurant-id", "form"])) : y("", !0)
353
- ])
354
- ])
355
- ]),
356
- C.value ? y("", !0) : (d(), p("div", Ze, [
357
- S(A, {
358
- "restaurant-id": P.value,
359
- devices: O.value,
360
- "kiosk-order-setting": r(l).state.kiosk,
361
- dialogType: !1
362
- }, null, 8, ["restaurant-id", "devices", "kiosk-order-setting"])
363
- ]))
364
- ])
365
- ]);
366
- };
367
- }
368
- });
369
- export {
370
- rt as default
371
- };