@feedmepos/mf-payment 1.5.35-dev → 1.5.37-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 (25) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-otzczqU5.js → Actions.vue_vue_type_script_setup_true_lang-CSmRCpz2.js} +1 -1
  2. package/dist/{Chargeback-CQkYS7zA.js → Chargeback-F4uNGOcy.js} +1 -1
  3. package/dist/{OnboardForm-By03Chhh.js → OnboardForm-BRD1s1Y3.js} +1 -1
  4. package/dist/{OnboardForm-CqZYRciP.js → OnboardForm-DuJ4ZrJV.js} +1 -1
  5. package/dist/{PayoutAccount-DbJB5Y6K.js → PayoutAccount-5IcgD7Bd.js} +1 -1
  6. package/dist/{PayoutAccount-D8ZiVHXg.js → PayoutAccount-Cs0IYGri.js} +1 -1
  7. package/dist/Settlement-kRuh2LGa.js +616 -0
  8. package/dist/{SettlementTransactions-C0vRk4kI.js → SettlementTransactions-DEoxfkFL.js} +2 -2
  9. package/dist/{SettlementTransactions-C4F8UT8k.js → SettlementTransactions-DN9uCpiR.js} +2 -2
  10. package/dist/Transaction-CvUypCQq.js +490 -0
  11. package/dist/{Transaction-pfFFXNUZ.js → Transaction-HTemq8TC.js} +117 -109
  12. package/dist/{TransactionOld-CaLBhbhp.js → TransactionOld-BEfflWka.js} +3 -3
  13. package/dist/{app-CjT9c5hY.js → app-BmekPZck.js} +11 -11
  14. package/dist/app.js +1 -1
  15. package/dist/{assets-gWQvONT9.js → assets-t2kJFjI9.js} +72 -71
  16. package/dist/composable/transaction/index.d.ts +4 -0
  17. package/dist/index-CPf8YYLa.js +9 -0
  18. package/dist/{index-CiCmB-Rg.js → index-jfRfVr4R.js} +1 -1
  19. package/dist/model/transaction.d.ts +1 -0
  20. package/dist/package.json +1 -1
  21. package/dist/{payout-account-BvYk9wz-.js → payout-account-Bmz3nyNW.js} +1 -1
  22. package/dist/tsconfig.app.tsbuildinfo +1 -1
  23. package/package.json +1 -1
  24. package/dist/Settlement-BAeQCoUt.js +0 -610
  25. package/dist/Transaction-CkmY_1p2.js +0 -482
@@ -1,482 +0,0 @@
1
- import { defineComponent as w, ref as F, watch as P, onMounted as z, resolveComponent as A, unref as s, openBlock as I, createBlock as Y, createElementBlock as q, createVNode as p, withCtx as V, createElementVNode as h, Fragment as j, renderList as J, createTextVNode as Q, toDisplayString as H, isRef as N, h as C } from "vue";
2
- import { t as D } from "./index-CiCmB-Rg.js";
3
- import { h as O } from "./moment-h96o7c8I.js";
4
- import { useI18n as B, useCoreStore as G } from "@feedmepos/mf-common";
5
- import { _ as W } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
6
- import { t as X, b as Z, _ as ee } from "./assets-gWQvONT9.js";
7
- import { u as te } from "./index-Q0ELb0wB.js";
8
- import { _ as ae } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
9
- import { _ as ne } from "./SelectAll.vue_vue_type_script_setup_true_lang-BNZTqdoF.js";
10
- import { _ as re } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-kymnzYpd.js";
11
- import { p as se } from "./index-Dq4IAN2N.js";
12
- import { t as oe } from "./index-DGqWjywh.js";
13
- import { u as le, p as E } from "./index-T2CVm7-_.js";
14
- import { useSnackbar as ie, useDialog as ce } from "@feedmepos/ui-library";
15
- import { _ as ue, a as me, b as de } from "./Actions.vue_vue_type_script_setup_true_lang-otzczqU5.js";
16
- import { g as pe } from "./grafana-VY3mqepx.js";
17
- import { w as L } from "./Modal-DB8M9o1T.js";
18
- import { u as K } from "./error-K1CakhA9.js";
19
- import { _ as ye } from "./index.vue_vue_type_script_setup_true_lang-CkzD8rQP.js";
20
- const fe = {
21
- key: 1,
22
- class: "inline-flex"
23
- }, _e = { class: "relative" }, ve = { class: "sticky top-0 py-8 bg-white translate-y-[-12px]" }, be = /* @__PURE__ */ w({
24
- __name: "SourceSelector",
25
- props: {
26
- id: {},
27
- by: {},
28
- excludePayoutAccount: { type: Boolean },
29
- excludeOrderingPayoutAccount: { type: Boolean },
30
- excludeMarketingPayoutAccount: { type: Boolean },
31
- excludeRestaurant: { type: Boolean },
32
- excludeDevice: { type: Boolean }
33
- },
34
- emits: ["update:id", "update:by"],
35
- setup(M, { emit: y }) {
36
- const f = M, m = y, { t: o } = B(), { currentBusiness: T, readRestaurants: _ } = G(), { isLoading: v, startAsyncCall: d } = le(!0), b = F([]), u = F(), g = F(""), S = F([]);
37
- let R;
38
- P(g, async () => {
39
- R && clearTimeout(R), R = setTimeout(() => {
40
- var c = new RegExp(g.value, "i");
41
- S.value = b.value.filter((n) => {
42
- const a = JSON.stringify(n);
43
- return c.test(a);
44
- });
45
- }, 700);
46
- }), P(u, () => {
47
- var c, n;
48
- m("update:id", (c = u.value) == null ? void 0 : c.value), m("update:by", (n = u.value) == null ? void 0 : n.by);
49
- });
50
- async function k() {
51
- return d(async () => {
52
- let c = await se.readBusinessPayoutAccounts();
53
- if (c.length !== 0)
54
- return c;
55
- });
56
- }
57
- async function $() {
58
- return d(async () => {
59
- let c = await oe.getBusinessTerminals();
60
- if (c.length !== 0)
61
- return c;
62
- });
63
- }
64
- async function U() {
65
- v.value = !0;
66
- const c = [];
67
- if (!f.excludePayoutAccount) {
68
- let n = await k();
69
- f.excludeMarketingPayoutAccount && (n = n == null ? void 0 : n.filter((a) => a.store.event !== "MARKETING")), f.excludeOrderingPayoutAccount && (n = n == null ? void 0 : n.filter((a) => a.store.event !== "ORDERING")), c.push(
70
- ...(n || []).map((a) => {
71
- var t, e, l, i;
72
- return {
73
- by: "PAYOUT_ACCOUNT",
74
- value: a._id,
75
- prefix: o("payment.components.payout_account"),
76
- type: "Payout Account - " + a.store.event,
77
- label: ((e = (t = a.ref) == null ? void 0 : t.profile) == null ? void 0 : e.name) ?? a.ref.name,
78
- chipLabel: "Payout Account: " + (((i = (l = a.ref) == null ? void 0 : l.profile) == null ? void 0 : i.name) ?? a.ref.name)
79
- };
80
- })
81
- );
82
- }
83
- if (!f.excludeRestaurant) {
84
- const n = await _();
85
- c.push(
86
- ...(n || []).map((a) => ({
87
- by: "RESTAURANT",
88
- value: a._id,
89
- prefix: o("payment.components.restaurant"),
90
- type: "Restaurant",
91
- label: a.profile.name + " (" + (a.profile.code ?? "--") + ")",
92
- chipLabel: "Restaurant: " + a.profile.name + " (" + (a.profile.code ?? "--") + ")"
93
- }))
94
- );
95
- }
96
- if (!f.excludeDevice) {
97
- const n = await $();
98
- c.push(
99
- ...(n || []).map((a) => ({
100
- by: "DEVICE",
101
- value: a._id,
102
- prefix: o("payment.components.device"),
103
- type: "Device - " + a.deviceType,
104
- label: a.deviceType === "TERMINAL" ? a.name : a.restaurant.profile.name,
105
- chipLabel: a.deviceType + ": " + (a.deviceType === "TERMINAL" ? a.name : a.restaurant.profile.name)
106
- }))
107
- );
108
- }
109
- b.value = c, S.value = b.value, v.value = !1;
110
- }
111
- return z(U), P(T, U), (c, n) => {
112
- const a = A("FmCircularProgress"), t = A("FmChip"), e = A("FmSearch"), l = A("FmMenuItem"), i = A("FmMenu");
113
- return s(v) ? (I(), Y(a, {
114
- key: 0,
115
- size: "md"
116
- })) : (I(), q("div", fe, [
117
- p(i, { "close-on-click": !0 }, {
118
- "menu-button": V(() => {
119
- var r;
120
- return [
121
- p(t, {
122
- icon: "account_box",
123
- label: ((r = u.value) == null ? void 0 : r.chipLabel) ?? s(o)("payment.components.select"),
124
- removable: !!u.value,
125
- onChipClosed: n[0] || (n[0] = (x) => u.value = void 0)
126
- }, null, 8, ["label", "removable"])
127
- ];
128
- }),
129
- default: V(() => [
130
- h("div", _e, [
131
- h("div", ve, [
132
- p(e, {
133
- "model-value": g.value,
134
- "onUpdate:modelValue": n[1] || (n[1] = (r) => g.value = r),
135
- placeholder: s(o)("payment.components.select")
136
- }, null, 8, ["model-value", "placeholder"])
137
- ]),
138
- h("div", null, [
139
- (I(!0), q(j, null, J(S.value, (r) => (I(), Y(l, {
140
- key: r.value,
141
- label: r.label,
142
- sublabel: r.type,
143
- onClick: () => u.value = r
144
- }, null, 8, ["label", "sublabel", "onClick"]))), 128))
145
- ])
146
- ])
147
- ]),
148
- _: 1
149
- })
150
- ]));
151
- };
152
- }
153
- }), Te = { class: "flex items-center gap-1" }, ge = /* @__PURE__ */ w({
154
- __name: "BillSeqNumber",
155
- props: {
156
- row: {},
157
- data: {}
158
- },
159
- setup(M) {
160
- return (y, f) => {
161
- const m = A("FmIcon");
162
- return I(), q("span", Te, [
163
- Q(H(M.row.original.seqNumber) + " ", 1),
164
- p(m, {
165
- size: "md",
166
- name: "check",
167
- color: "#16a34a"
168
- })
169
- ]);
170
- };
171
- }
172
- }), Ae = { class: "flex justify-between mb-6 items-center" }, he = { class: "flex space-x-8 items-start" }, Se = { class: "flex space-x-4 self-center" }, Ne = { class: "flex space-x-12 mb-6" }, Be = /* @__PURE__ */ w({
173
- __name: "Transaction",
174
- setup(M) {
175
- var n, a;
176
- const y = ie(), f = ce(), { sessionUser: m } = G(), { t: o } = B(), T = F(), { dateRange: _, searchKey: v, status: d, id: b, by: u } = te({
177
- by: "",
178
- id: "",
179
- searchKey: "",
180
- status: [E.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS],
181
- dateRange: {
182
- startDate: O().startOf("day").format("YYYY-MM-DD"),
183
- endDate: O().endOf("day").format("YYYY-MM-DD")
184
- }
185
- });
186
- let g;
187
- P(v, async () => {
188
- g && clearTimeout(g), g = setTimeout(
189
- () => {
190
- var t;
191
- return (t = T.value) == null ? void 0 : t.reset();
192
- },
193
- 700
194
- );
195
- }), P([_, d, b, u], () => {
196
- var t;
197
- (t = T.value) == null || t.reset();
198
- });
199
- const S = [
200
- {
201
- label: "Success",
202
- value: E.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS
203
- },
204
- {
205
- label: "Refunded",
206
- value: E.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED
207
- },
208
- {
209
- label: "Process",
210
- value: E.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING
211
- },
212
- {
213
- label: "Pending Settlement",
214
- value: E.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING_SETTLEMENT
215
- },
216
- {
217
- label: "Failed",
218
- value: E.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED
219
- }
220
- ];
221
- async function R(t, e) {
222
- var l;
223
- try {
224
- const i = await D.refetchTransaction({ transactionId: t.id });
225
- (l = T.value) == null || l.replaceData(e, i), y.open({
226
- type: "success",
227
- title: "Transaction queried and updated successfully."
228
- });
229
- } catch (i) {
230
- y.open({
231
- type: "error",
232
- title: "Fail to query transaction.",
233
- message: K(i)
234
- });
235
- }
236
- }
237
- async function k(t, e) {
238
- L(
239
- f,
240
- "Refund Transaction",
241
- "Are you sure to refund transaction? This action cannot be revert!",
242
- async () => {
243
- var l;
244
- try {
245
- const i = await D.refundTransaction({
246
- transactionId: t.id,
247
- reason: "portal transaction refund",
248
- amount: t.fdoAmount
249
- });
250
- (l = T.value) == null || l.replaceData(e, i), y.open({
251
- type: "success",
252
- title: "Transaction refund request initiated."
253
- });
254
- } catch (i) {
255
- y.open({
256
- type: "error",
257
- title: "Fail to request refund transaction.",
258
- message: K(i)
259
- });
260
- }
261
- }
262
- );
263
- }
264
- async function $(t, e) {
265
- L(
266
- f,
267
- "Notify Transaction",
268
- "Are you sure to perform notify transaction?",
269
- async () => {
270
- try {
271
- await D.renotifyTransaction(t.id), y.open({
272
- type: "success",
273
- title: "Transaction notify successfully."
274
- });
275
- } catch (l) {
276
- y.open({
277
- type: "error",
278
- title: "Fail to notify transaction.",
279
- message: K(l)
280
- });
281
- }
282
- }
283
- );
284
- }
285
- async function U(t, e) {
286
- const l = pe([
287
- {
288
- type: "span",
289
- queryKey: "transaction.id",
290
- queryValue: t.id
291
- }
292
- ], t.transactionAt);
293
- window.open(l, "_blank");
294
- }
295
- F("");
296
- const c = [
297
- {
298
- header: () => o("payment.transactions.table.id"),
299
- accessorKey: "id",
300
- cell: ({ cell: t, row: e }) => {
301
- var l, i;
302
- return ((l = m.value) != null && l.role.isStaff || (i = m.value) != null && i.role.isAdmin) && e.original.transactionId ? e.original.id + `
303
- ID: ` + e.original.transactionId : e.original.id;
304
- }
305
- },
306
- {
307
- header: () => o("payment.transactions.table.pay_id"),
308
- accessorKey: "payId"
309
- },
310
- {
311
- header: () => o("payment.transactions.table.gateway_id"),
312
- accessorKey: "gatewayTransactionId"
313
- },
314
- {
315
- header: () => o("payment.transactions.table.bill_seq"),
316
- accessorKey: "seqNumber",
317
- cell: ({ cell: t, row: e }) => e.original.seqNumberBinded ? C(ge, { row: e, data: t.getValue() }) : e.original.seqNumber
318
- },
319
- {
320
- header: () => o("payment.transactions.table.gateway"),
321
- accessorKey: "gateway",
322
- meta: {
323
- textAlign: "center"
324
- },
325
- cell: ({ cell: t, row: e }) => e.original.gateway ? C(ue, { row: e, data: t.getValue() }) : ""
326
- },
327
- {
328
- header: () => o("payment.transactions.table.method"),
329
- accessorKey: "method",
330
- meta: {
331
- textAlign: "center"
332
- },
333
- cell: ({ cell: t, row: e }) => e.original.method ? C(me, { row: e, data: t.getValue() }) : ""
334
- },
335
- {
336
- header: () => o("payment.transactions.table.type"),
337
- accessorKey: "payFor",
338
- meta: {
339
- textAlign: "center"
340
- }
341
- },
342
- {
343
- header: () => o("payment.transactions.table.status"),
344
- accessorKey: "status",
345
- cell: ({ cell: t }) => C(ee, { data: t.getValue() })
346
- },
347
- {
348
- header: () => o("payment.transactions.table.restaurant"),
349
- accessorKey: "restaurantId"
350
- },
351
- {
352
- header: () => o("payment.transactions.table.source"),
353
- accessorKey: "source",
354
- cell: ({ cell: t, row: e }) => `(${e.original.sourceType}) ${e.original.source}`
355
- },
356
- {
357
- header: () => o("payment.transactions.table.transaction_at"),
358
- accessorKey: "transactionAt",
359
- meta: {
360
- width: "180px"
361
- },
362
- cell: ({ cell: t, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
363
- },
364
- {
365
- header: () => o("payment.transactions.table.sales_amount"),
366
- accessorKey: "amount",
367
- cell: ({ cell: t, row: e }) => {
368
- var l, i;
369
- return ((l = m.value) != null && l.role.isStaff || (i = m.value) != null && i.role.isAdmin) && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount;
370
- }
371
- }
372
- ];
373
- return ((n = m.value) != null && n.role.isStaff || (a = m.value) != null && a.role.isAdmin) && c.push({
374
- header: () => o("payment.transactions.table.actions"),
375
- accessorKey: "actions",
376
- cell: ({ row: t }) => C(de, {
377
- transaction: t.original,
378
- onAction: (e) => {
379
- var l;
380
- switch (e) {
381
- case "notify":
382
- return $(t.original, t.index);
383
- case "query":
384
- return R(t.original, t.index);
385
- case "refund":
386
- return (l = m.value) != null && l.role.isStaff ? y.open({
387
- type: "error",
388
- title: "You are not allowed to refund transaction."
389
- }) : k(t.original, t.index);
390
- case "history":
391
- return U(t.original, t.index);
392
- }
393
- }
394
- })
395
- }), (t, e) => {
396
- const l = A("FmSearch"), i = A("FmSelect");
397
- return I(), Y(W, {
398
- title: s(o)("payment.transactions.title"),
399
- description: s(o)("payment.transactions.description"),
400
- loading: !1
401
- }, {
402
- default: V(() => [
403
- h("div", Ae, [
404
- h("div", he, [
405
- p(l, {
406
- "model-value": s(v),
407
- "onUpdate:modelValue": e[0] || (e[0] = (r) => N(v) ? v.value = r : null),
408
- class: "mr-8",
409
- label: s(o)("payment.transactions.search.title"),
410
- placeholder: s(o)("payment.transactions.search.placeholder")
411
- }, null, 8, ["model-value", "label", "placeholder"]),
412
- p(i, {
413
- modelValue: s(d),
414
- "onUpdate:modelValue": e[2] || (e[2] = (r) => N(d) ? d.value = r : null),
415
- class: "mr-6 w-[300px]",
416
- label: s(o)("payment.transactions.status"),
417
- "label-mark": "required",
418
- multiselect: "",
419
- items: S
420
- }, {
421
- "prepend-menu": V(() => [
422
- p(ne, {
423
- modelValue: s(d),
424
- "onUpdate:modelValue": e[1] || (e[1] = (r) => N(d) ? d.value = r : null),
425
- items: S
426
- }, null, 8, ["modelValue"])
427
- ]),
428
- _: 1
429
- }, 8, ["modelValue", "label"])
430
- ]),
431
- h("div", Se, [
432
- p(ae, {
433
- button: {
434
- appendIcon: "file_download",
435
- variant: "primary",
436
- label: s(o)("payment.transactions.button.export")
437
- },
438
- handler: async () => {
439
- var x;
440
- const r = await ((x = T.value) == null ? void 0 : x.allData());
441
- r != null && await s(D).downloadPortalTransactionReport(s(_), s(X)(r));
442
- }
443
- }, null, 8, ["button", "handler"])
444
- ])
445
- ]),
446
- h("div", Ne, [
447
- p(be, {
448
- id: s(b),
449
- "onUpdate:id": e[3] || (e[3] = (r) => N(b) ? b.value = r : null),
450
- by: s(u),
451
- "onUpdate:by": e[4] || (e[4] = (r) => N(u) ? u.value = r : null)
452
- }, null, 8, ["id", "by"]),
453
- p(re, {
454
- modelValue: s(_),
455
- "onUpdate:modelValue": e[5] || (e[5] = (r) => N(_) ? _.value = r : null)
456
- }, null, 8, ["modelValue"])
457
- ]),
458
- p(ye, {
459
- ref_key: "controller",
460
- ref: T,
461
- "column-defs": c,
462
- "rows-defs": s(Z),
463
- paginate: (r, x) => s(D).readTransactionsV2({
464
- limit: r,
465
- cursor: x,
466
- status: s(d),
467
- by: s(u),
468
- id: s(b),
469
- search: s(v),
470
- start: s(_).startDate,
471
- end: s(_).endDate
472
- })
473
- }, null, 8, ["rows-defs", "paginate"])
474
- ]),
475
- _: 1
476
- }, 8, ["title", "description"]);
477
- };
478
- }
479
- });
480
- export {
481
- Be as default
482
- };