@feedmepos/mf-order-setting 0.0.88 → 0.0.89

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/{DisplaySystemView-BiKFL6UY.js → DisplaySystemView-BA-5JObJ.js} +1 -1
  2. package/dist/{KioskDevicesView-DQPue13D.js → KioskDevicesView-CgdnW9N9.js} +1 -1
  3. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-BAe1eQvx.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-C9X9ziUm.js} +3 -3
  4. package/dist/KioskSettingView-CVck01e7.js +860 -0
  5. package/dist/{KioskView-BfTNsmN1.js → KioskView-DKY2QEh5.js} +54 -48
  6. package/dist/{OrderSettingsView-CowX8_oN.js → OrderSettingsView-CEPIZmHA.js} +774 -768
  7. package/dist/{app-DgZSoUgk.js → app-C9nnuR9O.js} +206 -190
  8. package/dist/app.js +1 -1
  9. package/dist/frontend/mf-order/src/app.d.ts +16 -0
  10. package/dist/frontend/mf-order/src/main.d.ts +16 -0
  11. package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +2 -0
  12. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +6 -0
  13. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  14. package/dist/{index-CGJIcLNE.js → index-BaC_Douy.js} +2 -2
  15. package/dist/{index-CWm0u6lo.js → index-DGAU5Dhc.js} +1 -1
  16. package/dist/{index-DzmXxFJu.js → index-Gk7389CW.js} +1 -1
  17. package/dist/{order.dto-DQWf-RVV.js → order.dto-CfCfBJYu.js} +43 -6
  18. package/dist/package/entity/food-court/food-court.dto.d.ts +51 -121
  19. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +10 -0
  20. package/dist/package/entity/kiosk/kiosk.do.d.ts +16 -16
  21. package/dist/package/entity/kiosk/kiosk.dto.d.ts +19 -19
  22. package/dist/package/entity/order/order-item/order-item.dto.d.ts +20 -0
  23. package/dist/package/entity/order/order.do.d.ts +19 -3
  24. package/dist/package/entity/order/order.dto.d.ts +107 -91
  25. package/dist/package/entity/order/order.enum.d.ts +1 -1
  26. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +3 -0
  27. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +6 -0
  28. package/dist/package/entity/order-setting/order-setting.do.d.ts +5 -0
  29. package/dist/package/entity/order-setting/order-setting.dto.d.ts +13 -0
  30. package/dist/package/entity/queue/queue.dto.d.ts +23 -36
  31. package/dist/package/entity/restaurant/restaurant.dto.d.ts +10 -15
  32. package/dist/package/entity/websocket/websocket.dto.d.ts +12 -0
  33. package/package.json +1 -1
  34. package/src/locales/en-US.json +4 -0
  35. package/src/locales/ja-JP.json +4 -0
  36. package/src/locales/th-TH.json +4 -0
  37. package/src/locales/zh-CN.json +4 -0
  38. package/src/modules/order-setting/kiosk/interface.ts +10 -0
  39. package/src/stores/order-setting/mapper.spec.ts +21 -0
  40. package/src/stores/order-setting/mapper.ts +8 -2
  41. package/src/views/kiosk/settings/KioskSettingView.vue +37 -0
  42. package/src/views/order-settings/delivery/delivery.spec.ts +23 -3
  43. package/src/views/order-settings/delivery/delivery.ts +4 -0
  44. package/dist/KioskSettingView-M3pBFSwt.js +0 -839
@@ -1,20 +1,20 @@
1
- import { defineComponent as G, openBlock as h, createElementBlock as Q, createElementVNode as y, toDisplayString as A, unref as m, ref as v, defineAsyncComponent as ue, computed as T, onMounted as ce, watch as re, resolveComponent as w, createVNode as U, withCtx as oe, createBlock as K, createCommentVNode as E } from "vue";
2
- import { u as se, a as pe, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-BAe1eQvx.js";
3
- import { useDialog as me, useSnackbar as ie } from "@feedmepos/ui-library";
1
+ import { defineComponent as X, openBlock as _, createElementBlock as Q, createElementVNode as y, toDisplayString as A, unref as d, ref as v, defineAsyncComponent as ue, computed as T, onMounted as ce, watch as re, resolveComponent as w, createVNode as U, withCtx as oe, createBlock as K, createCommentVNode as E } from "vue";
2
+ import { u as se, a as pe, _ as me } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-C9X9ziUm.js";
3
+ import { useDialog as de, useSnackbar as ie } from "@feedmepos/ui-library";
4
4
  import { useI18n as z, useCoreStore as ye } from "@feedmepos/mf-common";
5
- import { F as fe, a as ve, S as N } from "./order.dto-DQWf-RVV.js";
5
+ import { F as fe, a as ve, S as N } from "./order.dto-CfCfBJYu.js";
6
6
  import { defineStore as be } from "pinia";
7
- import { O as j } from "./index-DzmXxFJu.js";
8
- import { u as _e } from "./app-DgZSoUgk.js";
9
- const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body-md-400 block" }, Pe = { class: "fm-typo-en-title-md-600" }, we = /* @__PURE__ */ G({
7
+ import { O as W } from "./index-Gk7389CW.js";
8
+ import { u as he } from "./app-C9nnuR9O.js";
9
+ const _e = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body-md-400 block" }, Pe = { class: "fm-typo-en-title-md-600" }, we = /* @__PURE__ */ X({
10
10
  __name: "KioskOtpDialog",
11
11
  props: {
12
12
  otp: {}
13
13
  },
14
14
  setup(e) {
15
15
  const { t: a } = z();
16
- return (n, c) => (h(), Q("div", he, [
17
- y("span", Ce, A(m(a)("order.bindDeviceMessage")), 1),
16
+ return (n, c) => (_(), Q("div", _e, [
17
+ y("span", Ce, A(d(a)("order.bindDeviceMessage")), 1),
18
18
  y("div", Pe, A(e.otp), 1)
19
19
  ]));
20
20
  }
@@ -79,7 +79,8 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
79
79
  autoCloseBill: null,
80
80
  printReceiptAfterClose: null,
81
81
  allowReject: null,
82
- languages: null
82
+ languages: null,
83
+ minWeighGrams: null
83
84
  }, F = {
84
85
  payAtCounter: null,
85
86
  paid: null
@@ -89,7 +90,7 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
89
90
  kiosk: xe(e.kioskSettings, (a = e.sequenceSettings) == null ? void 0 : a.kioskDineIn)
90
91
  };
91
92
  }, xe = (e, a) => {
92
- var n, c, t, l, r, o, p, d, i, C, b, f;
93
+ var n, c, t, l, r, o, p, m, i, C, b, f;
93
94
  return {
94
95
  dineIn: Le(
95
96
  a ?? {
@@ -106,7 +107,7 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
106
107
  } : F
107
108
  },
108
109
  paymentSetting: {
109
- paymentTypes: ((d = e == null ? void 0 : e.paymentSetting) == null ? void 0 : d.paymentTypes) ?? [],
110
+ paymentTypes: ((m = e == null ? void 0 : e.paymentSetting) == null ? void 0 : m.paymentTypes) ?? [],
110
111
  offlinePaymentTypes: ((i = e == null ? void 0 : e.paymentSetting) == null ? void 0 : i.offlinePaymentTypes) ?? [],
111
112
  ePaymentTypes: ((C = e == null ? void 0 : e.paymentSetting) == null ? void 0 : C.ePaymentTypes) ?? ve.parse({
112
113
  card: {
@@ -142,10 +143,12 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
142
143
  allowReject: (e == null ? void 0 : e.allowReject) ?? null,
143
144
  // Stored [] means the same thing as unset ("all languages"), so collapse it
144
145
  // to null here — the form only ever has to reason about null vs a real set.
145
- languages: (f = e == null ? void 0 : e.languages) != null && f.length ? [...e.languages] : null
146
+ languages: (f = e == null ? void 0 : e.languages) != null && f.length ? [...e.languages] : null,
147
+ // KDI-5138. Read back so a save of any other kiosk field keeps it.
148
+ minWeighGrams: (e == null ? void 0 : e.minWeighGrams) ?? null
146
149
  };
147
150
  }, Le = (e, a) => {
148
- var n, c, t, l, r, o, p, d;
151
+ var n, c, t, l, r, o, p, m;
149
152
  return {
150
153
  enabled: !!a,
151
154
  sequenceNumber: e,
@@ -165,7 +168,7 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
165
168
  enablePaxDialog: a.displayStand.enablePaxDialog ?? !1,
166
169
  submitOrderInstruction: a.displayStand.submitOrderInstruction ? {
167
170
  payAtCounter: ((o = (r = a.displayStand.submitOrderInstruction) == null ? void 0 : r.payAtCounter) == null ? void 0 : o.en) ?? null,
168
- paid: ((d = (p = a.displayStand.submitOrderInstruction) == null ? void 0 : p.paid) == null ? void 0 : d.en) ?? null
171
+ paid: ((m = (p = a.displayStand.submitOrderInstruction) == null ? void 0 : p.paid) == null ? void 0 : m.en) ?? null
169
172
  } : F
170
173
  } : J
171
174
  };
@@ -217,6 +220,9 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
217
220
  // Omit rather than send [] when the merchant restricts nothing, so the
218
221
  // saved document stays free of a field that means "all languages" anyway.
219
222
  languages: (l = e.languages) != null && l.length ? e.languages : void 0,
223
+ // Omitted when unset: the backend $sets the whole kiosk subdocument, so a
224
+ // cleared minimum is removed instead of being stored as null.
225
+ minWeighGrams: e.minWeighGrams ?? void 0,
220
226
  paymentSetting: c(e.paymentSetting),
221
227
  takeaway: e.takeaway.submitOrderInstruction ? {
222
228
  submitOrderInstruction: {
@@ -240,26 +246,26 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
240
246
  } : {
241
247
  kioskSettings: n()
242
248
  };
243
- }, H = {
249
+ }, j = {
244
250
  convertOrderSettingDto: Re,
245
251
  toOrderKioskSettingsDto: Te
246
252
  }, Ue = be("orderSetting", () => {
247
253
  const e = v({});
248
254
  async function a() {
249
- const l = await j.getOrderSetting();
255
+ const l = await W.getOrderSetting();
250
256
  c(l);
251
257
  }
252
258
  async function n() {
253
259
  if (e.value.orderSetting && e.value.kiosk) {
254
- const { _id: l, ...r } = e.value.orderSetting, o = H.toOrderKioskSettingsDto(e.value.kiosk), p = {
260
+ const { _id: l, ...r } = e.value.orderSetting, o = j.toOrderKioskSettingsDto(e.value.kiosk), p = {
255
261
  ...r,
256
262
  kioskSettings: o.kioskSettings
257
- }, d = await j.updateOrderSetting(p);
258
- c(d);
263
+ }, m = await W.updateOrderSetting(p);
264
+ c(m);
259
265
  }
260
266
  }
261
267
  function c(l) {
262
- e.value.orderSetting = l, e.value.kiosk = H.convertOrderSettingDto(l).kiosk;
268
+ e.value.orderSetting = l, e.value.kiosk = j.convertOrderSettingDto(l).kiosk;
263
269
  }
264
270
  function t(l) {
265
271
  e.value.kiosk = l;
@@ -270,10 +276,10 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
270
276
  updateKioskSetting: n,
271
277
  setKioskOrderSetting: t
272
278
  };
273
- }), Ke = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ee = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Fe = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), De = /[^\p{L}\d]+/giu, W = "$1\0$2", X = "";
279
+ }), Ke = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ee = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Fe = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), De = /[^\p{L}\d]+/giu, G = "$1\0$2", H = "";
274
280
  function Z(e) {
275
281
  let a = e.trim();
276
- a = a.replace(Ke, W).replace(Ee, W), a = a.replace(De, "\0");
282
+ a = a.replace(Ke, G).replace(Ee, G), a = a.replace(De, "\0");
277
283
  let n = 0, c = a.length;
278
284
  for (; a.charAt(n) === "\0"; )
279
285
  n++;
@@ -308,7 +314,7 @@ function Me(e, a) {
308
314
  return (n) => `${a(n[0])}${e(n.slice(1))}`;
309
315
  }
310
316
  function Ne(e, a = {}) {
311
- const n = a.split ?? (a.separateNumbers ? qe : Z), c = a.prefixCharacters ?? X, t = a.suffixCharacters ?? X;
317
+ const n = a.split ?? (a.separateNumbers ? qe : Z), c = a.prefixCharacters ?? H, t = a.suffixCharacters ?? H;
312
318
  let l = 0, r = e.length;
313
319
  for (; l < e.length; ) {
314
320
  const o = e.charAt(l);
@@ -328,13 +334,13 @@ function Ne(e, a = {}) {
328
334
  e.slice(r)
329
335
  ];
330
336
  }
331
- const je = { class: "py-[1.5rem]" }, He = { class: "px-[1.5rem]" }, We = { class: "pt-[1.5rem]" }, Xe = { class: "flex flex-col gap-10" }, Ge = { class: "fm-typo-en-title-sm-600" }, Qe = { class: "fm-typo-en-title-sm-400" }, ea = /* @__PURE__ */ G({
337
+ const We = { class: "py-[1.5rem]" }, je = { class: "px-[1.5rem]" }, Ge = { class: "pt-[1.5rem]" }, He = { class: "flex flex-col gap-10" }, Xe = { class: "fm-typo-en-title-sm-600" }, Qe = { class: "fm-typo-en-title-sm-400" }, ea = /* @__PURE__ */ X({
332
338
  __name: "KioskView",
333
339
  setup(e) {
334
340
  var $, M;
335
- const { t: a } = z(), { canManageOrderSetting: n } = _e(), c = ue(
336
- () => import("./KioskSettingView-M3pBFSwt.js")
337
- ), t = v("device"), l = se(), r = Ue(), o = pe(), p = me(), { currentRestaurant: d, restaurants: i, changeRestaurant: C } = ye(), b = ie(), f = v((($ = d.value) == null ? void 0 : $._id) ?? void 0), I = v(null), R = v(""), D = v(null), q = T(() => {
341
+ const { t: a } = z(), { canManageOrderSetting: n } = he(), c = ue(
342
+ () => import("./KioskSettingView-CVck01e7.js")
343
+ ), t = v("device"), l = se(), r = Ue(), o = pe(), p = de(), { currentRestaurant: m, restaurants: i, changeRestaurant: C } = ye(), b = ie(), f = v((($ = m.value) == null ? void 0 : $._id) ?? void 0), I = v(null), R = v(""), D = v(null), q = T(() => {
338
344
  const u = R.value.trim().toLowerCase();
339
345
  return i.value.filter(
340
346
  (s) => !u || s.profile.name.toLowerCase().includes(u) || s._id.toLowerCase().includes(u)
@@ -347,16 +353,16 @@ const je = { class: "py-[1.5rem]" }, He = { class: "px-[1.5rem]" }, We = { class
347
353
  R.value = u;
348
354
  }
349
355
  function O(u) {
350
- var s, _;
356
+ var s, h;
351
357
  if (!u) {
352
358
  R.value = "";
353
359
  return;
354
360
  }
355
- (_ = (s = D.value) == null ? void 0 : s.querySelector("input")) == null || _.select();
361
+ (h = (s = D.value) == null ? void 0 : s.querySelector("input")) == null || h.select();
356
362
  }
357
- const P = v(((M = d.value) == null ? void 0 : M._id) ?? "");
363
+ const P = v(((M = m.value) == null ? void 0 : M._id) ?? "");
358
364
  async function B(u) {
359
- const s = i.value.find((_) => _._id == u);
365
+ const s = i.value.find((h) => h._id == u);
360
366
  await C(s), await V(), f.value = u, P.value = u;
361
367
  }
362
368
  async function V() {
@@ -414,7 +420,7 @@ const je = { class: "py-[1.5rem]" }, He = { class: "px-[1.5rem]" }, We = { class
414
420
  }
415
421
  return ce(async () => {
416
422
  var u;
417
- (u = d.value) != null && u._id && (P.value = d.value._id, await V());
423
+ (u = m.value) != null && u._id && (P.value = m.value._id, await V());
418
424
  }), re(
419
425
  () => i.value.length,
420
426
  async (u) => {
@@ -422,26 +428,26 @@ const je = { class: "py-[1.5rem]" }, He = { class: "px-[1.5rem]" }, We = { class
422
428
  },
423
429
  { immediate: !0 }
424
430
  ), (u, s) => {
425
- const _ = w("FmPageHead"), te = w("FmTabs"), le = w("FmMenuItem"), ne = w("FmSelect");
426
- return h(), Q("div", je, [
427
- U(_, {
428
- title: m(a)("order.kiosk")
431
+ const h = w("FmPageHead"), te = w("FmTabs"), le = w("FmMenuItem"), ne = w("FmSelect");
432
+ return _(), Q("div", We, [
433
+ U(h, {
434
+ title: d(a)("order.kiosk")
429
435
  }, null, 8, ["title"]),
430
- y("div", He, [
436
+ y("div", je, [
431
437
  U(te, {
432
438
  "model-value": t.value,
433
439
  "onUpdate:modelValue": s[0] || (s[0] = (L) => t.value = L),
434
440
  items: S.value
435
441
  }, null, 8, ["model-value", "items"]),
436
- y("div", We, [
437
- y("div", Xe, [
442
+ y("div", Ge, [
443
+ y("div", He, [
438
444
  y("div", {
439
445
  class: "flex flex-col gap-2",
440
446
  ref_key: "restaurantPicker",
441
447
  ref: D
442
448
  }, [
443
- y("span", Ge, A(m(a)("order.activateLocation")), 1),
444
- y("span", Qe, A(m(a)("order.selectRestaurant")) + ": ", 1),
449
+ y("span", Xe, A(d(a)("order.activateLocation")), 1),
450
+ y("span", Qe, A(d(a)("order.selectRestaurant")) + ": ", 1),
445
451
  U(ne, {
446
452
  class: "w-1/2",
447
453
  modelValue: f.value,
@@ -450,34 +456,34 @@ const je = { class: "py-[1.5rem]" }, He = { class: "px-[1.5rem]" }, We = { class
450
456
  B
451
457
  ],
452
458
  items: q.value,
453
- placeholder: m(a)("order.searchRestaurant"),
459
+ placeholder: d(a)("order.searchRestaurant"),
454
460
  searchable: "",
455
461
  "search-debounce": 150,
456
462
  "on-search": g,
457
463
  onDropdownChanged: O
458
464
  }, {
459
465
  "append-menu": oe(() => [
460
- q.value.length ? E("", !0) : (h(), K(le, {
466
+ q.value.length ? E("", !0) : (_(), K(le, {
461
467
  key: 0,
462
468
  disabled: "",
463
- label: m(a)("order.noRestaurantFound")
469
+ label: d(a)("order.noRestaurantFound")
464
470
  }, null, 8, ["label"]))
465
471
  ]),
466
472
  _: 1
467
473
  }, 8, ["modelValue", "items", "placeholder"])
468
474
  ], 512),
469
- t.value == "device" ? (h(), K(de, {
475
+ t.value == "device" ? (_(), K(me, {
470
476
  key: 0,
471
477
  devices: k.value,
472
478
  "load-error": I.value,
473
479
  onRequestOtp: ee,
474
480
  onRetry: x
475
481
  }, null, 8, ["devices", "load-error"])) : E("", !0),
476
- t.value == "setting" && m(n) ? (h(), K(m(c), {
482
+ t.value == "setting" && d(n) ? (_(), K(d(c), {
477
483
  key: `KioskSettingView-${P.value}`,
478
484
  "restaurant-id": P.value,
479
485
  onUpdateKioskOrderSetting: ae,
480
- form: m(r).state.kiosk ?? m(Ie)
486
+ form: d(r).state.kiosk ?? d(Ie)
481
487
  }, null, 8, ["restaurant-id", "form"])) : E("", !0)
482
488
  ])
483
489
  ])