@feedmepos/mf-payment 0.0.0-beta.34 → 0.0.0-beta.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/dist/{PayoutAccount-D-9hzZyp.js → PayoutAccount-C-FZD8lM.js} +2 -2
  2. package/dist/{PayoutAccount-BF4TdtVz.js → PayoutAccount-mpVH-GBq.js} +1 -1
  3. package/dist/{SettlementTransactions-w0jXLftr.js → SettlementTransactions-Co4ziq3a.js} +1 -1
  4. package/dist/{SettlementTransactions-CdZswF1S.js → SettlementTransactions-yJhT6FR4.js} +1 -1
  5. package/dist/{Terminal-BbIs7aYi.js → Terminal-BDDP5VT8.js} +1 -1
  6. package/dist/TerminalTransaction-CEQ3hedf.js +413 -0
  7. package/dist/{TerminalTransaction-BEyzFREU.js → TerminalTransaction-DCqbXI2q.js} +4 -4
  8. package/dist/{Transaction-Atm-A5eN.js → Transaction-D6mKrbLJ.js} +1 -1
  9. package/dist/Transaction-DvgeNetP.js +405 -0
  10. package/dist/api/terminal-transaction/index.d.ts +3 -1
  11. package/dist/api/transaction/index.d.ts +1 -0
  12. package/dist/app.js +9 -9
  13. package/dist/components/CursorTable/index.vue.d.ts +4 -0
  14. package/dist/{index-RhSxYSBk.js → index-Dlszue3Y.js} +20 -10
  15. package/dist/{index.vue_vue_type_script_setup_true_lang-B7ePQpGr.js → index.vue_vue_type_script_setup_true_lang-B8eGz19R.js} +62 -58
  16. package/dist/model/transaction.d.ts +2 -1
  17. package/dist/package.json +1 -1
  18. package/dist/{payout-account-C1kHqPZb.js → payout-account-C5rDbsPa.js} +175 -175
  19. package/dist/{transaction-BH1Pm92q.js → transaction-DdbmOKZ7.js} +18 -11
  20. package/dist/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +7 -0
  22. package/dist/views/admin/transaction/TransactionTable.vue.d.ts +6 -2
  23. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +7 -0
  24. package/package.json +1 -1
  25. package/dist/TerminalTransaction-CVcDmLvg.js +0 -274
  26. package/dist/Transaction-DpmCjczz.js +0 -243
@@ -2,10 +2,10 @@ import { defineComponent as b, resolveComponent as m, openBlock as g, createBloc
2
2
  import { u as S } from "./index-BgnU5ezY.js";
3
3
  import { _ as O } from "./index-Cnxt2xmc.js";
4
4
  import { _ as K } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
5
- import { P as V } from "./payout-account-C1kHqPZb.js";
5
+ import { P as V } from "./payout-account-C5rDbsPa.js";
6
6
  import { p as D } from "./index-ApzEWD1P.js";
7
7
  import "@feedmepos/ui-library";
8
- import { _ as T } from "./index.vue_vue_type_script_setup_true_lang-B7ePQpGr.js";
8
+ import { _ as T } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
9
9
  import { useRouter as $ } from "vue-router";
10
10
  const G = /* @__PURE__ */ b({
11
11
  __name: "Status",
@@ -3,7 +3,7 @@ import { p as z } from "./index-ApzEWD1P.js";
3
3
  import { _ as I, u as S, c as h } from "./index-Cnxt2xmc.js";
4
4
  import { defineStore as _ } from "pinia";
5
5
  import { useCoreStore as $ } from "@feedmepos/mf-common";
6
- import { c as AA, P as j } from "./payout-account-C1kHqPZb.js";
6
+ import { c as AA, P as j } from "./payout-account-C5rDbsPa.js";
7
7
  import { useDialogChild as sA, useDialog as eA } from "@feedmepos/ui-library";
8
8
  import { z as f, a as q } from "./validator-D5jtpt9A.js";
9
9
  import { P as K } from "./PDFViewer-CjH_C1uT.js";
@@ -3,7 +3,7 @@ import { c as E, u as j } from "./index-Cnxt2xmc.js";
3
3
  import "@feedmepos/ui-library";
4
4
  import { d as h } from "./dinero-CIVmXLL-.js";
5
5
  import { g as Y, a as H } from "./assets-sX1_K-nt.js";
6
- import { t as q, a as J } from "./transaction-BH1Pm92q.js";
6
+ import { t as q, a as J } from "./transaction-DdbmOKZ7.js";
7
7
  import { _ as Q } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
8
8
  import { useRouter as W } from "vue-router";
9
9
  import { s as X } from "./index-BSpzaL20.js";
@@ -3,7 +3,7 @@ import { c as E, u as q } from "./index-Cnxt2xmc.js";
3
3
  import { useDialog as J, useSnackbar as Q } from "@feedmepos/ui-library";
4
4
  import { d as B } from "./dinero-CIVmXLL-.js";
5
5
  import { g as W, a as X } from "./assets-sX1_K-nt.js";
6
- import { t as P, a as Z } from "./transaction-BH1Pm92q.js";
6
+ import { t as P, a as Z } from "./transaction-DdbmOKZ7.js";
7
7
  import { _ as ee } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
8
8
  import { useRouter as te } from "vue-router";
9
9
  import { s as ae } from "./index-BSpzaL20.js";
@@ -2,7 +2,7 @@ import { defineComponent as h, openBlock as d, createElementBlock as I, createTe
2
2
  import "./index-Cnxt2xmc.js";
3
3
  import { h as Y } from "./moment-h96o7c8I.js";
4
4
  import { u as j } from "./index-BgnU5ezY.js";
5
- import { _ as q } from "./index.vue_vue_type_script_setup_true_lang-B7ePQpGr.js";
5
+ import { _ as q } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
6
6
  import { _ as O } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
7
7
  import { useSnackbar as P, useDialogChild as Q, useDialog as G } from "@feedmepos/ui-library";
8
8
  import { t as F } from "./index-CBFVJirn.js";
@@ -0,0 +1,413 @@
1
+ import { defineComponent as I, openBlock as y, createElementBlock as w, unref as i, createCommentVNode as V, createElementVNode as h, resolveComponent as g, createBlock as S, normalizeClass as K, withCtx as N, toDisplayString as C, createVNode as p, Fragment as $, renderList as L, ref as P, watch as R, isRef as x, h as A } from "vue";
2
+ import { e as f } from "./index-Cnxt2xmc.js";
3
+ import { h as F } from "./moment-h96o7c8I.js";
4
+ import { u as B } from "./index-BgnU5ezY.js";
5
+ import { _ as G } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
6
+ import { _ as U } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
7
+ import { useSnackbar as Y, useDialog as Q } from "@feedmepos/ui-library";
8
+ import { g as W } from "./assets-sX1_K-nt.js";
9
+ import { E as j, t as b } from "./index-Dlszue3Y.js";
10
+ import { d as z } from "./dinero-CIVmXLL-.js";
11
+ import { _ as H } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
12
+ import { _ as J } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
13
+ import { useRouter as X } from "vue-router";
14
+ import { w as Z } from "./Modal-DB8M9o1T.js";
15
+ import { u as v } from "./error-K1CakhA9.js";
16
+ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I({
17
+ __name: "Gateway",
18
+ props: {
19
+ row: {},
20
+ data: {}
21
+ },
22
+ setup(T) {
23
+ return (a, m) => (y(), w("div", ee, [
24
+ a.row.original.ecrGateway ? (y(), w("img", {
25
+ key: 0,
26
+ class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
27
+ src: i(j)
28
+ }, null, 8, te)) : V("", !0),
29
+ h("img", {
30
+ class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
31
+ src: i(W)(a.row.original.gateway)
32
+ }, null, 8, ae)
33
+ ]));
34
+ }
35
+ }), re = /* @__PURE__ */ I({
36
+ __name: "Status",
37
+ props: {
38
+ row: {},
39
+ data: {}
40
+ },
41
+ setup(T) {
42
+ const a = T;
43
+ function m() {
44
+ return a.data === f.F_TERMINAL_TRANSACTION_ACTION.Enum.process ? "!w-[16px] !h-[16px] bg-yellow-400" : a.data === f.F_TERMINAL_TRANSACTION_ACTION.Enum.failed ? "!w-[16px] !h-[16px] bg-red-400" : a.data === f.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
45
+ }
46
+ return (r, l) => {
47
+ const s = g("FmBadge");
48
+ return y(), S(s, {
49
+ inline: "",
50
+ class: K(m())
51
+ }, {
52
+ default: N(() => [
53
+ h("div", null, C(r.data.toUpperCase()), 1)
54
+ ]),
55
+ _: 1
56
+ }, 8, ["class"]);
57
+ };
58
+ }
59
+ }), oe = /* @__PURE__ */ I({
60
+ __name: "RouteCell",
61
+ props: {
62
+ data: {},
63
+ route: {}
64
+ },
65
+ setup(T) {
66
+ const a = T, m = X();
67
+ function r() {
68
+ m.push(a.route);
69
+ }
70
+ return (l, s) => (y(), w("div", {
71
+ class: "fm-typo-en-link-md-600",
72
+ onClick: s[0] || (s[0] = (u) => {
73
+ u.stopPropagation(), r();
74
+ })
75
+ }, C(l.data), 1));
76
+ }
77
+ }), se = /* @__PURE__ */ I({
78
+ __name: "Actions",
79
+ props: {
80
+ onAction: { type: Function }
81
+ },
82
+ setup(T) {
83
+ const a = [
84
+ {
85
+ label: "Query",
86
+ sublabel: "Perform transaction status inquriy",
87
+ icon: "question_answer",
88
+ action: "query"
89
+ },
90
+ {
91
+ label: "Refund",
92
+ sublabel: "Perform transaction refund request",
93
+ icon: "request_page",
94
+ action: "refund"
95
+ }
96
+ ];
97
+ return (m, r) => {
98
+ const l = g("FmIcon"), s = g("FmMenuItem"), u = g("FmMenu");
99
+ return y(), w("div", {
100
+ onClick: r[0] || (r[0] = (c) => {
101
+ c.stopPropagation();
102
+ })
103
+ }, [
104
+ p(u, null, {
105
+ "menu-button": N(() => [
106
+ p(l, { name: "settings" })
107
+ ]),
108
+ default: N(() => [
109
+ (y(), w($, null, L(a, (c) => p(s, {
110
+ selectable: !0,
111
+ key: c.label,
112
+ sublabel: c.sublabel,
113
+ label: c.label,
114
+ icon: c.icon,
115
+ onclick: () => m.onAction(c.action)
116
+ }, null, 8, ["sublabel", "label", "icon", "onclick"])), 64))
117
+ ]),
118
+ _: 1
119
+ })
120
+ ]);
121
+ };
122
+ }
123
+ }), le = { class: "flex justify-between mb-6 items-start" }, ce = { class: "flex space-x-4 items-start" }, ie = { class: "flex space-x-4" }, xe = /* @__PURE__ */ I({
124
+ __name: "TerminalTransaction",
125
+ setup(T) {
126
+ const a = Y(), m = Q(), r = P(), { dateRange: l, status: s, searchKey: u } = B({
127
+ searchKey: "",
128
+ status: [f.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
129
+ dateRange: {
130
+ startDate: F().startOf("day").toISOString(),
131
+ endDate: F().endOf("day").toISOString()
132
+ }
133
+ });
134
+ R([l, s], () => {
135
+ var e;
136
+ return (e = r.value) == null ? void 0 : e.reset();
137
+ });
138
+ let c;
139
+ R(u, async () => {
140
+ c && clearTimeout(c), c = setTimeout(
141
+ () => {
142
+ var e;
143
+ return (e = r.value) == null ? void 0 : e.reset();
144
+ },
145
+ 700
146
+ );
147
+ });
148
+ async function E(e) {
149
+ var o, d, _;
150
+ const t = (d = (o = r.value) == null ? void 0 : o.pageData()) == null ? void 0 : d.at(e);
151
+ if (!t) {
152
+ a.open({
153
+ type: "error",
154
+ title: "Something went wrong",
155
+ message: "Fail to find transactions from the displayed transactions."
156
+ });
157
+ return;
158
+ }
159
+ if (!t.refId) {
160
+ a.open({
161
+ type: "error",
162
+ title: "Something went wrong",
163
+ message: "Transaction isn't a valid transaction to perform query"
164
+ });
165
+ return;
166
+ }
167
+ try {
168
+ const n = await b.queryTransaction(t._id);
169
+ (_ = r.value) == null || _.replaceData(e, n), a.open({
170
+ type: "success",
171
+ title: "Transaction queried and updated successfully."
172
+ });
173
+ } catch (n) {
174
+ a.open({
175
+ type: "error",
176
+ title: "Fail to query transaction.",
177
+ message: v(n)
178
+ });
179
+ }
180
+ }
181
+ async function k(e) {
182
+ var o, d;
183
+ const t = (d = (o = r.value) == null ? void 0 : o.pageData()) == null ? void 0 : d.at(e);
184
+ if (!t) {
185
+ a.open({
186
+ type: "error",
187
+ title: "Something went wrong",
188
+ message: "Fail to find transactions from the displayed transactions."
189
+ });
190
+ return;
191
+ }
192
+ if (!t.refId) {
193
+ a.open({
194
+ type: "error",
195
+ title: "Something went wrong",
196
+ message: "Transaction isn't a valid transaction to perform refund"
197
+ });
198
+ return;
199
+ }
200
+ Z(
201
+ m,
202
+ "Refund Transaction",
203
+ "Are you sure to refund transaction? This action cannot be revert!",
204
+ async () => {
205
+ var _;
206
+ try {
207
+ const n = await b.refundTransaction({
208
+ transactionId: t._id,
209
+ reason: "portal transaction refund",
210
+ amount: t.details.amount
211
+ });
212
+ (_ = r.value) == null || _.replaceData(e, n), a.open({
213
+ type: "success",
214
+ title: "Transaction queried and updated successfully."
215
+ });
216
+ } catch (n) {
217
+ a.open({
218
+ type: "error",
219
+ title: "Fail to query transaction.",
220
+ message: v(n)
221
+ });
222
+ }
223
+ }
224
+ );
225
+ }
226
+ const O = [
227
+ {
228
+ label: "Success",
229
+ value: f.F_TERMINAL_TRANSACTION_ACTION.Enum.success
230
+ },
231
+ {
232
+ label: "Refunded",
233
+ value: f.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded
234
+ },
235
+ {
236
+ label: "Process",
237
+ value: f.F_TERMINAL_TRANSACTION_ACTION.Enum.process
238
+ },
239
+ {
240
+ label: "Failed",
241
+ value: f.F_TERMINAL_TRANSACTION_ACTION.Enum.failed
242
+ }
243
+ ], D = function(e) {
244
+ const t = e;
245
+ let o = "-";
246
+ return t.details && t.details.amount && (o = z(t.details.amount).toFormat("$0.00")), {
247
+ id: e._id,
248
+ refId: e.refId,
249
+ owner: e.owner,
250
+ terminalId: e.terminalId,
251
+ transactionAt: F(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
252
+ action: e.action,
253
+ gateway: e.gateway,
254
+ ecrGateway: e.ecrGateway,
255
+ amount: o
256
+ };
257
+ }, M = [
258
+ {
259
+ accessorKey: "id",
260
+ header: () => "Transaction ID",
261
+ meta: {
262
+ textAlign: "left"
263
+ },
264
+ cell: ({ cell: e }) => A(J, { data: e.getValue() })
265
+ },
266
+ {
267
+ accessorKey: "terminalId",
268
+ header: () => "Terminal ID",
269
+ meta: {
270
+ textAlign: "left"
271
+ },
272
+ cell: ({ cell: e }) => {
273
+ const t = e.getValue();
274
+ return A(oe, {
275
+ data: t,
276
+ route: {
277
+ name: "mf-payment-admin.terminal-setting",
278
+ params: { terminalId: t }
279
+ }
280
+ });
281
+ }
282
+ },
283
+ {
284
+ accessorKey: "refId",
285
+ header: () => "Reference ID",
286
+ meta: {
287
+ textAlign: "left"
288
+ }
289
+ },
290
+ {
291
+ accessorKey: "gateway",
292
+ header: () => "Gateway",
293
+ meta: {
294
+ textAlign: "center",
295
+ maxWidth: "128px"
296
+ },
297
+ cell: ({ cell: e, row: t }) => A(ne, { row: t, data: e.getValue() })
298
+ },
299
+ {
300
+ accessorKey: "action",
301
+ header: () => "Status",
302
+ meta: {
303
+ textAlign: "right",
304
+ maxWidth: "132px"
305
+ },
306
+ cell: ({ cell: e, row: t }) => A(re, { row: t, data: e.getValue() })
307
+ },
308
+ {
309
+ accessorKey: "amount",
310
+ header: () => "Sales Amount",
311
+ meta: {
312
+ textAlign: "center"
313
+ }
314
+ },
315
+ {
316
+ accessorKey: "owner",
317
+ header: () => "Reference",
318
+ meta: {
319
+ textAlign: "left"
320
+ }
321
+ },
322
+ {
323
+ accessorKey: "transactionAt",
324
+ header: () => "Transaction At",
325
+ meta: {
326
+ textAlign: "left"
327
+ }
328
+ },
329
+ {
330
+ header: () => "Actions",
331
+ accessorKey: "actions",
332
+ cell: ({ row: e }) => A(se, {
333
+ onAction: (t) => {
334
+ const o = e.index;
335
+ switch (t) {
336
+ case "query":
337
+ return E(o);
338
+ case "refund":
339
+ return k(o);
340
+ }
341
+ }
342
+ })
343
+ }
344
+ ];
345
+ return (e, t) => {
346
+ const o = g("FmSearch"), d = g("FmSelect"), _ = g("FmDateRangePicker");
347
+ return y(), S(U, {
348
+ title: "Offline Transactions",
349
+ loading: !1
350
+ }, {
351
+ default: N(() => [
352
+ h("div", le, [
353
+ h("div", ce, [
354
+ p(o, {
355
+ "model-value": i(u),
356
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => x(u) ? u.value = n : null),
357
+ class: "mr-8",
358
+ label: "Search",
359
+ placeholder: "Search Transactions ..."
360
+ }, null, 8, ["model-value"]),
361
+ p(d, {
362
+ modelValue: i(s),
363
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => x(s) ? s.value = n : null),
364
+ class: "mr-6 w-[300px]",
365
+ label: "Status",
366
+ "label-mark": "required",
367
+ multiselect: "",
368
+ items: O
369
+ }, null, 8, ["modelValue"]),
370
+ p(_, {
371
+ modelValue: i(l),
372
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => x(l) ? l.value = n : null),
373
+ compare: "",
374
+ "show-predefined-range": ""
375
+ }, null, 8, ["modelValue"])
376
+ ]),
377
+ h("div", ie, [
378
+ p(H, {
379
+ button: {
380
+ appendIcon: "file_download",
381
+ variant: "primary",
382
+ label: "Export"
383
+ },
384
+ handler: () => {
385
+ var n;
386
+ return i(b).downloadTransactions(((n = r.value) == null ? void 0 : n.data()) ?? []);
387
+ }
388
+ }, null, 8, ["handler"])
389
+ ])
390
+ ]),
391
+ p(G, {
392
+ ref_key: "controller",
393
+ ref: r,
394
+ "column-defs": M,
395
+ "rows-defs": D,
396
+ paginate: (n, q) => i(b).readTransactions({
397
+ status: i(s),
398
+ searchKey: i(u),
399
+ limit: n,
400
+ cursor: q,
401
+ start: i(l).startDate,
402
+ end: i(l).endDate
403
+ })
404
+ }, null, 8, ["paginate"])
405
+ ]),
406
+ _: 1
407
+ });
408
+ };
409
+ }
410
+ });
411
+ export {
412
+ xe as default
413
+ };
@@ -2,10 +2,10 @@ import { defineComponent as N, openBlock as _, createElementBlock as w, Fragment
2
2
  import { e as l } from "./index-Cnxt2xmc.js";
3
3
  import { h as I } from "./moment-h96o7c8I.js";
4
4
  import { u as M } from "./index-BgnU5ezY.js";
5
- import { _ as $ } from "./index.vue_vue_type_script_setup_true_lang-B7ePQpGr.js";
5
+ import { _ as $ } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
6
6
  import "@feedmepos/ui-library";
7
7
  import { g as L } from "./assets-sX1_K-nt.js";
8
- import { E as B, t as x } from "./index-RhSxYSBk.js";
8
+ import { E as B, t as x } from "./index-Dlszue3Y.js";
9
9
  import { d as G } from "./dinero-CIVmXLL-.js";
10
10
  import { _ as P } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
11
11
  import { useCoreStore as U } from "@feedmepos/mf-common";
@@ -143,8 +143,8 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ N({
143
143
  accessorKey: "action",
144
144
  header: () => "Status",
145
145
  meta: {
146
- textAlign: "left",
147
- maxWidth: "128px"
146
+ textAlign: "right",
147
+ maxWidth: "132px"
148
148
  },
149
149
  cell: ({ cell: e, row: a }) => h(H, { row: a, data: e.getValue() })
150
150
  },
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as _, resolveComponent as T, openBlock as f, createBlock as N, normalizeClass as k, withCtx as R, createElementVNode as y, toDisplayString as K, createElementBlock as O, unref as o, ref as A, h as x, onMounted as V, watch as E, createVNode as p, isRef as F } from "vue";
2
- import { t as I, a as C } from "./transaction-BH1Pm92q.js";
2
+ import { t as I, a as C } from "./transaction-DdbmOKZ7.js";
3
3
  import { c as S, u as P } from "./index-Cnxt2xmc.js";
4
4
  import { useSnackbar as $ } from "@feedmepos/ui-library";
5
5
  import "./dinero-CIVmXLL-.js";