@feedmepos/mf-payment 1.10.1 → 1.10.3-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-Usbgr7kF.js → Actions.vue_vue_type_script_setup_true_lang-DcKc6Mnj.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-BL0YSULz.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-Dkk3qHSc.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-Dr3ukTqT.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-1V2lCr7u.js} +2 -2
  4. package/dist/{Chargeback-R3C9hCdW.js → Chargeback-DFnzY7Gi.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-BA0tliZY.js → DocumentViewer.vue_vue_type_script_setup_true_lang-CHRAaFkC.js} +9 -4
  6. package/dist/{ExternalTerminal-Ddh92c0F.js → ExternalTerminal-DYvze0g4.js} +6 -6
  7. package/dist/OnboardForm-DKEcXN5n.js +22522 -0
  8. package/dist/OnboardForm-qpFznSnd.js +1509 -0
  9. package/dist/{OnboardSubmission-DuQfgTqo.js → OnboardSubmission-BXpmgybz.js} +6 -6
  10. package/dist/{OnboardSubmission-BQhzQfe9.js → OnboardSubmission-CAIOEQSH.js} +3 -3
  11. package/dist/{PayoutAccount-CSZugVuH.js → PayoutAccount-BJIgQlse.js} +5 -5
  12. package/dist/{PayoutAccount-C5WL89y2.js → PayoutAccount-DN3Pd1LL.js} +7 -7
  13. package/dist/{PayoutAccountSetting-DQI4lLoZ.js → PayoutAccountSetting-DiZk3a4E.js} +6 -6
  14. package/dist/{Restaurant-qbYHDe7-.js → Restaurant-ffoGQUNm.js} +4 -4
  15. package/dist/{RestaurantSetting-v8GFyIFz.js → RestaurantSetting-BfDN099v.js} +3 -3
  16. package/dist/{Settlement-BSOG3EUJ.js → Settlement-BKD01FuC.js} +4 -4
  17. package/dist/{Settlement-BlSzZ4WA.js → Settlement-D-EWIBGV.js} +3 -3
  18. package/dist/{SettlementTransactions-B4I5CJw7.js → SettlementTransactions-DEUCKt62.js} +5 -5
  19. package/dist/{SettlementTransactions-hKOJ_dvI.js → SettlementTransactions-DpASwN3Z.js} +5 -5
  20. package/dist/{Status.vue_vue_type_script_setup_true_lang-9owCIn7j.js → Status.vue_vue_type_script_setup_true_lang-B6znlJS3.js} +1 -1
  21. package/dist/{Terminal-6wkTv7Qg.js → Terminal-S9Qxw0Tb.js} +6 -6
  22. package/dist/{TerminalSetting-CwuYBf2Q.js → TerminalSetting-U5eIXKfr.js} +6 -6
  23. package/dist/{Transaction-Ba1Yvx6P.js → Transaction-Cq3aE7uT.js} +11 -11
  24. package/dist/{Transaction-B9J9Jm36.js → Transaction-yIPyGTjd.js} +10 -10
  25. package/dist/{TransactionOld-Oil317DD.js → TransactionOld-DN88UGgf.js} +7 -7
  26. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-COzutx3-.js → TransactionStatus.vue_vue_type_script_setup_true_lang-BDo5sxfe.js} +1 -1
  27. package/dist/{app-_eJTNh14.js → app-CrSGwbBW.js} +362 -353
  28. package/dist/app.js +1 -1
  29. package/dist/{assets-DWG3k-R6.js → assets-GIXFmwP9.js} +1 -1
  30. package/dist/components/PDFViewer.vue.d.ts +11 -1
  31. package/dist/{grafana-DU0SqBMy.js → grafana-DwaZqlbQ.js} +1 -1
  32. package/dist/{index-D-zfRxxy.js → index-9UcL7FCB.js} +2 -2
  33. package/dist/{index-BnAD1CHo.js → index-CB7KfPlb.js} +1 -1
  34. package/dist/{index-CaRLBdsz.js → index-CIKDmuQi.js} +1 -1
  35. package/dist/{index-CYECWgNT.js → index-CN5tJWm7.js} +1 -1
  36. package/dist/{index-ClxJT-vp.js → index-CfVaap-8.js} +1 -1
  37. package/dist/{index-BjGftD0Z.js → index-ClczGi8g.js} +1 -1
  38. package/dist/{index-BxLU42iO.js → index-Cu8yFPkY.js} +1 -1
  39. package/dist/{index-BNYl5gy7.js → index-D23UO8yJ.js} +1 -1
  40. package/dist/{index-CL1MBNYX.js → index-D_d-ON1L.js} +1 -1
  41. package/dist/{index-CaVNfSJd.js → index-k-EHl8ar.js} +1 -1
  42. package/dist/{index.vue_vue_type_script_setup_true_lang-Dru_cUnL.js → index.vue_vue_type_script_setup_true_lang-BER8L9tc.js} +1 -1
  43. package/dist/{onboard-submission-_jgECm5X.js → onboard-submission-CjvHj3j4.js} +1 -1
  44. package/dist/package.json +1 -1
  45. package/dist/{payout-account-BBgOCiI9.js → payout-account-kg84B_VE.js} +3 -3
  46. package/dist/style.css +1 -1
  47. package/dist/tsconfig.app.tsbuildinfo +1 -1
  48. package/dist/views/admin/onboard-submission/cell/UploadButton.vue.d.ts +1 -1
  49. package/dist/views/onboard-submission/cell/UploadButton.vue.d.ts +1 -1
  50. package/package.json +1 -1
  51. package/dist/OnboardForm-BsGjofaE.js +0 -22368
  52. package/dist/OnboardForm-CLjI-GP2.js +0 -1448
@@ -1,1448 +0,0 @@
1
- import { defineComponent as Z, ref as E, computed as W, resolveComponent as C, openBlock as b, createElementBlock as P, createElementVNode as n, toDisplayString as U, createBlock as T, withCtx as f, createCommentVNode as A, createVNode as r, unref as e, Fragment as J, renderList as le, createTextVNode as z, onMounted as pe, resolveDynamicComponent as be } from "vue";
2
- import { o as H } from "./index-D-zfRxxy.js";
3
- import { u as te, p as oe } from "./index-CYECWgNT.js";
4
- import { useRouter as ce } from "vue-router";
5
- import { z as u, a as d } from "./validator-CTlVogBQ.js";
6
- import { P as ye } from "./payout-account-BBgOCiI9.js";
7
- import { a as ge } from "./onboard-submission-_jgECm5X.js";
8
- import { _ as re } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-BA0tliZY.js";
9
- import { s as Ve } from "./vue-signature-pad.esm-IXPjf4fL.js";
10
- import { _ as ie } from "./Status.vue_vue_type_script_setup_true_lang-9owCIn7j.js";
11
- import { useSnackbar as ae } from "@feedmepos/ui-library";
12
- import { u as Q } from "./error-K1CakhA9.js";
13
- const ve = ["src"], F = /* @__PURE__ */ Z({
14
- __name: "UploadButton",
15
- props: {
16
- modelValue: {},
17
- label: {},
18
- type: {},
19
- restaurantId: {}
20
- },
21
- emits: ["update:modelValue"],
22
- setup(m, { emit: O }) {
23
- const v = m, k = E(v.modelValue), g = O, w = (a) => {
24
- const i = new FileReader();
25
- i.onload = (x) => {
26
- var V;
27
- k.value = (V = x.target) == null ? void 0 : V.result, g("update:modelValue", a);
28
- }, i.readAsDataURL(a);
29
- }, c = (a) => {
30
- window.open(a, "_blank", "noopener,noreferrer");
31
- }, R = W(() => v.type === "image" ? ".png, .jpg, .jpeg" : ".pdf");
32
- return (a, i) => {
33
- const x = C("FmButton"), V = C("FmDropField");
34
- return b(), P("div", null, [
35
- n("p", null, U(m.label), 1),
36
- k.value ? (b(), T(re, {
37
- key: 0,
38
- document: k.value,
39
- "restaurant-id": m.restaurantId
40
- }, {
41
- default: f(({ src: I }) => [
42
- m.type === "image" ? (b(), P("img", {
43
- key: 0,
44
- src: I
45
- }, null, 8, ve)) : A("", !0),
46
- m.type === "pdf" ? (b(), T(x, {
47
- key: 1,
48
- class: "mt-4 w-full",
49
- "prepend-icon": "manage_accounts",
50
- label: "View Document",
51
- variant: "primary",
52
- onVnodeMounted: () => c(I),
53
- onClick: () => c(I)
54
- }, null, 8, ["onVnodeMounted", "onClick"])) : A("", !0)
55
- ]),
56
- _: 1
57
- }, 8, ["document", "restaurant-id"])) : (b(), T(V, {
58
- key: 1,
59
- accept: R.value,
60
- onFileUpload: w
61
- }, null, 8, ["accept"]))
62
- ]);
63
- };
64
- }
65
- }), fe = ["src"], ke = {
66
- key: 0,
67
- class: "text-center text-red-700 py-4"
68
- }, Ce = { class: "flex justify-evenly py-3" }, Ne = /* @__PURE__ */ Z({
69
- __name: "SignatureBoard",
70
- props: {
71
- modelValue: {},
72
- label: {},
73
- restaurantId: {}
74
- },
75
- emits: ["update:modelValue"],
76
- setup(m, { emit: O }) {
77
- const v = m, k = O, g = E(v.modelValue), w = E(!1), c = E(), R = E(!1);
78
- function a(x, V) {
79
- var D;
80
- const I = x.split(","), B = ((D = I[0].match(/:(.*?);/)) == null ? void 0 : D[1]) || "", q = atob(I[1]);
81
- let p = q.length;
82
- const j = new Uint8Array(p);
83
- for (; p--; )
84
- j[p] = q.charCodeAt(p);
85
- return new File([j], V, { type: B });
86
- }
87
- const i = function() {
88
- const { isEmpty: x, data: V } = c.value.saveSignature();
89
- if (x)
90
- return w.value = !0;
91
- g.value = V, R.value = !1, k("update:modelValue", a(V, "signature.png"));
92
- };
93
- return (x, V) => {
94
- const I = C("FmButton"), B = C("FmDialog");
95
- return b(), P("div", null, [
96
- n("p", null, U(m.label), 1),
97
- g.value ? (b(), T(re, {
98
- key: 0,
99
- document: g.value,
100
- "restaurant-id": m.restaurantId
101
- }, {
102
- default: f(({ src: q }) => [
103
- n("img", {
104
- src: q,
105
- alt: "Signature Preview",
106
- class: "w-full h-auto"
107
- }, null, 8, fe)
108
- ]),
109
- _: 1
110
- }, 8, ["document", "restaurant-id"])) : A("", !0),
111
- g.value ? A("", !0) : (b(), T(B, {
112
- key: 1,
113
- modelValue: R.value,
114
- "onUpdate:modelValue": V[1] || (V[1] = (q) => R.value = q)
115
- }, {
116
- "dialog-button": f(() => [
117
- r(I, {
118
- "prepend-icon": "signature",
119
- class: "w-full",
120
- label: "Signature"
121
- })
122
- ]),
123
- "dialog-header": f(() => [...V[2] || (V[2] = [
124
- n("div", null, "Signature Board", -1)
125
- ])]),
126
- default: f(() => [
127
- r(e(Ve), {
128
- ref_key: "signaturePad",
129
- ref: c,
130
- height: "300px",
131
- customStyle: { border: "2px solid #ccc", borderRadius: "3px" },
132
- options: { penColor: "#000000" }
133
- }, null, 512),
134
- w.value ? (b(), P("p", ke, " Please sign your signature before saving. ")) : A("", !0),
135
- n("div", Ce, [
136
- r(I, {
137
- variant: "destructive",
138
- label: "Clear",
139
- "prepend-icon": "delete",
140
- onClick: V[0] || (V[0] = (q) => c.value.clearSignature())
141
- }),
142
- r(I, {
143
- label: "Save",
144
- "prepend-icon": "save",
145
- onClick: i
146
- })
147
- ])
148
- ]),
149
- _: 1
150
- }, 8, ["modelValue"]))
151
- ]);
152
- };
153
- }
154
- }), Se = { class: "space-y-2" }, we = { class: "text-gray-900" }, qe = { class: "text-gray-900" }, Fe = { class: "text-gray-900" }, Pe = { class: "text-gray-900" }, Ue = { class: "text-gray-900" }, xe = { class: "text-gray-900" }, Ie = { class: "grid grid-cols-4 gap-6" }, Re = ["src"], De = {
155
- key: 1,
156
- class: "mt-2 truncate text-gray-700"
157
- }, Te = { key: 0 }, Be = {
158
- key: 0,
159
- class: "w-full flex justify-end mt-6"
160
- }, Ae = { class: "mt-6 grid grid-cols-4 gap-24" }, Ee = { class: "w-full flex justify-end mt-6" }, $e = { class: "mt-6 grid grid-cols-4 gap-24" }, je = { class: "col-span-2" }, Oe = { class: "col-span-2" }, Le = { class: "col-span-2" }, Me = { class: "col-span-2" }, He = { class: "col-span-2" }, ze = { class: "col-span-2" }, We = { class: "col-span-2" }, Je = { class: "col-start-1 col-span-2" }, Qe = { class: "col-span-2" }, Ke = { class: "col-span-2" }, Ge = { class: "col-span-2" }, Ye = { class: "mt-6 grid grid-cols-4 gap-6" }, he = { class: "mt-6 grid grid-cols-2 gap-24" }, ne = 30, Xe = /* @__PURE__ */ Z({
161
- __name: "SoftspaceSubmission",
162
- props: {
163
- submission: {
164
- type: Object,
165
- required: !0
166
- }
167
- },
168
- emits: ["update:submission"],
169
- setup(m, { emit: O }) {
170
- const v = m, k = O, g = ae(), w = E(!1), { isLoading: c, startAsyncCall: R } = te(), { fields: a, documents: i, restaurantId: x, profile: V, status: I, statusReason: B } = v.submission, q = E(""), p = E(
171
- v.submission.rates ? Object.fromEntries(
172
- Object.entries(v.submission.rates).map(([y, l]) => [y, `${l}`])
173
- ) : {
174
- duitNow: "0.8",
175
- mydebitCard: "0.5",
176
- localDebit: "0.5",
177
- localCredit: "1.1",
178
- foreignCard: "3.0",
179
- jcbStandard: "2.2",
180
- jcbPlatinum: "2.2"
181
- }
182
- ), j = W(
183
- () => Object.values(p.value).every((y) => parseFloat(y) > 0)
184
- ), { isLoading: D, startAsyncCall: Y } = te(), M = E([]), _ = (y) => Number(y.replace("additionalDocument", "")), h = W(
185
- () => Object.keys(v.submission.documents).filter((y) => /^additionalDocument\d+$/.test(y)).sort((y, l) => _(y) - _(l))
186
- ), ee = W(
187
- () => h.value.length + M.value.length
188
- ), S = (y) => {
189
- if (!(ee.value >= ne)) {
190
- if (y.type.startsWith("image/")) {
191
- const l = new FileReader();
192
- l.onload = ($) => {
193
- var L;
194
- return M.value.push({
195
- file: y,
196
- preview: String(((L = $.target) == null ? void 0 : L.result) ?? "")
197
- });
198
- }, l.readAsDataURL(y);
199
- return;
200
- }
201
- M.value.push({ file: y, preview: "" });
202
- }
203
- }, s = () => Y(async () => {
204
- try {
205
- let y = h.value.reduce(
206
- ($, L) => Math.max($, _(L)),
207
- 0
208
- );
209
- const l = {};
210
- for (const { file: $ } of M.value) {
211
- const L = `additionalDocument${++y}`;
212
- l[L] = await H.uploadDocument(
213
- x,
214
- L,
215
- $
216
- );
217
- }
218
- k(
219
- "update:submission",
220
- await H.addAdditionalDocuments(
221
- v.submission._id,
222
- l
223
- )
224
- ), M.value = [], g.open({ type: "success", title: "Documents saved" });
225
- } catch (y) {
226
- g.open({
227
- type: "error",
228
- title: "Error occurs when sending additional documents",
229
- message: Q(y)
230
- });
231
- }
232
- }), N = () => R(async () => {
233
- try {
234
- const y = await H.reviewById(
235
- v.submission._id,
236
- {
237
- rates: {
238
- duitNow: parseFloat(p.value.duitNow),
239
- mydebitCard: parseFloat(p.value.mydebitCard),
240
- localDebit: parseFloat(p.value.localDebit),
241
- localCredit: parseFloat(p.value.localCredit),
242
- foreignCard: parseFloat(p.value.foreignCard),
243
- jcbStandard: parseFloat(p.value.jcbStandard),
244
- jcbPlatinum: parseFloat(p.value.jcbPlatinum)
245
- },
246
- status: "approved"
247
- }
248
- );
249
- k("update:submission", y), w.value = !1, g.open({
250
- type: "success",
251
- title: "Submission updated successfully"
252
- });
253
- } catch (y) {
254
- g.open({
255
- type: "error",
256
- title: "Error occurs when updating submission",
257
- message: Q(y)
258
- });
259
- }
260
- }), X = () => R(async () => {
261
- try {
262
- const y = await H.reviewById(
263
- v.submission._id,
264
- {
265
- status: "rejected",
266
- statusReason: q.value
267
- }
268
- );
269
- k("update:submission", y), w.value = !1, g.open({
270
- type: "success",
271
- title: "Submission updated successfully"
272
- });
273
- } catch (y) {
274
- g.open({
275
- type: "error",
276
- title: "Error occurs when updating submission",
277
- message: Q(y)
278
- });
279
- }
280
- });
281
- return (y, l) => {
282
- const $ = C("FmButton"), L = C("FmDropField"), o = C("FmTextField"), K = C("FmTextarea"), ue = C("FmDialog"), de = C("FmPhoneNumber"), se = C("FmSelect"), me = C("FmForm");
283
- return b(), P(J, null, [
284
- n("div", Se, [
285
- n("div", null, [
286
- l[34] || (l[34] = n("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
287
- n("span", we, U(e(x)), 1)
288
- ]),
289
- n("div", null, [
290
- l[35] || (l[35] = n("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
291
- n("span", qe, U(e(V).name) + " ( " + U(e(V).legalName) + " )", 1)
292
- ]),
293
- n("div", null, [
294
- l[36] || (l[36] = n("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
295
- n("span", Fe, U(e(V).email), 1)
296
- ]),
297
- n("div", null, [
298
- l[37] || (l[37] = n("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
299
- n("span", Pe, U(e(V).phoneNo), 1)
300
- ]),
301
- n("div", null, [
302
- l[38] || (l[38] = n("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
303
- n("span", Ue, [
304
- r(ie, { data: e(I) }, null, 8, ["data"])
305
- ])
306
- ]),
307
- n("div", null, [
308
- l[39] || (l[39] = n("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
309
- n("span", xe, U(e(B)), 1)
310
- ])
311
- ]),
312
- l[51] || (l[51] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Additional Documents ", -1)),
313
- n("div", Ie, [
314
- (b(!0), P(J, null, le(h.value, (t) => (b(), T(F, {
315
- key: t,
316
- label: t.replace("additionalDocument", "Document "),
317
- type: /\.pdf$/i.test(v.submission.documents[t]) ? "pdf" : "image",
318
- modelValue: v.submission.documents[t],
319
- "onUpdate:modelValue": (G) => v.submission.documents[t] = G,
320
- "restaurant-id": e(x)
321
- }, null, 8, ["label", "type", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128)),
322
- (b(!0), P(J, null, le(M.value, (t, G) => (b(), P("div", {
323
- key: `new-${G}`
324
- }, [
325
- n("p", null, "Document " + U(h.value.length + G + 1), 1),
326
- t.file.type.startsWith("image/") ? (b(), P("img", {
327
- key: 0,
328
- src: t.preview,
329
- class: "mt-2 rounded border"
330
- }, null, 8, Re)) : (b(), P("p", De, U(t.file.name), 1)),
331
- r($, {
332
- class: "mt-4",
333
- "prepend-icon": "delete",
334
- label: "Remove",
335
- variant: "destructive",
336
- onClick: (ql) => M.value.splice(G, 1)
337
- }, null, 8, ["onClick"])
338
- ]))), 128)),
339
- ee.value < ne ? (b(), P("div", Te, [
340
- n("p", null, "Document " + U(ee.value + 1), 1),
341
- r(L, {
342
- accept: ".png, .jpg, .jpeg, .pdf",
343
- onFileUpload: S
344
- })
345
- ])) : A("", !0)
346
- ]),
347
- M.value.length ? (b(), P("div", Be, [
348
- r($, {
349
- type: "button",
350
- variant: "primary",
351
- "prepend-icon": "cloud_upload",
352
- label: "Save documents",
353
- loading: e(D),
354
- onClick: s
355
- }, null, 8, ["loading"])
356
- ])) : A("", !0),
357
- l[52] || (l[52] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
358
- n("div", Ae, [
359
- r(o, {
360
- modelValue: p.value.duitNow,
361
- "onUpdate:modelValue": l[0] || (l[0] = (t) => p.value.duitNow = t),
362
- label: "DuitNow QR",
363
- "label-mark": "required",
364
- type: "number",
365
- inputmode: "numeric",
366
- decimal: 2,
367
- rules: e(u)(
368
- e(d).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
369
- )
370
- }, {
371
- append: f(() => [...l[40] || (l[40] = [
372
- z("%", -1)
373
- ])]),
374
- _: 1
375
- }, 8, ["modelValue", "rules"]),
376
- r(o, {
377
- modelValue: p.value.mydebitCard,
378
- "onUpdate:modelValue": l[1] || (l[1] = (t) => p.value.mydebitCard = t),
379
- label: "myDebit Card",
380
- "label-mark": "required",
381
- type: "number",
382
- inputmode: "numeric",
383
- decimal: 2,
384
- rules: e(u)(
385
- e(d).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
386
- )
387
- }, {
388
- append: f(() => [...l[41] || (l[41] = [
389
- z("%", -1)
390
- ])]),
391
- _: 1
392
- }, 8, ["modelValue", "rules"]),
393
- r(o, {
394
- modelValue: p.value.localDebit,
395
- "onUpdate:modelValue": l[2] || (l[2] = (t) => p.value.localDebit = t),
396
- label: "Local Debit Card",
397
- "label-mark": "required",
398
- type: "number",
399
- inputmode: "numeric",
400
- decimal: 2,
401
- rules: e(u)(
402
- e(d).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
403
- )
404
- }, {
405
- append: f(() => [...l[42] || (l[42] = [
406
- z("%", -1)
407
- ])]),
408
- _: 1
409
- }, 8, ["modelValue", "rules"]),
410
- r(o, {
411
- modelValue: p.value.localCredit,
412
- "onUpdate:modelValue": l[3] || (l[3] = (t) => p.value.localCredit = t),
413
- label: "Local Credit Card",
414
- "label-mark": "required",
415
- type: "number",
416
- inputmode: "numeric",
417
- decimal: 2,
418
- rules: e(u)(
419
- e(d).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
420
- )
421
- }, {
422
- append: f(() => [...l[43] || (l[43] = [
423
- z("%", -1)
424
- ])]),
425
- _: 1
426
- }, 8, ["modelValue", "rules"]),
427
- r(o, {
428
- modelValue: p.value.foreignCard,
429
- "onUpdate:modelValue": l[4] || (l[4] = (t) => p.value.foreignCard = t),
430
- label: "Foreign Card",
431
- "label-mark": "required",
432
- type: "number",
433
- inputmode: "numeric",
434
- decimal: 2,
435
- rules: e(u)(
436
- e(d).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
437
- )
438
- }, {
439
- append: f(() => [...l[44] || (l[44] = [
440
- z("%", -1)
441
- ])]),
442
- _: 1
443
- }, 8, ["modelValue", "rules"]),
444
- r(o, {
445
- modelValue: p.value.jcbStandard,
446
- "onUpdate:modelValue": l[5] || (l[5] = (t) => p.value.jcbStandard = t),
447
- label: "JCB Standard",
448
- "label-mark": "required",
449
- type: "number",
450
- inputmode: "numeric",
451
- decimal: 2,
452
- rules: e(u)(
453
- e(d).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
454
- )
455
- }, {
456
- append: f(() => [...l[45] || (l[45] = [
457
- z("%", -1)
458
- ])]),
459
- _: 1
460
- }, 8, ["modelValue", "rules"]),
461
- r(o, {
462
- modelValue: p.value.jcbPlatinum,
463
- "onUpdate:modelValue": l[6] || (l[6] = (t) => p.value.jcbPlatinum = t),
464
- label: "JCB Platinum",
465
- "label-mark": "required",
466
- type: "number",
467
- inputmode: "numeric",
468
- decimal: 2,
469
- rules: e(u)(
470
- e(d).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
471
- )
472
- }, {
473
- append: f(() => [...l[46] || (l[46] = [
474
- z("%", -1)
475
- ])]),
476
- _: 1
477
- }, 8, ["modelValue", "rules"])
478
- ]),
479
- n("div", Ee, [
480
- r(ue, {
481
- modelValue: w.value,
482
- "onUpdate:modelValue": l[8] || (l[8] = (t) => w.value = t)
483
- }, {
484
- "dialog-button": f(() => [
485
- r($, {
486
- class: "mr-6",
487
- type: "button",
488
- variant: "destructive",
489
- "prepend-icon": "block",
490
- loading: e(c),
491
- label: "Reject Submission"
492
- }, null, 8, ["loading"])
493
- ]),
494
- "dialog-header": f(() => [...l[47] || (l[47] = [
495
- n("div", null, "Rejecting Submission", -1)
496
- ])]),
497
- default: f(() => [
498
- r(K, {
499
- modelValue: q.value,
500
- "onUpdate:modelValue": l[7] || (l[7] = (t) => q.value = t),
501
- label: "Reason for Rejection",
502
- "label-mark": "optional",
503
- "helper-text": "Please provide a reason for rejection."
504
- }, null, 8, ["modelValue"]),
505
- r($, {
506
- class: "mb-2 mt-6 w-full",
507
- label: "Submit",
508
- "prepend-icon": "save",
509
- onClick: X,
510
- loading: e(c)
511
- }, null, 8, ["loading"])
512
- ]),
513
- _: 1
514
- }, 8, ["modelValue"]),
515
- r($, {
516
- type: "button",
517
- variant: "primary",
518
- "prepend-icon": "approval",
519
- disabled: !j.value,
520
- label: "Approve Submission with Rates",
521
- onClick: N,
522
- loading: e(c)
523
- }, null, 8, ["disabled", "loading"])
524
- ]),
525
- r(me, { disabled: !0 }, {
526
- default: f(() => [
527
- l[48] || (l[48] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
528
- n("div", $e, [
529
- n("div", je, [
530
- r(o, {
531
- modelValue: e(a).picName,
532
- "onUpdate:modelValue": l[9] || (l[9] = (t) => e(a).picName = t),
533
- label: "Owner/Director Name",
534
- placeholder: "Enter your name",
535
- "label-mark": "required",
536
- rules: e(u)(e(d).string().min(1, "Owner/Director Name is required"))
537
- }, null, 8, ["modelValue", "rules"])
538
- ]),
539
- n("div", Oe, [
540
- r(o, {
541
- modelValue: e(a).picRole,
542
- "onUpdate:modelValue": l[10] || (l[10] = (t) => e(a).picRole = t),
543
- label: "Owner/Director Role",
544
- placeholder: "Enter your role",
545
- "label-mark": "required",
546
- rules: e(u)(e(d).string().min(1, "Owner/Director Role is required"))
547
- }, null, 8, ["modelValue", "rules"])
548
- ]),
549
- n("div", Le, [
550
- r(o, {
551
- modelValue: e(a).picEmail,
552
- "onUpdate:modelValue": l[11] || (l[11] = (t) => e(a).picEmail = t),
553
- label: "Owner/Director Email",
554
- type: "email",
555
- placeholder: "Enter your email address",
556
- "label-mark": "required",
557
- rules: e(u)(e(d).string().min(1, "Owner/Director Email is required"))
558
- }, null, 8, ["modelValue", "rules"])
559
- ]),
560
- n("div", Me, [
561
- r(de, {
562
- "model-value": e(a).picContact,
563
- "onUpdate:modelValue": l[12] || (l[12] = (t) => e(a).picContact = t),
564
- "default-country": "MY",
565
- label: "Owner/Director Contact",
566
- "label-mark": "required",
567
- rules: e(u)(e(d).string().min(1, "Owner/Director Contact is required"))
568
- }, null, 8, ["model-value", "rules"])
569
- ]),
570
- n("div", He, [
571
- r(o, {
572
- modelValue: e(a).tradingName,
573
- "onUpdate:modelValue": l[13] || (l[13] = (t) => e(a).tradingName = t),
574
- label: "Trading Name",
575
- placeholder: "Enter trading name",
576
- "label-mark": "required",
577
- rules: e(u)(e(d).string().min(1, "Trading Name is required"))
578
- }, null, 8, ["modelValue", "rules"])
579
- ]),
580
- n("div", ze, [
581
- r(o, {
582
- modelValue: e(a).outletName,
583
- "onUpdate:modelValue": l[14] || (l[14] = (t) => e(a).outletName = t),
584
- label: "Registered Name",
585
- placeholder: "Enter registered name",
586
- "label-mark": "required",
587
- rules: e(u)(e(d).string().min(1, "Registered Name is required"))
588
- }, null, 8, ["modelValue", "rules"])
589
- ]),
590
- n("div", We, [
591
- r(o, {
592
- modelValue: e(a).outletAddress,
593
- "onUpdate:modelValue": l[15] || (l[15] = (t) => e(a).outletAddress = t),
594
- label: "Outlet Address",
595
- placeholder: "Enter outlet address",
596
- "label-mark": "required",
597
- rules: e(u)(e(d).string().min(1, "Address is required"))
598
- }, null, 8, ["modelValue", "rules"])
599
- ]),
600
- r(o, {
601
- modelValue: e(a).outletPostCode,
602
- "onUpdate:modelValue": l[16] || (l[16] = (t) => e(a).outletPostCode = t),
603
- label: "Postal Code",
604
- placeholder: "Enter postal code",
605
- "label-mark": "required",
606
- rules: e(u)(e(d).string().min(1, "Postal Code is required"))
607
- }, null, 8, ["modelValue", "rules"]),
608
- r(o, {
609
- modelValue: e(a).outletState,
610
- "onUpdate:modelValue": l[17] || (l[17] = (t) => e(a).outletState = t),
611
- label: "State",
612
- placeholder: "Enter state",
613
- "label-mark": "required",
614
- rules: e(u)(e(d).string().min(1, "State is required"))
615
- }, null, 8, ["modelValue", "rules"]),
616
- r(o, {
617
- modelValue: e(a).outletCity,
618
- "onUpdate:modelValue": l[18] || (l[18] = (t) => e(a).outletCity = t),
619
- label: "City",
620
- placeholder: "Enter city",
621
- "label-mark": "required",
622
- rules: e(u)(e(d).string().min(1, "City is required"))
623
- }, null, 8, ["modelValue", "rules"]),
624
- n("div", Je, [
625
- r(se, {
626
- modelValue: e(a).businessType,
627
- "onUpdate:modelValue": l[19] || (l[19] = (t) => e(a).businessType = t),
628
- label: "Type",
629
- placeholder: "Select business type",
630
- "label-mark": "required",
631
- rules: e(u)(e(d).string().min(1, "Business Type is required")),
632
- items: [
633
- { label: "Sole Proprietorship", value: "sole_proprietorship" },
634
- { label: "Partnership", value: "partnership" },
635
- {
636
- label: "Private Limited Company (Sdn Bhd)",
637
- value: "private_limited"
638
- },
639
- {
640
- label: "Public Limited Company (Berhad)",
641
- value: "public_limited"
642
- }
643
- ]
644
- }, null, 8, ["modelValue", "rules"])
645
- ]),
646
- n("div", Qe, [
647
- r(o, {
648
- modelValue: e(a).businessRegNo,
649
- "onUpdate:modelValue": l[20] || (l[20] = (t) => e(a).businessRegNo = t),
650
- label: "Registration No",
651
- placeholder: "Enter registration number",
652
- "label-mark": "required",
653
- rules: e(u)(e(d).string().min(1, "Reg No is required"))
654
- }, null, 8, ["modelValue", "rules"])
655
- ]),
656
- n("div", Ke, [
657
- r(o, {
658
- modelValue: e(a).tinNo,
659
- "onUpdate:modelValue": l[21] || (l[21] = (t) => e(a).tinNo = t),
660
- label: "Tax Identification No (TIN)",
661
- placeholder: "Enter your TIN number",
662
- "label-mark": "required",
663
- rules: e(u)(e(d).string().min(1, "TIN is required"))
664
- }, null, 8, ["modelValue", "rules"])
665
- ]),
666
- n("div", Ge, [
667
- r(o, {
668
- modelValue: e(a).sstNo,
669
- "onUpdate:modelValue": l[22] || (l[22] = (t) => e(a).sstNo = t),
670
- label: "SST Registration No (SST)",
671
- placeholder: "Enter your SST number",
672
- "label-mark": "optional"
673
- }, null, 8, ["modelValue"])
674
- ])
675
- ]),
676
- l[49] || (l[49] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information & Documents ", -1)),
677
- n("div", Ye, [
678
- r(se, {
679
- modelValue: e(a).bankName,
680
- "onUpdate:modelValue": l[23] || (l[23] = (t) => e(a).bankName = t),
681
- label: "Bank",
682
- placeholder: "Select bank type",
683
- "label-mark": "required",
684
- rules: e(u)(e(d).string().min(1, "Bank Type is required")),
685
- items: e(ye).bankNameOptions()
686
- }, null, 8, ["modelValue", "rules", "items"]),
687
- r(o, {
688
- modelValue: e(a).bankHolderName,
689
- "onUpdate:modelValue": l[24] || (l[24] = (t) => e(a).bankHolderName = t),
690
- label: "Beneficiary Name",
691
- placeholder: "Enter Beneficiary Name",
692
- "label-mark": "required",
693
- rules: e(u)(e(d).string().min(1, "Beneficiary Name is required"))
694
- }, null, 8, ["modelValue", "rules"]),
695
- r(o, {
696
- modelValue: e(a).bankAccountNo,
697
- "onUpdate:modelValue": l[25] || (l[25] = (t) => e(a).bankAccountNo = t),
698
- label: "Account Number",
699
- placeholder: "Enter Account Number",
700
- "label-mark": "required",
701
- rules: e(u)(e(d).string().min(1, "Account Number is required"))
702
- }, null, 8, ["modelValue", "rules"]),
703
- r(F, {
704
- label: "Authorized Person ID",
705
- modelValue: e(i).authorizedPersonID,
706
- "onUpdate:modelValue": l[26] || (l[26] = (t) => e(i).authorizedPersonID = t),
707
- type: "image",
708
- "restaurant-id": m.submission.restaurantId
709
- }, null, 8, ["modelValue", "restaurant-id"]),
710
- r(F, {
711
- label: "Outlet Photo",
712
- modelValue: e(i).outletPhoto,
713
- "onUpdate:modelValue": l[27] || (l[27] = (t) => e(i).outletPhoto = t),
714
- type: "image",
715
- "restaurant-id": m.submission.restaurantId
716
- }, null, 8, ["modelValue", "restaurant-id"]),
717
- (b(!0), P(J, null, le([1, 2, 3, 4, 5].filter(
718
- (t) => !!e(i)[`onsitePhoto${t}`]
719
- ), (t) => (b(), T(F, {
720
- key: t,
721
- label: e(ge)[t - 1],
722
- modelValue: e(i)[`onsitePhoto${t}`],
723
- "onUpdate:modelValue": (G) => e(i)[`onsitePhoto${t}`] = G,
724
- type: "image",
725
- "restaurant-id": m.submission.restaurantId
726
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128)),
727
- e(i).interiorPhoto ? (b(), T(F, {
728
- key: 0,
729
- label: "Interior Photo",
730
- modelValue: e(i).interiorPhoto,
731
- "onUpdate:modelValue": l[28] || (l[28] = (t) => e(i).interiorPhoto = t),
732
- type: "image",
733
- "restaurant-id": m.submission.restaurantId
734
- }, null, 8, ["modelValue", "restaurant-id"])) : A("", !0),
735
- r(F, {
736
- label: "Latest Bank Statement",
737
- modelValue: e(i).bankStatement,
738
- "onUpdate:modelValue": l[29] || (l[29] = (t) => e(i).bankStatement = t),
739
- type: "pdf",
740
- "restaurant-id": m.submission.restaurantId
741
- }, null, 8, ["modelValue", "restaurant-id"]),
742
- e(a).businessType === "private_limited" || e(a).businessType === "public_limited" ? (b(), T(F, {
743
- key: 1,
744
- label: "Superform",
745
- type: "pdf",
746
- modelValue: e(i).certificate,
747
- "onUpdate:modelValue": l[30] || (l[30] = (t) => e(i).certificate = t),
748
- "restaurant-id": m.submission.restaurantId
749
- }, null, 8, ["modelValue", "restaurant-id"])) : A("", !0),
750
- e(a).businessType === "sole_proprietorship" || e(a).businessType === "partnership" ? (b(), T(F, {
751
- key: 2,
752
- label: "SSM Certificate & Info",
753
- type: "pdf",
754
- modelValue: e(i).certificate,
755
- "onUpdate:modelValue": l[31] || (l[31] = (t) => e(i).certificate = t),
756
- "restaurant-id": m.submission.restaurantId
757
- }, null, 8, ["modelValue", "restaurant-id"])) : A("", !0)
758
- ]),
759
- l[50] || (l[50] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
760
- n("div", he, [
761
- r(Ne, {
762
- modelValue: e(i).signature,
763
- "onUpdate:modelValue": l[32] || (l[32] = (t) => e(i).signature = t),
764
- "restaurant-id": m.submission.restaurantId,
765
- label: "Signature"
766
- }, null, 8, ["modelValue", "restaurant-id"]),
767
- r(F, {
768
- label: "Company Stamp",
769
- type: "image",
770
- modelValue: e(i).companyStamp,
771
- "onUpdate:modelValue": l[33] || (l[33] = (t) => e(i).companyStamp = t),
772
- "restaurant-id": m.submission.restaurantId
773
- }, null, 8, ["modelValue", "restaurant-id"])
774
- ])
775
- ]),
776
- _: 1
777
- })
778
- ], 64);
779
- };
780
- }
781
- }), Ze = { class: "space-y-2" }, _e = { class: "text-gray-900" }, el = { class: "text-gray-900" }, ll = { class: "text-gray-900" }, tl = { class: "text-gray-900" }, al = { class: "text-gray-900" }, sl = { class: "text-gray-900" }, nl = { class: "mt-6 grid grid-cols-4 gap-24" }, ol = { class: "w-full flex justify-end mt-6" }, rl = { class: "mt-6 grid grid-cols-4 gap-24" }, il = { class: "col-span-2" }, ul = { class: "col-span-2" }, dl = { class: "col-span-2" }, ml = { class: "col-span-2" }, pl = { class: "mt-6 grid grid-cols-4 gap-24" }, bl = { class: "mt-6 grid grid-cols-4 gap-24" }, cl = { class: "mt-6 grid grid-cols-4 gap-24" }, yl = { class: "col-span-2" }, gl = { class: "col-span-2" }, Vl = { class: "col-span-2" }, vl = { class: "col-span-2" }, fl = { class: "col-span-2" }, kl = { class: "col-span-2" }, Cl = /* @__PURE__ */ Z({
782
- __name: "NTTSubmission",
783
- props: {
784
- submission: {
785
- type: Object,
786
- required: !0
787
- }
788
- },
789
- emits: ["update:submission"],
790
- setup(m, { emit: O }) {
791
- const v = m, k = O, g = ae(), w = E(!1), { isLoading: c, startAsyncCall: R } = te(), { fields: a, documents: i, restaurantId: x, profile: V, status: I, statusReason: B } = v.submission, q = E(""), p = [
792
- { key: "localCardDebit", label: "Local Card (Debit)", defaultValue: "2.3" },
793
- {
794
- key: "localCardStandard",
795
- label: "Local Card (Standard)",
796
- defaultValue: "2.3"
797
- },
798
- {
799
- key: "localCardPremium",
800
- label: "Local Card (Premium)",
801
- defaultValue: "2.3"
802
- },
803
- {
804
- key: "localCardSuperPremium",
805
- label: "Local Card (Super Premium)",
806
- defaultValue: "2.3"
807
- },
808
- {
809
- key: "internationalCard",
810
- label: "International Card",
811
- defaultValue: "3.1"
812
- },
813
- { key: "upiCard", label: "UPI Card", defaultValue: "3" },
814
- { key: "jcbCard", label: "JCB Card", defaultValue: "3" },
815
- { key: "dciCard", label: "DCI Card", defaultValue: "3" },
816
- { key: "amexCard", label: "Amex Card", defaultValue: "3" },
817
- { key: "alipay", label: "Alipay", defaultValue: "2.3" },
818
- { key: "alipayPlus", label: "Alipay+", defaultValue: "2.3" },
819
- { key: "trueMoney", label: "TrueMoney", defaultValue: "2.3" },
820
- { key: "shopeePay", label: "ShopeePay", defaultValue: "2.3" },
821
- { key: "linePay", label: "LinePay", defaultValue: "2.1" },
822
- { key: "thaiQr", label: "ThaiQR", defaultValue: "0.5" }
823
- ], j = Object.fromEntries(
824
- p.map((S) => [S.key, S.defaultValue])
825
- ), D = E(
826
- v.submission.rates ? Object.fromEntries(
827
- Object.entries(v.submission.rates).map(([S, s]) => [S, `${s}`])
828
- ) : { ...j }
829
- ), Y = W(
830
- () => Object.values(D.value).every((S) => parseFloat(S) > 0)
831
- ), M = W(() => a.businessType === "juristic" ? "Juristic" : a.businessType === "individual" ? "Individual" : a.businessType || "-"), _ = () => R(async () => {
832
- try {
833
- const S = await H.reviewById(
834
- v.submission._id,
835
- {
836
- status: oe.FdoOnboardStatus.enum.ready
837
- }
838
- );
839
- k("update:submission", S), g.open({
840
- type: "success",
841
- title: "Submission marked as ready"
842
- });
843
- } catch (S) {
844
- g.open({
845
- type: "error",
846
- title: "Error occurs when marking submission as ready",
847
- message: Q(S)
848
- });
849
- }
850
- }), h = () => R(async () => {
851
- try {
852
- const S = await H.reviewById(
853
- v.submission._id,
854
- {
855
- rates: Object.fromEntries(
856
- p.map((s) => [
857
- s.key,
858
- parseFloat(D.value[s.key])
859
- ])
860
- ),
861
- status: "approved"
862
- }
863
- );
864
- k("update:submission", S), g.open({
865
- type: "success",
866
- title: "Submission updated successfully"
867
- });
868
- } catch (S) {
869
- g.open({
870
- type: "error",
871
- title: "Error occurs when updating submission",
872
- message: Q(S)
873
- });
874
- }
875
- }), ee = () => R(async () => {
876
- try {
877
- const S = await H.reviewById(
878
- v.submission._id,
879
- {
880
- status: "rejected",
881
- statusReason: q.value
882
- }
883
- );
884
- k("update:submission", S), w.value = !1, g.open({
885
- type: "success",
886
- title: "Submission updated successfully"
887
- });
888
- } catch (S) {
889
- g.open({
890
- type: "error",
891
- title: "Error occurs when updating submission",
892
- message: Q(S)
893
- });
894
- }
895
- });
896
- return (S, s) => {
897
- const N = C("FmTextField"), X = C("FmButton"), y = C("FmTextarea"), l = C("FmDialog"), $ = C("FmPhoneNumber"), L = C("FmForm");
898
- return b(), P(J, null, [
899
- n("div", Ze, [
900
- n("div", null, [
901
- s[31] || (s[31] = n("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
902
- n("span", _e, U(e(x)), 1)
903
- ]),
904
- n("div", null, [
905
- s[32] || (s[32] = n("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
906
- n("span", el, U(e(V).name) + " ( " + U(e(V).legalName) + " )", 1)
907
- ]),
908
- n("div", null, [
909
- s[33] || (s[33] = n("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
910
- n("span", ll, U(e(V).email), 1)
911
- ]),
912
- n("div", null, [
913
- s[34] || (s[34] = n("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
914
- n("span", tl, U(e(V).phoneNo), 1)
915
- ]),
916
- n("div", null, [
917
- s[35] || (s[35] = n("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
918
- n("span", al, [
919
- r(ie, { data: e(I) }, null, 8, ["data"])
920
- ])
921
- ]),
922
- n("div", null, [
923
- s[36] || (s[36] = n("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
924
- n("span", sl, U(e(B)), 1)
925
- ])
926
- ]),
927
- s[43] || (s[43] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
928
- n("div", nl, [
929
- (b(), P(J, null, le(p, (o) => r(N, {
930
- key: o.key,
931
- modelValue: D.value[o.key],
932
- "onUpdate:modelValue": (K) => D.value[o.key] = K,
933
- label: o.label,
934
- "label-mark": "required",
935
- type: "number",
936
- inputmode: "numeric",
937
- decimal: 2,
938
- rules: e(u)(
939
- e(d).string().min(1, "Rate is required").transform((K) => parseFloat(K)).refine((K) => !isNaN(K), { message: "Rate must be a number" })
940
- )
941
- }, {
942
- append: f(() => [...s[37] || (s[37] = [
943
- z("%", -1)
944
- ])]),
945
- _: 1
946
- }, 8, ["modelValue", "onUpdate:modelValue", "label", "rules"])), 64))
947
- ]),
948
- n("div", ol, [
949
- r(l, {
950
- modelValue: w.value,
951
- "onUpdate:modelValue": s[1] || (s[1] = (o) => w.value = o)
952
- }, {
953
- "dialog-button": f(() => [
954
- r(X, {
955
- class: "mr-6",
956
- type: "button",
957
- variant: "destructive",
958
- "prepend-icon": "block",
959
- loading: e(c),
960
- label: "Reject Submission"
961
- }, null, 8, ["loading"])
962
- ]),
963
- "dialog-header": f(() => [...s[38] || (s[38] = [
964
- n("div", null, "Rejecting Submission", -1)
965
- ])]),
966
- default: f(() => [
967
- r(y, {
968
- modelValue: q.value,
969
- "onUpdate:modelValue": s[0] || (s[0] = (o) => q.value = o),
970
- label: "Reason for Rejection",
971
- "label-mark": "optional",
972
- "helper-text": "Please provide a reason for rejection."
973
- }, null, 8, ["modelValue"]),
974
- r(X, {
975
- class: "mb-2 mt-6 w-full",
976
- label: "Submit",
977
- "prepend-icon": "save",
978
- onClick: ee,
979
- loading: e(c)
980
- }, null, 8, ["loading"])
981
- ]),
982
- _: 1
983
- }, 8, ["modelValue"]),
984
- r(X, {
985
- type: "button",
986
- variant: "primary",
987
- "prepend-icon": "approval",
988
- label: "Approve Submission with Rates",
989
- disabled: !Y.value,
990
- onClick: h,
991
- loading: e(c)
992
- }, null, 8, ["disabled", "loading"]),
993
- e(I) === "approved" ? (b(), T(X, {
994
- key: 0,
995
- type: "button",
996
- variant: "secondary",
997
- "prepend-icon": "check_circle",
998
- label: "Mark as Ready",
999
- class: "ml-6",
1000
- onClick: _,
1001
- loading: e(c)
1002
- }, null, 8, ["loading"])) : A("", !0)
1003
- ]),
1004
- r(L, { disabled: !0 }, {
1005
- default: f(() => [
1006
- s[39] || (s[39] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
1007
- n("div", rl, [
1008
- n("div", il, [
1009
- r(N, {
1010
- modelValue: e(a).companyName,
1011
- "onUpdate:modelValue": s[2] || (s[2] = (o) => e(a).companyName = o),
1012
- label: "Company Name",
1013
- "label-mark": "required",
1014
- rules: e(u)(e(d).string().min(1, "Company Name is required"))
1015
- }, null, 8, ["modelValue", "rules"])
1016
- ]),
1017
- n("div", ul, [
1018
- r(N, {
1019
- modelValue: e(a).outletName,
1020
- "onUpdate:modelValue": s[3] || (s[3] = (o) => e(a).outletName = o),
1021
- label: "Outlet Name (Thai)",
1022
- "label-mark": "required",
1023
- rules: e(u)(e(d).string().min(1, "Outlet Name is required"))
1024
- }, null, 8, ["modelValue", "rules"])
1025
- ]),
1026
- n("div", dl, [
1027
- r(N, {
1028
- modelValue: e(a).outletNameEnglish,
1029
- "onUpdate:modelValue": s[4] || (s[4] = (o) => e(a).outletNameEnglish = o),
1030
- label: "Outlet Name (English)",
1031
- "label-mark": "required",
1032
- rules: e(u)(e(d).string().min(1, "Outlet Name English is required"))
1033
- }, null, 8, ["modelValue", "rules"])
1034
- ]),
1035
- n("div", ml, [
1036
- r(N, {
1037
- modelValue: e(a).outletAddress,
1038
- "onUpdate:modelValue": s[5] || (s[5] = (o) => e(a).outletAddress = o),
1039
- label: "Outlet Address",
1040
- "label-mark": "required",
1041
- rules: e(u)(e(d).string().min(1, "Outlet Address is required"))
1042
- }, null, 8, ["modelValue", "rules"])
1043
- ]),
1044
- r(N, {
1045
- modelValue: e(a).outletPostCode,
1046
- "onUpdate:modelValue": s[6] || (s[6] = (o) => e(a).outletPostCode = o),
1047
- label: "Post Code",
1048
- "label-mark": "required",
1049
- rules: e(u)(e(d).string().min(1, "Post Code is required"))
1050
- }, null, 8, ["modelValue", "rules"]),
1051
- r(N, {
1052
- modelValue: e(a).outletState,
1053
- "onUpdate:modelValue": s[7] || (s[7] = (o) => e(a).outletState = o),
1054
- label: "State",
1055
- "label-mark": "required",
1056
- rules: e(u)(e(d).string().min(1, "State is required"))
1057
- }, null, 8, ["modelValue", "rules"]),
1058
- r(N, {
1059
- modelValue: e(a).outletCity,
1060
- "onUpdate:modelValue": s[8] || (s[8] = (o) => e(a).outletCity = o),
1061
- label: "City",
1062
- "label-mark": "required",
1063
- rules: e(u)(e(d).string().min(1, "City is required"))
1064
- }, null, 8, ["modelValue", "rules"]),
1065
- r(N, {
1066
- "model-value": M.value,
1067
- label: "Business Type",
1068
- "label-mark": "required"
1069
- }, null, 8, ["model-value"]),
1070
- r(N, {
1071
- modelValue: e(a).numberOfDevices,
1072
- "onUpdate:modelValue": s[9] || (s[9] = (o) => e(a).numberOfDevices = o),
1073
- label: "Number of Devices",
1074
- "label-mark": "required"
1075
- }, null, 8, ["modelValue"])
1076
- ]),
1077
- s[40] || (s[40] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
1078
- n("div", pl, [
1079
- r(N, {
1080
- modelValue: e(a).bankName,
1081
- "onUpdate:modelValue": s[10] || (s[10] = (o) => e(a).bankName = o),
1082
- label: "Bank Name",
1083
- "label-mark": "required",
1084
- rules: e(u)(e(d).string().min(1, "Bank Name is required"))
1085
- }, null, 8, ["modelValue", "rules"]),
1086
- r(N, {
1087
- modelValue: e(a).bankHolderName,
1088
- "onUpdate:modelValue": s[11] || (s[11] = (o) => e(a).bankHolderName = o),
1089
- label: "Bank Holder Name",
1090
- "label-mark": "required",
1091
- rules: e(u)(e(d).string().min(1, "Bank Holder Name is required"))
1092
- }, null, 8, ["modelValue", "rules"]),
1093
- r(N, {
1094
- modelValue: e(a).bankAccountNo,
1095
- "onUpdate:modelValue": s[12] || (s[12] = (o) => e(a).bankAccountNo = o),
1096
- label: "Bank Account No",
1097
- "label-mark": "required",
1098
- rules: e(u)(e(d).string().min(1, "Bank Account No is required"))
1099
- }, null, 8, ["modelValue", "rules"]),
1100
- r(N, {
1101
- modelValue: e(a).bankBranch,
1102
- "onUpdate:modelValue": s[13] || (s[13] = (o) => e(a).bankBranch = o),
1103
- label: "Bank Branch",
1104
- "label-mark": "required",
1105
- rules: e(u)(e(d).string().min(1, "Bank Branch is required"))
1106
- }, null, 8, ["modelValue", "rules"]),
1107
- r(N, {
1108
- modelValue: e(a).bankBranchCode,
1109
- "onUpdate:modelValue": s[14] || (s[14] = (o) => e(a).bankBranchCode = o),
1110
- label: "Bank Branch Code",
1111
- "label-mark": "required",
1112
- rules: e(u)(e(d).string().min(1, "Bank Branch Code is required"))
1113
- }, null, 8, ["modelValue", "rules"])
1114
- ]),
1115
- s[41] || (s[41] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
1116
- n("div", bl, [
1117
- r(F, {
1118
- label: "Authorized Person ID",
1119
- modelValue: e(i).authorizedPersonID,
1120
- "onUpdate:modelValue": s[15] || (s[15] = (o) => e(i).authorizedPersonID = o),
1121
- type: "image",
1122
- "restaurant-id": m.submission.restaurantId
1123
- }, null, 8, ["modelValue", "restaurant-id"]),
1124
- r(F, {
1125
- label: "Outlet Photo",
1126
- modelValue: e(i).outletPhoto,
1127
- "onUpdate:modelValue": s[16] || (s[16] = (o) => e(i).outletPhoto = o),
1128
- type: "image",
1129
- "restaurant-id": m.submission.restaurantId
1130
- }, null, 8, ["modelValue", "restaurant-id"]),
1131
- r(F, {
1132
- label: "Interior Photo",
1133
- modelValue: e(i).interiorPhoto,
1134
- "onUpdate:modelValue": s[17] || (s[17] = (o) => e(i).interiorPhoto = o),
1135
- type: "image",
1136
- "restaurant-id": m.submission.restaurantId
1137
- }, null, 8, ["modelValue", "restaurant-id"]),
1138
- r(F, {
1139
- label: "Bank Statement",
1140
- modelValue: e(i).bankStatement,
1141
- "onUpdate:modelValue": s[18] || (s[18] = (o) => e(i).bankStatement = o),
1142
- type: "pdf",
1143
- "restaurant-id": m.submission.restaurantId
1144
- }, null, 8, ["modelValue", "restaurant-id"]),
1145
- e(a).businessType === "juristic" ? (b(), T(F, {
1146
- key: 0,
1147
- label: "Company Certificate",
1148
- type: "pdf",
1149
- modelValue: e(i).companyCertificate,
1150
- "onUpdate:modelValue": s[19] || (s[19] = (o) => e(i).companyCertificate = o),
1151
- "restaurant-id": m.submission.restaurantId
1152
- }, null, 8, ["modelValue", "restaurant-id"])) : A("", !0),
1153
- e(a).businessType === "juristic" ? (b(), T(F, {
1154
- key: 1,
1155
- label: "VAT Certificate",
1156
- type: "pdf",
1157
- modelValue: e(i).vatCertificate,
1158
- "onUpdate:modelValue": s[20] || (s[20] = (o) => e(i).vatCertificate = o),
1159
- "restaurant-id": m.submission.restaurantId
1160
- }, null, 8, ["modelValue", "restaurant-id"])) : A("", !0),
1161
- e(a).businessType === "individual" ? (b(), T(F, {
1162
- key: 2,
1163
- label: "Commercial Certificate",
1164
- type: "pdf",
1165
- modelValue: e(i).commercialCertificate,
1166
- "onUpdate:modelValue": s[21] || (s[21] = (o) => e(i).commercialCertificate = o),
1167
- "restaurant-id": m.submission.restaurantId
1168
- }, null, 8, ["modelValue", "restaurant-id"])) : A("", !0)
1169
- ]),
1170
- s[42] || (s[42] = n("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
1171
- n("div", cl, [
1172
- n("div", yl, [
1173
- r(N, {
1174
- modelValue: e(a).picName,
1175
- "onUpdate:modelValue": s[22] || (s[22] = (o) => e(a).picName = o),
1176
- label: "PIC Name",
1177
- "label-mark": "required",
1178
- rules: e(u)(e(d).string().min(1, "PIC Name is required"))
1179
- }, null, 8, ["modelValue", "rules"])
1180
- ]),
1181
- n("div", gl, [
1182
- r(N, {
1183
- modelValue: e(a).picRole,
1184
- "onUpdate:modelValue": s[23] || (s[23] = (o) => e(a).picRole = o),
1185
- label: "PIC Role",
1186
- "label-mark": "required",
1187
- rules: e(u)(e(d).string().min(1, "PIC Role is required"))
1188
- }, null, 8, ["modelValue", "rules"])
1189
- ]),
1190
- n("div", Vl, [
1191
- r(N, {
1192
- modelValue: e(a).picEmail,
1193
- "onUpdate:modelValue": s[24] || (s[24] = (o) => e(a).picEmail = o),
1194
- label: "PIC Email",
1195
- "label-mark": "required",
1196
- rules: e(u)(e(d).string().min(1, "PIC Email is required"))
1197
- }, null, 8, ["modelValue", "rules"])
1198
- ]),
1199
- n("div", vl, [
1200
- r($, {
1201
- "model-value": e(a).picContact,
1202
- "onUpdate:modelValue": s[25] || (s[25] = (o) => e(a).picContact = o),
1203
- "default-country": "TH",
1204
- label: "PIC Contact",
1205
- "label-mark": "required",
1206
- rules: e(u)(e(d).string().min(1, "PIC Contact is required"))
1207
- }, null, 8, ["model-value", "rules"])
1208
- ]),
1209
- n("div", fl, [
1210
- r(N, {
1211
- modelValue: e(a).witnessName,
1212
- "onUpdate:modelValue": s[26] || (s[26] = (o) => e(a).witnessName = o),
1213
- label: "Witness Name",
1214
- "label-mark": "required",
1215
- rules: e(u)(e(d).string().min(1, "Witness Name is required"))
1216
- }, null, 8, ["modelValue", "rules"])
1217
- ]),
1218
- n("div", kl, [
1219
- r(N, {
1220
- modelValue: e(a).witnessRole,
1221
- "onUpdate:modelValue": s[27] || (s[27] = (o) => e(a).witnessRole = o),
1222
- label: "Witness Role",
1223
- "label-mark": "required",
1224
- rules: e(u)(e(d).string().min(1, "Witness Role is required"))
1225
- }, null, 8, ["modelValue", "rules"])
1226
- ]),
1227
- r(F, {
1228
- label: "Signature",
1229
- type: "image",
1230
- modelValue: e(i).signature,
1231
- "onUpdate:modelValue": s[28] || (s[28] = (o) => e(i).signature = o),
1232
- "restaurant-id": m.submission.restaurantId
1233
- }, null, 8, ["modelValue", "restaurant-id"]),
1234
- r(F, {
1235
- label: "Witness Signature",
1236
- type: "image",
1237
- modelValue: e(i).witnessSignature,
1238
- "onUpdate:modelValue": s[29] || (s[29] = (o) => e(i).witnessSignature = o),
1239
- "restaurant-id": m.submission.restaurantId
1240
- }, null, 8, ["modelValue", "restaurant-id"]),
1241
- r(F, {
1242
- label: "Company Stamp",
1243
- type: "image",
1244
- modelValue: e(i).companyStamp,
1245
- "onUpdate:modelValue": s[30] || (s[30] = (o) => e(i).companyStamp = o),
1246
- "restaurant-id": m.submission.restaurantId
1247
- }, null, 8, ["modelValue", "restaurant-id"])
1248
- ])
1249
- ]),
1250
- _: 1
1251
- })
1252
- ], 64);
1253
- };
1254
- }
1255
- }), Nl = /* @__PURE__ */ Z({
1256
- __name: "TyroSubmission",
1257
- props: {
1258
- submission: {
1259
- type: Object,
1260
- required: !0
1261
- }
1262
- },
1263
- emits: ["update:submission"],
1264
- setup(m) {
1265
- const O = m, v = W(() => {
1266
- const k = O.submission.fields || {}, g = (w) => k[w] || "N/A";
1267
- return [
1268
- {
1269
- label: "Tyro POS Reference ID",
1270
- value: g("tyroPosReference")
1271
- },
1272
- {
1273
- label: "Tyro Merchant ID",
1274
- value: g("tyroMerchantId")
1275
- },
1276
- {
1277
- label: "Tyro Merchant Name",
1278
- value: g("tyroMerchantDisplayName")
1279
- },
1280
- {
1281
- label: "Authorised",
1282
- value: g("tyroIsAuthorised")
1283
- }
1284
- ];
1285
- });
1286
- return (k, g) => {
1287
- const w = C("FmCardHeader"), c = C("FmCardSection"), R = C("FmCard");
1288
- return b(), T(R, {
1289
- class: "max-w-3xl mt-8 p-6",
1290
- variant: "elevated"
1291
- }, {
1292
- default: f(() => [
1293
- r(c, { class: "flex flex-col gap-16 justify-between" }, {
1294
- default: f(() => [
1295
- r(w, {
1296
- class: "p-0",
1297
- title: "Tyro Authorisation",
1298
- subtitle: ""
1299
- }),
1300
- r(c, { class: "p-0" }, {
1301
- default: f(() => [
1302
- (b(!0), P(J, null, le(v.value, (a) => (b(), P("p", {
1303
- key: a.label,
1304
- class: "text-sm text-gray-900 break-all mb-4 last:mb-0"
1305
- }, [
1306
- n("b", null, U(a.label), 1),
1307
- z(": " + U(a.value), 1)
1308
- ]))), 128))
1309
- ]),
1310
- _: 1
1311
- })
1312
- ]),
1313
- _: 1
1314
- })
1315
- ]),
1316
- _: 1
1317
- });
1318
- };
1319
- }
1320
- }), Sl = {
1321
- key: 0,
1322
- class: "flex items-center justify-center min-h-[80vh]"
1323
- }, wl = { class: "px-32 pb-32" }, jl = /* @__PURE__ */ Z({
1324
- __name: "OnboardForm",
1325
- props: {
1326
- submissionId: {
1327
- type: String,
1328
- required: !0
1329
- }
1330
- },
1331
- setup(m) {
1332
- const { startAsyncCall: O, isLoading: v } = te(), k = ae(), g = m, w = ce(), c = E(null), R = W(
1333
- () => {
1334
- var B;
1335
- return ((B = c.value) == null ? void 0 : B.type) === oe.FdoOnboardType.enum.tyro;
1336
- }
1337
- ), a = () => {
1338
- if (window.history.length > 1) {
1339
- w.back();
1340
- return;
1341
- }
1342
- w.push({ name: "mf-payment-admin.onboard-submission" });
1343
- };
1344
- pe(() => {
1345
- O(async () => {
1346
- c.value = await H.readById(g.submissionId);
1347
- });
1348
- });
1349
- const i = W(() => {
1350
- if (!c.value) return null;
1351
- switch (c.value.type) {
1352
- case "softspace":
1353
- return Xe;
1354
- case "ntt":
1355
- return Cl;
1356
- case "tyro":
1357
- return Nl;
1358
- default:
1359
- return null;
1360
- }
1361
- }), x = E(0);
1362
- function V(B) {
1363
- c.value = B, x.value = Date.now();
1364
- }
1365
- const I = async (B) => {
1366
- var q, p;
1367
- if (c.value)
1368
- switch (B) {
1369
- case "preview":
1370
- let j;
1371
- try {
1372
- j = k.open({
1373
- message: "Generating preview document...",
1374
- type: "info"
1375
- }), await H.previewDocument(
1376
- (q = c.value) == null ? void 0 : q._id
1377
- );
1378
- } catch (D) {
1379
- k.open({
1380
- type: "error",
1381
- title: "Error occurs when generating submission document",
1382
- message: Q(D)
1383
- });
1384
- } finally {
1385
- j && k.close(j);
1386
- }
1387
- break;
1388
- case "send":
1389
- try {
1390
- k.open({
1391
- message: "Sending onboarding document...",
1392
- type: "info"
1393
- }), await H.sendDocument(
1394
- (p = c.value) == null ? void 0 : p._id
1395
- ), k.open({
1396
- type: "success",
1397
- title: "Submission documents send successfully"
1398
- });
1399
- } catch (D) {
1400
- k.open({
1401
- type: "error",
1402
- title: "Error occurs when sending document",
1403
- message: Q(D)
1404
- });
1405
- }
1406
- break;
1407
- }
1408
- };
1409
- return (B, q) => {
1410
- var D, Y;
1411
- const p = C("FmCircularProgress"), j = C("FmPageHead");
1412
- return e(v) ? (b(), P("div", Sl, [
1413
- r(p, { size: "xxl" })
1414
- ])) : (b(), P(J, { key: 1 }, [
1415
- r(j, {
1416
- title: `Submission - ${(D = c.value) == null ? void 0 : D.type}`,
1417
- description: `ID - ${(Y = c.value) == null ? void 0 : Y._id}`,
1418
- "back-button": !0,
1419
- "onClick:back": a,
1420
- "onClick:action": I,
1421
- actions: R.value ? [] : [
1422
- {
1423
- label: "Preview Document",
1424
- value: "preview",
1425
- prependIcon: "preview"
1426
- },
1427
- {
1428
- label: "Send for Review",
1429
- value: "send",
1430
- isPrimary: !0,
1431
- prependIcon: "send"
1432
- }
1433
- ]
1434
- }, null, 8, ["title", "description", "actions"]),
1435
- n("div", wl, [
1436
- (b(), T(be(i.value), {
1437
- key: x.value,
1438
- submission: c.value,
1439
- "onUpdate:submission": V
1440
- }, null, 40, ["submission"]))
1441
- ])
1442
- ], 64));
1443
- };
1444
- }
1445
- });
1446
- export {
1447
- jl as default
1448
- };