@feedmepos/mf-payment 0.0.0-beta.3 → 0.0.0-beta.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/{PayoutAccount-BVljEwn3.js → PDFViewer-CjH_C1uT.js} +10851 -14329
  2. package/dist/PayoutAccount-0WC8znVs.js +3484 -0
  3. package/dist/{PayoutAccount-J3GJxUjj.js → PayoutAccount-DG7T6kD1.js} +99 -96
  4. package/dist/PayoutAccountSetting-CYEzOO_x.js +425 -0
  5. package/dist/{Settlement-C4IEccV6.js → Settlement-B7dxZllN.js} +3 -3
  6. package/dist/{Settlement-D4gdbOE0.js → Settlement-CcTtaP6I.js} +3 -3
  7. package/dist/{SettlementTransactions-DYelInkD.js → SettlementTransactions-CN80rfjl.js} +124 -128
  8. package/dist/{SettlementTransactions-C3dnWHkD.js → SettlementTransactions-DaPsFXU6.js} +4 -4
  9. package/dist/{Terminal-Co7KPrrb.js → Terminal-CMBB-Q32.js} +3 -3
  10. package/dist/{TerminalTransaction-CtVBUTMg.js → TerminalTransaction-MeyqLQ81.js} +4 -4
  11. package/dist/{Transaction-CvDEP2Uq.js → Transaction-BAQvj173.js} +4 -4
  12. package/dist/{Transaction-Rk0g5_Gn.js → Transaction-CATazx8y.js} +4 -4
  13. package/dist/api/payout/index.d.ts +2 -1
  14. package/dist/app.d.ts +3 -0
  15. package/dist/app.js +29 -23
  16. package/dist/{assets-CZ2m5tCN.js → assets-LSl507nH.js} +1 -1
  17. package/dist/components/PDFViewer.vue.d.ts +0 -2
  18. package/dist/error-K1CakhA9.js +6 -0
  19. package/dist/{index-B8_4waUa.js → index-B-3Vz_px.js} +1 -1
  20. package/dist/index-ONVv2EsB.js +40 -0
  21. package/dist/{index-DvzXwr90.js → index-RfsX2czs.js} +2 -3
  22. package/dist/{index-CjCiGW2Y.js → index-g9d8rwR_.js} +1 -1
  23. package/dist/{index.vue_vue_type_script_setup_true_lang-y4tchjya.js → index.vue_vue_type_script_setup_true_lang-BB6McGpo.js} +1 -1
  24. package/dist/package.json +6 -6
  25. package/dist/{index-D-lMrCvM.js → payout-account-B1kRpd3u.js} +732 -763
  26. package/dist/plugins.d.ts +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/{transaction-fdJNol6A.js → transaction-CfEK62PY.js} +1 -1
  29. package/dist/tsconfig.app.tsbuildinfo +1 -1
  30. package/dist/views/admin/payout-account/PayoutAccountSetting.vue.d.ts +11 -1
  31. package/dist/views/admin/payout-account/cell/RateInput.vue.d.ts +8 -0
  32. package/dist/views/admin/payout-account/cell/TPlusInput.vue.d.ts +8 -0
  33. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +81 -0
  34. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +90 -0
  35. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +81 -0
  36. package/package.json +18 -18
@@ -0,0 +1,425 @@
1
+ import { defineComponent as S, resolveComponent as i, openBlock as v, createElementBlock as C, Fragment as B, createElementVNode as o, createVNode as u, withCtx as b, createTextVNode as g, toDisplayString as F, createCommentVNode as V, createBlock as P, ref as w, watch as E, computed as R, unref as k, isRef as h, h as T, onMounted as q, resolveDynamicComponent as _, normalizeProps as D, mergeProps as z } from "vue";
2
+ import { p as $ } from "./index-ONVv2EsB.js";
3
+ import { u as H } from "./index-RfsX2czs.js";
4
+ import { _ as K } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
5
+ import { useRouter as O } from "vue-router";
6
+ import { u as M } from "./index-B-3Vz_px.js";
7
+ import { P as U } from "./PDFViewer-CjH_C1uT.js";
8
+ import { useSnackbar as G } from "@feedmepos/ui-library";
9
+ import { u as L } from "./error-K1CakhA9.js";
10
+ const Q = { class: "flex gap-16 mb-6" }, W = ["src"], J = /* @__PURE__ */ S({
11
+ __name: "Information",
12
+ props: {
13
+ payoutAccount: {
14
+ type: Object,
15
+ required: !0
16
+ }
17
+ },
18
+ setup(t) {
19
+ return (c, e) => {
20
+ const d = i("FmCardHeader"), s = i("FmCardSection"), m = i("FmCard");
21
+ return v(), C(B, null, [
22
+ o("div", Q, [
23
+ u(m, {
24
+ horizontal: "",
25
+ class: "flex-1 p-6",
26
+ variant: "elevated"
27
+ }, {
28
+ default: b(() => [
29
+ u(s, { class: "flex flex-col gap-16 justify-between" }, {
30
+ default: b(() => [
31
+ u(d, {
32
+ class: "p-0",
33
+ title: "Account Info",
34
+ subtitle: ""
35
+ }),
36
+ u(s, { class: "p-0" }, {
37
+ default: b(() => {
38
+ var r, y, f, a, n;
39
+ return [
40
+ e[0] || (e[0] = o("b", null, "For", -1)),
41
+ g(": " + F((y = (r = t.payoutAccount) == null ? void 0 : r.store) == null ? void 0 : y.event) + " ", 1),
42
+ e[1] || (e[1] = o("br", null, null, -1)),
43
+ e[2] || (e[2] = o("b", null, "Reference", -1)),
44
+ g(": " + F((a = (f = t.payoutAccount) == null ? void 0 : f.store) == null ? void 0 : a.id), 1),
45
+ e[3] || (e[3] = o("br", null, null, -1)),
46
+ e[4] || (e[4] = o("b", null, "Business", -1)),
47
+ g(": " + F((n = t.payoutAccount) == null ? void 0 : n.businessId), 1),
48
+ e[5] || (e[5] = o("br", null, null, -1))
49
+ ];
50
+ }),
51
+ _: 1
52
+ })
53
+ ]),
54
+ _: 1
55
+ })
56
+ ]),
57
+ _: 1
58
+ }),
59
+ u(m, {
60
+ horizontal: "",
61
+ class: "flex-1 p-6",
62
+ variant: "elevated"
63
+ }, {
64
+ default: b(() => [
65
+ u(s, { class: "flex flex-col gap-16 justify-between" }, {
66
+ default: b(() => [
67
+ u(d, {
68
+ class: "p-0",
69
+ title: "Key Person",
70
+ subtitle: ""
71
+ }),
72
+ u(s, { class: "p-0" }, {
73
+ default: b(() => {
74
+ var r, y, f, a, n, l, p, x;
75
+ return [
76
+ e[6] || (e[6] = o("b", null, "Email", -1)),
77
+ g(": " + F((f = (y = (r = t.payoutAccount) == null ? void 0 : r.store) == null ? void 0 : y.keyPerson) == null ? void 0 : f.email) + " ", 1),
78
+ e[7] || (e[7] = o("br", null, null, -1)),
79
+ e[8] || (e[8] = o("b", null, "Name", -1)),
80
+ g(": " + F((l = (n = (a = t.payoutAccount) == null ? void 0 : a.store) == null ? void 0 : n.keyPerson) == null ? void 0 : l.name), 1),
81
+ e[9] || (e[9] = o("br", null, null, -1)),
82
+ e[10] || (e[10] = o("b", null, "Phone", -1)),
83
+ g(": " + F((x = (p = t.payoutAccount) == null ? void 0 : p.store.keyPerson) == null ? void 0 : x.phone), 1),
84
+ e[11] || (e[11] = o("br", null, null, -1))
85
+ ];
86
+ }),
87
+ _: 1
88
+ })
89
+ ]),
90
+ _: 1
91
+ })
92
+ ]),
93
+ _: 1
94
+ })
95
+ ]),
96
+ e[12] || (e[12] = o("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
97
+ t.payoutAccount.store.exteriorPhoto ? (v(), C("img", {
98
+ key: 0,
99
+ src: t.payoutAccount.store.exteriorPhoto
100
+ }, null, 8, W)) : V("", !0)
101
+ ], 64);
102
+ };
103
+ }
104
+ }), X = { class: "flex gap-16 mt-6" }, Y = { class: "flex-1" }, Z = { class: "flex-1" }, ee = /* @__PURE__ */ S({
105
+ __name: "Settlement",
106
+ props: {
107
+ payoutAccount: {
108
+ type: Object,
109
+ required: !0
110
+ }
111
+ },
112
+ setup(t) {
113
+ return (c, e) => {
114
+ const d = i("FmCardHeader"), s = i("FmCardSection"), m = i("FmCard");
115
+ return v(), C(B, null, [
116
+ u(m, {
117
+ horizontal: "",
118
+ class: "flex-1 p-6 mx-6",
119
+ variant: "elevated"
120
+ }, {
121
+ default: b(() => [
122
+ u(s, { class: "flex flex-col gap-16 justify-between" }, {
123
+ default: b(() => [
124
+ u(d, {
125
+ class: "p-0",
126
+ title: "Bank Info",
127
+ subtitle: ""
128
+ }),
129
+ u(s, { class: "p-0" }, {
130
+ default: b(() => {
131
+ var r, y, f, a, n, l;
132
+ return [
133
+ e[0] || (e[0] = o("b", null, "Bank", -1)),
134
+ g(": " + F((y = (r = t.payoutAccount) == null ? void 0 : r.store.bank) == null ? void 0 : y.name), 1),
135
+ e[1] || (e[1] = o("br", null, null, -1)),
136
+ e[2] || (e[2] = o("b", null, "Name", -1)),
137
+ g(": " + F((a = (f = t.payoutAccount) == null ? void 0 : f.store.bank) == null ? void 0 : a.holderName), 1),
138
+ e[3] || (e[3] = o("br", null, null, -1)),
139
+ e[4] || (e[4] = o("b", null, "Number", -1)),
140
+ g(": " + F((l = (n = t.payoutAccount) == null ? void 0 : n.store.bank) == null ? void 0 : l.accountNumber), 1)
141
+ ];
142
+ }),
143
+ _: 1
144
+ })
145
+ ]),
146
+ _: 1
147
+ })
148
+ ]),
149
+ _: 1
150
+ }),
151
+ o("div", X, [
152
+ o("div", Y, [
153
+ e[5] || (e[5] = o("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
154
+ t.payoutAccount.store.ssm ? (v(), P(U, {
155
+ key: 0,
156
+ pdf: t.payoutAccount.store.ssm,
157
+ "disable-text-layer": !0,
158
+ "disable-annotation-layer": !0
159
+ }, null, 8, ["pdf"])) : V("", !0)
160
+ ]),
161
+ o("div", Z, [
162
+ e[6] || (e[6] = o("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
163
+ t.payoutAccount.store.bankStatement ? (v(), P(U, {
164
+ key: 0,
165
+ pdf: t.payoutAccount.store.bankStatement,
166
+ "disable-text-layer": !0,
167
+ "disable-annotation-layer": !0
168
+ }, null, 8, ["pdf"])) : V("", !0)
169
+ ])
170
+ ])
171
+ ], 64);
172
+ };
173
+ }
174
+ }), te = /* @__PURE__ */ S({
175
+ __name: "RateInput",
176
+ props: {
177
+ data: {},
178
+ onChange: { type: Function }
179
+ },
180
+ setup(t) {
181
+ const c = t, e = w(c.data.toString());
182
+ return E(e, (d) => {
183
+ c.onChange(parseFloat(d));
184
+ }), (d, s) => {
185
+ const m = i("FmTextField");
186
+ return v(), P(m, {
187
+ inputmode: "decimal",
188
+ modelValue: e.value,
189
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => e.value = r)
190
+ }, {
191
+ append: b(() => s[1] || (s[1] = [
192
+ g("%")
193
+ ])),
194
+ _: 1
195
+ }, 8, ["modelValue"]);
196
+ };
197
+ }
198
+ }), ne = /* @__PURE__ */ S({
199
+ __name: "TPlusInput",
200
+ props: {
201
+ data: {},
202
+ onChange: { type: Function }
203
+ },
204
+ setup(t) {
205
+ const c = t, e = w(c.data.toString());
206
+ return E(e, (d) => {
207
+ c.onChange(parseInt(d));
208
+ }), (d, s) => {
209
+ const m = i("FmTextField");
210
+ return v(), P(m, {
211
+ inputmode: "numeric",
212
+ modelValue: e.value,
213
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => e.value = r)
214
+ }, null, 8, ["modelValue"]);
215
+ };
216
+ }
217
+ }), oe = { class: "flex gap-16 mt-6" }, ae = { class: "flex-1" }, le = { class: "flex-1" }, ue = { class: "my-6 w-full flex justify-end" }, se = { class: "w-[320px]" }, re = /* @__PURE__ */ S({
218
+ __name: "PaymentStatus",
219
+ props: {
220
+ onUpdate: {
221
+ type: Function,
222
+ required: !0
223
+ },
224
+ payoutAccount: {
225
+ type: Object,
226
+ required: !0
227
+ }
228
+ },
229
+ setup(t) {
230
+ const c = t, e = w(!1), d = G(), s = async (a) => {
231
+ try {
232
+ e.value = !0, await c.onUpdate(a), d.open({
233
+ type: "success",
234
+ title: "Payout account update succesfully"
235
+ });
236
+ } catch (n) {
237
+ d.open({
238
+ type: "error",
239
+ title: "Error occurs when updating payout account",
240
+ message: L(n)
241
+ });
242
+ } finally {
243
+ e.value = !1;
244
+ }
245
+ }, { search: m } = M({
246
+ search: ""
247
+ }), r = R(() => {
248
+ const { ssm: a, bank: n, bankStatement: l } = c.payoutAccount.store;
249
+ return a && n && n.name && n.accountNumber && n.holderName && l;
250
+ }), y = w(""), f = [
251
+ {
252
+ header: () => "Payment Method",
253
+ accessorKey: "issuer",
254
+ cell: (a) => `${a.row.original.issuer} (${a.row.original.variant})`
255
+ },
256
+ {
257
+ header: () => "Rate",
258
+ accessorKey: "rate",
259
+ cell: ({ row: a }) => {
260
+ let n = 0;
261
+ return a.original.rate && (n = a.original.rate.amount / Math.pow(10, a.original.rate.precision)), T(te, {
262
+ data: n,
263
+ onChange: (l) => {
264
+ const p = c.payoutAccount.methods.at(a.index);
265
+ p.rate || (p.rate = {
266
+ amount: 0,
267
+ precision: 4
268
+ }), p.rate.amount = l * Math.pow(10, p.rate.precision);
269
+ }
270
+ });
271
+ }
272
+ },
273
+ {
274
+ header: () => "T plus",
275
+ accessorKey: "tPlus",
276
+ cell: ({ row: a }) => T(ne, {
277
+ data: a.original.tPlus ?? 0,
278
+ onChange: (n) => {
279
+ const l = c.payoutAccount.methods.at(a.index);
280
+ l.tPlus = n;
281
+ }
282
+ })
283
+ }
284
+ ];
285
+ return (a, n) => {
286
+ const l = i("FmRadio"), p = i("FmRadioGroup"), x = i("FmSwitch"), I = i("FmSearch"), N = i("FmTable"), j = i("FmButton");
287
+ return v(), C(B, null, [
288
+ o("div", oe, [
289
+ o("div", ae, [
290
+ u(p, {
291
+ modelValue: t.payoutAccount.status,
292
+ "onUpdate:modelValue": n[0] || (n[0] = (A) => t.payoutAccount.status = A),
293
+ label: "Account Status"
294
+ }, {
295
+ default: b(() => [
296
+ u(l, {
297
+ value: "NEW",
298
+ label: "New"
299
+ }),
300
+ u(l, {
301
+ value: "PENDING",
302
+ label: "Pending"
303
+ }),
304
+ u(l, {
305
+ value: "APPROVED",
306
+ label: "Approved"
307
+ })
308
+ ]),
309
+ _: 1
310
+ }, 8, ["modelValue"])
311
+ ]),
312
+ o("div", le, [
313
+ u(x, {
314
+ modelValue: t.payoutAccount.enable,
315
+ "onUpdate:modelValue": n[1] || (n[1] = (A) => t.payoutAccount.enable = A),
316
+ disabled: !r.value,
317
+ label: "Enabled",
318
+ sublabel: "Merchant can use online features such as e-payment, settlement"
319
+ }, null, 8, ["modelValue", "disabled"])
320
+ ])
321
+ ]),
322
+ t.payoutAccount.enable ? (v(), C(B, { key: 0 }, [
323
+ o("div", ue, [
324
+ o("div", se, [
325
+ u(I, {
326
+ modelValue: k(m),
327
+ "onUpdate:modelValue": n[2] || (n[2] = (A) => h(m) ? m.value = A : null),
328
+ placeholder: "Search Method ..."
329
+ }, null, 8, ["modelValue"])
330
+ ])
331
+ ]),
332
+ u(N, {
333
+ class: "mt-6",
334
+ modelValue: y.value,
335
+ "onUpdate:modelValue": n[3] || (n[3] = (A) => y.value = A),
336
+ "search-value": k(m),
337
+ "row-data": t.payoutAccount.methods,
338
+ "column-defs": f
339
+ }, null, 8, ["modelValue", "search-value", "row-data"])
340
+ ], 64)) : V("", !0),
341
+ u(j, {
342
+ class: "w-full mt-6",
343
+ variant: "primary",
344
+ label: "Save",
345
+ loading: e.value,
346
+ onclick: () => s(t.payoutAccount)
347
+ }, null, 8, ["loading", "onclick"])
348
+ ], 64);
349
+ };
350
+ }
351
+ }), ge = /* @__PURE__ */ S({
352
+ __name: "PayoutAccountSetting",
353
+ props: {
354
+ accountId: {
355
+ type: String,
356
+ required: !0
357
+ }
358
+ },
359
+ setup(t) {
360
+ const c = t, { tab: e } = M({
361
+ tab: "information"
362
+ }), { isLoading: d, startAsyncCall: s } = H(!0), m = O(), r = w();
363
+ async function y(l) {
364
+ await $.updateById(
365
+ c.accountId,
366
+ l
367
+ ), r.value = await $.readById(c.accountId);
368
+ }
369
+ function f() {
370
+ s(async () => {
371
+ r.value = await $.readById(c.accountId);
372
+ });
373
+ }
374
+ q(f);
375
+ const a = [
376
+ {
377
+ label: "Information",
378
+ value: "information",
379
+ icon: "overview",
380
+ render: J
381
+ },
382
+ {
383
+ label: "Settlement",
384
+ value: "settlement",
385
+ icon: "payments",
386
+ render: ee
387
+ },
388
+ {
389
+ label: "Payment",
390
+ value: "payment",
391
+ icon: "request_quote",
392
+ render: re
393
+ }
394
+ ], n = R(() => {
395
+ var l;
396
+ return (l = a.find((p) => p.value === e.value)) == null ? void 0 : l.render;
397
+ });
398
+ return (l, p) => {
399
+ var I;
400
+ const x = i("FmTabs");
401
+ return v(), P(K, {
402
+ title: `Payout Account (${(I = r.value) == null ? void 0 : I._id})`,
403
+ loading: k(d),
404
+ onBack: k(m).back
405
+ }, {
406
+ default: b(() => [
407
+ u(x, {
408
+ "model-value": k(e),
409
+ "onUpdate:modelValue": p[0] || (p[0] = (N) => h(e) ? e.value = N : null),
410
+ class: "mb-6",
411
+ items: a
412
+ }, null, 8, ["model-value"]),
413
+ k(e) ? (v(), P(_(n.value), D(z({ key: 0 }, {
414
+ payoutAccount: r.value,
415
+ onUpdate: y
416
+ })), null, 16)) : V("", !0)
417
+ ]),
418
+ _: 1
419
+ }, 8, ["title", "loading", "onBack"]);
420
+ };
421
+ }
422
+ });
423
+ export {
424
+ ge as default
425
+ };
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as w, ref as S, computed as k, resolveComponent as _, openBlock as v, createBlock as h, onMounted as A, watch as R, unref as i, withCtx as C, createElementVNode as u, createVNode as p, isRef as D } from "vue";
2
- import { u as V } from "./index-DvzXwr90.js";
2
+ import { u as V } from "./index-RfsX2czs.js";
3
3
  import { h as y } from "./moment-h96o7c8I.js";
4
4
  import { useCoreStore as b } from "@feedmepos/mf-common";
5
5
  import { _ as $ } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
- import { s as B } from "./index-CjCiGW2Y.js";
6
+ import { s as B } from "./index-g9d8rwR_.js";
7
7
  import "@feedmepos/ui-library";
8
8
  import { d as f } from "./dinero-CIVmXLL-.js";
9
9
  import { useRouter as K } from "vue-router";
10
- import { u as P } from "./index-B8_4waUa.js";
10
+ import { u as P } from "./index-B-3Vz_px.js";
11
11
  const O = /* @__PURE__ */ w({
12
12
  __name: "SettlementTable",
13
13
  props: {
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as w, ref as v, computed as S, resolveComponent as _, openBlock as x, createBlock as h, watch as k, onMounted as A, unref as i, withCtx as D, createElementVNode as u, createVNode as p, isRef as C } from "vue";
2
- import { u as R } from "./index-DvzXwr90.js";
2
+ import { u as R } from "./index-RfsX2czs.js";
3
3
  import { h as y } from "./moment-h96o7c8I.js";
4
- import { s as V } from "./index-CjCiGW2Y.js";
4
+ import { s as V } from "./index-g9d8rwR_.js";
5
5
  import "@feedmepos/ui-library";
6
6
  import { d as f } from "./dinero-CIVmXLL-.js";
7
7
  import { useRouter as b } from "vue-router";
8
8
  import { _ as B } from "./AdminLayout.vue_vue_type_script_setup_true_lang-oPYFBeEo.js";
9
- import { u as $ } from "./index-B8_4waUa.js";
9
+ import { u as $ } from "./index-B-3Vz_px.js";
10
10
  const K = /* @__PURE__ */ w({
11
11
  __name: "SettlementTable",
12
12
  props: {