@feedmepos/mf-payment 1.0.0 → 1.0.1-beta.1

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 (98) hide show
  1. package/README.md +11 -1
  2. package/dist/{AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js → AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js} +8 -9
  3. package/dist/DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js +31 -0
  4. package/dist/PDFViewer-xrBtzrlR.js +22426 -0
  5. package/dist/{PayoutAccount-Dc1CYQ0W.js → PayoutAccount-CyVXI1Sx.js} +93 -83
  6. package/dist/{PayoutAccount-DZaKHWcy.js → PayoutAccount-DGUnImHC.js} +259 -258
  7. package/dist/{PayoutAccountSetting-BzmNuLFj.js → PayoutAccountSetting-BbtOFbsd.js} +161 -183
  8. package/dist/Restaurant-ewsvVw3P.js +262 -0
  9. package/dist/RestaurantSetting-BboKM1iG.js +389 -0
  10. package/dist/SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js +42 -0
  11. package/dist/{Settlement-Bx3zAkIw.js → Settlement-DsJlFpCC.js} +41 -43
  12. package/dist/Settlement-Hr7jN3EL.js +145 -0
  13. package/dist/{SettlementTransactions-D_SVuKyR.js → SettlementTransactions-BncoGGQ3.js} +10 -10
  14. package/dist/{SettlementTransactions-AaYyTH96.js → SettlementTransactions-Bz9ZVYfq.js} +41 -41
  15. package/dist/{Terminal-68OQnhM3.js → Terminal-D-U0BVTe.js} +117 -103
  16. package/dist/TerminalSetting-JD3sbXOB.js +387 -0
  17. package/dist/TerminalTransaction-B5iY_F-3.js +261 -0
  18. package/dist/TerminalTransaction-DHmD5x8e.js +485 -0
  19. package/dist/{Transaction-a1VfiCP_.js → Transaction-BedQtv8p.js} +125 -127
  20. package/dist/Transaction-DA_TB9zD.js +238 -0
  21. package/dist/api/restaurant/index.d.ts +6 -0
  22. package/dist/{app-C9FRsUfb.js → app-CpyZU23J.js} +315 -285
  23. package/dist/app.js +1 -1
  24. package/dist/{assets-Bji7O2YD.js → assets-8c19wXSV.js} +22 -21
  25. package/dist/components/AdminLayout.vue.d.ts +8 -13
  26. package/dist/components/AutoCopyCell.vue.d.ts +3 -4
  27. package/dist/components/DateRangePicker.vue.d.ts +13 -0
  28. package/dist/components/Layout.vue.d.ts +8 -13
  29. package/dist/components/PDFViewer.vue.d.ts +1 -1
  30. package/dist/components/PagingTable/FmTableSelection.vue.d.ts +13 -0
  31. package/dist/components/PagingTable/index.vue.d.ts +48 -0
  32. package/dist/components/RouteCell.vue.d.ts +5 -6
  33. package/dist/components/SelectAll.vue.d.ts +57 -0
  34. package/dist/helpers/idToDate.d.ts +1 -1
  35. package/dist/{index-Bt_OgDYn.js → index-1fXAFo2E.js} +32176 -32166
  36. package/dist/index-BIXuzGa9.js +19 -0
  37. package/dist/{index-DBfZnaV1.js → index-Cb1zVhcH.js} +1 -1
  38. package/dist/{index-DSuZG0l6.js → index-DEpszFWF.js} +1 -1
  39. package/dist/{index-DjDGwRX8.js → index-DdJrUqkm.js} +1 -1
  40. package/dist/{index-CLYePgWW.js → index-DeU3Qyca.js} +1 -1
  41. package/dist/{index-_0TroOJr.js → index-DoAIw4wM.js} +1 -1
  42. package/dist/index-DsLFmVsY.js +28 -0
  43. package/dist/{index.vue_vue_type_script_setup_true_lang-Jlcg1hAB.js → index.vue_vue_type_script_setup_true_lang-GT2x04Bn.js} +64 -61
  44. package/dist/package.json +2 -2
  45. package/dist/{payout-account-BWcq7OJy.js → payout-account-BbheLTUt.js} +2 -2
  46. package/dist/router/index.d.ts +1 -0
  47. package/dist/stores/iframe.d.ts +1 -1
  48. package/dist/stores/payoutAccount.d.ts +1 -1
  49. package/dist/{transaction-DqrhM5jB.js → transaction-W49zE8RL.js} +26 -16
  50. package/dist/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/views/admin/payout-account/cell/Bank.vue.d.ts +3 -5
  52. package/dist/views/admin/payout-account/cell/IsActive.vue.d.ts +3 -5
  53. package/dist/views/admin/payout-account/cell/PersonInCharge.vue.d.ts +3 -5
  54. package/dist/views/admin/payout-account/cell/RateInput.vue.d.ts +3 -5
  55. package/dist/views/admin/payout-account/cell/Status.vue.d.ts +3 -5
  56. package/dist/views/admin/payout-account/cell/TPlusInput.vue.d.ts +3 -5
  57. package/dist/views/admin/restaurant/Restaurant.vue.d.ts +2 -0
  58. package/dist/views/admin/restaurant/RestaurantSetting.vue.d.ts +12 -0
  59. package/dist/views/admin/restaurant/cell/IsActive.vue.d.ts +7 -0
  60. package/dist/views/admin/restaurant/tabs/PaymentGateway.vue.d.ts +803 -0
  61. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +56 -0
  62. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +50 -0
  63. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +52 -0
  64. package/dist/views/admin/settlement/cell/Actions.vue.d.ts +4 -6
  65. package/dist/views/admin/settlement/cell/Gateway.vue.d.ts +3 -5
  66. package/dist/views/admin/settlement/cell/Method.vue.d.ts +3 -5
  67. package/dist/views/admin/settlement/cell/Status.vue.d.ts +3 -5
  68. package/dist/views/admin/terminal/TerminalBindCodeDialog.vue.d.ts +1 -1
  69. package/dist/views/admin/terminal/cell/Actions.vue.d.ts +7 -79
  70. package/dist/views/admin/terminal/cell/ID.vue.d.ts +3 -5
  71. package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +3 -4
  72. package/dist/views/admin/terminal-transaction/cell/Gateway.vue.d.ts +3 -5
  73. package/dist/views/admin/terminal-transaction/cell/Status.vue.d.ts +3 -5
  74. package/dist/views/admin/terminal-transaction/cell/Timestamp.vue.d.ts +7 -0
  75. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +3 -4
  76. package/dist/views/admin/transaction/cell/Gateway.vue.d.ts +3 -5
  77. package/dist/views/admin/transaction/cell/Method.vue.d.ts +3 -5
  78. package/dist/views/admin/transaction/cell/Status.vue.d.ts +3 -5
  79. package/dist/views/payout-account/cell/Bank.vue.d.ts +3 -5
  80. package/dist/views/payout-account/cell/IsActive.vue.d.ts +3 -5
  81. package/dist/views/payout-account/cell/PersonInCharge.vue.d.ts +3 -5
  82. package/dist/views/payout-account/cell/Status.vue.d.ts +3 -5
  83. package/dist/views/settlement/cell/Actions.vue.d.ts +4 -6
  84. package/dist/views/settlement/cell/Gateway.vue.d.ts +3 -5
  85. package/dist/views/settlement/cell/Method.vue.d.ts +3 -5
  86. package/dist/views/settlement/cell/Status.vue.d.ts +3 -5
  87. package/dist/views/terminal-transaction/cell/Gateway.vue.d.ts +3 -5
  88. package/dist/views/terminal-transaction/cell/Status.vue.d.ts +3 -5
  89. package/dist/views/transaction/cell/Gateway.vue.d.ts +3 -5
  90. package/dist/views/transaction/cell/Method.vue.d.ts +3 -5
  91. package/dist/views/transaction/cell/Status.vue.d.ts +3 -5
  92. package/package.json +2 -2
  93. package/dist/PDFViewer-CjH_C1uT.js +0 -21792
  94. package/dist/Settlement-mwnO-iYH.js +0 -150
  95. package/dist/TerminalSetting-DEFim0xg.js +0 -379
  96. package/dist/TerminalTransaction-CQjNdffr.js +0 -426
  97. package/dist/TerminalTransaction-ClihmWOJ.js +0 -250
  98. package/dist/Transaction-68L7JzIk.js +0 -242
@@ -1,426 +0,0 @@
1
- import { defineComponent as h, openBlock as y, createElementBlock as I, unref as c, createCommentVNode as V, createElementVNode as w, resolveComponent as g, createBlock as v, normalizeClass as K, withCtx as x, toDisplayString as C, createVNode as p, Fragment as $, renderList as P, ref as L, watch as F, isRef as N, h as A } from "vue";
2
- import { c as f } from "./index-Bt_OgDYn.js";
3
- import { h as R } from "./moment-h96o7c8I.js";
4
- import { u as B } from "./index-DjDGwRX8.js";
5
- import { _ as G } from "./index.vue_vue_type_script_setup_true_lang-Jlcg1hAB.js";
6
- import { _ as U } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
7
- import { useSnackbar as Y, useDialog as Q } from "@feedmepos/ui-library";
8
- import { g as W } from "./assets-Bji7O2YD.js";
9
- import { E as j, t as b } from "./index-DSuZG0l6.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 S } from "./error-K1CakhA9.js";
16
- const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ h({
17
- __name: "Gateway",
18
- props: {
19
- row: {},
20
- data: {}
21
- },
22
- setup(T) {
23
- return (a, m) => (y(), I("div", ee, [
24
- a.row.original.ecrGateway ? (y(), I("img", {
25
- key: 0,
26
- class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
27
- src: c(j)
28
- }, null, 8, te)) : V("", !0),
29
- w("img", {
30
- class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
31
- src: c(W)(a.row.original.gateway)
32
- }, null, 8, ae)
33
- ]));
34
- }
35
- }), re = /* @__PURE__ */ h({
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 (o, l) => {
47
- const s = g("FmBadge");
48
- return y(), v(s, {
49
- inline: "",
50
- class: K(m())
51
- }, {
52
- default: x(() => [
53
- w("div", null, C(o.data.toUpperCase()), 1)
54
- ]),
55
- _: 1
56
- }, 8, ["class"]);
57
- };
58
- }
59
- }), oe = /* @__PURE__ */ h({
60
- __name: "RouteCell",
61
- props: {
62
- data: {},
63
- route: {}
64
- },
65
- setup(T) {
66
- const a = T, m = X();
67
- function o() {
68
- m.push(a.route);
69
- }
70
- return (l, s) => (y(), I("div", {
71
- class: "fm-typo-en-link-md-600",
72
- onClick: s[0] || (s[0] = (u) => {
73
- u.stopPropagation(), o();
74
- })
75
- }, C(l.data), 1));
76
- }
77
- }), se = /* @__PURE__ */ h({
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, o) => {
98
- const l = g("FmIcon"), s = g("FmMenuItem"), u = g("FmMenu");
99
- return y(), I("div", {
100
- onClick: o[0] || (o[0] = (i) => {
101
- i.stopPropagation();
102
- })
103
- }, [
104
- p(u, null, {
105
- "menu-button": x(() => [
106
- p(l, { name: "settings" })
107
- ]),
108
- default: x(() => [
109
- (y(), I($, null, P(a, (i) => p(s, {
110
- selectable: !0,
111
- key: i.label,
112
- sublabel: i.sublabel,
113
- label: i.label,
114
- icon: i.icon,
115
- onclick: () => m.onAction(i.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" }, ie = { class: "flex space-x-4 items-start" }, ce = { class: "flex space-x-4" }, Ne = /* @__PURE__ */ h({
124
- __name: "TerminalTransaction",
125
- setup(T) {
126
- const a = Y(), m = Q(), o = L(), { dateRange: l, status: s, searchKey: u } = B({
127
- searchKey: "",
128
- status: [f.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
129
- dateRange: {
130
- startDate: R().startOf("day").toISOString(),
131
- endDate: R().endOf("day").toISOString()
132
- }
133
- });
134
- F([l, s], () => {
135
- var e;
136
- return (e = o.value) == null ? void 0 : e.reset();
137
- });
138
- let i;
139
- F(u, async () => {
140
- i && clearTimeout(i), i = setTimeout(
141
- () => {
142
- var e;
143
- return (e = o.value) == null ? void 0 : e.reset();
144
- },
145
- 700
146
- );
147
- });
148
- async function k(e) {
149
- var r, d, _;
150
- const t = (d = (r = o.value) == null ? void 0 : r.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
- (_ = o.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: S(n)
178
- });
179
- }
180
- }
181
- async function E(e) {
182
- var r, d;
183
- const t = (d = (r = o.value) == null ? void 0 : r.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
- (_ = o.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: S(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 r = "-";
246
- return t.details && t.details.amount && (r = z(t.details.amount).toFormat("$0.00")), {
247
- id: e._id,
248
- orderId: e.orderId,
249
- refId: e.refId,
250
- owner: e.owner,
251
- terminalId: e.terminalId,
252
- transactionAt: R(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
253
- action: e.action,
254
- gateway: e.gateway,
255
- ecrGateway: e.ecrGateway,
256
- amount: r
257
- };
258
- }, M = [
259
- {
260
- accessorKey: "id",
261
- header: () => "Transaction ID",
262
- meta: {
263
- textAlign: "left"
264
- },
265
- cell: ({ cell: e }) => A(J, { data: e.getValue() })
266
- },
267
- {
268
- accessorKey: "orderId",
269
- header: () => "Pay ID",
270
- meta: {
271
- textAlign: "left"
272
- }
273
- },
274
- {
275
- accessorKey: "refId",
276
- header: () => "Reference ID",
277
- meta: {
278
- textAlign: "left"
279
- }
280
- },
281
- {
282
- accessorKey: "gateway",
283
- header: () => "Gateway",
284
- meta: {
285
- textAlign: "center",
286
- maxWidth: "128px"
287
- },
288
- cell: ({ cell: e, row: t }) => A(ne, { row: t, data: e.getValue() })
289
- },
290
- {
291
- accessorKey: "action",
292
- header: () => "Status",
293
- meta: {
294
- textAlign: "right",
295
- maxWidth: "132px"
296
- },
297
- cell: ({ cell: e, row: t }) => A(re, { row: t, data: e.getValue() })
298
- },
299
- {
300
- accessorKey: "amount",
301
- header: () => "Sales Amount",
302
- meta: {
303
- textAlign: "center"
304
- }
305
- },
306
- {
307
- accessorKey: "terminalId",
308
- header: () => "Terminal ID",
309
- meta: {
310
- textAlign: "left"
311
- },
312
- cell: ({ cell: e, row: t }) => {
313
- const r = e.getValue();
314
- return A(oe, {
315
- data: r,
316
- route: {
317
- name: "mf-payment-admin.terminal-setting",
318
- params: { terminalId: r }
319
- }
320
- });
321
- }
322
- },
323
- {
324
- accessorKey: "owner",
325
- header: () => "Reference",
326
- meta: {
327
- textAlign: "left"
328
- }
329
- },
330
- {
331
- accessorKey: "transactionAt",
332
- header: () => "Transaction At",
333
- meta: {
334
- textAlign: "left"
335
- }
336
- },
337
- {
338
- header: () => "Actions",
339
- accessorKey: "actions",
340
- cell: ({ row: e }) => {
341
- if (e.original.gateway === "ScanPay")
342
- return A(se, {
343
- onAction: (t) => {
344
- const r = e.index;
345
- switch (t) {
346
- case "query":
347
- return k(r);
348
- case "refund":
349
- return E(r);
350
- }
351
- }
352
- });
353
- }
354
- }
355
- ];
356
- return (e, t) => {
357
- const r = g("FmSearch"), d = g("FmSelect"), _ = g("FmDateRangePicker");
358
- return y(), v(U, {
359
- title: "Offline Transactions",
360
- loading: !1
361
- }, {
362
- default: x(() => [
363
- w("div", le, [
364
- w("div", ie, [
365
- p(r, {
366
- "model-value": c(u),
367
- "onUpdate:modelValue": t[0] || (t[0] = (n) => N(u) ? u.value = n : null),
368
- class: "mr-8",
369
- label: "Search",
370
- placeholder: "Search Transactions ..."
371
- }, null, 8, ["model-value"]),
372
- p(d, {
373
- modelValue: c(s),
374
- "onUpdate:modelValue": t[1] || (t[1] = (n) => N(s) ? s.value = n : null),
375
- class: "mr-6 w-[300px]",
376
- label: "Status",
377
- "label-mark": "required",
378
- multiselect: "",
379
- items: O
380
- }, null, 8, ["modelValue"]),
381
- p(_, {
382
- modelValue: c(l),
383
- "onUpdate:modelValue": t[2] || (t[2] = (n) => N(l) ? l.value = n : null),
384
- compare: "",
385
- "show-predefined-range": ""
386
- }, null, 8, ["modelValue"])
387
- ]),
388
- w("div", ce, [
389
- p(H, {
390
- button: {
391
- appendIcon: "file_download",
392
- variant: "primary",
393
- label: "Export"
394
- },
395
- handler: async () => {
396
- var n;
397
- return c(b).downloadTransactions(await ((n = o.value) == null ? void 0 : n.allData()) ?? []);
398
- }
399
- }, null, 8, ["handler"])
400
- ])
401
- ]),
402
- p(G, {
403
- ref_key: "controller",
404
- ref: o,
405
- "column-defs": M,
406
- "rows-defs": D,
407
- onRowClick: t[3] || (t[3] = () => {
408
- }),
409
- paginate: (n, q) => c(b).readTransactions({
410
- status: c(s),
411
- searchKey: c(u),
412
- limit: n,
413
- cursor: q,
414
- start: c(l).startDate,
415
- end: c(l).endDate
416
- })
417
- }, null, 8, ["paginate"])
418
- ]),
419
- _: 1
420
- });
421
- };
422
- }
423
- });
424
- export {
425
- Ne as default
426
- };
@@ -1,250 +0,0 @@
1
- import { defineComponent as y, openBlock as _, createElementBlock as x, Fragment as F, unref as t, createCommentVNode as k, createElementVNode as d, resolveComponent as p, createBlock as R, normalizeClass as D, withCtx as C, toDisplayString as V, ref as K, watch as T, createVNode as i, isRef as g, h } from "vue";
2
- import { c as l } from "./index-Bt_OgDYn.js";
3
- import { h as I } from "./moment-h96o7c8I.js";
4
- import { u as M } from "./index-DjDGwRX8.js";
5
- import { _ as $ } from "./index.vue_vue_type_script_setup_true_lang-Jlcg1hAB.js";
6
- import "@feedmepos/ui-library";
7
- import { g as L } from "./assets-Bji7O2YD.js";
8
- import { E as B, t as w } from "./index-DSuZG0l6.js";
9
- import { d as G } from "./dinero-CIVmXLL-.js";
10
- import { _ as P } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
11
- import { useCoreStore as U } from "@feedmepos/mf-common";
12
- import { _ as Y } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
13
- import { _ as W } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
14
- import { _ as j } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
15
- const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
16
- __name: "Gateway",
17
- props: {
18
- row: {},
19
- data: {}
20
- },
21
- setup(f) {
22
- return (n, s) => (_(), x(F, null, [
23
- n.row.original.ecrGateway ? (_(), x("img", {
24
- key: 0,
25
- class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
26
- src: t(B)
27
- }, null, 8, q)) : k("", !0),
28
- d("img", {
29
- class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
30
- src: t(L)(n.row.original.gateway)
31
- }, null, 8, z)
32
- ], 64));
33
- }
34
- }), H = /* @__PURE__ */ y({
35
- __name: "Status",
36
- props: {
37
- row: {},
38
- data: {}
39
- },
40
- setup(f) {
41
- const n = f;
42
- function s() {
43
- return n.data === l.F_TERMINAL_TRANSACTION_ACTION.Enum.process ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === l.F_TERMINAL_TRANSACTION_ACTION.Enum.failed ? "!w-[16px] !h-[16px] bg-red-400" : n.data === l.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
44
- }
45
- return (o, m) => {
46
- const c = p("FmBadge");
47
- return _(), R(c, {
48
- inline: "",
49
- class: D(s())
50
- }, {
51
- default: C(() => [
52
- d("div", null, V(o.data.toUpperCase()), 1)
53
- ]),
54
- _: 1
55
- }, 8, ["class"]);
56
- };
57
- }
58
- }), J = { class: "flex justify-between mb-6 items-start" }, X = { class: "flex space-x-8 items-start" }, Z = { class: "flex space-x-4" }, _e = /* @__PURE__ */ y({
59
- __name: "TerminalTransaction",
60
- setup(f) {
61
- const { currentRestaurant: n } = U(), s = K(), { dateRange: o, status: m, searchKey: c } = M({
62
- searchKey: "",
63
- status: [l.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
64
- dateRange: {
65
- startDate: I().startOf("day").toISOString(),
66
- endDate: I().endOf("day").toISOString()
67
- }
68
- });
69
- T([o, m], () => {
70
- var e;
71
- return (e = s.value) == null ? void 0 : e.reset();
72
- }), T(n, () => {
73
- var e;
74
- return (e = s.value) == null ? void 0 : e.reset();
75
- });
76
- let A;
77
- T(c, async () => {
78
- A && clearTimeout(A), A = setTimeout(
79
- () => {
80
- var e;
81
- return (e = s.value) == null ? void 0 : e.reset();
82
- },
83
- 700
84
- );
85
- });
86
- const S = [
87
- {
88
- label: "Success",
89
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.success
90
- },
91
- {
92
- label: "Refunded",
93
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded
94
- },
95
- {
96
- label: "Process",
97
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.process
98
- },
99
- {
100
- label: "Failed",
101
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.failed
102
- }
103
- ], E = function(e) {
104
- const a = e;
105
- let u = "-";
106
- return a.details && a.details.amount && (u = G(a.details.amount).toFormat("$0.00")), {
107
- id: e._id,
108
- orderId: e.orderId,
109
- refId: e.refId,
110
- terminalId: e.terminalId,
111
- transactionAt: I(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
112
- action: e.action,
113
- gateway: e.gateway,
114
- ecrGateway: e.ecrGateway,
115
- amount: u
116
- };
117
- }, O = [
118
- {
119
- accessorKey: "id",
120
- header: () => "Transaction ID",
121
- meta: {
122
- textAlign: "left"
123
- },
124
- cell: ({ cell: e }) => h(W, { data: e.getValue() })
125
- },
126
- {
127
- accessorKey: "orderId",
128
- header: () => "Pay ID",
129
- meta: {
130
- textAlign: "left"
131
- }
132
- },
133
- {
134
- accessorKey: "refId",
135
- header: () => "Reference ID",
136
- meta: {
137
- textAlign: "left"
138
- }
139
- },
140
- {
141
- accessorKey: "gateway",
142
- header: () => "Gateway",
143
- meta: {
144
- textAlign: "center",
145
- maxWidth: "128px"
146
- },
147
- cell: ({ cell: e, row: a }) => h(Q, { row: a, data: e.getValue() })
148
- },
149
- {
150
- accessorKey: "action",
151
- header: () => "Status",
152
- meta: {
153
- textAlign: "right",
154
- maxWidth: "132px"
155
- },
156
- cell: ({ cell: e, row: a }) => h(H, { row: a, data: e.getValue() })
157
- },
158
- {
159
- accessorKey: "amount",
160
- header: () => "Sales Amount",
161
- meta: {
162
- textAlign: "center"
163
- }
164
- },
165
- {
166
- accessorKey: "terminalId",
167
- header: () => "Terminal ID",
168
- meta: {
169
- textAlign: "left"
170
- }
171
- },
172
- {
173
- accessorKey: "transactionAt",
174
- header: () => "Transaction At",
175
- meta: {
176
- textAlign: "left"
177
- }
178
- }
179
- ];
180
- return (e, a) => {
181
- const u = p("FmSearch"), N = p("FmSelect"), v = p("FmDateRangePicker");
182
- return _(), R(j, {
183
- title: "Offline Transactions",
184
- description: "Transactions are purchases or payments made in retail using electronic devices such as POS systems, kiosks, terminals, or ECRs.",
185
- loading: !1
186
- }, {
187
- default: C(() => [
188
- d("div", J, [
189
- d("div", X, [
190
- i(P),
191
- i(u, {
192
- "model-value": t(c),
193
- "onUpdate:modelValue": a[0] || (a[0] = (r) => g(c) ? c.value = r : null),
194
- class: "mr-8",
195
- label: "Search",
196
- placeholder: "Search Transactions ..."
197
- }, null, 8, ["model-value"]),
198
- i(N, {
199
- modelValue: t(m),
200
- "onUpdate:modelValue": a[1] || (a[1] = (r) => g(m) ? m.value = r : null),
201
- class: "mr-6 w-[300px]",
202
- label: "Status",
203
- "label-mark": "required",
204
- multiselect: "",
205
- items: S
206
- }, null, 8, ["modelValue"]),
207
- i(v, {
208
- modelValue: t(o),
209
- "onUpdate:modelValue": a[2] || (a[2] = (r) => g(o) ? o.value = r : null),
210
- compare: "",
211
- "show-predefined-range": ""
212
- }, null, 8, ["modelValue"])
213
- ]),
214
- d("div", Z, [
215
- i(Y, {
216
- button: {
217
- appendIcon: "file_download",
218
- variant: "primary",
219
- label: "Export"
220
- },
221
- handler: () => {
222
- var r;
223
- return t(w).downloadTransactions(((r = s.value) == null ? void 0 : r.data()) ?? []);
224
- }
225
- }, null, 8, ["handler"])
226
- ])
227
- ]),
228
- i($, {
229
- ref_key: "controller",
230
- ref: s,
231
- "column-defs": O,
232
- "rows-defs": E,
233
- paginate: (r, b) => t(w).readRestaurantTransactions({
234
- status: t(m),
235
- searchKey: t(c),
236
- limit: r,
237
- cursor: b,
238
- start: t(o).startDate,
239
- end: t(o).endDate
240
- })
241
- }, null, 8, ["paginate"])
242
- ]),
243
- _: 1
244
- });
245
- };
246
- }
247
- });
248
- export {
249
- _e as default
250
- };