@feedmepos/mf-payment 1.11.3-dev → 1.11.5-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 (54) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-v0SnPr5a.js → Actions.vue_vue_type_script_setup_true_lang-CaYfiHeE.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-DkWcXyh8.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-CGGazClM.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-CPT869Wj.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-DTbMceoX.js} +3 -3
  4. package/dist/{Chargeback-DBdMY6rF.js → Chargeback-BS3WIqFz.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-CC6od7-2.js → DocumentViewer.vue_vue_type_script_setup_true_lang-zoaRv68Y.js} +1 -1
  6. package/dist/{ExternalTerminal-C-fkxJM1.js → ExternalTerminal-DHd87yns.js} +6 -6
  7. package/dist/OnboardForm-BAqS4YTe.js +1805 -0
  8. package/dist/{OnboardForm-m-eFFjFa.js → OnboardForm-DybF2Xpq.js} +6 -6
  9. package/dist/{OnboardSubmission-CjdEUnwb.js → OnboardSubmission-Ekq71UtI.js} +3 -3
  10. package/dist/{OnboardSubmission-CWDie0Df.js → OnboardSubmission-c-T3mdsX.js} +6 -6
  11. package/dist/{PaymentCheckout-DeyXPwEF.js → PaymentCheckout-ljT0nlId.js} +2 -2
  12. package/dist/{PayoutAccount-C-tpgVwN.js → PayoutAccount-BKgfsrf4.js} +5 -5
  13. package/dist/{PayoutAccount-B1qD1gJN.js → PayoutAccount-DV8O33uo.js} +7 -7
  14. package/dist/{PayoutAccountSetting-CyTqnA_G.js → PayoutAccountSetting-CzfCvedQ.js} +6 -6
  15. package/dist/{Restaurant-DMK56dUY.js → Restaurant-CPtr4wkD.js} +4 -4
  16. package/dist/{RestaurantSetting-Cbz0p1Yf.js → RestaurantSetting-xxGl_dJX.js} +3 -3
  17. package/dist/{Settlement-CPP1bUR9.js → Settlement-BhX_a8E8.js} +4 -4
  18. package/dist/{Settlement-Bpa-abXS.js → Settlement-Bv7GHHCG.js} +3 -3
  19. package/dist/{SettlementTransactions-DIn7uIFk.js → SettlementTransactions-D1rHtfit.js} +5 -5
  20. package/dist/{SettlementTransactions-otdARkcC.js → SettlementTransactions-Duh2LsRY.js} +5 -5
  21. package/dist/{Status.vue_vue_type_script_setup_true_lang-DGlhkKxZ.js → Status.vue_vue_type_script_setup_true_lang-CVMiovZi.js} +1 -1
  22. package/dist/{Terminal-CGYKt4T3.js → Terminal-BAAmhFn3.js} +6 -6
  23. package/dist/{TerminalSetting-BMLsViC8.js → TerminalSetting-BD_E8Fmw.js} +7 -7
  24. package/dist/{TerminalTemplate-CVCkpNJo.js → TerminalTemplate-DBB60fPH.js} +5 -5
  25. package/dist/{TerminalTemplateSetting-C1PLbLc5.js → TerminalTemplateSetting-CY8lvkvb.js} +5 -5
  26. package/dist/{Transaction-Dk3hcOYl.js → Transaction-CPgBiDP9.js} +10 -10
  27. package/dist/{Transaction-Bi8WMK-J.js → Transaction-ezANQx5W.js} +12 -12
  28. package/dist/{TransactionOld-BI8VhSYc.js → TransactionOld-BHsqPlP6.js} +7 -7
  29. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-T772VqFe.js → TransactionStatus.vue_vue_type_script_setup_true_lang-BnRLxudT.js} +1 -1
  30. package/dist/api/onboard-submission/index.d.ts +1 -1
  31. package/dist/{app-B5h83d26.js → app-CcG9h_1h.js} +26 -26
  32. package/dist/app.js +1 -1
  33. package/dist/{assets-CQn4-mCk.js → assets-aOyz_Xdo.js} +1 -1
  34. package/dist/{grafana-DipV6jzB.js → grafana-Dd1q_or-.js} +1 -1
  35. package/dist/{index-zMzAjmwz.js → index-B5RVh7Dv.js} +1 -1
  36. package/dist/{index-Cs00ZYzD.js → index-BA4vV9PS.js} +1 -1
  37. package/dist/{index-B5eEeJe7.js → index-Bl5v_ygb.js} +1 -1
  38. package/dist/{index-CHBejTua.js → index-BxIurCFl.js} +1 -1
  39. package/dist/{index-rmD5hk67.js → index-CNL-EBVv.js} +1 -1
  40. package/dist/{index-CbRJWjTB.js → index-C_1f0U3Q.js} +1 -1
  41. package/dist/{index-e3vroquS.js → index-DF5J3ly5.js} +1 -1
  42. package/dist/{index-OJbHgXbS.js → index-DIqpeMJg.js} +1 -1
  43. package/dist/{index-BiTo3-CO.js → index-De1W4TpZ.js} +24 -24
  44. package/dist/{index-C07g4gZq.js → index-Dpbobspy.js} +1 -1
  45. package/dist/{index-CP7BTy-D.js → index-_0RCDI7E.js} +1 -1
  46. package/dist/{index.vue_vue_type_script_setup_true_lang-Cu7pAJFv.js → index.vue_vue_type_script_setup_true_lang-C8XtGjpP.js} +1 -1
  47. package/dist/{onboard-submission-CRJ6q1pV.js → onboard-submission-ytd4azQw.js} +1 -1
  48. package/dist/package.json +1 -1
  49. package/dist/{payout-account-BPRFi4QA.js → payout-account-3edqDHiA.js} +3 -3
  50. package/dist/style.css +1 -1
  51. package/dist/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/{useQuery-D1xFn41j.js → useQuery-mCN49hhF.js} +1 -1
  53. package/package.json +1 -1
  54. package/dist/OnboardForm-DE3bXb-m.js +0 -1757
@@ -1,1757 +0,0 @@
1
- import { defineComponent as Q, ref as j, computed as _, resolveComponent as w, openBlock as m, createElementBlock as V, createElementVNode as a, toDisplayString as R, createBlock as T, withCtx as P, createCommentVNode as $, createVNode as o, unref as e, Fragment as M, renderList as K, normalizeClass as ye, createTextVNode as Y, onMounted as we, resolveDynamicComponent as xe } from "vue";
2
- import { o as h } from "./index-BiTo3-CO.js";
3
- import { u as ne, p as ve } from "./index-e3vroquS.js";
4
- import { useRouter as Ie } from "vue-router";
5
- import { z as b, a as c } from "./validator-CTlVogBQ.js";
6
- import { D as Re, P as qe } from "./payout-account-BPRFi4QA.js";
7
- import { a as Ue } from "./onboard-submission-CRJ6q1pV.js";
8
- import { _ as fe } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-CC6od7-2.js";
9
- import { s as Fe } from "./vue-signature-pad.esm-IXPjf4fL.js";
10
- import { _ as Ve } from "./Status.vue_vue_type_script_setup_true_lang-DGlhkKxZ.js";
11
- import { useSnackbar as ue } from "@feedmepos/ui-library";
12
- import { u as G } from "./error-K1CakhA9.js";
13
- const De = ["src"], pe = ".png, .jpg, .jpeg", be = ".pdf", F = /* @__PURE__ */ Q({
14
- __name: "UploadButton",
15
- props: {
16
- modelValue: {},
17
- label: {},
18
- type: {},
19
- restaurantId: {}
20
- },
21
- emits: ["update:modelValue"],
22
- setup(u, { emit: C }) {
23
- const d = u, y = j(d.modelValue), g = C, N = (r) => {
24
- const D = new FileReader();
25
- D.onload = (k) => {
26
- var A;
27
- y.value = (A = k.target) == null ? void 0 : A.result, g("update:modelValue", r);
28
- }, D.readAsDataURL(r);
29
- }, p = (r) => {
30
- window.open(r, "_blank", "noopener,noreferrer");
31
- }, q = _(() => d.type === "image" ? pe : d.type === "pdf" ? be : `${pe}, ${be}`), s = (r) => d.type === "pdf" ? !0 : d.type === "image" ? !1 : r === "application/pdf";
32
- return (r, D) => {
33
- const k = w("FmButton"), A = w("FmDropField");
34
- return m(), V("div", null, [
35
- a("p", null, R(u.label), 1),
36
- y.value ? (m(), T(fe, {
37
- key: 0,
38
- document: y.value,
39
- "restaurant-id": u.restaurantId
40
- }, {
41
- default: P(({ src: E, type: x }) => [
42
- s(x) ? (m(), T(k, {
43
- key: 1,
44
- class: "mt-4 w-full",
45
- "prepend-icon": "manage_accounts",
46
- label: "View Document",
47
- variant: "primary",
48
- onVnodeMounted: () => p(E),
49
- onClick: () => p(E)
50
- }, null, 8, ["onVnodeMounted", "onClick"])) : (m(), V("img", {
51
- key: 0,
52
- src: E
53
- }, null, 8, De))
54
- ]),
55
- _: 1
56
- }, 8, ["document", "restaurant-id"])) : (m(), T(A, {
57
- key: 1,
58
- accept: q.value,
59
- onFileUpload: N
60
- }, null, 8, ["accept"]))
61
- ]);
62
- };
63
- }
64
- }), Ee = ["src"], Te = {
65
- key: 0,
66
- class: "text-center text-red-700 py-4"
67
- }, Ae = { class: "flex justify-evenly py-3" }, $e = /* @__PURE__ */ Q({
68
- __name: "SignatureBoard",
69
- props: {
70
- modelValue: {},
71
- label: {},
72
- restaurantId: {}
73
- },
74
- emits: ["update:modelValue"],
75
- setup(u, { emit: C }) {
76
- const d = u, y = C, g = j(d.modelValue), N = j(!1), p = j(), q = j(!1);
77
- function s(D, k) {
78
- var B;
79
- const A = D.split(","), E = ((B = A[0].match(/:(.*?);/)) == null ? void 0 : B[1]) || "", x = atob(A[1]);
80
- let L = x.length;
81
- const v = new Uint8Array(L);
82
- for (; L--; )
83
- v[L] = x.charCodeAt(L);
84
- return new File([v], k, { type: E });
85
- }
86
- const r = function() {
87
- const { isEmpty: D, data: k } = p.value.saveSignature();
88
- if (D)
89
- return N.value = !0;
90
- g.value = k, q.value = !1, y("update:modelValue", s(k, "signature.png"));
91
- };
92
- return (D, k) => {
93
- const A = w("FmButton"), E = w("FmDialog");
94
- return m(), V("div", null, [
95
- a("p", null, R(u.label), 1),
96
- g.value ? (m(), T(fe, {
97
- key: 0,
98
- document: g.value,
99
- "restaurant-id": u.restaurantId
100
- }, {
101
- default: P(({ src: x }) => [
102
- a("img", {
103
- src: x,
104
- alt: "Signature Preview",
105
- class: "w-full h-auto"
106
- }, null, 8, Ee)
107
- ]),
108
- _: 1
109
- }, 8, ["document", "restaurant-id"])) : $("", !0),
110
- g.value ? $("", !0) : (m(), T(E, {
111
- key: 1,
112
- modelValue: q.value,
113
- "onUpdate:modelValue": k[1] || (k[1] = (x) => q.value = x)
114
- }, {
115
- "dialog-button": P(() => [
116
- o(A, {
117
- "prepend-icon": "signature",
118
- class: "w-full",
119
- label: "Signature"
120
- })
121
- ]),
122
- "dialog-header": P(() => [...k[2] || (k[2] = [
123
- a("div", null, "Signature Board", -1)
124
- ])]),
125
- default: P(() => [
126
- o(e(Fe), {
127
- ref_key: "signaturePad",
128
- ref: p,
129
- height: "300px",
130
- customStyle: { border: "2px solid #ccc", borderRadius: "3px" },
131
- options: { penColor: "#000000" }
132
- }, null, 512),
133
- N.value ? (m(), V("p", Te, " Please sign your signature before saving. ")) : $("", !0),
134
- a("div", Ae, [
135
- o(A, {
136
- variant: "destructive",
137
- label: "Clear",
138
- "prepend-icon": "delete",
139
- onClick: k[0] || (k[0] = (x) => p.value.clearSignature())
140
- }),
141
- o(A, {
142
- label: "Save",
143
- "prepend-icon": "save",
144
- onClick: r
145
- })
146
- ])
147
- ]),
148
- _: 1
149
- }, 8, ["modelValue"]))
150
- ]);
151
- };
152
- }
153
- }), Le = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Be = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Oe = new RegExp("(\\d)(\\p{Ll})", "gu"), je = new RegExp("(\\p{L})(\\d)", "gu"), _e = /[^\p{L}\d]+/giu, oe = "$1\0$2";
154
- function Me(u, C = {}) {
155
- let d = u.replace(Le, oe).replace(Be, oe);
156
- C.separateNumbers && (d = d.replace(Oe, oe).replace(je, oe)), d = d.replace(_e, "\0");
157
- let y = 0, g = d.length;
158
- for (; d.charAt(y) === "\0"; )
159
- y++;
160
- if (y === g)
161
- return [];
162
- for (; d.charAt(g - 1) === "\0"; )
163
- g--;
164
- return d.slice(y, g).split(/\0/g);
165
- }
166
- function he(u) {
167
- return (C) => C.toLocaleLowerCase(u);
168
- }
169
- function ze(u) {
170
- return (C) => C.toLocaleUpperCase(u);
171
- }
172
- function ce(u, C) {
173
- const d = he(C == null ? void 0 : C.locale), y = ze(C == null ? void 0 : C.locale);
174
- return Me(u).map((g, N) => N === 0 ? y(g[0]) + d(g.slice(1)) : d(g)).join(" ");
175
- }
176
- const He = {
177
- key: 0,
178
- class: "text-sm text-gray-500"
179
- }, We = {
180
- key: 1,
181
- class: "relative ml-2 border-l border-gray-200"
182
- }, Ye = { class: "flex items-center gap-2" }, Ge = { class: "font-medium text-gray-900" }, Je = {
183
- key: 0,
184
- class: "rounded bg-gray-100 px-2 py-[2px] text-xs text-gray-600"
185
- }, Ke = { class: "mt-1 text-sm text-gray-500" }, Qe = {
186
- key: 0,
187
- class: "mt-1 text-sm text-gray-700"
188
- }, ke = /* @__PURE__ */ Q({
189
- __name: "Timeline",
190
- props: {
191
- entries: {
192
- type: Array,
193
- default: () => []
194
- }
195
- },
196
- setup(u) {
197
- const C = u, d = {
198
- submission: { label: "Submitted", icon: "upload_file", color: "bg-blue-400" },
199
- resubmission: {
200
- label: "Resubmitted",
201
- icon: "upload_file",
202
- color: "bg-blue-400"
203
- },
204
- "send-for-review": {
205
- label: "Sent for Review",
206
- icon: "send",
207
- color: "bg-indigo-400"
208
- },
209
- "submission-review-approved": {
210
- label: "Review Approved",
211
- icon: "check_circle",
212
- color: "bg-green-400"
213
- },
214
- "submission-review-rejected": {
215
- label: "Review Rejected",
216
- icon: "cancel",
217
- color: "bg-red-400"
218
- },
219
- "submission-review-ready": {
220
- label: "Marked as Ready",
221
- icon: "task_alt",
222
- color: "bg-green-400"
223
- },
224
- "additional-document": {
225
- label: "Additional Document Added",
226
- icon: "attach_file",
227
- color: "bg-gray-400"
228
- },
229
- reminder: {
230
- label: "Reminder Sent",
231
- icon: "notifications",
232
- color: "bg-yellow-400"
233
- },
234
- "pending-merchant": {
235
- label: "Pending Merchant",
236
- icon: "storefront",
237
- color: "bg-yellow-400"
238
- },
239
- "pending-fasspay": {
240
- label: "Pending FassPay",
241
- icon: "hourglass_top",
242
- color: "bg-orange-400"
243
- },
244
- "complete-fasspay": {
245
- label: "FassPay Completed",
246
- icon: "task_alt",
247
- color: "bg-green-400"
248
- },
249
- "complete-credit-card": {
250
- label: "Credit Card Completed",
251
- icon: "credit_card",
252
- color: "bg-green-400"
253
- },
254
- "provider-update": {
255
- label: "Provider Update",
256
- icon: "update",
257
- color: "bg-orange-400"
258
- }
259
- }, y = {
260
- approved: "bg-green-400",
261
- ready: "bg-green-400",
262
- rejected: "bg-red-400",
263
- submitted: "bg-blue-400",
264
- pending: "bg-yellow-400"
265
- };
266
- function g(p) {
267
- const q = d[p];
268
- if (q) return q;
269
- if (p.startsWith("status-update-")) {
270
- const s = p.replace("status-update-", "");
271
- return {
272
- label: `Status Updated to ${ce(s)}`,
273
- icon: "sync",
274
- color: y[s] ?? "bg-gray-400"
275
- };
276
- }
277
- return {
278
- label: ce(p.replace(/-/g, " ")),
279
- icon: "radio_button_checked",
280
- color: "bg-gray-400"
281
- };
282
- }
283
- const N = _(
284
- () => (C.entries ?? []).map((p) => ({
285
- ...p,
286
- ...g(p.action),
287
- at: Re(p.timestamp)
288
- })).sort((p, q) => q.at.valueOf() - p.at.valueOf())
289
- );
290
- return (p, q) => {
291
- const s = w("FmIcon");
292
- return N.value.length ? (m(), V("ol", We, [
293
- (m(!0), V(M, null, K(N.value, (r, D) => (m(), V("li", {
294
- key: `${r.action}-${r.timestamp}-${D}`,
295
- class: "relative pb-6 pl-6 last:pb-0"
296
- }, [
297
- a("span", {
298
- class: ye([
299
- "absolute -left-[8px] top-1 h-4 w-4 rounded-full ring-4 ring-white",
300
- r.color
301
- ])
302
- }, null, 2),
303
- a("div", Ye, [
304
- o(s, {
305
- name: r.icon,
306
- size: "sm",
307
- class: "text-gray-500"
308
- }, null, 8, ["name"]),
309
- a("span", Ge, R(r.label), 1),
310
- D === 0 ? (m(), V("span", Je, " Latest ")) : $("", !0)
311
- ]),
312
- a("p", Ke, R(r.at.isValid() ? r.at.format("DD MMM YYYY, HH:mm") : r.timestamp), 1),
313
- r.description ? (m(), V("p", Qe, R(r.description), 1)) : $("", !0)
314
- ]))), 128))
315
- ])) : (m(), V("p", He, " No activity recorded yet. "));
316
- };
317
- }
318
- }), Xe = { class: "space-y-2" }, Ze = { 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: "flex items-center gap-2 border-b pb-1 mt-6 mb-6" }, ol = { class: "flex items-center justify-between gap-6" }, rl = { class: "flex gap-6" }, il = { class: "flex gap-6" }, ul = { class: "grid grid-cols-4 gap-6" }, dl = ["src"], ml = {
319
- key: 1,
320
- class: "mt-2 truncate text-gray-700"
321
- }, pl = { key: 0 }, bl = {
322
- key: 0,
323
- class: "w-full flex justify-end mt-6"
324
- }, cl = { class: "mt-6 grid grid-cols-4 gap-24" }, gl = { class: "grid grid-cols-4 gap-6" }, yl = { class: "w-full flex justify-end mt-6" }, vl = { class: "mt-6 grid grid-cols-4 gap-24" }, fl = { class: "col-span-2" }, Vl = { class: "col-span-2" }, kl = { class: "col-span-2" }, Cl = { class: "col-span-2" }, Nl = { class: "col-span-2" }, Sl = { class: "col-span-2" }, Pl = { class: "col-span-2" }, wl = { class: "col-span-2" }, xl = { class: "col-start-1 col-span-2" }, Il = { class: "col-span-2" }, Rl = { class: "col-span-2" }, ql = { class: "col-span-2" }, Ul = { class: "mt-6 grid grid-cols-4 gap-6" }, Fl = { class: "mt-6 grid grid-cols-4 gap-6" }, Dl = { class: "mt-6 grid grid-cols-4 gap-6" }, El = { class: "mt-6 grid grid-cols-4 gap-6" }, Tl = { class: "mt-6 grid grid-cols-4 gap-6" }, Al = { class: "mt-6 grid grid-cols-4 gap-6" }, $l = {
325
- key: 2,
326
- class: "text-sm text-gray-500"
327
- }, Ll = { class: "mt-6 grid grid-cols-2 gap-24" }, ge = 30, Bl = /* @__PURE__ */ Q({
328
- __name: "SoftspaceSubmission",
329
- props: {
330
- submission: {
331
- type: Object,
332
- required: !0
333
- }
334
- },
335
- emits: ["update:submission"],
336
- setup(u, { emit: C }) {
337
- var de;
338
- const d = u, y = C, g = ue(), N = j(!1), { isLoading: p, startAsyncCall: q } = ne(), { fields: s, documents: r, restaurantId: D, profile: k, status: A, statusReason: E } = d.submission, x = j(""), L = j(
339
- parseInt(((de = d.submission.fields) == null ? void 0 : de.numberOfDevices) ?? 1)
340
- ), v = j(
341
- d.submission.rates ? Object.fromEntries(
342
- Object.entries(d.submission.rates).map(([f, l]) => [f, `${l}`])
343
- ) : {
344
- duitNow: "0.8",
345
- mydebitCard: "0.5",
346
- localDebit: "0.5",
347
- localCredit: "1.1",
348
- foreignCard: "3.0",
349
- jcbStandard: "2.2",
350
- jcbPlatinum: "2.2"
351
- }
352
- ), B = _(
353
- () => Object.values(v.value).every((f) => parseFloat(f) > 0)
354
- ), X = _(
355
- () => Object.keys(d.submission.documents).filter((f) => /^authorizedPersonID\d+$/.test(f)).sort(
356
- (f, l) => Number(f.replace("authorizedPersonID", "")) - Number(l.replace("authorizedPersonID", ""))
357
- )
358
- ), { isLoading: Z, startAsyncCall: ee } = ne(), z = j([]), ae = (f) => Number(f.replace("additionalDocument", "")), S = _(
359
- () => Object.keys(d.submission.documents).filter((f) => /^additionalDocument\d+$/.test(f)).sort((f, l) => ae(f) - ae(l))
360
- ), n = _(
361
- () => S.value.length + z.value.length
362
- ), U = (f) => {
363
- if (!(n.value >= ge)) {
364
- if (f.type.startsWith("image/")) {
365
- const l = new FileReader();
366
- l.onload = (O) => {
367
- var H;
368
- return z.value.push({
369
- file: f,
370
- preview: String(((H = O.target) == null ? void 0 : H.result) ?? "")
371
- });
372
- }, l.readAsDataURL(f);
373
- return;
374
- }
375
- z.value.push({ file: f, preview: "" });
376
- }
377
- }, le = () => ee(async () => {
378
- try {
379
- let f = S.value.reduce(
380
- (O, H) => Math.max(O, ae(H)),
381
- 0
382
- );
383
- const l = {};
384
- for (const { file: O } of z.value) {
385
- const H = `additionalDocument${++f}`;
386
- l[H] = await h.uploadDocument(
387
- D,
388
- H,
389
- O
390
- );
391
- }
392
- y(
393
- "update:submission",
394
- await h.addAdditionalDocuments(
395
- d.submission._id,
396
- l
397
- )
398
- ), z.value = [], g.open({ type: "success", title: "Documents saved" });
399
- } catch (f) {
400
- g.open({
401
- type: "error",
402
- title: "Error occurs when sending additional documents",
403
- message: G(f)
404
- });
405
- }
406
- }), re = () => q(async () => {
407
- try {
408
- const f = await h.reviewById(
409
- d.submission._id,
410
- {
411
- numberOfDevices: L.value.toString(),
412
- rates: {
413
- duitNow: parseFloat(v.value.duitNow),
414
- mydebitCard: parseFloat(v.value.mydebitCard),
415
- localDebit: parseFloat(v.value.localDebit),
416
- localCredit: parseFloat(v.value.localCredit),
417
- foreignCard: parseFloat(v.value.foreignCard),
418
- jcbStandard: parseFloat(v.value.jcbStandard),
419
- jcbPlatinum: parseFloat(v.value.jcbPlatinum)
420
- },
421
- status: "approved"
422
- }
423
- );
424
- y("update:submission", f), N.value = !1, g.open({
425
- type: "success",
426
- title: "Submission updated successfully"
427
- });
428
- } catch (f) {
429
- g.open({
430
- type: "error",
431
- title: "Error occurs when updating submission",
432
- message: G(f)
433
- });
434
- }
435
- }), { isLoading: te, startAsyncCall: ie } = ne(), se = _(
436
- () => d.submission.timelineStatus === "complete"
437
- ), i = (f) => ie(async () => {
438
- try {
439
- y(
440
- "update:submission",
441
- await h.trackStatus(d.submission._id, f)
442
- ), g.open({
443
- type: "success",
444
- title: "Status tracking updated successfully"
445
- });
446
- } catch (l) {
447
- g.open({
448
- type: "error",
449
- title: "Error occurs when updating status tracking",
450
- message: G(l)
451
- });
452
- }
453
- }), J = () => q(async () => {
454
- try {
455
- const f = await h.reviewById(
456
- d.submission._id,
457
- {
458
- status: "rejected",
459
- statusReason: x.value
460
- }
461
- );
462
- y("update:submission", f), N.value = !1, g.open({
463
- type: "success",
464
- title: "Submission updated successfully"
465
- });
466
- } catch (f) {
467
- g.open({
468
- type: "error",
469
- title: "Error occurs when updating submission",
470
- message: G(f)
471
- });
472
- }
473
- });
474
- return (f, l) => {
475
- const O = w("FmButton"), H = w("FmDropField"), I = w("FmTextField"), Ce = w("FmTextarea"), Ne = w("FmDialog"), Se = w("FmPhoneNumber"), me = w("FmSelect"), Pe = w("FmForm");
476
- return m(), V(M, null, [
477
- a("div", Xe, [
478
- a("div", null, [
479
- l[42] || (l[42] = a("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
480
- a("span", Ze, R(e(D)), 1)
481
- ]),
482
- a("div", null, [
483
- l[43] || (l[43] = a("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
484
- a("span", el, R(e(k).name) + " ( " + R(e(k).legalName) + " )", 1)
485
- ]),
486
- a("div", null, [
487
- l[44] || (l[44] = a("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
488
- a("span", ll, R(e(k).email), 1)
489
- ]),
490
- a("div", null, [
491
- l[45] || (l[45] = a("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
492
- a("span", tl, R(e(k).phoneNo), 1)
493
- ]),
494
- a("div", null, [
495
- l[46] || (l[46] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
496
- a("span", al, [
497
- o(Ve, { data: e(A) }, null, 8, ["data"])
498
- ])
499
- ]),
500
- a("div", null, [
501
- l[47] || (l[47] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
502
- a("span", sl, R(e(E)), 1)
503
- ])
504
- ]),
505
- a("div", nl, [
506
- l[48] || (l[48] = a("h3", { class: "font-semibold text-lg" }, "Status Tracking", -1)),
507
- a("span", {
508
- class: ye([
509
- "rounded px-2 py-[2px] text-xs",
510
- se.value ? "bg-green-100 text-green-700" : "bg-yellow-100 text-yellow-700"
511
- ])
512
- }, R(se.value ? "COMPLETE" : "PENDING"), 3)
513
- ]),
514
- a("div", ol, [
515
- a("div", rl, [
516
- o(O, {
517
- type: "button",
518
- variant: "secondary",
519
- "prepend-icon": "storefront",
520
- label: "Pending Merchant",
521
- loading: e(te),
522
- onClick: l[0] || (l[0] = (t) => i("pending-merchant"))
523
- }, null, 8, ["loading"]),
524
- o(O, {
525
- type: "button",
526
- variant: "secondary",
527
- "prepend-icon": "hourglass_top",
528
- label: "Pending FassPay",
529
- loading: e(te),
530
- onClick: l[1] || (l[1] = (t) => i("pending-fasspay"))
531
- }, null, 8, ["loading"])
532
- ]),
533
- a("div", il, [
534
- o(O, {
535
- type: "button",
536
- variant: "tertiary",
537
- "prepend-icon": "task_alt",
538
- label: "Complete FassPay",
539
- loading: e(te),
540
- onClick: l[2] || (l[2] = (t) => i("complete-fasspay"))
541
- }, null, 8, ["loading"]),
542
- o(O, {
543
- type: "button",
544
- variant: "primary",
545
- "prepend-icon": "credit_card",
546
- label: "Complete Credit Card",
547
- loading: e(te),
548
- disabled: se.value,
549
- onClick: l[3] || (l[3] = (t) => i("complete-credit-card"))
550
- }, null, 8, ["loading", "disabled"])
551
- ])
552
- ]),
553
- l[66] || (l[66] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Timeline", -1)),
554
- o(ke, {
555
- entries: u.submission.timeline
556
- }, null, 8, ["entries"]),
557
- l[67] || (l[67] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " (SharePoint) Additional Requested Documents ", -1)),
558
- a("div", ul, [
559
- (m(!0), V(M, null, K(S.value, (t) => (m(), T(F, {
560
- key: t,
561
- label: t.replace("additionalDocument", "Document "),
562
- type: /\.pdf$/i.test(d.submission.documents[t]) ? "pdf" : "image",
563
- modelValue: d.submission.documents[t],
564
- "onUpdate:modelValue": (W) => d.submission.documents[t] = W,
565
- "restaurant-id": e(D)
566
- }, null, 8, ["label", "type", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128)),
567
- (m(!0), V(M, null, K(z.value, (t, W) => (m(), V("div", {
568
- key: `new-${W}`
569
- }, [
570
- a("p", null, "Document " + R(S.value.length + W + 1), 1),
571
- t.file.type.startsWith("image/") ? (m(), V("img", {
572
- key: 0,
573
- src: t.preview,
574
- class: "mt-2 rounded border"
575
- }, null, 8, dl)) : (m(), V("p", ml, R(t.file.name), 1)),
576
- o(O, {
577
- class: "mt-4",
578
- "prepend-icon": "delete",
579
- label: "Remove",
580
- variant: "destructive",
581
- onClick: (pt) => z.value.splice(W, 1)
582
- }, null, 8, ["onClick"])
583
- ]))), 128)),
584
- n.value < ge ? (m(), V("div", pl, [
585
- a("p", null, "Document " + R(n.value + 1), 1),
586
- o(H, {
587
- accept: ".png, .jpg, .jpeg, .pdf",
588
- onFileUpload: U
589
- })
590
- ])) : $("", !0)
591
- ]),
592
- z.value.length ? (m(), V("div", bl, [
593
- o(O, {
594
- type: "button",
595
- variant: "primary",
596
- "prepend-icon": "cloud_upload",
597
- label: "Save documents",
598
- loading: e(Z),
599
- onClick: le
600
- }, null, 8, ["loading"])
601
- ])) : $("", !0),
602
- l[68] || (l[68] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
603
- a("div", cl, [
604
- o(I, {
605
- modelValue: v.value.duitNow,
606
- "onUpdate:modelValue": l[4] || (l[4] = (t) => v.value.duitNow = t),
607
- label: "DuitNow QR",
608
- "label-mark": "required",
609
- type: "number",
610
- inputmode: "numeric",
611
- decimal: 2,
612
- rules: e(b)(
613
- e(c).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
614
- )
615
- }, {
616
- append: P(() => [...l[49] || (l[49] = [
617
- Y("%", -1)
618
- ])]),
619
- _: 1
620
- }, 8, ["modelValue", "rules"]),
621
- o(I, {
622
- modelValue: v.value.mydebitCard,
623
- "onUpdate:modelValue": l[5] || (l[5] = (t) => v.value.mydebitCard = t),
624
- label: "myDebit Card",
625
- "label-mark": "required",
626
- type: "number",
627
- inputmode: "numeric",
628
- decimal: 2,
629
- rules: e(b)(
630
- e(c).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
631
- )
632
- }, {
633
- append: P(() => [...l[50] || (l[50] = [
634
- Y("%", -1)
635
- ])]),
636
- _: 1
637
- }, 8, ["modelValue", "rules"]),
638
- o(I, {
639
- modelValue: v.value.localDebit,
640
- "onUpdate:modelValue": l[6] || (l[6] = (t) => v.value.localDebit = t),
641
- label: "Local Debit Card",
642
- "label-mark": "required",
643
- type: "number",
644
- inputmode: "numeric",
645
- decimal: 2,
646
- rules: e(b)(
647
- e(c).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
648
- )
649
- }, {
650
- append: P(() => [...l[51] || (l[51] = [
651
- Y("%", -1)
652
- ])]),
653
- _: 1
654
- }, 8, ["modelValue", "rules"]),
655
- o(I, {
656
- modelValue: v.value.localCredit,
657
- "onUpdate:modelValue": l[7] || (l[7] = (t) => v.value.localCredit = t),
658
- label: "Local Credit Card",
659
- "label-mark": "required",
660
- type: "number",
661
- inputmode: "numeric",
662
- decimal: 2,
663
- rules: e(b)(
664
- e(c).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
665
- )
666
- }, {
667
- append: P(() => [...l[52] || (l[52] = [
668
- Y("%", -1)
669
- ])]),
670
- _: 1
671
- }, 8, ["modelValue", "rules"]),
672
- o(I, {
673
- modelValue: v.value.foreignCard,
674
- "onUpdate:modelValue": l[8] || (l[8] = (t) => v.value.foreignCard = t),
675
- label: "Foreign Card",
676
- "label-mark": "required",
677
- type: "number",
678
- inputmode: "numeric",
679
- decimal: 2,
680
- rules: e(b)(
681
- e(c).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
682
- )
683
- }, {
684
- append: P(() => [...l[53] || (l[53] = [
685
- Y("%", -1)
686
- ])]),
687
- _: 1
688
- }, 8, ["modelValue", "rules"]),
689
- o(I, {
690
- modelValue: v.value.jcbStandard,
691
- "onUpdate:modelValue": l[9] || (l[9] = (t) => v.value.jcbStandard = t),
692
- label: "JCB Standard",
693
- "label-mark": "required",
694
- type: "number",
695
- inputmode: "numeric",
696
- decimal: 2,
697
- rules: e(b)(
698
- e(c).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
699
- )
700
- }, {
701
- append: P(() => [...l[54] || (l[54] = [
702
- Y("%", -1)
703
- ])]),
704
- _: 1
705
- }, 8, ["modelValue", "rules"]),
706
- o(I, {
707
- modelValue: v.value.jcbPlatinum,
708
- "onUpdate:modelValue": l[10] || (l[10] = (t) => v.value.jcbPlatinum = t),
709
- label: "JCB Platinum",
710
- "label-mark": "required",
711
- type: "number",
712
- inputmode: "numeric",
713
- decimal: 2,
714
- rules: e(b)(
715
- e(c).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
716
- )
717
- }, {
718
- append: P(() => [...l[55] || (l[55] = [
719
- Y("%", -1)
720
- ])]),
721
- _: 1
722
- }, 8, ["modelValue", "rules"])
723
- ]),
724
- l[69] || (l[69] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-6" }, "Extra Settings", -1)),
725
- a("div", gl, [
726
- o(I, {
727
- modelValue: L.value,
728
- "onUpdate:modelValue": l[11] || (l[11] = (t) => L.value = t),
729
- label: "Number of Devices",
730
- "label-mark": "required",
731
- type: "number",
732
- inputmode: "numeric"
733
- }, null, 8, ["modelValue"])
734
- ]),
735
- a("div", yl, [
736
- o(Ne, {
737
- modelValue: N.value,
738
- "onUpdate:modelValue": l[13] || (l[13] = (t) => N.value = t)
739
- }, {
740
- "dialog-button": P(() => [
741
- o(O, {
742
- class: "mr-6",
743
- type: "button",
744
- variant: "destructive",
745
- "prepend-icon": "block",
746
- loading: e(p),
747
- label: "Reject Submission"
748
- }, null, 8, ["loading"])
749
- ]),
750
- "dialog-header": P(() => [...l[56] || (l[56] = [
751
- a("div", null, "Rejecting Submission", -1)
752
- ])]),
753
- default: P(() => [
754
- o(Ce, {
755
- modelValue: x.value,
756
- "onUpdate:modelValue": l[12] || (l[12] = (t) => x.value = t),
757
- label: "Reason for Rejection",
758
- "label-mark": "optional",
759
- "helper-text": "Please provide a reason for rejection."
760
- }, null, 8, ["modelValue"]),
761
- o(O, {
762
- class: "mb-2 mt-6 w-full",
763
- label: "Submit",
764
- "prepend-icon": "save",
765
- onClick: J,
766
- loading: e(p)
767
- }, null, 8, ["loading"])
768
- ]),
769
- _: 1
770
- }, 8, ["modelValue"]),
771
- o(O, {
772
- type: "button",
773
- variant: "primary",
774
- "prepend-icon": "approval",
775
- disabled: !B.value,
776
- label: "Approve Submission with Rates",
777
- onClick: re,
778
- loading: e(p)
779
- }, null, 8, ["disabled", "loading"])
780
- ]),
781
- o(Pe, { disabled: !0 }, {
782
- default: P(() => [
783
- l[57] || (l[57] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
784
- a("div", vl, [
785
- a("div", fl, [
786
- o(I, {
787
- modelValue: e(s).picName,
788
- "onUpdate:modelValue": l[14] || (l[14] = (t) => e(s).picName = t),
789
- label: "Owner/Director Name",
790
- placeholder: "Enter your name",
791
- "label-mark": "required",
792
- rules: e(b)(e(c).string().min(1, "Owner/Director Name is required"))
793
- }, null, 8, ["modelValue", "rules"])
794
- ]),
795
- a("div", Vl, [
796
- o(I, {
797
- modelValue: e(s).picRole,
798
- "onUpdate:modelValue": l[15] || (l[15] = (t) => e(s).picRole = t),
799
- label: "Owner/Director Role",
800
- placeholder: "Enter your role",
801
- "label-mark": "required",
802
- rules: e(b)(e(c).string().min(1, "Owner/Director Role is required"))
803
- }, null, 8, ["modelValue", "rules"])
804
- ]),
805
- a("div", kl, [
806
- o(I, {
807
- modelValue: e(s).picEmail,
808
- "onUpdate:modelValue": l[16] || (l[16] = (t) => e(s).picEmail = t),
809
- label: "Owner/Director Email",
810
- type: "email",
811
- placeholder: "Enter your email address",
812
- "label-mark": "required",
813
- rules: e(b)(e(c).string().min(1, "Owner/Director Email is required"))
814
- }, null, 8, ["modelValue", "rules"])
815
- ]),
816
- a("div", Cl, [
817
- o(Se, {
818
- "model-value": e(s).picContact,
819
- "onUpdate:modelValue": l[17] || (l[17] = (t) => e(s).picContact = t),
820
- "default-country": "MY",
821
- label: "Owner/Director Contact",
822
- "label-mark": "required",
823
- rules: e(b)(e(c).string().min(1, "Owner/Director Contact is required"))
824
- }, null, 8, ["model-value", "rules"])
825
- ]),
826
- a("div", Nl, [
827
- o(I, {
828
- modelValue: e(s).nric,
829
- "onUpdate:modelValue": l[18] || (l[18] = (t) => e(s).nric = t),
830
- label: "Owner/Director NRIC No",
831
- placeholder: "Enter your NRIC number",
832
- "label-mark": "required",
833
- rules: e(b)(e(c).string().min(1, "NRIC No is required"))
834
- }, null, 8, ["modelValue", "rules"])
835
- ]),
836
- a("div", Sl, [
837
- o(I, {
838
- modelValue: e(s).tradingName,
839
- "onUpdate:modelValue": l[19] || (l[19] = (t) => e(s).tradingName = t),
840
- label: "Trading Name",
841
- placeholder: "Enter trading name",
842
- "label-mark": "required",
843
- rules: e(b)(e(c).string().min(1, "Trading Name is required"))
844
- }, null, 8, ["modelValue", "rules"])
845
- ]),
846
- a("div", Pl, [
847
- o(I, {
848
- modelValue: e(s).outletName,
849
- "onUpdate:modelValue": l[20] || (l[20] = (t) => e(s).outletName = t),
850
- label: "Registered Name",
851
- placeholder: "Enter registered name",
852
- "label-mark": "required",
853
- rules: e(b)(e(c).string().min(1, "Registered Name is required"))
854
- }, null, 8, ["modelValue", "rules"])
855
- ]),
856
- a("div", wl, [
857
- o(I, {
858
- modelValue: e(s).outletAddress,
859
- "onUpdate:modelValue": l[21] || (l[21] = (t) => e(s).outletAddress = t),
860
- label: "Outlet Address",
861
- placeholder: "Enter outlet address",
862
- "label-mark": "required",
863
- rules: e(b)(e(c).string().min(1, "Address is required"))
864
- }, null, 8, ["modelValue", "rules"])
865
- ]),
866
- o(I, {
867
- modelValue: e(s).outletPostCode,
868
- "onUpdate:modelValue": l[22] || (l[22] = (t) => e(s).outletPostCode = t),
869
- label: "Postal Code",
870
- placeholder: "Enter postal code",
871
- "label-mark": "required",
872
- rules: e(b)(e(c).string().min(1, "Postal Code is required"))
873
- }, null, 8, ["modelValue", "rules"]),
874
- o(I, {
875
- modelValue: e(s).outletState,
876
- "onUpdate:modelValue": l[23] || (l[23] = (t) => e(s).outletState = t),
877
- label: "State",
878
- placeholder: "Enter state",
879
- "label-mark": "required",
880
- rules: e(b)(e(c).string().min(1, "State is required"))
881
- }, null, 8, ["modelValue", "rules"]),
882
- o(I, {
883
- modelValue: e(s).outletCity,
884
- "onUpdate:modelValue": l[24] || (l[24] = (t) => e(s).outletCity = t),
885
- label: "City",
886
- placeholder: "Enter city",
887
- "label-mark": "required",
888
- rules: e(b)(e(c).string().min(1, "City is required"))
889
- }, null, 8, ["modelValue", "rules"]),
890
- a("div", xl, [
891
- o(me, {
892
- modelValue: e(s).businessType,
893
- "onUpdate:modelValue": l[25] || (l[25] = (t) => e(s).businessType = t),
894
- label: "Type",
895
- placeholder: "Select business type",
896
- "label-mark": "required",
897
- rules: e(b)(e(c).string().min(1, "Business Type is required")),
898
- items: [
899
- { label: "Sole Proprietorship", value: "sole_proprietorship" },
900
- { label: "Partnership", value: "partnership" },
901
- {
902
- label: "Private Limited Company (Sdn Bhd)",
903
- value: "private_limited"
904
- },
905
- {
906
- label: "Public Limited Company (Berhad)",
907
- value: "public_limited"
908
- }
909
- ]
910
- }, null, 8, ["modelValue", "rules"])
911
- ]),
912
- a("div", Il, [
913
- o(I, {
914
- modelValue: e(s).businessRegNo,
915
- "onUpdate:modelValue": l[26] || (l[26] = (t) => e(s).businessRegNo = t),
916
- label: "Registration No",
917
- placeholder: "Enter registration number",
918
- "label-mark": "required",
919
- rules: e(b)(e(c).string().min(1, "Reg No is required"))
920
- }, null, 8, ["modelValue", "rules"])
921
- ]),
922
- a("div", Rl, [
923
- o(I, {
924
- modelValue: e(s).tinNo,
925
- "onUpdate:modelValue": l[27] || (l[27] = (t) => e(s).tinNo = t),
926
- label: "Tax Identification No (TIN)",
927
- placeholder: "Enter your TIN number",
928
- "label-mark": "required",
929
- rules: e(b)(e(c).string().min(1, "TIN is required"))
930
- }, null, 8, ["modelValue", "rules"])
931
- ]),
932
- a("div", ql, [
933
- o(I, {
934
- modelValue: e(s).sstNo,
935
- "onUpdate:modelValue": l[28] || (l[28] = (t) => e(s).sstNo = t),
936
- label: "SST Registration No (SST)",
937
- placeholder: "Enter your SST number",
938
- "label-mark": "optional"
939
- }, null, 8, ["modelValue"])
940
- ])
941
- ]),
942
- l[58] || (l[58] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
943
- a("div", Ul, [
944
- o(me, {
945
- modelValue: e(s).bankName,
946
- "onUpdate:modelValue": l[29] || (l[29] = (t) => e(s).bankName = t),
947
- label: "Bank",
948
- placeholder: "Select bank type",
949
- "label-mark": "required",
950
- rules: e(b)(e(c).string().min(1, "Bank Type is required")),
951
- items: e(qe).bankNameOptions()
952
- }, null, 8, ["modelValue", "rules", "items"]),
953
- o(I, {
954
- modelValue: e(s).bankHolderName,
955
- "onUpdate:modelValue": l[30] || (l[30] = (t) => e(s).bankHolderName = t),
956
- label: "Beneficiary Name",
957
- placeholder: "Enter Beneficiary Name",
958
- "label-mark": "required",
959
- rules: e(b)(e(c).string().min(1, "Beneficiary Name is required"))
960
- }, null, 8, ["modelValue", "rules"]),
961
- o(I, {
962
- modelValue: e(s).bankAccountNo,
963
- "onUpdate:modelValue": l[31] || (l[31] = (t) => e(s).bankAccountNo = t),
964
- label: "Account Number",
965
- placeholder: "Enter Account Number",
966
- "label-mark": "required",
967
- rules: e(b)(e(c).string().min(1, "Account Number is required"))
968
- }, null, 8, ["modelValue", "rules"])
969
- ]),
970
- l[59] || (l[59] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
971
- l[60] || (l[60] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 1. All Directors/Owner ICs ", -1)),
972
- a("div", Fl, [
973
- o(F, {
974
- label: "Authorized Person ID",
975
- modelValue: e(r).authorizedPersonID,
976
- "onUpdate:modelValue": l[32] || (l[32] = (t) => e(r).authorizedPersonID = t),
977
- type: "image",
978
- "restaurant-id": u.submission.restaurantId
979
- }, null, 8, ["modelValue", "restaurant-id"]),
980
- (m(!0), V(M, null, K(X.value, (t) => (m(), T(F, {
981
- key: t,
982
- label: `Authorized Person ID ${t.replace("authorizedPersonID", "")}`,
983
- modelValue: e(r)[t],
984
- "onUpdate:modelValue": (W) => e(r)[t] = W,
985
- type: "image",
986
- "restaurant-id": u.submission.restaurantId
987
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128))
988
- ]),
989
- l[61] || (l[61] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-6" }, " Section 2. Business Information ", -1)),
990
- a("div", Dl, [
991
- e(s).businessType === "private_limited" || e(s).businessType === "public_limited" ? (m(), T(F, {
992
- key: 0,
993
- label: "Superform",
994
- type: "pdf",
995
- modelValue: e(r).certificate,
996
- "onUpdate:modelValue": l[33] || (l[33] = (t) => e(r).certificate = t),
997
- "restaurant-id": u.submission.restaurantId
998
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
999
- e(s).businessType === "sole_proprietorship" || e(s).businessType === "partnership" ? (m(), T(F, {
1000
- key: 1,
1001
- label: "Business Registration Document",
1002
- type: "pdf",
1003
- modelValue: e(r).certificate,
1004
- "onUpdate:modelValue": l[34] || (l[34] = (t) => e(r).certificate = t),
1005
- "restaurant-id": u.submission.restaurantId
1006
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1007
- e(r).interiorPhoto ? (m(), T(F, {
1008
- key: 2,
1009
- label: "Interior Photo",
1010
- modelValue: e(r).interiorPhoto,
1011
- "onUpdate:modelValue": l[35] || (l[35] = (t) => e(r).interiorPhoto = t),
1012
- type: "image",
1013
- "restaurant-id": u.submission.restaurantId
1014
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1015
- o(F, {
1016
- label: "Outlet Photo",
1017
- modelValue: e(r).outletPhoto,
1018
- "onUpdate:modelValue": l[36] || (l[36] = (t) => e(r).outletPhoto = t),
1019
- type: "image-or-pdf",
1020
- "restaurant-id": u.submission.restaurantId
1021
- }, null, 8, ["modelValue", "restaurant-id"])
1022
- ]),
1023
- l[62] || (l[62] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 3. Payout Information ", -1)),
1024
- a("div", El, [
1025
- o(F, {
1026
- label: "Latest Bank Statement",
1027
- modelValue: e(r).bankStatement,
1028
- "onUpdate:modelValue": l[37] || (l[37] = (t) => e(r).bankStatement = t),
1029
- type: "pdf",
1030
- "restaurant-id": u.submission.restaurantId
1031
- }, null, 8, ["modelValue", "restaurant-id"])
1032
- ]),
1033
- l[63] || (l[63] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 4. Site Photos ", -1)),
1034
- a("div", Tl, [
1035
- (m(!0), V(M, null, K([1, 2, 3, 4, 5].filter(
1036
- (t) => !!e(r)[`onsitePhoto${t}`]
1037
- ), (t) => (m(), T(F, {
1038
- key: t,
1039
- label: e(Ue)[t - 1],
1040
- modelValue: e(r)[`onsitePhoto${t}`],
1041
- "onUpdate:modelValue": (W) => e(r)[`onsitePhoto${t}`] = W,
1042
- type: "image",
1043
- "restaurant-id": u.submission.restaurantId
1044
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128))
1045
- ]),
1046
- l[64] || (l[64] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 5. Additional Documents ", -1)),
1047
- a("div", Al, [
1048
- e(r).liquorLicense ? (m(), T(F, {
1049
- key: 0,
1050
- label: "Liquor License",
1051
- modelValue: e(r).liquorLicense,
1052
- "onUpdate:modelValue": l[38] || (l[38] = (t) => e(r).liquorLicense = t),
1053
- type: "image-or-pdf",
1054
- "restaurant-id": u.submission.restaurantId
1055
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1056
- e(r).appendixC ? (m(), T(F, {
1057
- key: 1,
1058
- label: "Appendix C",
1059
- modelValue: e(r).appendixC,
1060
- "onUpdate:modelValue": l[39] || (l[39] = (t) => e(r).appendixC = t),
1061
- type: "pdf",
1062
- "restaurant-id": u.submission.restaurantId
1063
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1064
- !e(r).liquorLicense && !e(r).appendixC ? (m(), V("p", $l, " No additional documents submitted. ")) : $("", !0)
1065
- ]),
1066
- l[65] || (l[65] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
1067
- a("div", Ll, [
1068
- o($e, {
1069
- modelValue: e(r).signature,
1070
- "onUpdate:modelValue": l[40] || (l[40] = (t) => e(r).signature = t),
1071
- "restaurant-id": u.submission.restaurantId,
1072
- label: "Signature"
1073
- }, null, 8, ["modelValue", "restaurant-id"]),
1074
- o(F, {
1075
- label: "Company Stamp",
1076
- type: "image",
1077
- modelValue: e(r).companyStamp,
1078
- "onUpdate:modelValue": l[41] || (l[41] = (t) => e(r).companyStamp = t),
1079
- "restaurant-id": u.submission.restaurantId
1080
- }, null, 8, ["modelValue", "restaurant-id"])
1081
- ])
1082
- ]),
1083
- _: 1
1084
- })
1085
- ], 64);
1086
- };
1087
- }
1088
- }), Ol = { class: "space-y-2" }, jl = { class: "text-gray-900" }, _l = { class: "text-gray-900" }, Ml = { class: "text-gray-900" }, hl = { class: "text-gray-900" }, zl = { class: "text-gray-900" }, Hl = { class: "text-gray-900" }, Wl = { class: "mt-6 grid grid-cols-4 gap-24" }, Yl = { class: "w-full flex justify-end mt-6" }, Gl = { class: "mt-6 grid grid-cols-4 gap-24" }, Jl = { class: "col-span-2" }, Kl = { class: "col-span-2" }, Ql = { class: "col-span-2" }, Xl = { class: "col-span-2" }, Zl = { class: "mt-6 grid grid-cols-4 gap-24" }, et = { class: "mt-6 grid grid-cols-4 gap-24" }, lt = { class: "mt-6 grid grid-cols-4 gap-24" }, tt = { class: "col-span-2" }, at = { class: "col-span-2" }, st = { class: "col-span-2" }, nt = { class: "col-span-2" }, ot = { class: "col-span-2" }, rt = { class: "col-span-2" }, it = /* @__PURE__ */ Q({
1089
- __name: "NTTSubmission",
1090
- props: {
1091
- submission: {
1092
- type: Object,
1093
- required: !0
1094
- }
1095
- },
1096
- emits: ["update:submission"],
1097
- setup(u, { emit: C }) {
1098
- const d = u, y = C, g = ue(), N = j(!1), { isLoading: p, startAsyncCall: q } = ne(), { fields: s, documents: r, restaurantId: D, profile: k, status: A, statusReason: E } = d.submission, x = j(""), L = [
1099
- { key: "localCardDebit", label: "Local Card (Debit)", defaultValue: "2.3" },
1100
- {
1101
- key: "localCardStandard",
1102
- label: "Local Card (Standard)",
1103
- defaultValue: "2.3"
1104
- },
1105
- {
1106
- key: "localCardPremium",
1107
- label: "Local Card (Premium)",
1108
- defaultValue: "2.3"
1109
- },
1110
- {
1111
- key: "localCardSuperPremium",
1112
- label: "Local Card (Super Premium)",
1113
- defaultValue: "2.3"
1114
- },
1115
- {
1116
- key: "internationalCard",
1117
- label: "International Card",
1118
- defaultValue: "3.1"
1119
- },
1120
- { key: "upiCard", label: "UPI Card", defaultValue: "3" },
1121
- { key: "jcbCard", label: "JCB Card", defaultValue: "3" },
1122
- { key: "dciCard", label: "DCI Card", defaultValue: "3" },
1123
- { key: "amexCard", label: "Amex Card", defaultValue: "3" },
1124
- { key: "alipay", label: "Alipay", defaultValue: "2.3" },
1125
- { key: "alipayPlus", label: "Alipay+", defaultValue: "2.3" },
1126
- { key: "trueMoney", label: "TrueMoney", defaultValue: "2.3" },
1127
- { key: "shopeePay", label: "ShopeePay", defaultValue: "2.3" },
1128
- { key: "linePay", label: "LinePay", defaultValue: "2.1" },
1129
- { key: "thaiQr", label: "ThaiQR", defaultValue: "0.5" }
1130
- ], v = Object.fromEntries(
1131
- L.map((S) => [S.key, S.defaultValue])
1132
- ), B = j(
1133
- d.submission.rates ? Object.fromEntries(
1134
- Object.entries(d.submission.rates).map(([S, n]) => [S, `${n}`])
1135
- ) : { ...v }
1136
- ), X = _(
1137
- () => Object.values(B.value).every((S) => parseFloat(S) > 0)
1138
- ), Z = _(() => s.businessType === "juristic" ? "Juristic" : s.businessType === "individual" ? "Individual" : s.businessType || "-"), ee = () => q(async () => {
1139
- try {
1140
- const S = await h.reviewById(
1141
- d.submission._id,
1142
- {
1143
- status: ve.FdoOnboardStatus.enum.ready
1144
- }
1145
- );
1146
- y("update:submission", S), g.open({
1147
- type: "success",
1148
- title: "Submission marked as ready"
1149
- });
1150
- } catch (S) {
1151
- g.open({
1152
- type: "error",
1153
- title: "Error occurs when marking submission as ready",
1154
- message: G(S)
1155
- });
1156
- }
1157
- }), z = () => q(async () => {
1158
- try {
1159
- const S = await h.reviewById(
1160
- d.submission._id,
1161
- {
1162
- rates: Object.fromEntries(
1163
- L.map((n) => [
1164
- n.key,
1165
- parseFloat(B.value[n.key])
1166
- ])
1167
- ),
1168
- status: "approved"
1169
- }
1170
- );
1171
- y("update:submission", S), g.open({
1172
- type: "success",
1173
- title: "Submission updated successfully"
1174
- });
1175
- } catch (S) {
1176
- g.open({
1177
- type: "error",
1178
- title: "Error occurs when updating submission",
1179
- message: G(S)
1180
- });
1181
- }
1182
- }), ae = () => q(async () => {
1183
- try {
1184
- const S = await h.reviewById(
1185
- d.submission._id,
1186
- {
1187
- status: "rejected",
1188
- statusReason: x.value
1189
- }
1190
- );
1191
- y("update:submission", S), N.value = !1, g.open({
1192
- type: "success",
1193
- title: "Submission updated successfully"
1194
- });
1195
- } catch (S) {
1196
- g.open({
1197
- type: "error",
1198
- title: "Error occurs when updating submission",
1199
- message: G(S)
1200
- });
1201
- }
1202
- });
1203
- return (S, n) => {
1204
- const U = w("FmTextField"), le = w("FmButton"), re = w("FmTextarea"), te = w("FmDialog"), ie = w("FmPhoneNumber"), se = w("FmForm");
1205
- return m(), V(M, null, [
1206
- a("div", Ol, [
1207
- a("div", null, [
1208
- n[31] || (n[31] = a("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
1209
- a("span", jl, R(e(D)), 1)
1210
- ]),
1211
- a("div", null, [
1212
- n[32] || (n[32] = a("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
1213
- a("span", _l, R(e(k).name) + " ( " + R(e(k).legalName) + " )", 1)
1214
- ]),
1215
- a("div", null, [
1216
- n[33] || (n[33] = a("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
1217
- a("span", Ml, R(e(k).email), 1)
1218
- ]),
1219
- a("div", null, [
1220
- n[34] || (n[34] = a("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
1221
- a("span", hl, R(e(k).phoneNo), 1)
1222
- ]),
1223
- a("div", null, [
1224
- n[35] || (n[35] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
1225
- a("span", zl, [
1226
- o(Ve, { data: e(A) }, null, 8, ["data"])
1227
- ])
1228
- ]),
1229
- a("div", null, [
1230
- n[36] || (n[36] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
1231
- a("span", Hl, R(e(E)), 1)
1232
- ])
1233
- ]),
1234
- n[43] || (n[43] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
1235
- a("div", Wl, [
1236
- (m(), V(M, null, K(L, (i) => o(U, {
1237
- key: i.key,
1238
- modelValue: B.value[i.key],
1239
- "onUpdate:modelValue": (J) => B.value[i.key] = J,
1240
- label: i.label,
1241
- "label-mark": "required",
1242
- type: "number",
1243
- inputmode: "numeric",
1244
- decimal: 2,
1245
- rules: e(b)(
1246
- e(c).string().min(1, "Rate is required").transform((J) => parseFloat(J)).refine((J) => !isNaN(J), { message: "Rate must be a number" })
1247
- )
1248
- }, {
1249
- append: P(() => [...n[37] || (n[37] = [
1250
- Y("%", -1)
1251
- ])]),
1252
- _: 1
1253
- }, 8, ["modelValue", "onUpdate:modelValue", "label", "rules"])), 64))
1254
- ]),
1255
- a("div", Yl, [
1256
- o(te, {
1257
- modelValue: N.value,
1258
- "onUpdate:modelValue": n[1] || (n[1] = (i) => N.value = i)
1259
- }, {
1260
- "dialog-button": P(() => [
1261
- o(le, {
1262
- class: "mr-6",
1263
- type: "button",
1264
- variant: "destructive",
1265
- "prepend-icon": "block",
1266
- loading: e(p),
1267
- label: "Reject Submission"
1268
- }, null, 8, ["loading"])
1269
- ]),
1270
- "dialog-header": P(() => [...n[38] || (n[38] = [
1271
- a("div", null, "Rejecting Submission", -1)
1272
- ])]),
1273
- default: P(() => [
1274
- o(re, {
1275
- modelValue: x.value,
1276
- "onUpdate:modelValue": n[0] || (n[0] = (i) => x.value = i),
1277
- label: "Reason for Rejection",
1278
- "label-mark": "optional",
1279
- "helper-text": "Please provide a reason for rejection."
1280
- }, null, 8, ["modelValue"]),
1281
- o(le, {
1282
- class: "mb-2 mt-6 w-full",
1283
- label: "Submit",
1284
- "prepend-icon": "save",
1285
- onClick: ae,
1286
- loading: e(p)
1287
- }, null, 8, ["loading"])
1288
- ]),
1289
- _: 1
1290
- }, 8, ["modelValue"]),
1291
- o(le, {
1292
- type: "button",
1293
- variant: "primary",
1294
- "prepend-icon": "approval",
1295
- label: "Approve Submission with Rates",
1296
- disabled: !X.value,
1297
- onClick: z,
1298
- loading: e(p)
1299
- }, null, 8, ["disabled", "loading"]),
1300
- e(A) === "approved" ? (m(), T(le, {
1301
- key: 0,
1302
- type: "button",
1303
- variant: "secondary",
1304
- "prepend-icon": "check_circle",
1305
- label: "Mark as Ready",
1306
- class: "ml-6",
1307
- onClick: ee,
1308
- loading: e(p)
1309
- }, null, 8, ["loading"])) : $("", !0)
1310
- ]),
1311
- o(se, { disabled: !0 }, {
1312
- default: P(() => [
1313
- n[39] || (n[39] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
1314
- a("div", Gl, [
1315
- a("div", Jl, [
1316
- o(U, {
1317
- modelValue: e(s).companyName,
1318
- "onUpdate:modelValue": n[2] || (n[2] = (i) => e(s).companyName = i),
1319
- label: "Company Name",
1320
- "label-mark": "required",
1321
- rules: e(b)(e(c).string().min(1, "Company Name is required"))
1322
- }, null, 8, ["modelValue", "rules"])
1323
- ]),
1324
- a("div", Kl, [
1325
- o(U, {
1326
- modelValue: e(s).outletName,
1327
- "onUpdate:modelValue": n[3] || (n[3] = (i) => e(s).outletName = i),
1328
- label: "Outlet Name (Thai)",
1329
- "label-mark": "required",
1330
- rules: e(b)(e(c).string().min(1, "Outlet Name is required"))
1331
- }, null, 8, ["modelValue", "rules"])
1332
- ]),
1333
- a("div", Ql, [
1334
- o(U, {
1335
- modelValue: e(s).outletNameEnglish,
1336
- "onUpdate:modelValue": n[4] || (n[4] = (i) => e(s).outletNameEnglish = i),
1337
- label: "Outlet Name (English)",
1338
- "label-mark": "required",
1339
- rules: e(b)(e(c).string().min(1, "Outlet Name English is required"))
1340
- }, null, 8, ["modelValue", "rules"])
1341
- ]),
1342
- a("div", Xl, [
1343
- o(U, {
1344
- modelValue: e(s).outletAddress,
1345
- "onUpdate:modelValue": n[5] || (n[5] = (i) => e(s).outletAddress = i),
1346
- label: "Outlet Address",
1347
- "label-mark": "required",
1348
- rules: e(b)(e(c).string().min(1, "Outlet Address is required"))
1349
- }, null, 8, ["modelValue", "rules"])
1350
- ]),
1351
- o(U, {
1352
- modelValue: e(s).outletPostCode,
1353
- "onUpdate:modelValue": n[6] || (n[6] = (i) => e(s).outletPostCode = i),
1354
- label: "Post Code",
1355
- "label-mark": "required",
1356
- rules: e(b)(e(c).string().min(1, "Post Code is required"))
1357
- }, null, 8, ["modelValue", "rules"]),
1358
- o(U, {
1359
- modelValue: e(s).outletState,
1360
- "onUpdate:modelValue": n[7] || (n[7] = (i) => e(s).outletState = i),
1361
- label: "State",
1362
- "label-mark": "required",
1363
- rules: e(b)(e(c).string().min(1, "State is required"))
1364
- }, null, 8, ["modelValue", "rules"]),
1365
- o(U, {
1366
- modelValue: e(s).outletCity,
1367
- "onUpdate:modelValue": n[8] || (n[8] = (i) => e(s).outletCity = i),
1368
- label: "City",
1369
- "label-mark": "required",
1370
- rules: e(b)(e(c).string().min(1, "City is required"))
1371
- }, null, 8, ["modelValue", "rules"]),
1372
- o(U, {
1373
- "model-value": Z.value,
1374
- label: "Business Type",
1375
- "label-mark": "required"
1376
- }, null, 8, ["model-value"]),
1377
- o(U, {
1378
- modelValue: e(s).numberOfDevices,
1379
- "onUpdate:modelValue": n[9] || (n[9] = (i) => e(s).numberOfDevices = i),
1380
- label: "Number of Devices",
1381
- "label-mark": "required"
1382
- }, null, 8, ["modelValue"])
1383
- ]),
1384
- n[40] || (n[40] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
1385
- a("div", Zl, [
1386
- o(U, {
1387
- modelValue: e(s).bankName,
1388
- "onUpdate:modelValue": n[10] || (n[10] = (i) => e(s).bankName = i),
1389
- label: "Bank Name",
1390
- "label-mark": "required",
1391
- rules: e(b)(e(c).string().min(1, "Bank Name is required"))
1392
- }, null, 8, ["modelValue", "rules"]),
1393
- o(U, {
1394
- modelValue: e(s).bankHolderName,
1395
- "onUpdate:modelValue": n[11] || (n[11] = (i) => e(s).bankHolderName = i),
1396
- label: "Bank Holder Name",
1397
- "label-mark": "required",
1398
- rules: e(b)(e(c).string().min(1, "Bank Holder Name is required"))
1399
- }, null, 8, ["modelValue", "rules"]),
1400
- o(U, {
1401
- modelValue: e(s).bankAccountNo,
1402
- "onUpdate:modelValue": n[12] || (n[12] = (i) => e(s).bankAccountNo = i),
1403
- label: "Bank Account No",
1404
- "label-mark": "required",
1405
- rules: e(b)(e(c).string().min(1, "Bank Account No is required"))
1406
- }, null, 8, ["modelValue", "rules"]),
1407
- o(U, {
1408
- modelValue: e(s).bankBranch,
1409
- "onUpdate:modelValue": n[13] || (n[13] = (i) => e(s).bankBranch = i),
1410
- label: "Bank Branch",
1411
- "label-mark": "required",
1412
- rules: e(b)(e(c).string().min(1, "Bank Branch is required"))
1413
- }, null, 8, ["modelValue", "rules"]),
1414
- o(U, {
1415
- modelValue: e(s).bankBranchCode,
1416
- "onUpdate:modelValue": n[14] || (n[14] = (i) => e(s).bankBranchCode = i),
1417
- label: "Bank Branch Code",
1418
- "label-mark": "required",
1419
- rules: e(b)(e(c).string().min(1, "Bank Branch Code is required"))
1420
- }, null, 8, ["modelValue", "rules"])
1421
- ]),
1422
- n[41] || (n[41] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
1423
- a("div", et, [
1424
- o(F, {
1425
- label: "Authorized Person ID",
1426
- modelValue: e(r).authorizedPersonID,
1427
- "onUpdate:modelValue": n[15] || (n[15] = (i) => e(r).authorizedPersonID = i),
1428
- type: "image",
1429
- "restaurant-id": u.submission.restaurantId
1430
- }, null, 8, ["modelValue", "restaurant-id"]),
1431
- o(F, {
1432
- label: "Outlet Photo",
1433
- modelValue: e(r).outletPhoto,
1434
- "onUpdate:modelValue": n[16] || (n[16] = (i) => e(r).outletPhoto = i),
1435
- type: "image",
1436
- "restaurant-id": u.submission.restaurantId
1437
- }, null, 8, ["modelValue", "restaurant-id"]),
1438
- o(F, {
1439
- label: "Interior Photo",
1440
- modelValue: e(r).interiorPhoto,
1441
- "onUpdate:modelValue": n[17] || (n[17] = (i) => e(r).interiorPhoto = i),
1442
- type: "image",
1443
- "restaurant-id": u.submission.restaurantId
1444
- }, null, 8, ["modelValue", "restaurant-id"]),
1445
- o(F, {
1446
- label: "Bank Statement",
1447
- modelValue: e(r).bankStatement,
1448
- "onUpdate:modelValue": n[18] || (n[18] = (i) => e(r).bankStatement = i),
1449
- type: "pdf",
1450
- "restaurant-id": u.submission.restaurantId
1451
- }, null, 8, ["modelValue", "restaurant-id"]),
1452
- e(s).businessType === "juristic" ? (m(), T(F, {
1453
- key: 0,
1454
- label: "Company Certificate",
1455
- type: "pdf",
1456
- modelValue: e(r).companyCertificate,
1457
- "onUpdate:modelValue": n[19] || (n[19] = (i) => e(r).companyCertificate = i),
1458
- "restaurant-id": u.submission.restaurantId
1459
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1460
- e(s).businessType === "juristic" ? (m(), T(F, {
1461
- key: 1,
1462
- label: "VAT Certificate",
1463
- type: "pdf",
1464
- modelValue: e(r).vatCertificate,
1465
- "onUpdate:modelValue": n[20] || (n[20] = (i) => e(r).vatCertificate = i),
1466
- "restaurant-id": u.submission.restaurantId
1467
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1468
- e(s).businessType === "individual" ? (m(), T(F, {
1469
- key: 2,
1470
- label: "Commercial Certificate",
1471
- type: "pdf",
1472
- modelValue: e(r).commercialCertificate,
1473
- "onUpdate:modelValue": n[21] || (n[21] = (i) => e(r).commercialCertificate = i),
1474
- "restaurant-id": u.submission.restaurantId
1475
- }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0)
1476
- ]),
1477
- n[42] || (n[42] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
1478
- a("div", lt, [
1479
- a("div", tt, [
1480
- o(U, {
1481
- modelValue: e(s).picName,
1482
- "onUpdate:modelValue": n[22] || (n[22] = (i) => e(s).picName = i),
1483
- label: "PIC Name",
1484
- "label-mark": "required",
1485
- rules: e(b)(e(c).string().min(1, "PIC Name is required"))
1486
- }, null, 8, ["modelValue", "rules"])
1487
- ]),
1488
- a("div", at, [
1489
- o(U, {
1490
- modelValue: e(s).picRole,
1491
- "onUpdate:modelValue": n[23] || (n[23] = (i) => e(s).picRole = i),
1492
- label: "PIC Role",
1493
- "label-mark": "required",
1494
- rules: e(b)(e(c).string().min(1, "PIC Role is required"))
1495
- }, null, 8, ["modelValue", "rules"])
1496
- ]),
1497
- a("div", st, [
1498
- o(U, {
1499
- modelValue: e(s).picEmail,
1500
- "onUpdate:modelValue": n[24] || (n[24] = (i) => e(s).picEmail = i),
1501
- label: "PIC Email",
1502
- "label-mark": "required",
1503
- rules: e(b)(e(c).string().min(1, "PIC Email is required"))
1504
- }, null, 8, ["modelValue", "rules"])
1505
- ]),
1506
- a("div", nt, [
1507
- o(ie, {
1508
- "model-value": e(s).picContact,
1509
- "onUpdate:modelValue": n[25] || (n[25] = (i) => e(s).picContact = i),
1510
- "default-country": "TH",
1511
- label: "PIC Contact",
1512
- "label-mark": "required",
1513
- rules: e(b)(e(c).string().min(1, "PIC Contact is required"))
1514
- }, null, 8, ["model-value", "rules"])
1515
- ]),
1516
- a("div", ot, [
1517
- o(U, {
1518
- modelValue: e(s).witnessName,
1519
- "onUpdate:modelValue": n[26] || (n[26] = (i) => e(s).witnessName = i),
1520
- label: "Witness Name",
1521
- "label-mark": "required",
1522
- rules: e(b)(e(c).string().min(1, "Witness Name is required"))
1523
- }, null, 8, ["modelValue", "rules"])
1524
- ]),
1525
- a("div", rt, [
1526
- o(U, {
1527
- modelValue: e(s).witnessRole,
1528
- "onUpdate:modelValue": n[27] || (n[27] = (i) => e(s).witnessRole = i),
1529
- label: "Witness Role",
1530
- "label-mark": "required",
1531
- rules: e(b)(e(c).string().min(1, "Witness Role is required"))
1532
- }, null, 8, ["modelValue", "rules"])
1533
- ]),
1534
- o(F, {
1535
- label: "Signature",
1536
- type: "image",
1537
- modelValue: e(r).signature,
1538
- "onUpdate:modelValue": n[28] || (n[28] = (i) => e(r).signature = i),
1539
- "restaurant-id": u.submission.restaurantId
1540
- }, null, 8, ["modelValue", "restaurant-id"]),
1541
- o(F, {
1542
- label: "Witness Signature",
1543
- type: "image",
1544
- modelValue: e(r).witnessSignature,
1545
- "onUpdate:modelValue": n[29] || (n[29] = (i) => e(r).witnessSignature = i),
1546
- "restaurant-id": u.submission.restaurantId
1547
- }, null, 8, ["modelValue", "restaurant-id"]),
1548
- o(F, {
1549
- label: "Company Stamp",
1550
- type: "image",
1551
- modelValue: e(r).companyStamp,
1552
- "onUpdate:modelValue": n[30] || (n[30] = (i) => e(r).companyStamp = i),
1553
- "restaurant-id": u.submission.restaurantId
1554
- }, null, 8, ["modelValue", "restaurant-id"])
1555
- ])
1556
- ]),
1557
- _: 1
1558
- })
1559
- ], 64);
1560
- };
1561
- }
1562
- }), ut = /* @__PURE__ */ Q({
1563
- __name: "TyroSubmission",
1564
- props: {
1565
- submission: {
1566
- type: Object,
1567
- required: !0
1568
- }
1569
- },
1570
- emits: ["update:submission"],
1571
- setup(u) {
1572
- const C = u, d = _(() => {
1573
- const y = C.submission.fields || {}, g = (N) => y[N] || "N/A";
1574
- return [
1575
- {
1576
- label: "Tyro POS Reference ID",
1577
- value: g("tyroPosReference")
1578
- },
1579
- {
1580
- label: "Tyro Merchant ID",
1581
- value: g("tyroMerchantId")
1582
- },
1583
- {
1584
- label: "Tyro Merchant Name",
1585
- value: g("tyroMerchantDisplayName")
1586
- },
1587
- {
1588
- label: "Authorised",
1589
- value: g("tyroIsAuthorised")
1590
- }
1591
- ];
1592
- });
1593
- return (y, g) => {
1594
- const N = w("FmCardHeader"), p = w("FmCardSection"), q = w("FmCard");
1595
- return m(), T(q, {
1596
- class: "max-w-3xl mt-8 p-6",
1597
- variant: "elevated"
1598
- }, {
1599
- default: P(() => [
1600
- o(p, { class: "flex flex-col gap-16 justify-between" }, {
1601
- default: P(() => [
1602
- o(N, {
1603
- class: "p-0",
1604
- title: "Tyro Authorisation",
1605
- subtitle: ""
1606
- }),
1607
- o(p, { class: "p-0" }, {
1608
- default: P(() => [
1609
- (m(!0), V(M, null, K(d.value, (s) => (m(), V("p", {
1610
- key: s.label,
1611
- class: "text-sm text-gray-900 break-all mb-4 last:mb-0"
1612
- }, [
1613
- a("b", null, R(s.label), 1),
1614
- Y(": " + R(s.value), 1)
1615
- ]))), 128))
1616
- ]),
1617
- _: 1
1618
- })
1619
- ]),
1620
- _: 1
1621
- })
1622
- ]),
1623
- _: 1
1624
- });
1625
- };
1626
- }
1627
- }), dt = {
1628
- key: 0,
1629
- class: "flex items-center justify-center min-h-[80vh]"
1630
- }, mt = { class: "px-32 pb-32" }, wt = /* @__PURE__ */ Q({
1631
- __name: "OnboardForm",
1632
- props: {
1633
- submissionId: {
1634
- type: String,
1635
- required: !0
1636
- }
1637
- },
1638
- setup(u) {
1639
- const { startAsyncCall: C, isLoading: d } = ne(), y = ue(), g = u, N = Ie(), p = j(null), q = _(
1640
- () => {
1641
- var E;
1642
- return ((E = p.value) == null ? void 0 : E.type) === ve.FdoOnboardType.enum.tyro;
1643
- }
1644
- ), s = () => {
1645
- if (window.history.length > 1) {
1646
- N.back();
1647
- return;
1648
- }
1649
- N.push({ name: "mf-payment-admin.onboard-submission" });
1650
- };
1651
- we(() => {
1652
- C(async () => {
1653
- p.value = await h.readById(g.submissionId);
1654
- });
1655
- });
1656
- const r = _(() => {
1657
- if (!p.value) return null;
1658
- switch (p.value.type) {
1659
- case "softspace":
1660
- return Bl;
1661
- case "ntt":
1662
- return it;
1663
- case "tyro":
1664
- return ut;
1665
- default:
1666
- return null;
1667
- }
1668
- }), D = j(0);
1669
- function k(E) {
1670
- p.value = E, D.value = Date.now();
1671
- }
1672
- const A = async (E) => {
1673
- var x, L;
1674
- if (p.value)
1675
- switch (E) {
1676
- case "preview":
1677
- let v;
1678
- try {
1679
- v = y.open({
1680
- message: "Generating preview document...",
1681
- type: "info"
1682
- }), await h.previewDocument((x = p.value) == null ? void 0 : x._id);
1683
- } catch (B) {
1684
- y.open({
1685
- type: "error",
1686
- title: "Error occurs when generating submission document",
1687
- message: G(B)
1688
- });
1689
- } finally {
1690
- v && y.close(v);
1691
- }
1692
- break;
1693
- case "send":
1694
- try {
1695
- y.open({
1696
- message: "Sending onboarding document...",
1697
- type: "info"
1698
- }), await h.sendDocument((L = p.value) == null ? void 0 : L._id), y.open({
1699
- type: "success",
1700
- title: "Submission documents send successfully"
1701
- });
1702
- } catch (B) {
1703
- y.open({
1704
- type: "error",
1705
- title: "Error occurs when sending document",
1706
- message: G(B)
1707
- });
1708
- }
1709
- break;
1710
- }
1711
- };
1712
- return (E, x) => {
1713
- var B, X, Z, ee;
1714
- const L = w("FmCircularProgress"), v = w("FmPageHead");
1715
- return e(d) ? (m(), V("div", dt, [
1716
- o(L, { size: "xxl" })
1717
- ])) : (m(), V(M, { key: 1 }, [
1718
- o(v, {
1719
- title: `Submission - ${(B = p.value) == null ? void 0 : B.type}`,
1720
- description: `ID - ${(X = p.value) == null ? void 0 : X._id}`,
1721
- "back-button": !0,
1722
- "onClick:back": s,
1723
- "onClick:action": A,
1724
- actions: q.value ? [] : [
1725
- {
1726
- label: "Preview Document",
1727
- value: "preview",
1728
- prependIcon: "preview"
1729
- },
1730
- {
1731
- label: "Send for Review",
1732
- value: "send",
1733
- isPrimary: !0,
1734
- prependIcon: "send"
1735
- }
1736
- ]
1737
- }, null, 8, ["title", "description", "actions"]),
1738
- a("div", mt, [
1739
- (m(), T(xe(r.value), {
1740
- key: D.value,
1741
- submission: p.value,
1742
- "onUpdate:submission": k
1743
- }, null, 40, ["submission"])),
1744
- ((Z = p.value) == null ? void 0 : Z.type) !== "softspace" ? (m(), V(M, { key: 0 }, [
1745
- x[0] || (x[0] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-6" }, "Timeline", -1)),
1746
- o(ke, {
1747
- entries: (ee = p.value) == null ? void 0 : ee.timeline
1748
- }, null, 8, ["entries"])
1749
- ], 64)) : $("", !0)
1750
- ])
1751
- ], 64));
1752
- };
1753
- }
1754
- });
1755
- export {
1756
- wt as default
1757
- };