@feedmepos/mf-payment 1.5.72-dev → 1.5.73-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 (44) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-CUFmPuuD.js → Actions.vue_vue_type_script_setup_true_lang-BJupTyqX.js} +1 -1
  2. package/dist/{Chargeback-D3ycV0dO.js → Chargeback-WYytp2pg.js} +5 -5
  3. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-B3PfVFMF.js → DocumentViewer.vue_vue_type_script_setup_true_lang-BBnhnIeC.js} +1 -1
  4. package/dist/{OnboardForm-BVgHtaOF.js → OnboardForm-BCRC8dK2.js} +5 -5
  5. package/dist/{OnboardForm-Cl_9wg9A.js → OnboardForm-D3ShNAyH.js} +5 -5
  6. package/dist/{OnboardSubmission-syEkMsnl.js → OnboardSubmission-CEpJu58Y.js} +2 -2
  7. package/dist/{OnboardSubmission-4DKhhcgO.js → OnboardSubmission-wkUEgwE7.js} +5 -5
  8. package/dist/{PayoutAccount-Ba036aA3.js → PayoutAccount-C-WF0dpN.js} +5 -5
  9. package/dist/{PayoutAccount-_--Cy3p1.js → PayoutAccount-CYJ3oHcE.js} +130 -130
  10. package/dist/{PayoutAccountSetting-BXuwIdUh.js → PayoutAccountSetting-DbpY6GnD.js} +4 -4
  11. package/dist/{Restaurant-9qoIhpAm.js → Restaurant-BlnPSy25.js} +4 -4
  12. package/dist/{RestaurantSetting-DhxCwmlV.js → RestaurantSetting-CaX_Clgi.js} +3 -3
  13. package/dist/{Settlement-CbD6kM0Y.js → Settlement-BnHlR6gI.js} +4 -4
  14. package/dist/{Settlement-BarxYu6s.js → Settlement-DYW7ySXJ.js} +3 -3
  15. package/dist/{SettlementTransactions-MTe6S-Uy.js → SettlementTransactions-D5P8KZrh.js} +4 -4
  16. package/dist/{SettlementTransactions-DLflVs3c.js → SettlementTransactions-DvFL6Rkr.js} +4 -4
  17. package/dist/{Status.vue_vue_type_script_setup_true_lang-lIGLD62m.js → Status.vue_vue_type_script_setup_true_lang-DVnG6pdr.js} +1 -1
  18. package/dist/{Terminal-DR42JQp3.js → Terminal-wudV6UoA.js} +5 -5
  19. package/dist/{TerminalSetting-f7KCbdPX.js → TerminalSetting-Cz0W7cpS.js} +4 -4
  20. package/dist/{Transaction-DNYIVkap.js → Transaction-D1Z4lBz2.js} +98 -101
  21. package/dist/Transaction-Dwy9_GrM.js +507 -0
  22. package/dist/TransactionOld-DnxCKSaY.js +313 -0
  23. package/dist/{app-CZ7PgHN3.js → app-CP0wL5ns.js} +737 -732
  24. package/dist/app.js +1 -1
  25. package/dist/{assets-BtDGiTj3.js → assets-JQoSuSEA.js} +1 -1
  26. package/dist/{grafana-CUJ3wZ0Q.js → grafana-6o8_cFtS.js} +1 -1
  27. package/dist/{index-QYK2Hpl8.js → index--I0_vtNS.js} +1 -1
  28. package/dist/{index-C6NNeQJv.js → index-Ba3VR5ek.js} +1 -1
  29. package/dist/{index-BwUcOJGN.js → index-BnAPDCZv.js} +1 -1
  30. package/dist/{index-D8x_gCxD.js → index-CJUa_zHC.js} +2 -2
  31. package/dist/{index-Df9CuqAR.js → index-DIZGmv4_.js} +1 -1
  32. package/dist/{index-BX8Q4nIm.js → index-E3dm6KHn.js} +1 -1
  33. package/dist/{index-Cz1ptim0.js → index-OqVbzjLO.js} +1 -1
  34. package/dist/{index-Bj4_RvUb.js → index-dnQtvH7M.js} +1 -1
  35. package/dist/{index-BmkdfHiJ.js → index-lNQ4Q5-W.js} +1 -1
  36. package/dist/{index.vue_vue_type_script_setup_true_lang--xO2jUEf.js → index.vue_vue_type_script_setup_true_lang-Dof9cIZc.js} +1 -1
  37. package/dist/package.json +1 -1
  38. package/dist/{payout-account-BPkE-Ua4.js → payout-account-C_s7fod6.js} +3 -3
  39. package/dist/tsconfig.app.tsbuildinfo +1 -1
  40. package/dist/utils/permission.d.ts +1 -0
  41. package/dist/views/transaction/TransactionTable.vue.d.ts +2 -2
  42. package/package.json +1 -1
  43. package/dist/Transaction-VNG3CUqX.js +0 -517
  44. package/dist/TransactionOld-gyEQgFOk.js +0 -314
@@ -0,0 +1,313 @@
1
+ import { defineComponent as I, ref as x, watch as T, resolveComponent as F, openBlock as Y, createBlock as C, h as v, onMounted as M, unref as s, withCtx as O, createElementVNode as b, createVNode as f, isRef as q } from "vue";
2
+ import { t as g } from "./index-Ba3VR5ek.js";
3
+ import { u as S } from "./index-BnAPDCZv.js";
4
+ import { useSnackbar as U, useDialog as L } from "@feedmepos/ui-library";
5
+ import { _ as P, b as R, t as B } from "./assets-JQoSuSEA.js";
6
+ import { _ as J, a as j, b as G } from "./Actions.vue_vue_type_script_setup_true_lang-BJupTyqX.js";
7
+ import { g as Q } from "./grafana-6o8_cFtS.js";
8
+ import { w as $ } from "./Modal-DB8M9o1T.js";
9
+ import { u as K } from "./error-K1CakhA9.js";
10
+ import { useCoreStore as N, useI18n as E } from "@feedmepos/mf-common";
11
+ import { h as D } from "./app-CP0wL5ns.js";
12
+ import { h as k } from "./moment-h96o7c8I.js";
13
+ import { _ as z } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
14
+ import { u as H } from "./index-lNQ4Q5-W.js";
15
+ import { _ as W } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
16
+ import { _ as X } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-DG3iyjkK.js";
17
+ import { _ as Z } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-BNVnvrVY.js";
18
+ const aa = /* @__PURE__ */ I({
19
+ __name: "TransactionTable",
20
+ props: {
21
+ data: {
22
+ type: Array,
23
+ required: !0
24
+ },
25
+ loading: {
26
+ type: Boolean,
27
+ required: !0
28
+ }
29
+ },
30
+ emits: ["row-click"],
31
+ setup(V, { emit: l }) {
32
+ const n = V, o = x([...n.data]);
33
+ T(
34
+ () => n.data,
35
+ (e) => {
36
+ o.value = [...e];
37
+ },
38
+ { deep: !0, immediate: !0 }
39
+ );
40
+ const A = l, u = U(), d = L(), { sessionUser: i } = N(), { t } = E();
41
+ async function _(e) {
42
+ try {
43
+ const a = await g.refetchTransaction({
44
+ transactionId: e.id
45
+ });
46
+ o.value = o.value.map(
47
+ (c) => c.id === a._id ? R(a) : c
48
+ ), u.open({
49
+ type: "success",
50
+ title: "Transaction queried and updated successfully."
51
+ });
52
+ } catch (a) {
53
+ u.open({
54
+ type: "error",
55
+ title: "Fail to query transaction.",
56
+ message: K(a)
57
+ });
58
+ }
59
+ }
60
+ async function h(e) {
61
+ $(
62
+ d,
63
+ "Refund Transaction",
64
+ "Are you sure to refund transaction? This action cannot be revert!",
65
+ async () => {
66
+ try {
67
+ const a = await g.refundTransaction({
68
+ transactionId: e.id,
69
+ reason: "portal transaction refund",
70
+ amount: e.fdoAmount
71
+ });
72
+ o.value = o.value.map(
73
+ (c) => c.id === a._id ? R(a) : c
74
+ ), u.open({
75
+ type: "success",
76
+ title: "Transaction refund request initiated."
77
+ });
78
+ } catch (a) {
79
+ u.open({
80
+ type: "error",
81
+ title: "Fail to request refund transaction.",
82
+ message: K(a)
83
+ });
84
+ }
85
+ }
86
+ );
87
+ }
88
+ async function y(e) {
89
+ $(
90
+ d,
91
+ "Notify Transaction",
92
+ "Are you sure to perform notify transaction?",
93
+ async () => {
94
+ try {
95
+ await g.renotifyTransaction(e.id), u.open({
96
+ type: "success",
97
+ title: "Transaction notify successfully."
98
+ });
99
+ } catch (a) {
100
+ u.open({
101
+ type: "error",
102
+ title: "Fail to notify transaction.",
103
+ message: K(a)
104
+ });
105
+ }
106
+ }
107
+ );
108
+ }
109
+ async function p(e) {
110
+ const a = Q(
111
+ [
112
+ {
113
+ type: "span",
114
+ queryKey: "transaction.id",
115
+ queryValue: e.id
116
+ }
117
+ ],
118
+ e.transactionAt
119
+ );
120
+ window.open(a, "_blank");
121
+ }
122
+ const r = x(""), m = [
123
+ {
124
+ header: () => t("payment.transactions.table.id"),
125
+ accessorKey: "id",
126
+ cell: ({ cell: e, row: a }) => D(i.value) && a.original.transactionId ? a.original.id + `
127
+ ID: ` + a.original.transactionId : a.original.id
128
+ },
129
+ {
130
+ header: () => t("payment.transactions.table.pay_id"),
131
+ accessorKey: "payId"
132
+ },
133
+ {
134
+ header: () => t("payment.transactions.table.gateway_id"),
135
+ accessorKey: "gatewayTransactionId"
136
+ },
137
+ {
138
+ header: () => t("payment.transactions.table.bill_seq"),
139
+ accessorKey: "seqNumber"
140
+ },
141
+ {
142
+ header: () => t("payment.transactions.table.gateway"),
143
+ accessorKey: "gateway",
144
+ meta: {
145
+ textAlign: "center"
146
+ },
147
+ cell: ({ cell: e, row: a }) => a.original.gateway ? v(J, { row: a, data: e.getValue() }) : ""
148
+ },
149
+ {
150
+ header: () => t("payment.transactions.table.method"),
151
+ accessorKey: "method",
152
+ meta: {
153
+ textAlign: "center"
154
+ },
155
+ cell: ({ cell: e, row: a }) => a.original.method ? v(j, { row: a, data: e.getValue() }) : ""
156
+ },
157
+ {
158
+ header: () => t("payment.transactions.table.type"),
159
+ accessorKey: "payFor",
160
+ meta: {
161
+ textAlign: "center"
162
+ }
163
+ },
164
+ {
165
+ header: () => t("payment.transactions.table.status"),
166
+ accessorKey: "status",
167
+ cell: ({ cell: e }) => v(P, { data: e.getValue() })
168
+ },
169
+ {
170
+ header: () => t("payment.transactions.table.restaurant"),
171
+ accessorKey: "restaurantId"
172
+ },
173
+ {
174
+ header: () => t("payment.transactions.table.source"),
175
+ accessorKey: "source",
176
+ cell: ({ cell: e, row: a }) => `(${a.original.sourceType}) ${a.original.source}`
177
+ },
178
+ {
179
+ header: () => t("payment.transactions.table.transaction_at"),
180
+ accessorKey: "transactionAt",
181
+ meta: {
182
+ width: "180px"
183
+ },
184
+ cell: ({ cell: e, row: a }) => a.original.status === "REFUNDED" ? a.original.refundedAt : a.original.transactionAt
185
+ },
186
+ {
187
+ header: () => t("payment.transactions.table.sales_amount"),
188
+ accessorKey: "amount",
189
+ cell: ({ cell: e, row: a }) => D(i.value) && a.original.flags.isDelivery ? a.original.amount + "( " + a.original.gatewayAmount + ")" : a.original.amount
190
+ }
191
+ ];
192
+ return D(i.value) && m.push({
193
+ header: () => t("payment.transactions.table.actions"),
194
+ accessorKey: "actions",
195
+ cell: ({ row: e }) => v(G, {
196
+ transaction: e.original,
197
+ onAction: (a) => {
198
+ switch (a) {
199
+ case "notify":
200
+ return y(e.original);
201
+ case "query":
202
+ return _(e.original);
203
+ case "refund":
204
+ return h(e.original);
205
+ case "history":
206
+ return p(e.original);
207
+ }
208
+ }
209
+ })
210
+ }), (e, a) => {
211
+ const c = F("FmTable");
212
+ return Y(), C(c, {
213
+ modelValue: r.value,
214
+ "onUpdate:modelValue": a[0] || (a[0] = (w) => r.value = w),
215
+ "column-defs": m,
216
+ "row-data": o.value,
217
+ loading: n.loading,
218
+ onRowClick: a[1] || (a[1] = (w) => A("row-click", o.value.at(w.index)))
219
+ }, null, 8, ["modelValue", "row-data", "loading"]);
220
+ };
221
+ }
222
+ }), ea = { class: "flex justify-between mb-6 items-center" }, ta = { class: "flex space-x-8" }, na = { class: "flex space-x-4 self-center" }, ra = { class: "flex gap-8 mb-6" }, xa = /* @__PURE__ */ I({
223
+ __name: "TransactionOld",
224
+ setup(V) {
225
+ const { dateRange: l, searchKey: n } = H({
226
+ searchKey: "",
227
+ dateRange: {
228
+ startDate: k().startOf("day").format("YYYY-MM-DD"),
229
+ endDate: k().endOf("day").format("YYYY-MM-DD")
230
+ }
231
+ }), { isLoading: o, startAsyncCall: A } = S(!0), { currentRestaurant: u } = N(), { t: d } = E(), i = x([]), t = x([]);
232
+ async function _() {
233
+ await A(async () => {
234
+ const { startDate: p, endDate: r } = l.value, m = await g.readRestaurantTransactions({
235
+ start: p,
236
+ end: r
237
+ });
238
+ if (i.value = B(m), t.value = i.value, n.value > "") {
239
+ var e = new RegExp(n.value, "i");
240
+ t.value = i.value.filter((a) => {
241
+ const c = JSON.stringify(a);
242
+ return e.test(c);
243
+ });
244
+ }
245
+ });
246
+ }
247
+ function h() {
248
+ _();
249
+ }
250
+ M(h), T(u, h), T(l, _);
251
+ let y;
252
+ return T(n, async () => {
253
+ y && clearTimeout(y), y = setTimeout(() => {
254
+ var p = new RegExp(n.value, "i");
255
+ t.value = i.value.filter((r) => {
256
+ const m = JSON.stringify(r);
257
+ return p.test(m);
258
+ });
259
+ }, 700);
260
+ }), (p, r) => {
261
+ const m = F("FmSearch");
262
+ return Y(), C(z, {
263
+ title: s(d)("payment.transactions.title"),
264
+ description: s(d)("payment.transactions.description"),
265
+ loading: s(o)
266
+ }, {
267
+ default: O(() => [
268
+ b("div", ea, [
269
+ b("div", ta, [
270
+ f(m, {
271
+ "model-value": s(n),
272
+ "onUpdate:modelValue": r[0] || (r[0] = (e) => q(n) ? n.value = e : null),
273
+ label: s(d)("payment.transactions.search.title"),
274
+ placeholder: s(d)("payment.transactions.search.placeholder")
275
+ }, null, 8, ["model-value", "label", "placeholder"])
276
+ ]),
277
+ b("div", na, [
278
+ f(W, {
279
+ button: {
280
+ appendIcon: "file_download",
281
+ variant: "primary",
282
+ label: s(d)("payment.transactions.button.export")
283
+ },
284
+ handler: async () => {
285
+ await s(g).downloadPortalTransactionReport(
286
+ s(l),
287
+ i.value,
288
+ !0
289
+ );
290
+ }
291
+ }, null, 8, ["button", "handler"])
292
+ ])
293
+ ]),
294
+ b("div", ra, [
295
+ f(X),
296
+ f(Z, {
297
+ modelValue: s(l),
298
+ "onUpdate:modelValue": r[1] || (r[1] = (e) => q(l) ? l.value = e : null)
299
+ }, null, 8, ["modelValue"])
300
+ ]),
301
+ f(aa, {
302
+ loading: s(o),
303
+ data: t.value
304
+ }, null, 8, ["loading", "data"])
305
+ ]),
306
+ _: 1
307
+ }, 8, ["title", "description", "loading"]);
308
+ };
309
+ }
310
+ });
311
+ export {
312
+ xa as default
313
+ };