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