@feedmepos/mf-payment 0.0.0-beta.9 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/dist/AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js +39 -0
  2. package/dist/AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js +42 -0
  3. package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js +40 -0
  4. package/dist/Modal-DB8M9o1T.js +13 -0
  5. package/dist/PayoutAccount-DZaKHWcy.js +612 -0
  6. package/dist/{PayoutAccount-DLhMMlw_.js → PayoutAccount-Dc1CYQ0W.js} +38 -35
  7. package/dist/PayoutAccountSetting-BzmNuLFj.js +780 -0
  8. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js +33 -0
  9. package/dist/Settlement-Bx3zAkIw.js +195 -0
  10. package/dist/Settlement-mwnO-iYH.js +150 -0
  11. package/dist/{SettlementTransactions-CoEzdtYT.js → SettlementTransactions-AaYyTH96.js} +99 -105
  12. package/dist/{SettlementTransactions-Dl1H4jvh.js → SettlementTransactions-D_SVuKyR.js} +117 -130
  13. package/dist/Terminal-68OQnhM3.js +372 -0
  14. package/dist/TerminalSetting-DEFim0xg.js +379 -0
  15. package/dist/TerminalTransaction-CQjNdffr.js +426 -0
  16. package/dist/TerminalTransaction-ClihmWOJ.js +250 -0
  17. package/dist/Transaction-68L7JzIk.js +242 -0
  18. package/dist/Transaction-a1VfiCP_.js +405 -0
  19. package/dist/api/index.d.ts +14 -0
  20. package/dist/api/pagination.d.ts +20 -0
  21. package/dist/api/payment-gateway/index.d.ts +9 -0
  22. package/dist/api/settlement/index.d.ts +12 -13
  23. package/dist/api/terminal/index.d.ts +13 -1
  24. package/dist/api/terminal-transaction/index.d.ts +12 -1
  25. package/dist/api/transaction/index.d.ts +7 -2
  26. package/dist/app-C9FRsUfb.js +6343 -0
  27. package/dist/app.js +3 -198
  28. package/dist/assets-Bji7O2YD.js +45 -0
  29. package/dist/clipboard-4jh1WteU.js +10 -0
  30. package/dist/components/AsyncButton.vue.d.ts +21 -0
  31. package/dist/components/AutoCopyCell.vue.d.ts +6 -0
  32. package/dist/components/CursorTable/index.vue.d.ts +24 -5
  33. package/dist/components/RestaurantSelector.vue.d.ts +2 -0
  34. package/dist/components/RouteCell.vue.d.ts +8 -0
  35. package/dist/helpers/assets.d.ts +2 -0
  36. package/dist/index-Bt_OgDYn.js +56107 -0
  37. package/dist/index-CLYePgWW.js +47 -0
  38. package/dist/{index-CF56zGyu.js → index-DBfZnaV1.js} +1 -1
  39. package/dist/index-DSuZG0l6.js +52 -0
  40. package/dist/{index-Bmka-1lQ.js → index-DjDGwRX8.js} +1 -1
  41. package/dist/index-_0TroOJr.js +127 -0
  42. package/dist/index.vue_vue_type_script_setup_true_lang-Jlcg1hAB.js +167 -0
  43. package/dist/model/transaction.d.ts +2 -1
  44. package/dist/package.json +4 -4
  45. package/dist/payout-account-BWcq7OJy.js +1805 -0
  46. package/dist/stores/payoutAccount.d.ts +4 -4
  47. package/dist/transaction-DqrhM5jB.js +87 -0
  48. package/dist/tsconfig.app.tsbuildinfo +1 -1
  49. package/dist/validator-D5jtpt9A.js +2877 -0
  50. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
  51. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +81 -0
  52. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
  53. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
  54. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +56 -0
  55. package/dist/views/admin/payout-account/tabs/gateway/GhlGateway.vue.d.ts +50 -0
  56. package/dist/views/admin/payout-account/tabs/gateway/RevenueMonsterGateway.vue.d.ts +52 -0
  57. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +12 -12
  58. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +83 -0
  59. package/dist/views/admin/terminal/TerminalSetting.vue.d.ts +12 -0
  60. package/dist/views/admin/terminal/cell/Actions.vue.d.ts +80 -9
  61. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +94 -0
  62. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +94 -0
  63. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +85 -0
  64. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +94 -0
  65. package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +7 -0
  66. package/dist/views/admin/transaction/TransactionTable.vue.d.ts +6 -2
  67. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +7 -0
  68. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
  69. package/dist/views/settlement/SettlementTable.vue.d.ts +12 -12
  70. package/dist/views/terminal-transaction/TerminalTransaction.vue.d.ts +2 -0
  71. package/dist/views/terminal-transaction/cell/Gateway.vue.d.ts +9 -0
  72. package/dist/views/terminal-transaction/cell/Status.vue.d.ts +9 -0
  73. package/package.json +4 -4
  74. package/dist/AdminLayout.vue_vue_type_script_setup_true_lang-oPYFBeEo.js +0 -42
  75. package/dist/PayoutAccount-xxSxqBTL.js +0 -3485
  76. package/dist/PayoutAccountSetting-CIeos0md.js +0 -425
  77. package/dist/Settlement-BVGACeme.js +0 -136
  78. package/dist/Settlement-Ce48KHrc.js +0 -132
  79. package/dist/Terminal-ByKV2Rof.js +0 -204
  80. package/dist/TerminalTransaction-RuSxBAxf.js +0 -240
  81. package/dist/Transaction-CYo-uLQi.js +0 -241
  82. package/dist/Transaction-Cjw9WwX8.js +0 -242
  83. package/dist/api/auth/index.d.ts +0 -7
  84. package/dist/assets-BuLGUMIx.js +0 -472
  85. package/dist/index-Coz5aeIO.js +0 -61
  86. package/dist/index-DCPNrUDq.js +0 -40075
  87. package/dist/index.vue_vue_type_script_setup_true_lang-CAR-bNaR.js +0 -150
  88. package/dist/mascot-side-3VXskf9y.js +0 -4
  89. package/dist/payout-account-iAM7HPtG.js +0 -3317
  90. package/dist/transaction-vRrBf3FN.js +0 -64
@@ -1,425 +0,0 @@
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-CF56zGyu.js";
3
- import { u as H } from "./index-DCPNrUDq.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-Bmka-1lQ.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,136 +0,0 @@
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-DCPNrUDq.js";
3
- import { h as y } from "./moment-h96o7c8I.js";
4
- import { useCoreStore as b } from "@feedmepos/mf-common";
5
- import { _ as $ } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
- import { s as B } from "./index-Coz5aeIO.js";
7
- import "@feedmepos/ui-library";
8
- import { d as f } from "./dinero-CIVmXLL-.js";
9
- import { useRouter as K } from "vue-router";
10
- import { u as P } from "./index-Bmka-1lQ.js";
11
- const O = /* @__PURE__ */ w({
12
- __name: "SettlementTable",
13
- props: {
14
- data: {
15
- type: Array,
16
- required: !0
17
- },
18
- loading: {
19
- type: Boolean,
20
- required: !0
21
- }
22
- },
23
- emits: ["row-click"],
24
- setup(g, { emit: m }) {
25
- const e = g, n = m, r = S(""), d = [
26
- {
27
- header: () => "Settlement ID",
28
- accessorKey: "id"
29
- },
30
- {
31
- header: () => "Created At",
32
- accessorKey: "transactionAt",
33
- meta: {
34
- width: "180px"
35
- }
36
- },
37
- {
38
- header: () => "Sales Amount",
39
- accessorKey: "amount"
40
- },
41
- {
42
- header: () => "Fee",
43
- accessorKey: "fee"
44
- },
45
- {
46
- header: () => "Settlement Amount",
47
- accessorKey: "payout"
48
- }
49
- ], s = k(() => e.data.map((t) => ({
50
- id: t._id,
51
- transactionAt: y(t.createdAt).format("YYYY-MM-DD"),
52
- amount: f(t.totalAmount).toFormat("$0.00"),
53
- fee: f(t.totalFee).toFormat("$0.00"),
54
- payout: f(t.totalPayout).toFormat("$0.00")
55
- })));
56
- return (t, a) => {
57
- const l = _("FmTable");
58
- return v(), h(l, {
59
- modelValue: r.value,
60
- "onUpdate:modelValue": a[0] || (a[0] = (o) => r.value = o),
61
- "row-data": s.value,
62
- "column-defs": d,
63
- loading: e.loading,
64
- onRowClick: a[1] || (a[1] = (o) => n("row-click", e.data.at(o.index)))
65
- }, null, 8, ["modelValue", "row-data", "loading"]);
66
- };
67
- }
68
- }), Y = { class: "flex justify-between items-center mb-6" }, I = { class: "flex space-x-4 items-center" }, L = { class: "flex space-x-4 items-center" }, H = /* @__PURE__ */ w({
69
- __name: "Settlement",
70
- setup(g) {
71
- const m = K(), { dateRange: e } = P({
72
- dateRange: {
73
- startDate: y().startOf("day").toISOString(),
74
- endDate: y().endOf("day").toISOString()
75
- }
76
- }), { isLoading: n, startAsyncCall: r } = V(!0), { currentRestaurant: d } = b(), s = S([]);
77
- async function t() {
78
- await r(async () => {
79
- const l = await B.readRestaurantSettlements(
80
- {
81
- start: e.value.startDate,
82
- end: e.value.endDate
83
- }
84
- );
85
- s.value = l;
86
- });
87
- }
88
- function a() {
89
- t();
90
- }
91
- return A(a), R(d, a), (l, o) => {
92
- const x = _("FmDateRangePicker"), F = _("FmButton");
93
- return v(), h($, {
94
- title: "Settlements",
95
- description: "Settlements are the finalization of financial transactions, transferring funds to complete payments.",
96
- loading: i(n)
97
- }, {
98
- default: C(() => [
99
- u("div", Y, [
100
- u("div", I, [
101
- p(x, {
102
- modelValue: i(e),
103
- "onUpdate:modelValue": [
104
- o[0] || (o[0] = (c) => D(e) ? e.value = c : null),
105
- t
106
- ],
107
- compare: "",
108
- "show-predefined-range": ""
109
- }, null, 8, ["modelValue"])
110
- ]),
111
- u("div", L, [
112
- p(F, {
113
- "append-icon": "file_download",
114
- variant: "primary",
115
- label: "Export",
116
- onClick: () => {
117
- }
118
- })
119
- ])
120
- ]),
121
- p(O, {
122
- loading: i(n),
123
- data: s.value,
124
- onRowClick: o[1] || (o[1] = (c) => i(m).push({
125
- path: `/payment/settlement/${c._id}`
126
- }))
127
- }, null, 8, ["loading", "data"])
128
- ]),
129
- _: 1
130
- }, 8, ["loading"]);
131
- };
132
- }
133
- });
134
- export {
135
- H as default
136
- };
@@ -1,132 +0,0 @@
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-DCPNrUDq.js";
3
- import { h as y } from "./moment-h96o7c8I.js";
4
- import { s as V } from "./index-Coz5aeIO.js";
5
- import "@feedmepos/ui-library";
6
- import { d as f } from "./dinero-CIVmXLL-.js";
7
- import { useRouter as b } from "vue-router";
8
- import { _ as B } from "./AdminLayout.vue_vue_type_script_setup_true_lang-oPYFBeEo.js";
9
- import { u as $ } from "./index-Bmka-1lQ.js";
10
- const K = /* @__PURE__ */ w({
11
- __name: "SettlementTable",
12
- props: {
13
- data: {
14
- type: Array,
15
- required: !0
16
- },
17
- loading: {
18
- type: Boolean,
19
- required: !0
20
- }
21
- },
22
- emits: ["row-click"],
23
- setup(g, { emit: s }) {
24
- const n = g, l = s, d = v(""), e = [
25
- {
26
- header: () => "Settlement ID",
27
- accessorKey: "id"
28
- },
29
- {
30
- header: () => "Created At",
31
- accessorKey: "transactionAt",
32
- meta: {
33
- width: "180px"
34
- }
35
- },
36
- {
37
- header: () => "Sales Amount",
38
- accessorKey: "amount"
39
- },
40
- {
41
- header: () => "Fee",
42
- accessorKey: "fee"
43
- },
44
- {
45
- header: () => "Settlement Amount",
46
- accessorKey: "payout"
47
- }
48
- ], m = S(() => n.data.map((t) => ({
49
- id: t._id,
50
- transactionAt: y(t.createdAt).format("YYYY-MM-DD"),
51
- amount: f(t.totalAmount).toFormat("$0.00"),
52
- fee: f(t.totalFee).toFormat("$0.00"),
53
- payout: f(t.totalPayout).toFormat("$0.00")
54
- })));
55
- return (t, o) => {
56
- const a = _("FmTable");
57
- return x(), h(a, {
58
- modelValue: d.value,
59
- "onUpdate:modelValue": o[0] || (o[0] = (r) => d.value = r),
60
- "row-data": m.value,
61
- "column-defs": e,
62
- loading: n.loading,
63
- onRowClick: o[1] || (o[1] = (r) => l("row-click", n.data.at(r.index)))
64
- }, null, 8, ["modelValue", "row-data", "loading"]);
65
- };
66
- }
67
- }), P = { class: "flex justify-between items-center mb-6" }, O = { class: "flex space-x-4 items-center" }, Y = { class: "flex space-x-4 items-center" }, Q = /* @__PURE__ */ w({
68
- __name: "Settlement",
69
- setup(g) {
70
- const { isLoading: s, startAsyncCall: n } = R(!0), l = v([]), d = b(), { dateRange: e } = $({
71
- dateRange: {
72
- startDate: y().startOf("day").toISOString(),
73
- endDate: y().endOf("day").toISOString()
74
- }
75
- });
76
- k(e, m);
77
- async function m() {
78
- await n(async () => {
79
- const o = await V.readByDate(
80
- {
81
- start: e.value.startDate,
82
- end: e.value.endDate
83
- }
84
- );
85
- l.value = o;
86
- });
87
- }
88
- function t() {
89
- m();
90
- }
91
- return A(t), (o, a) => {
92
- const r = _("FmDateRangePicker"), F = _("FmButton");
93
- return x(), h(B, {
94
- title: "Settlements",
95
- loading: i(s)
96
- }, {
97
- default: D(() => [
98
- u("div", P, [
99
- u("div", O, [
100
- p(r, {
101
- modelValue: i(e),
102
- "onUpdate:modelValue": a[0] || (a[0] = (c) => C(e) ? e.value = c : null),
103
- compare: "",
104
- "show-predefined-range": ""
105
- }, null, 8, ["modelValue"])
106
- ]),
107
- u("div", Y, [
108
- p(F, {
109
- "append-icon": "file_download",
110
- variant: "primary",
111
- label: "Export",
112
- onClick: () => {
113
- }
114
- })
115
- ])
116
- ]),
117
- p(K, {
118
- loading: i(s),
119
- data: l.value,
120
- onRowClick: a[1] || (a[1] = (c) => i(d).push({
121
- path: `/payment/admin/settlement/${c._id}`
122
- }))
123
- }, null, 8, ["loading", "data"])
124
- ]),
125
- _: 1
126
- }, 8, ["loading"]);
127
- };
128
- }
129
- });
130
- export {
131
- Q as default
132
- };