@feedmepos/mf-order-setting 0.0.73-dev → 0.0.74-dev

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 (42) hide show
  1. package/dist/{KioskDevicesView-Dztw-Q35.js → KioskDevicesView-CW7nDXi2.js} +1 -1
  2. package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-CPDkls2i.js +762 -0
  3. package/dist/{KioskSettingView-BUHmoxyO.js → KioskSettingView-DErXeFIt.js} +3 -3
  4. package/dist/KioskView-d1YjttbD.js +362 -0
  5. package/dist/{OrderSettingsView-C5PK8CKZ.js → OrderSettingsView-asfw4cYT.js} +13 -10
  6. package/dist/app-DrWO2wkv.js +20750 -0
  7. package/dist/app.js +3 -3
  8. package/dist/{dayjs.min-B3nOmXcs.js → dayjs.min-Fu6ejRAr.js} +1 -1
  9. package/dist/frontend/mf-order/src/api/index.d.ts +3 -1
  10. package/dist/frontend/mf-order/src/app.d.ts +160 -152
  11. package/dist/frontend/mf-order/src/composables/useKioskPermission.d.ts +11 -0
  12. package/dist/frontend/mf-order/src/composables/useOrderSettingPermission.d.ts +13 -0
  13. package/dist/frontend/mf-order/src/main.d.ts +160 -152
  14. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +3 -3
  15. package/dist/frontend/mf-order/src/views/kiosk/KioskStatePanel.vue.d.ts +19 -0
  16. package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +7 -1
  17. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  18. package/dist/{index-B4XxBqiV.js → index-DEKeP24S.js} +7 -7
  19. package/dist/{index-6PQJ07gD.js → index-DJLCZHNZ.js} +2 -2
  20. package/dist/{lineman-settings.dto-DcYJFu0U.js → lineman-settings.dto-DS4tgxBJ.js} +18974 -18109
  21. package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +6 -6
  22. package/dist/package/entity/order-setting/order-setting.do.d.ts +4 -4
  23. package/dist/package/entity/order-setting/order-setting.dto.d.ts +8 -8
  24. package/dist/package/entity/order-setting/sms/sms.do.d.ts +2 -2
  25. package/dist/package/entity/order-setting/sms/sms.dto.d.ts +2 -2
  26. package/package.json +3 -2
  27. package/src/api/index.ts +5 -2
  28. package/src/composables/useKioskPermission.ts +41 -0
  29. package/src/composables/useOrderSettingPermission.ts +34 -0
  30. package/src/locales/en-US.json +429 -421
  31. package/src/main.ts +9 -6
  32. package/src/router/routes.ts +34 -5
  33. package/src/views/kiosk/KioskStatePanel.vue +31 -0
  34. package/src/views/kiosk/KioskView.vue +100 -62
  35. package/src/views/kiosk/devices/KioskDeviceCard.vue +4 -0
  36. package/src/views/kiosk/devices/KioskDevicesView.vue +42 -9
  37. package/src/views/order-settings/OrderSettingsView.vue +8 -5
  38. package/src/views/order-settings/delivery/delivery.ts +1 -1
  39. package/vite.config.ts +5 -2
  40. package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-Ol419NZh.js +0 -707
  41. package/dist/KioskView-B8j77zMA.js +0 -343
  42. package/dist/app-C2_s0fkK.js +0 -18792
@@ -1,343 +0,0 @@
1
- import { defineComponent as N, openBlock as _, createElementBlock as $, createElementVNode as m, toDisplayString as P, unref as d, ref as w, defineAsyncComponent as J, computed as h, onMounted as X, watch as Y, resolveComponent as A, createVNode as x, createBlock as R, createCommentVNode as V } from "vue";
2
- import { u as Z, _ as O } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-Ol419NZh.js";
3
- import { useDialog as g, useSnackbar as S } from "@feedmepos/ui-library";
4
- import { useI18n as B, useCoreStore as k } from "@feedmepos/mf-common";
5
- import { defineStore as aa } from "pinia";
6
- import { O as D, c as ea } from "./index-B4XxBqiV.js";
7
- import { F as ta, a as na } from "./lineman-settings.dto-DcYJFu0U.js";
8
- const la = { class: "flex flex-col gap-5 pb-6" }, ua = { class: "fm-typo-en-body-md-400 block" }, oa = { class: "fm-typo-en-title-md-600" }, ca = /* @__PURE__ */ N({
9
- __name: "KioskOtpDialog",
10
- props: {
11
- otp: {}
12
- },
13
- setup(a) {
14
- const { t: e } = B();
15
- return (c, l) => (_(), $("div", la, [
16
- m("span", ua, P(d(e)("order.bindDeviceMessage")), 1),
17
- m("div", oa, P(a.otp), 1)
18
- ]));
19
- }
20
- }), M = {
21
- enabled: !1,
22
- prefix: null,
23
- padDigit: 0,
24
- standSlotRange: {
25
- min: 1,
26
- max: 10
27
- },
28
- enablePaxDialog: !1,
29
- submitOrderInstruction: {
30
- payAtCounter: null,
31
- paid: null
32
- }
33
- }, ra = {
34
- enabled: !1,
35
- submitOrderInstruction: {
36
- payAtCounter: null,
37
- paid: null
38
- }
39
- }, E = {
40
- enabled: !1,
41
- submitOrderInstruction: {
42
- payAtCounter: null,
43
- paid: null
44
- },
45
- enablePaxDialog: !1
46
- }, sa = {
47
- dineIn: {
48
- enabled: !1,
49
- pickUp: E,
50
- sequenceNumber: ta.parse({}),
51
- displayStand: M
52
- },
53
- takeaway: ra,
54
- paymentSetting: {
55
- paymentTypes: [],
56
- offlinePaymentTypes: [],
57
- ePaymentTypes: {
58
- terminal: !1,
59
- card: {
60
- terminal: !1,
61
- nfc: !1
62
- },
63
- eWallet: {
64
- terminalQrPay: !1,
65
- terminalScanPay: !1,
66
- qrPay: !1,
67
- scanPay: !1
68
- }
69
- }
70
- },
71
- menuItem: {
72
- showAllOnly: !1
73
- },
74
- coverImageLandscape: null,
75
- coverImagePortrait: null,
76
- otaChannel: ""
77
- }, K = {
78
- payAtCounter: null,
79
- paid: null
80
- }, pa = (a) => {
81
- var e;
82
- return {
83
- kiosk: da(a.kioskSettings, (e = a.sequenceSettings) == null ? void 0 : e.kioskDineIn)
84
- };
85
- }, da = (a, e) => {
86
- var c, l, t, n, s, o, u, p, f, i, v;
87
- return {
88
- dineIn: ma(
89
- e ?? {
90
- current: 0,
91
- prefix: "#K"
92
- },
93
- (a == null ? void 0 : a.dineIn) ?? void 0
94
- ),
95
- takeaway: {
96
- enabled: (a == null ? void 0 : a.canTakeaway) ?? !1,
97
- submitOrderInstruction: (c = a == null ? void 0 : a.takeaway) != null && c.submitOrderInstruction ? {
98
- payAtCounter: ((n = (t = (l = a == null ? void 0 : a.takeaway) == null ? void 0 : l.submitOrderInstruction) == null ? void 0 : t.payAtCounter) == null ? void 0 : n.en) ?? null,
99
- paid: ((u = (o = (s = a == null ? void 0 : a.takeaway) == null ? void 0 : s.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : u.en) ?? null
100
- } : K
101
- },
102
- paymentSetting: {
103
- paymentTypes: ((p = a == null ? void 0 : a.paymentSetting) == null ? void 0 : p.paymentTypes) ?? [],
104
- offlinePaymentTypes: ((f = a == null ? void 0 : a.paymentSetting) == null ? void 0 : f.offlinePaymentTypes) ?? [],
105
- ePaymentTypes: ((i = a == null ? void 0 : a.paymentSetting) == null ? void 0 : i.ePaymentTypes) ?? na.parse({
106
- card: {
107
- terminal: !1,
108
- nfc: !1
109
- },
110
- eWallet: {
111
- qrPay: !1,
112
- scanPay: !1
113
- }
114
- })
115
- },
116
- menuItem: {
117
- showAllOnly: ((v = a == null ? void 0 : a.menuItem) == null ? void 0 : v.showAllOnly) ?? !1
118
- },
119
- otaChannel: (a == null ? void 0 : a.otaChannel) ?? "",
120
- coverImageLandscape: (a == null ? void 0 : a.coverImageLandscape) ?? null,
121
- coverImagePortrait: (a == null ? void 0 : a.coverImagePortrait) ?? null
122
- };
123
- }, ma = (a, e) => {
124
- var c, l, t, n, s, o, u, p;
125
- return {
126
- enabled: !!e,
127
- sequenceNumber: a,
128
- pickUp: e != null && e.pickUp ? {
129
- ...e.pickUp,
130
- submitOrderInstruction: e.pickUp.submitOrderInstruction ? {
131
- payAtCounter: ((l = (c = e.pickUp.submitOrderInstruction) == null ? void 0 : c.payAtCounter) == null ? void 0 : l.en) ?? null,
132
- paid: ((n = (t = e.pickUp.submitOrderInstruction) == null ? void 0 : t.paid) == null ? void 0 : n.en) ?? null
133
- } : K,
134
- enablePaxDialog: e.pickUp.enablePaxDialog ? e.pickUp.enablePaxDialog : !1
135
- } : E,
136
- displayStand: e != null && e.displayStand ? {
137
- enabled: e.displayStand.enabled,
138
- standSlotRange: e.displayStand.standSlotRange,
139
- prefix: e.displayStand.prefix,
140
- padDigit: e.displayStand.padDigit,
141
- enablePaxDialog: e.displayStand.enablePaxDialog ?? !1,
142
- submitOrderInstruction: e.displayStand.submitOrderInstruction ? {
143
- payAtCounter: ((o = (s = e.displayStand.submitOrderInstruction) == null ? void 0 : s.payAtCounter) == null ? void 0 : o.en) ?? null,
144
- paid: ((p = (u = e.displayStand.submitOrderInstruction) == null ? void 0 : u.paid) == null ? void 0 : p.en) ?? null
145
- } : K
146
- } : M
147
- };
148
- }, ia = (a) => {
149
- const e = (t) => {
150
- var n, s, o, u;
151
- return {
152
- requiredSlot: !!t.displayStand,
153
- displayStand: {
154
- ...t.displayStand,
155
- submitOrderInstruction: {
156
- payAtCounter: (n = t.displayStand.submitOrderInstruction) != null && n.payAtCounter ? {
157
- en: t.displayStand.submitOrderInstruction.payAtCounter
158
- } : null,
159
- paid: (s = t.displayStand.submitOrderInstruction) != null && s.paid ? {
160
- en: t.displayStand.submitOrderInstruction.paid
161
- } : null
162
- }
163
- },
164
- pickUp: {
165
- ...t.pickUp,
166
- submitOrderInstruction: {
167
- payAtCounter: (o = t.pickUp.submitOrderInstruction) != null && o.payAtCounter ? {
168
- en: t.pickUp.submitOrderInstruction.payAtCounter
169
- } : null,
170
- paid: (u = t.pickUp.submitOrderInstruction) != null && u.paid ? {
171
- en: t.pickUp.submitOrderInstruction.paid
172
- } : null
173
- }
174
- }
175
- };
176
- }, c = (t) => ({
177
- canTakeaway: a.takeaway.enabled,
178
- dineIn: t,
179
- menuItem: a.menuItem,
180
- coverImageLandscape: a.coverImageLandscape,
181
- coverImagePortrait: a.coverImagePortrait,
182
- otaChannel: a.otaChannel || void 0,
183
- paymentSetting: l(a.paymentSetting),
184
- takeaway: a.takeaway.submitOrderInstruction ? {
185
- submitOrderInstruction: {
186
- payAtCounter: a.takeaway.submitOrderInstruction.payAtCounter ? {
187
- en: a.takeaway.submitOrderInstruction.payAtCounter
188
- } : null,
189
- paid: a.takeaway.submitOrderInstruction.paid ? {
190
- en: a.takeaway.submitOrderInstruction.paid
191
- } : null
192
- }
193
- } : void 0
194
- }), l = (t) => ({
195
- paymentTypes: t.paymentTypes,
196
- offlinePaymentTypes: t.offlinePaymentTypes,
197
- ePaymentTypes: t.ePaymentTypes
198
- });
199
- return a.dineIn.enabled ? {
200
- kioskSettings: c(e(a.dineIn)),
201
- kioskDineIn: a.dineIn.sequenceNumber
202
- } : {
203
- kioskSettings: c()
204
- };
205
- }, L = {
206
- convertOrderSettingDto: pa,
207
- toOrderKioskSettingsDto: ia
208
- }, ya = aa("orderSetting", () => {
209
- const a = w({});
210
- async function e() {
211
- const n = await D.getOrderSetting();
212
- l(n);
213
- }
214
- async function c() {
215
- if (a.value.orderSetting && a.value.kiosk) {
216
- const { _id: n, ...s } = a.value.orderSetting, o = L.toOrderKioskSettingsDto(a.value.kiosk), u = {
217
- ...s,
218
- kioskSettings: o.kioskSettings
219
- }, p = await D.updateOrderSetting(u);
220
- l(p);
221
- }
222
- }
223
- function l(n) {
224
- a.value.orderSetting = n, a.value.kiosk = L.convertOrderSettingDto(n).kiosk;
225
- }
226
- function t(n) {
227
- a.value.kiosk = n;
228
- }
229
- return {
230
- state: a.value,
231
- getSetting: e,
232
- updateKioskSetting: c,
233
- setKioskOrderSetting: t
234
- };
235
- }), fa = { class: "py-[1.5rem]" }, va = { class: "px-[1.5rem]" }, ba = { class: "pt-[1.5rem]" }, _a = { class: "flex flex-col gap-10" }, wa = { class: "flex flex-col gap-2" }, Pa = { class: "fm-typo-en-title-sm-600" }, Ca = { class: "fm-typo-en-title-sm-400" }, qa = /* @__PURE__ */ N({
236
- __name: "KioskView",
237
- setup(a) {
238
- var q, F;
239
- const { t: e } = B(), c = J(
240
- () => import("./KioskSettingView-BUHmoxyO.js")
241
- ), l = w("device"), t = Z(), n = ya(), s = g(), { currentRestaurant: o, restaurants: u, changeRestaurant: p } = k(), f = S(), i = w(((q = o.value) == null ? void 0 : q._id) ?? void 0), v = h(() => u.value.map((r) => ({
242
- label: r.profile.name,
243
- value: r._id
244
- }))), b = w(((F = o.value) == null ? void 0 : F._id) ?? "");
245
- async function T(r) {
246
- const y = u.value.find((C) => C._id == r);
247
- await p(y), await U(), i.value = r, b.value = r;
248
- }
249
- async function U() {
250
- await n.getSetting(), await t.getDevices();
251
- }
252
- const H = h(() => [
253
- {
254
- label: e("order.deviceBinding"),
255
- value: "device"
256
- },
257
- {
258
- label: e("order.settings"),
259
- value: "setting"
260
- }
261
- ]), W = h(() => t.state.devices);
262
- async function Q() {
263
- await t.requestOtp(), s.open({
264
- title: ea(e("order.bindDevice")),
265
- contentComponent: ca,
266
- contentComponentProps: {
267
- otp: t.state.otp
268
- }
269
- }).onClose(async () => {
270
- await t.getDevices();
271
- });
272
- }
273
- async function j(r) {
274
- try {
275
- n.setKioskOrderSetting(r), await n.updateKioskSetting(), f.open({
276
- title: e("order.kioskSettingSuccess"),
277
- type: "success"
278
- });
279
- } catch {
280
- f.open({
281
- title: e("order.kioskSettingFailed"),
282
- type: "error"
283
- });
284
- }
285
- }
286
- return X(async () => {
287
- var r;
288
- (r = o.value) != null && r._id && (b.value = o.value._id, await U());
289
- }), Y(
290
- () => u.value.length,
291
- async (r) => {
292
- i.value === void 0 && u.value.length > 0 && await T(u.value[0]._id);
293
- },
294
- { immediate: !0 }
295
- ), (r, y) => {
296
- const C = A("FmPageHead"), z = A("FmTabs"), G = A("FmSelect");
297
- return _(), $("div", fa, [
298
- x(C, {
299
- title: d(e)("order.kiosk")
300
- }, null, 8, ["title"]),
301
- m("div", va, [
302
- x(z, {
303
- "model-value": l.value,
304
- "onUpdate:modelValue": y[0] || (y[0] = (I) => l.value = I),
305
- items: H.value
306
- }, null, 8, ["model-value", "items"]),
307
- m("div", ba, [
308
- m("div", _a, [
309
- m("div", wa, [
310
- m("span", Pa, P(d(e)("order.activateLocation")), 1),
311
- m("span", Ca, P(d(e)("order.selectRestaurant")) + ": ", 1),
312
- x(G, {
313
- class: "w-1/2",
314
- modelValue: i.value,
315
- "onUpdate:modelValue": [
316
- y[1] || (y[1] = (I) => i.value = I),
317
- T
318
- ],
319
- items: v.value,
320
- placeholder: d(e)("order.selectItem")
321
- }, null, 8, ["modelValue", "items", "placeholder"])
322
- ]),
323
- l.value == "device" ? (_(), R(O, {
324
- key: 0,
325
- devices: W.value,
326
- onRequestOtp: Q
327
- }, null, 8, ["devices"])) : V("", !0),
328
- l.value == "setting" ? (_(), R(d(c), {
329
- key: `KioskSettingView-${b.value}`,
330
- "restaurant-id": b.value,
331
- onUpdateKioskOrderSetting: j,
332
- form: d(n).state.kiosk ?? d(sa)
333
- }, null, 8, ["restaurant-id", "form"])) : V("", !0)
334
- ])
335
- ])
336
- ])
337
- ]);
338
- };
339
- }
340
- });
341
- export {
342
- qa as default
343
- };