@feedmepos/mf-order-setting 0.0.76 → 0.0.77

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 (81) hide show
  1. package/dist/{KioskDevicesView-H7stMDFu.js → KioskDevicesView-Dgs5_UoK.js} +1 -1
  2. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DgpV4oKE.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-B4DXPgAV.js} +3 -3
  3. package/dist/KioskSettingView-BUcPNVTc.js +681 -0
  4. package/dist/{KioskView-Cxcc1UL1.js → KioskView-DelVMMj4.js} +137 -127
  5. package/dist/{OrderSettingsView-Ds2L_rbu.js → OrderSettingsView-DE2U7vqW.js} +9232 -8262
  6. package/dist/{app-BDlPjU4y.js → app-BIvt4NBq.js} +1476 -1302
  7. package/dist/app.js +1 -1
  8. package/dist/{dayjs.min-OJf1trOq.js → dayjs.min-B58_jBg3.js} +1 -1
  9. package/dist/frontend/mf-order/src/api/index.d.ts +3 -1
  10. package/dist/frontend/mf-order/src/api/remoteOrder/index.d.ts +65 -2
  11. package/dist/frontend/mf-order/src/app.d.ts +174 -0
  12. package/dist/frontend/mf-order/src/composables/useInternalUser.d.ts +3 -0
  13. package/dist/frontend/mf-order/src/main.d.ts +174 -0
  14. package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +4 -0
  15. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +15 -3
  16. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/AdditionalStores.vue.d.ts +16 -0
  17. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +2 -2
  18. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/FoodpandaAdditionalStores.vue.d.ts +10 -0
  19. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +15 -4
  20. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegrationIdentityDetails.vue.d.ts +10 -0
  21. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ShopeefoodAdditionalStores.vue.d.ts +10 -0
  22. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  23. package/dist/index-CLS-FSH-.js +762 -0
  24. package/dist/{index-gGOpbnY3.js → index-CahsmFL1.js} +1 -1
  25. package/dist/{lineman-settings.dto-Cny_fF4n.js → lineman-settings.dto-DBDThIb0.js} +8999 -8874
  26. package/dist/package/entity/delivery/delivery.enum.d.ts +1 -1
  27. package/dist/package/entity/incoming-order/incoming-order.do.d.ts +4 -4
  28. package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +11 -0
  29. package/dist/package/entity/order-platform/base-integration.dto.d.ts +179 -0
  30. package/dist/package/entity/order-platform/deliveroo/deliveroo-dto.d.ts +2 -2
  31. package/dist/package/entity/order-platform/deliveroo/deliveroo-setting.do.d.ts +2 -2
  32. package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +2 -2
  33. package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +4 -4
  34. package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +4 -4
  35. package/dist/package/entity/order-platform/foodpanda/foodpanda-menu.dto.d.ts +1 -1
  36. package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +105 -4
  37. package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +30 -11
  38. package/dist/package/entity/order-platform/gofood/gofood-settings.do.d.ts +2 -2
  39. package/dist/package/entity/order-platform/gofood/gofood-settings.dto.d.ts +2 -2
  40. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +10 -10
  41. package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +134 -6
  42. package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +42 -20
  43. package/dist/package/entity/order-platform/lineman/lineman-settings.do.d.ts +2 -2
  44. package/dist/package/entity/order-platform/lineman/lineman-settings.dto.d.ts +2 -2
  45. package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +102 -4
  46. package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +66 -5
  47. package/dist/package/entity/order-platform/tng/tng-settings.do.d.ts +2 -2
  48. package/dist/package/entity/order-platform/tng/tng-settings.dto.d.ts +4 -4
  49. package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +2 -2
  50. package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +2 -2
  51. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +6 -0
  52. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +6 -0
  53. package/dist/package/entity/order-setting/order-setting.do.d.ts +14 -4
  54. package/dist/package/entity/order-setting/order-setting.dto.d.ts +28 -8
  55. package/dist/package/entity/restaurant/restaurant.dto.d.ts +10 -0
  56. package/dist/package/entity/websocket/websocket.dto.d.ts +24 -0
  57. package/dist/style.css +1 -1
  58. package/package.json +1 -1
  59. package/src/api/index.ts +8 -2
  60. package/src/api/remoteOrder/index.ts +200 -4
  61. package/src/composables/useInternalUser.ts +14 -0
  62. package/src/locales/en-US.json +43 -0
  63. package/src/locales/ja-JP.json +43 -0
  64. package/src/locales/th-TH.json +90 -45
  65. package/src/locales/zh-CN.json +43 -0
  66. package/src/modules/order-setting/kiosk/interface.ts +29 -19
  67. package/src/stores/order-setting/mapper.ts +65 -55
  68. package/src/views/kiosk/settings/KioskSettingView.vue +33 -0
  69. package/src/views/order-settings/delivery/DeliverySetting.vue +0 -1
  70. package/src/views/order-settings/delivery/delivery.data.ts +3 -0
  71. package/src/views/order-settings/delivery/integrated-delivery/AdditionalStores.vue +472 -0
  72. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaAdditionalStores.vue +314 -0
  73. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +27 -8
  74. package/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue +31 -12
  75. package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +23 -11
  76. package/src/views/order-settings/delivery/integrated-delivery/IntegrationIdentityDetails.vue +144 -0
  77. package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodAdditionalStores.vue +335 -0
  78. package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue +29 -8
  79. package/src/views/order-settings/queue/QueueSetting.vue +1 -1
  80. package/dist/KioskSettingView-fF6k9s_q.js +0 -658
  81. package/dist/index-Bid9lO2x.js +0 -665
@@ -1,665 +0,0 @@
1
- import { defineComponent as Q, ref as O, resolveComponent as F, openBlock as g, createElementBlock as E, createElementVNode as h, toDisplayString as C, createVNode as D, unref as $, createBlock as j, computed as N, watch as ne, onMounted as ae, withCtx as M, createTextVNode as re, createCommentVNode as x, Fragment as oe, renderList as se, renderSlot as ue } from "vue";
2
- import { e as w } from "./app-BDlPjU4y.js";
3
- import { useDialog as le, useSnackbar as ie } from "@feedmepos/ui-library";
4
- import { useI18n as G, useCoreStore as te } from "@feedmepos/mf-common";
5
- import { defineStore as de } from "pinia";
6
- import { r as R, g as n, x as V, w as z, e as q } from "./lineman-settings.dto-Cny_fF4n.js";
7
- const ce = /* @__PURE__ */ Q({
8
- __name: "OfflinePaymentTypeDialogContent",
9
- props: {
10
- name: {},
11
- instruction: {}
12
- },
13
- emits: ["update:nameValue", "update:instructionValue"],
14
- setup(e, { emit: t }) {
15
- const { t: u } = G(), y = e, r = t, f = O("");
16
- function m(b) {
17
- r("update:nameValue", b);
18
- }
19
- function P(b) {
20
- r("update:instructionValue", b);
21
- }
22
- return (b, v) => {
23
- const _ = F("FmTextField"), c = F("FmTextarea");
24
- return g(), E("div", null, [
25
- h("span", null, C(y.name), 1),
26
- D(_, {
27
- "model-value": f.value,
28
- "onUpdate:modelValue": m,
29
- placeholder: $(u)("order.enterPaymentName"),
30
- rules: [(i) => !!i || $(u)("order.fieldCannotBeEmpty")]
31
- }, null, 8, ["model-value", "placeholder", "rules"]),
32
- v[0] || (v[0] = h("div", { class: "mb-12" }, null, -1)),
33
- h("span", null, C(y.instruction), 1),
34
- D(c, {
35
- "model-value": f.value,
36
- "onUpdate:modelValue": P,
37
- placeholder: $(u)("order.enterPaymentInstruction")
38
- }, null, 8, ["model-value", "placeholder"])
39
- ]);
40
- };
41
- }
42
- }), pe = /* @__PURE__ */ Q({
43
- __name: "OfflinePaymentTypeDialog",
44
- emits: ["add:offline-payment-type"],
45
- setup(e, { emit: t }) {
46
- const { t: u } = G(), y = le(), r = O(""), f = O(""), m = () => {
47
- r.value = "", f.value = "", y.open({
48
- title: u("order.addCustomPayment"),
49
- contentComponent: ce,
50
- contentComponentProps: {
51
- name: u("order.name"),
52
- instruction: u("order.instruction"),
53
- "onUpdate:nameValue": (v) => {
54
- r.value = v;
55
- },
56
- "onUpdate:instructionValue": (v) => {
57
- f.value = v;
58
- }
59
- },
60
- primaryActions: { text: u("order.add"), close: !0 },
61
- secondaryActions: { text: u("order.cancel"), close: !0 }
62
- }).onPrimary(async () => {
63
- const v = {
64
- name: r.value,
65
- instruction: f.value
66
- };
67
- await P(v);
68
- });
69
- };
70
- async function P(v) {
71
- b("add:offline-payment-type", v);
72
- }
73
- const b = t;
74
- return (v, _) => {
75
- const c = F("FmButton");
76
- return g(), j(c, {
77
- label: $(u)("order.editOfflinePayment"),
78
- onClick: m,
79
- variant: "plain"
80
- }, null, 8, ["label"]);
81
- };
82
- }
83
- }), ye = { class: "flex flex-col gap-3" }, fe = { class: "flex-grow fm-typo-en-title-sm-600" }, me = { class: "flex flex-row items-center" }, ve = { key: 0 }, ge = { key: 0 }, we = { class: "font-bold" }, he = { class: "mt-3" }, Pe = {
84
- key: 1,
85
- class: "text-fm-color-secondary-salmon fm-typo-en-body-sm-600 ml-7"
86
- }, be = {
87
- key: 2,
88
- class: "ml-7"
89
- }, _e = {
90
- key: 4,
91
- class: "text-fm-color-secondary-salmon fm-typo-en-body-sm-600 ml-7"
92
- }, Re = /* @__PURE__ */ Q({
93
- __name: "PaymentType",
94
- props: {
95
- paymentTypes: {
96
- type: Array,
97
- required: !0
98
- },
99
- offlinePaymentTypes: {
100
- type: Array,
101
- required: !0
102
- },
103
- showDisabledOptions: {
104
- type: Boolean,
105
- default: !1
106
- },
107
- disabledSuffixes: {
108
- type: Object,
109
- default: () => ({})
110
- },
111
- allowEPayment: {
112
- type: [Boolean, String],
113
- required: !0
114
- },
115
- allowCredit: {
116
- type: [Boolean, String],
117
- default: !1
118
- },
119
- maxCustomPayment: {
120
- type: Number,
121
- default: void 0
122
- }
123
- },
124
- emits: ["update:paymentTypes", "update:offlinePaymentTypes"],
125
- setup(e, { emit: t }) {
126
- const { t: u } = G(), { currentRestaurant: y } = te(), r = e, f = t;
127
- async function m(l) {
128
- f(
129
- "update:offlinePaymentTypes",
130
- r.offlinePaymentTypes.filter((d, p) => p !== l)
131
- );
132
- }
133
- const P = N(() => (r.paymentTypes || []).includes(w.F_ORDER_PAYMENT_TYPE.enum.ePayment)), b = N(() => (r.paymentTypes || []).includes(w.F_ORDER_PAYMENT_TYPE.enum.credit)), v = N(() => {
134
- const l = r.paymentTypes || [], d = r.offlinePaymentTypes || [];
135
- return l.includes(w.F_ORDER_PAYMENT_TYPE.enum.cash) || d.length > 0;
136
- }), _ = O(!1), c = O([]), i = N(() => [
137
- { label: u("order.offlinePayment"), value: "offline" },
138
- {
139
- label: u("order.ePayment"),
140
- value: "e-payment",
141
- disable: !r.allowEPayment,
142
- suffix: !r.allowEPayment && r.showDisabledOptions ? {
143
- text: `(${r.disabledSuffixes["e-payment"] || u("order.notAllowed")})`,
144
- class: "text-negative t-system"
145
- } : void 0
146
- },
147
- {
148
- label: u("order.credit"),
149
- value: "credit",
150
- disable: !r.allowCredit,
151
- suffix: !r.allowCredit && r.showDisabledOptions ? {
152
- text: `(${r.disabledSuffixes.credit || u("order.notAllowed")})`,
153
- class: "text-negative t-system"
154
- } : void 0
155
- }
156
- ]), k = () => {
157
- const l = [];
158
- v.value && l.push("offline"), P.value && l.push("e-payment"), b.value && l.push("credit"), c.value = l;
159
- let d = 0;
160
- r.showDisabledOptions ? d = i.value.length : d = i.value.filter((p) => !(p.value === "e-payment" && !r.allowEPayment || p.value === "credit" && !r.allowCredit)).length, _.value = l.length === d && l.length > 0;
161
- };
162
- k();
163
- const B = (l) => {
164
- const d = i.value.filter((o) => !(o.value === "e-payment" && !r.allowEPayment || o.value === "credit" && !r.allowCredit));
165
- c.value = l ? d.map((o) => o.value) : [], _.value = l;
166
- const p = [], a = l ? r.offlinePaymentTypes || [] : [];
167
- c.value.includes("e-payment") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.ePayment), c.value.includes("offline") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.cash), c.value.includes("credit") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.credit), f("update:paymentTypes", p), f("update:offlinePaymentTypes", a);
168
- }, A = (l) => {
169
- c.value = l, r.showDisabledOptions ? i.value.length : i.value.filter((o) => !(o.value === "e-payment" && !r.allowEPayment || o.value === "credit" && !r.allowCredit)).length;
170
- const d = i.value.filter((o) => !(o.value === "e-payment" && !r.allowEPayment || o.value === "credit" && !r.allowCredit)).length;
171
- _.value = l.length === d && l.length > 0;
172
- const p = [], a = l.includes("offline") ? r.offlinePaymentTypes || [] : [];
173
- l.includes("e-payment") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.ePayment), l.includes("offline") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.cash), l.includes("credit") && p.push(w.F_ORDER_PAYMENT_TYPE.enum.credit), f("update:paymentTypes", p), f("update:offlinePaymentTypes", a);
174
- };
175
- return ne(
176
- () => y.value,
177
- (l) => {
178
- k();
179
- },
180
- { immediate: !0 }
181
- ), ae(() => {
182
- k();
183
- }), (l, d) => {
184
- var L, W, H, J, K, X, Z;
185
- const p = F("FmCheckbox"), a = F("FmCardSection"), o = F("FmCard"), Y = F("FmButton");
186
- return g(), E("div", ye, [
187
- h("div", fe, C($(u)("order.acceptedPayment")), 1),
188
- D(p, {
189
- value: "",
190
- "model-value": _.value,
191
- label: $(u)("order.all"),
192
- indeterminate: c.value.length > 0 && !_.value,
193
- "onUpdate:modelValue": B
194
- }, null, 8, ["model-value", "label", "indeterminate"]),
195
- h("div", me, [
196
- D(p, {
197
- modelValue: c.value,
198
- "onUpdate:modelValue": [
199
- d[0] || (d[0] = (T) => c.value = T),
200
- A
201
- ],
202
- label: i.value[0].label,
203
- value: i.value[0].value
204
- }, null, 8, ["modelValue", "label", "value"])
205
- ]),
206
- c.value.includes(i.value[0].value) ? (g(), E("div", ve, [
207
- ((L = e.offlinePaymentTypes) == null ? void 0 : L.length) === 0 ? (g(), E("div", ge, [
208
- D(o, { variant: "outlined" }, {
209
- default: M(() => [
210
- D(a, null, {
211
- default: M(() => [
212
- re(C($(u)("order.cash")), 1)
213
- ]),
214
- _: 1
215
- })
216
- ]),
217
- _: 1
218
- })
219
- ])) : x("", !0),
220
- (g(!0), E(oe, null, se(e.offlinePaymentTypes, (T, ee) => (g(), E("p", { key: ee }, [
221
- D(o, {
222
- variant: "outlined",
223
- class: "mb-3"
224
- }, {
225
- default: M(() => [
226
- D(a, { class: "flex items-center justify-between" }, {
227
- default: M(() => [
228
- h("div", null, [
229
- h("span", we, C(T.name), 1),
230
- d[4] || (d[4] = h("br", null, null, -1)),
231
- h("span", null, C(T.instruction), 1)
232
- ]),
233
- h("div", null, [
234
- D(Y, {
235
- "append-icon": "delete",
236
- variant: "plain",
237
- onClick: (Se) => m(ee)
238
- }, null, 8, ["onClick"])
239
- ])
240
- ]),
241
- _: 2
242
- }, 1024)
243
- ]),
244
- _: 2
245
- }, 1024)
246
- ]))), 128)),
247
- h("div", he, [
248
- e.offlinePaymentTypes.length === 0 || e.showDisabledOptions ? (g(), j(pe, {
249
- key: 0,
250
- "onAdd:offlinePaymentType": d[1] || (d[1] = (T) => f("update:offlinePaymentTypes", [...r.offlinePaymentTypes, T]))
251
- })) : x("", !0)
252
- ])
253
- ])) : x("", !0),
254
- D(p, {
255
- modelValue: c.value,
256
- "onUpdate:modelValue": [
257
- d[2] || (d[2] = (T) => c.value = T),
258
- A
259
- ],
260
- label: i.value[1].label,
261
- value: i.value[1].value,
262
- disabled: i.value[1].disable
263
- }, null, 8, ["modelValue", "label", "value", "disabled"]),
264
- i.value[1].suffix ? (g(), E("div", Pe, C((J = (H = (W = i.value) == null ? void 0 : W[1]) == null ? void 0 : H.suffix) == null ? void 0 : J.text), 1)) : x("", !0),
265
- c.value.includes("e-payment") ? (g(), E("div", be, [
266
- ue(l.$slots, "e-payment-content")
267
- ])) : x("", !0),
268
- e.allowCredit || e.showDisabledOptions ? (g(), j(p, {
269
- key: 3,
270
- modelValue: c.value,
271
- "onUpdate:modelValue": [
272
- d[3] || (d[3] = (T) => c.value = T),
273
- A
274
- ],
275
- label: i.value[2].label,
276
- value: i.value[2].value,
277
- disabled: i.value[2].disable
278
- }, null, 8, ["modelValue", "label", "value", "disabled"])) : x("", !0),
279
- i.value[2].suffix ? (g(), E("div", _e, C((Z = (X = (K = i.value) == null ? void 0 : K[2]) == null ? void 0 : X.suffix) == null ? void 0 : Z.text), 1)) : x("", !0)
280
- ]);
281
- };
282
- }
283
- }), I = {
284
- async readRestaurantSetting(e) {
285
- const t = await V().get(`/restaurants/${e}/restaurant-setting`);
286
- return n(t);
287
- },
288
- async updateDineInSetting(e) {
289
- const t = await R().put("/dine-in", e);
290
- return n(t);
291
- },
292
- async updatePickupSetting(e) {
293
- const t = await R().put("/pickup", e);
294
- return n(t);
295
- },
296
- async updateDriveThruSetting(e) {
297
- const t = await R().put("/drive-thru", e);
298
- return n(t);
299
- },
300
- async updateServiceCharge(e) {
301
- const t = await R().put("/service-charge-setting", e);
302
- return n(t);
303
- },
304
- async getMobileOrderSetting() {
305
- return await n(await R().get("/order-settings"));
306
- },
307
- async updateQueueSetting(e, t) {
308
- const u = await R().put("/queue", t);
309
- return n(u);
310
- }
311
- }, s = (e) => {
312
- const t = `/${e}`;
313
- return V(t, "portal");
314
- }, U = () => {
315
- const e = z.getRestaurantId();
316
- if (!e) throw new Error("Invalid restaurant ID");
317
- const { linkedDeliveryBackend: t } = z.getBackendUrl(), u = `${t}/restaurants/${e}/linked-deliveries`;
318
- return V("", "portal", { url: u });
319
- }, S = {
320
- async readLinkedDeliveryCompanies() {
321
- return n(await U().get(""));
322
- },
323
- async readLocalDeliveryCompanies() {
324
- return n(await V().get("/deliveries"));
325
- },
326
- async createDeliveryCompany(e) {
327
- return n(await U().post("", e));
328
- },
329
- async updateDeliveryCompany(e) {
330
- return n(await U().put(`/${e._id}`, e));
331
- },
332
- async deleteDeliveryCompany(e) {
333
- return n(await U().delete(`/${e._id}`));
334
- },
335
- integratedDelivery: {
336
- async updateInhouse(e, t) {
337
- return n(
338
- await V().put(`/restaurants/${e}/in-house-delivery`, t)
339
- );
340
- },
341
- async updateFeedme(e, t) {
342
- return n(
343
- await V().put(`/restaurants/${e}/feedme-delivery`, t)
344
- );
345
- },
346
- async readFoodpanda(e) {
347
- return n(await s("foodpanda").get(`/setting/${e}`));
348
- },
349
- async readFoodpandaOrders(e) {
350
- return n(await s("foodpanda").get("/order", { params: e }));
351
- },
352
- async reflowFoodpandaOrders(e) {
353
- return n(await s("foodpanda").put(`/order/reflow/${e}`));
354
- },
355
- async rejectFoodpandaOrders(e) {
356
- return n(await s("foodpanda").put(`/order/void/${e}`));
357
- },
358
- async updateFoodpanda(e, t) {
359
- return n(
360
- await s("foodpanda").put(`/setting/${e}`, {
361
- _id: e,
362
- ...t
363
- })
364
- );
365
- },
366
- async syncFoodpandaMenu(e) {
367
- return n(await s("foodpanda").put(`/menu-sync/${e}`));
368
- },
369
- async readGrabfood(e) {
370
- return n(await s("grabfood").get(`/setting/${e}`));
371
- },
372
- async readGrabfoodOrders(e) {
373
- return n(await s("grabfood").get("/order", { params: e }));
374
- },
375
- async reflowGrabfoodOrders(e) {
376
- return n(await s("grabfood").put(`/order/reflow/${e}`));
377
- },
378
- async rejectGrabfoodOrders(e) {
379
- return n(await s("grabfood").put(`/order/void/${e}`));
380
- },
381
- async updateGrabfood(e, t) {
382
- return n(
383
- await s("grabfood").put(`/setting/${e}`, {
384
- _id: e,
385
- ...t
386
- })
387
- );
388
- },
389
- async syncGrabfoodMenu(e) {
390
- return n(await s("grabfood").get(`/menu-sync/${e}`));
391
- },
392
- async startSelfServeFlow(e) {
393
- return n(
394
- await s("grabfood").get(`/setting/integration-url/${e}`)
395
- );
396
- },
397
- async readShopeefood(e) {
398
- return n(await s("shopeefood").get(`/setting/${e}`));
399
- },
400
- async readShopeefoodOrders(e) {
401
- return n(await s("shopeefood").get("/order", { params: e }));
402
- },
403
- async reflowShopeefoodOrders(e) {
404
- return n(await s("shopeefood").put(`/order/reflow/${e}`));
405
- },
406
- async rejectShopeefoodOrders(e) {
407
- return n(await s("shopeefood").put(`/order/void/${e}`));
408
- },
409
- async updateShopeefood(e, t) {
410
- return n(
411
- await s("shopeefood").put(`/setting/${e}`, {
412
- _id: e,
413
- ...t
414
- })
415
- );
416
- },
417
- async syncShopeefoodMenu(e) {
418
- return n(await s("shopeefood").get(`/menu-sync/${e}`));
419
- },
420
- async readGofood(e) {
421
- return n(await s("gofood").get(`/setting/${e}`));
422
- },
423
- async updateGofood(e, t) {
424
- return n(
425
- await s("gofood").put(`/setting/${e}`, {
426
- ...t,
427
- _id: e
428
- })
429
- );
430
- },
431
- async syncGofoodMenu(e) {
432
- return n(await s("gofood").get(`/menu-sync/${e}`));
433
- },
434
- async readLineman(e) {
435
- return n(await s("lineman").get(`/setting/${e}`));
436
- },
437
- async updateLineman(e, t) {
438
- return n(
439
- await s("lineman").put(`/setting/${e}`, {
440
- ...t,
441
- _id: e
442
- })
443
- );
444
- },
445
- async updateDeliveroo(e, t) {
446
- return n(
447
- await s("deliveroo").put(`/setting/${e}`, {
448
- _id: e,
449
- ...t
450
- })
451
- );
452
- },
453
- async readDeliveroo(e) {
454
- return n(await s("deliveroo").get(`/setting/${e}`));
455
- },
456
- async syncDeliverooMenu(e) {
457
- return n(await s("deliveroo").get(`/menu-sync/${e}`));
458
- },
459
- async readTng(e) {
460
- return n(await s("tng").get(`/setting/${e}`));
461
- },
462
- async updateTng(e, t) {
463
- return n(
464
- await s("tng").put(`/setting/${e}`, {
465
- _id: e,
466
- ...t
467
- })
468
- );
469
- },
470
- async syncTngMenu(e) {
471
- return n(await s("tng").put(`/menu-sync/${e}`));
472
- },
473
- async readExternal(e) {
474
- return n(await s("external").get(`/setting/${e}`));
475
- },
476
- async updateExternal(e, t) {
477
- return n(
478
- await s("external").put(`setting/${e}`, {
479
- ...t
480
- })
481
- );
482
- },
483
- async syncExternalMenu(e) {
484
- return n(await s("external").get(`/menu-sync/${e}`));
485
- },
486
- async flowTestOrder(e, t) {
487
- return n(await s(t).put(`/test-order/${e}`));
488
- },
489
- async cancelTestOrder(e, t) {
490
- return n(
491
- await s(t).put(`/test-order/cancel/${e}`)
492
- );
493
- },
494
- async reflowFpOrderNotInDb(e) {
495
- return n(await s("foodpanda").put("/order/reconcile", e));
496
- },
497
- async reflowGfOrderNotInDb(e) {
498
- return n(await s("grabfood").put("/order/reconcile", e));
499
- }
500
- }
501
- };
502
- function Te() {
503
- return {
504
- restaurantSettings: {}
505
- };
506
- }
507
- const Ve = de("restaurant", () => {
508
- const e = te(), t = O(Te()), u = N(
509
- () => {
510
- var a;
511
- return t.value.restaurantSettings[((a = e.currentRestaurant.value) == null ? void 0 : a._id) || ""];
512
- }
513
- );
514
- async function y(a) {
515
- const o = await I.readRestaurantSetting(a);
516
- return t.value.restaurantSettings = {
517
- ...t.value.restaurantSettings,
518
- [a]: o
519
- }, o;
520
- }
521
- async function r(a) {
522
- await y(a), z.setRestaurantId(a), setRestaurantId(a), q.FeatureFlag.setRestaurant(a || void 0), localStorage.set("feedme_restaurant", a);
523
- }
524
- async function f(a) {
525
- await I.updateServiceCharge(a);
526
- }
527
- async function m(a) {
528
- await I.updateDineInSetting(a);
529
- }
530
- async function P(a) {
531
- await I.updatePickupSetting(a);
532
- }
533
- async function b(a) {
534
- await I.updateDriveThruSetting(a);
535
- }
536
- async function v(a, o) {
537
- await S.integratedDelivery.updateInhouse(a, o);
538
- }
539
- async function _(a, o) {
540
- return await S.integratedDelivery.updateFeedme(a, o);
541
- }
542
- async function c(a, o) {
543
- await S.integratedDelivery.updateFoodpanda(a, o);
544
- }
545
- async function i(a, o) {
546
- await S.integratedDelivery.updateGrabfood(a, o);
547
- }
548
- async function k(a, o) {
549
- await S.integratedDelivery.updateLineman(a, o);
550
- }
551
- async function B(a, o) {
552
- await S.integratedDelivery.updateShopeefood(a, o);
553
- }
554
- async function A(a, o) {
555
- await S.integratedDelivery.updateGofood(a, o);
556
- }
557
- async function l(a, o) {
558
- await S.integratedDelivery.updateDeliveroo(a, o);
559
- }
560
- async function d(a, o) {
561
- await S.integratedDelivery.updateExternal(a, o);
562
- }
563
- function p() {
564
- const { t: a } = G();
565
- if (!e.currentRestaurant.value)
566
- return "getRestaurantEPayment - Invalid restaurant ";
567
- const o = e.currentRestaurant.value.payoutAccount, Y = e.currentRestaurant.value.posVersion;
568
- return !!Y && q.Pos.canUse({
569
- feature: w.F_FEATURE.enum.qrEPayment,
570
- posVersion: Y
571
- }) ? !o || !o.enable || o.status !== w.F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED ? a("order.payoutAccountIsRequired") : !0 : a("order.payoutPosVersion", { version: q.Pos.minVersionToUse(w.F_FEATURE.enum.qrEPayment) });
572
- }
573
- return {
574
- state: t.value,
575
- currentRestaurantSetting: u.value,
576
- readRestaurantSetting: y,
577
- selectRestaurant: r,
578
- updateServiceCharge: f,
579
- updateDineInSetting: m,
580
- updatePickupSetting: P,
581
- updateDriveThruSetting: b,
582
- updateInhouseDelivery: v,
583
- updateFeedmeDelivery: _,
584
- updateIntegratedFoodpandaDelivery: c,
585
- updateIntegratedGrabfoodDelivery: i,
586
- updateIntegratedLinemanDelivery: k,
587
- updateIntegratedShopeefoodDelivery: B,
588
- updateIntegratedGofoodDelivery: A,
589
- updateIntegratedDeliverooDelivery: l,
590
- updateExternalDelivery: d,
591
- getRestaurantEPayment: p
592
- };
593
- });
594
- function De() {
595
- const e = ie();
596
- function t(m) {
597
- e.open({
598
- type: "success",
599
- message: m,
600
- position: "bottom"
601
- });
602
- }
603
- function u(m) {
604
- e.open({
605
- type: "error",
606
- message: m,
607
- position: "bottom"
608
- });
609
- }
610
- let y = null;
611
- function r(m) {
612
- return y = e.open({
613
- type: "neutral",
614
- spinner: !0,
615
- message: m,
616
- position: "bottom",
617
- persistent: !0
618
- // Ensure the snackbar stays visible until manually closed
619
- }), y;
620
- }
621
- function f() {
622
- y && (e.close(y), y = null);
623
- }
624
- return { showSuccess: t, showError: u, showLoading: r, closeLoadingSnackbar: f };
625
- }
626
- const ke = () => {
627
- const { showError: e } = De(), t = O(!1);
628
- function u() {
629
- t.value = !0;
630
- }
631
- function y() {
632
- t.value = !1;
633
- }
634
- async function r(m) {
635
- try {
636
- return u(), await m();
637
- } finally {
638
- y();
639
- }
640
- }
641
- async function f(m) {
642
- try {
643
- return u(), await m();
644
- } catch (P) {
645
- throw e(`${P}`), P;
646
- } finally {
647
- y();
648
- }
649
- }
650
- return {
651
- isLoading: t,
652
- startLoading: u,
653
- stopLoading: y,
654
- startAsyncCall: r,
655
- startAsyncCallWithErr: f
656
- };
657
- };
658
- export {
659
- Re as _,
660
- Ve as a,
661
- De as b,
662
- I as c,
663
- S as r,
664
- ke as u
665
- };