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