@feedmepos/mf-payment 1.0.5 → 1.0.6

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 (71) hide show
  1. package/dist/{PayoutAccount-BwBgS41r.js → PayoutAccount-Bx7j4usm.js} +5 -5
  2. package/dist/{PayoutAccount-B6kGeSLY.js → PayoutAccount-D1VVUe7P.js} +3 -3
  3. package/dist/PayoutAccountSelector.vue_vue_type_script_setup_true_lang-CTO1rfpW.js +110 -0
  4. package/dist/{PayoutAccountSetting-C1yeSNv8.js → PayoutAccountSetting-CAzm0xMA.js} +4 -4
  5. package/dist/Restaurant-C1mCXDDi.js +305 -0
  6. package/dist/{RestaurantSetting-CWZAKz1A.js → RestaurantSetting-Bl4PmDhX.js} +4 -4
  7. package/dist/{Settlement-ByPXBNx1.js → Settlement-BohWN-9p.js} +3 -3
  8. package/dist/{Settlement-BKwie9R8.js → Settlement-CD6UXJon.js} +3 -3
  9. package/dist/{SettlementTransactions-BPEh0mSi.js → SettlementTransactions-BsTAhWyT.js} +4 -4
  10. package/dist/{SettlementTransactions-BGGqKJgP.js → SettlementTransactions-C96K2hX7.js} +4 -4
  11. package/dist/Terminal-BqLyl7JL.js +404 -0
  12. package/dist/{TerminalSetting-qklmRz3H.js → TerminalSetting-DA8V_6xm.js} +3 -3
  13. package/dist/TerminalTransaction-CHKkiGh-.js +819 -0
  14. package/dist/{TerminalTransaction-YXcGJ2ne.js → TerminalTransaction-CyzfSUrM.js} +184 -154
  15. package/dist/Transaction-BbPlz0Ko.js +145 -0
  16. package/dist/{Transaction-IDcY01Oi.js → Transaction-Dbo4CGwe.js} +81 -48
  17. package/dist/TransactionOld-DHoxbpV6.js +99 -0
  18. package/dist/TransactionTable.vue_vue_type_script_setup_true_lang-DBLSJKQ4.js +151 -0
  19. package/dist/api/terminal-transaction/index.d.ts +2 -1
  20. package/dist/api/transaction/index.d.ts +8 -1
  21. package/dist/{app-CjbTCCDJ.js → app-BXz8Wn43.js} +537 -524
  22. package/dist/app.js +1 -1
  23. package/dist/{assets-DjRoCcqv.js → assets-D7z1NUL3.js} +1 -1
  24. package/dist/components/PayoutAccountSelector.vue.d.ts +23 -0
  25. package/dist/grafana-CI6OiGSa.js +46 -0
  26. package/dist/helpers/grafana.d.ts +7 -0
  27. package/dist/{index-BEFlDEyV.js → index-B1eB6TU2.js} +1 -1
  28. package/dist/{index-CWGSYCJG.js → index-BV2jqYvf.js} +1 -1
  29. package/dist/{index-DFePh4ct.js → index-BuusVr9a.js} +1 -1
  30. package/dist/{index-Dj_LwPBy.js → index-BvRX5SR2.js} +8489 -8321
  31. package/dist/{index-CKyh0nlu.js → index-Cd5mrhS-.js} +13 -9
  32. package/dist/{index-BerQZMQW.js → index-Cq1QcpFe.js} +1 -1
  33. package/dist/{index-Bp_58SiC.js → index-CsgiQM_A.js} +1 -1
  34. package/dist/{index-BWFqxSU3.js → index-DYzlBSuM.js} +1 -1
  35. package/dist/{index.vue_vue_type_script_setup_true_lang-BgTr7KWF.js → index.vue_vue_type_script_setup_true_lang-90r_Uqco.js} +1 -1
  36. package/dist/model/transaction.d.ts +2 -0
  37. package/dist/package.json +3 -3
  38. package/dist/{payout-account-ByuqS-Ea.js → payout-account-BIyLMj5M.js} +2 -2
  39. package/dist/router/index.d.ts +1 -0
  40. package/dist/stores/payoutAccount.d.ts +4 -4
  41. package/dist/transaction-CZyySNYA.js +118 -0
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
  44. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +4 -4
  45. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
  46. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
  47. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  48. package/dist/views/admin/payout-account/tabs/gateway/GhlGateway.vue.d.ts +8 -8
  49. package/dist/views/admin/payout-account/tabs/gateway/RevenueMonsterGateway.vue.d.ts +6 -6
  50. package/dist/views/admin/restaurant/cell/LogButton.vue.d.ts +5 -0
  51. package/dist/views/admin/restaurant/tabs/PaymentGateway.vue.d.ts +2 -2
  52. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  53. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +8 -8
  54. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +6 -6
  55. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +12 -12
  56. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +8 -8
  57. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +8 -8
  58. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +8 -8
  59. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +8 -8
  60. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +8 -8
  61. package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +3 -1
  62. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +1 -1
  63. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
  64. package/dist/views/settlement/SettlementTable.vue.d.ts +12 -12
  65. package/dist/views/transaction/TransactionOld.vue.d.ts +2 -0
  66. package/package.json +3 -3
  67. package/dist/Restaurant-B02jty0J.js +0 -262
  68. package/dist/Terminal-DX8v8WpM.js +0 -386
  69. package/dist/TerminalTransaction-64Bn6vh0.js +0 -261
  70. package/dist/Transaction-DMw2p-Wq.js +0 -238
  71. package/dist/transaction-Cyw84Cks.js +0 -101
@@ -1,386 +0,0 @@
1
- import { defineComponent as x, openBlock as f, createElementBlock as B, createTextVNode as O, createElementVNode as h, toDisplayString as $, resolveComponent as p, createVNode as y, normalizeClass as z, withCtx as V, createBlock as g, createCommentVNode as F, ref as k, computed as Y, unref as c, watch as K, isRef as P, h as E } from "vue";
2
- import "./index-Dj_LwPBy.js";
3
- import { h as j } from "./moment-h96o7c8I.js";
4
- import { u as q } from "./index-BerQZMQW.js";
5
- import { _ as Q } from "./index.vue_vue_type_script_setup_true_lang-BgTr7KWF.js";
6
- import { _ as G } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
7
- import { useSnackbar as D, useDialogChild as H, useDialog as J } from "@feedmepos/ui-library";
8
- import { t as A } from "./index-DFePh4ct.js";
9
- import { c as M } from "./clipboard-4jh1WteU.js";
10
- import { u as N } from "./error-K1CakhA9.js";
11
- import { z as R, a as U } from "./validator-D5jtpt9A.js";
12
- import { useCoreStore as W } from "@feedmepos/mf-common";
13
- import { w as X } from "./Modal-DB8M9o1T.js";
14
- import { useRouter as Z } from "vue-router";
15
- const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
16
- __name: "TerminalBindCodeDialog",
17
- props: {
18
- code: {
19
- type: String,
20
- required: !0
21
- }
22
- },
23
- setup(v) {
24
- const n = v, a = D();
25
- function r() {
26
- try {
27
- M(n.code), a.open({ title: "Text copied to clipboard." }, 1e3);
28
- } catch {
29
- a.open({ title: "Clipboard API incompatible." }, 1e3);
30
- }
31
- }
32
- return (i, l) => (f(), B("div", ee, [
33
- l[1] || (l[1] = O(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
34
- h("div", {
35
- class: "my-6 text-center fm-typo-en-title-md-800 tracking-[0.3rem] cursor-pointer hover:text-fm-color-neutral-gray-300",
36
- onClick: l[0] || (l[0] = (o) => {
37
- o.stopPropagation(), r();
38
- })
39
- }, $(v.code), 1)
40
- ]));
41
- }
42
- }), ne = /* @__PURE__ */ x({
43
- __name: "ID",
44
- props: {
45
- row: {},
46
- data: {}
47
- },
48
- setup(v) {
49
- const n = v, a = D();
50
- function r() {
51
- return n.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
52
- }
53
- function i() {
54
- try {
55
- M(n.data), a.open({ title: "Text copied to clipboard." }, 1e3);
56
- } catch {
57
- a.open({ title: "Clipboard API incompatible." }, 1e3);
58
- }
59
- n.data;
60
- }
61
- return (l, o) => {
62
- const d = p("FmBadge");
63
- return f(), B("div", {
64
- onClick: o[0] || (o[0] = (_) => {
65
- _.stopPropagation(), i();
66
- })
67
- }, [
68
- y(d, {
69
- inline: "",
70
- class: z(r())
71
- }, {
72
- default: V(() => [
73
- h("div", null, $(l.data), 1)
74
- ]),
75
- _: 1
76
- }, 8, ["class"])
77
- ]);
78
- };
79
- }
80
- }), oe = { class: "flex" }, ae = /* @__PURE__ */ x({
81
- __name: "Actions",
82
- props: {
83
- data: {}
84
- },
85
- emits: ["link", "unlink", "edit"],
86
- setup(v, { emit: n }) {
87
- const a = n;
88
- return (r, i) => {
89
- const l = p("FmButton");
90
- return f(), B("div", oe, [
91
- r.data.deviceType === "TERMINAL" && !r.data.deviceId ? (f(), g(l, {
92
- key: 0,
93
- variant: "plain",
94
- "prepend-icon": "link",
95
- onClick: i[0] || (i[0] = (o) => {
96
- o.stopPropagation(), a("link");
97
- })
98
- })) : F("", !0),
99
- r.data.deviceType === "TERMINAL" && r.data.deviceId ? (f(), g(l, {
100
- key: 1,
101
- variant: "plain",
102
- "prepend-icon": "link_off",
103
- onClick: i[1] || (i[1] = (o) => {
104
- o.stopPropagation(), a("unlink");
105
- })
106
- })) : F("", !0),
107
- y(l, {
108
- variant: "plain",
109
- "prepend-icon": "edit",
110
- onClick: i[2] || (i[2] = (o) => {
111
- o.stopPropagation(), a("edit");
112
- })
113
- })
114
- ]);
115
- };
116
- }
117
- }), re = /* @__PURE__ */ x({
118
- __name: "TerminalDialog",
119
- props: {
120
- terminal: {
121
- type: Object
122
- }
123
- },
124
- setup(v) {
125
- var w, b, I;
126
- const n = v, a = W(), r = H(), i = k(), l = k((w = n.terminal) == null ? void 0 : w.name), o = k((b = n.terminal) == null ? void 0 : b.referenceId), d = k(((I = n.terminal) == null ? void 0 : I.status) === "Active"), _ = Y(() => a.restaurants.value.map((T) => ({
127
- label: T.profile.name,
128
- value: T._id
129
- })));
130
- return (T, u) => {
131
- const e = p("FmSelect"), t = p("FmTextField"), m = p("FmSwitch"), C = p("FmButton"), S = p("FmForm");
132
- return f(), g(S, {
133
- ref: i.value,
134
- class: "flex flex-col gap-16 mb-6",
135
- onValidationSuccess: u[3] || (u[3] = () => {
136
- c(r).emitData({ name: l.value, referenceId: o.value, status: d.value ? "Active" : "Inactive" }), c(r).emitAction("primary");
137
- })
138
- }, {
139
- default: V(() => [
140
- n.terminal ? F("", !0) : (f(), g(e, {
141
- key: 0,
142
- modelValue: o.value,
143
- "onUpdate:modelValue": u[0] || (u[0] = (s) => o.value = s),
144
- label: "Restaurant",
145
- "helper-text": "If you can't find the restaurant please change the business to the restaurant's business.",
146
- items: _.value,
147
- rules: c(R)(c(U).string())
148
- }, null, 8, ["modelValue", "items", "rules"])),
149
- y(t, {
150
- modelValue: l.value,
151
- "onUpdate:modelValue": u[1] || (u[1] = (s) => l.value = s),
152
- label: "Terminal Name",
153
- rules: c(R)(c(U).string())
154
- }, null, 8, ["modelValue", "rules"]),
155
- n.terminal ? (f(), g(m, {
156
- key: 1,
157
- modelValue: d.value,
158
- "onUpdate:modelValue": u[2] || (u[2] = (s) => d.value = s),
159
- label: "Status"
160
- }, null, 8, ["modelValue"])) : F("", !0),
161
- y(C, {
162
- type: "submit",
163
- label: "Create"
164
- })
165
- ]),
166
- _: 1
167
- }, 512);
168
- };
169
- }
170
- }), le = { class: "flex justify-between mb-6 items-center" }, ie = { class: "flex space-x-4" }, se = { class: "flex space-x-4" }, he = /* @__PURE__ */ x({
171
- __name: "Terminal",
172
- setup(v) {
173
- const n = k(), { searchKey: a, deviceType: r } = q({
174
- searchKey: "",
175
- deviceType: void 0
176
- });
177
- K(r, () => {
178
- var e;
179
- return (e = n.value) == null ? void 0 : e.reset();
180
- });
181
- let i;
182
- K(a, async () => {
183
- i && clearTimeout(i), i = setTimeout(
184
- () => {
185
- var e;
186
- return (e = n.value) == null ? void 0 : e.reset();
187
- },
188
- 700
189
- );
190
- });
191
- const l = Z(), o = J(), d = D();
192
- async function _(e) {
193
- X(
194
- o,
195
- "Terminal Unbind",
196
- "Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
197
- async () => {
198
- var t;
199
- try {
200
- await A.unbind(e), (t = n.value) == null || t.reset(), d.open({
201
- type: "success",
202
- message: "Terminal unbind successfully"
203
- });
204
- } catch (m) {
205
- d.open({
206
- type: "error",
207
- title: "Error occurs when unbind terminal",
208
- message: N(m)
209
- });
210
- }
211
- }
212
- );
213
- }
214
- async function w(e) {
215
- const t = await A.getBindCode(e);
216
- o.open({
217
- title: "Terminal Bind Code",
218
- closeButton: !0,
219
- overlay: !0,
220
- contentComponent: te,
221
- contentComponentProps: { code: t }
222
- });
223
- }
224
- async function b(e) {
225
- o.open({
226
- title: e ? "Update Terminal" : "Create New Terminal",
227
- closeButton: !0,
228
- overlay: !0,
229
- contentComponent: re,
230
- contentComponentProps: { terminal: e }
231
- }).onPrimary(async (t) => {
232
- var m;
233
- o.close();
234
- try {
235
- await A.create(t), (m = n.value) == null || m.reset(), d.open({
236
- type: "success",
237
- message: e ? "Terminal udpated successfully" : "Terminal created successfully."
238
- });
239
- } catch (C) {
240
- d.open({
241
- type: "error",
242
- title: "Error occurs when create terminal",
243
- message: N(C)
244
- });
245
- }
246
- });
247
- }
248
- const I = function(e) {
249
- return {
250
- id: e._id,
251
- status: e.status,
252
- referenceId: e.referenceId,
253
- name: e.name,
254
- deviceId: e.deviceId,
255
- deviceType: e.deviceType,
256
- updatedAt: j(e.updatedAt).format("YYYY-MM-DD hh:mm:ss")
257
- };
258
- }, T = [
259
- {
260
- accessorKey: "id",
261
- header: () => "Terminal ID",
262
- meta: {
263
- textAlign: "right"
264
- },
265
- cell: ({ cell: e, row: t }) => E(ne, { row: t, data: e.getValue() })
266
- },
267
- {
268
- accessorKey: "deviceType",
269
- header: () => "Device Type",
270
- meta: {
271
- textAlign: "left"
272
- }
273
- },
274
- {
275
- accessorKey: "name",
276
- header: () => "Name",
277
- meta: {
278
- textAlign: "left"
279
- }
280
- },
281
- {
282
- accessorKey: "referenceId",
283
- header: () => "Reference",
284
- meta: {
285
- textAlign: "left"
286
- }
287
- },
288
- {
289
- accessorKey: "deviceId",
290
- header: () => "Bound Device Id",
291
- meta: {
292
- textAlign: "left"
293
- }
294
- },
295
- {
296
- accessorKey: "updatedAt",
297
- header: () => "Last Updated",
298
- meta: {
299
- textAlign: "left"
300
- }
301
- },
302
- {
303
- accessorKey: "id",
304
- header: () => "Actions",
305
- meta: {
306
- textAlign: "center"
307
- },
308
- cell: ({ row: e }) => {
309
- var m;
310
- const t = (m = n.value) == null ? void 0 : m.pageData().at(e.index);
311
- return E(ae, {
312
- data: t,
313
- onLink: () => w(t._id),
314
- onUnlink: () => _(t._id),
315
- onEdit: () => b(t)
316
- });
317
- }
318
- }
319
- ], u = [
320
- {
321
- label: "POS",
322
- value: "POS"
323
- },
324
- {
325
- label: "KIOSK",
326
- value: "KIOSK"
327
- },
328
- {
329
- label: "TERMINAL",
330
- value: "TERMINAL"
331
- }
332
- ];
333
- return (e, t) => {
334
- const m = p("FmSearch"), C = p("FmSelect"), S = p("FmButton");
335
- return f(), g(G, {
336
- title: "Terminals",
337
- loading: !1
338
- }, {
339
- default: V(() => [
340
- h("div", le, [
341
- h("div", ie, [
342
- y(m, {
343
- "model-value": c(a),
344
- "onUpdate:modelValue": t[0] || (t[0] = (s) => P(a) ? a.value = s : null),
345
- class: "mr-8",
346
- label: "Search",
347
- placeholder: "Search Terminals ..."
348
- }, null, 8, ["model-value"]),
349
- y(C, {
350
- modelValue: c(r),
351
- "onUpdate:modelValue": t[1] || (t[1] = (s) => P(r) ? r.value = s : null),
352
- class: "ml-6 w-[180px]",
353
- label: "Device",
354
- items: u
355
- }, null, 8, ["modelValue"])
356
- ]),
357
- h("div", se, [
358
- y(S, {
359
- label: "Create",
360
- icon: "add",
361
- onClick: t[2] || (t[2] = () => b())
362
- })
363
- ])
364
- ]),
365
- y(Q, {
366
- ref_key: "controller",
367
- ref: n,
368
- "column-defs": T,
369
- "rows-defs": I,
370
- paginate: (s, L) => c(A).read({ searchKey: c(a), deviceType: c(r), limit: s, cursor: L }),
371
- onRowClick: t[3] || (t[3] = (s) => c(l).push({
372
- name: "mf-payment-admin.terminal-setting",
373
- params: {
374
- terminalId: s._id
375
- }
376
- }))
377
- }, null, 8, ["paginate"])
378
- ]),
379
- _: 1
380
- });
381
- };
382
- }
383
- });
384
- export {
385
- he as default
386
- };
@@ -1,261 +0,0 @@
1
- import { defineComponent as N, openBlock as p, createElementBlock as C, Fragment as O, unref as r, createCommentVNode as F, createElementVNode as d, resolveComponent as I, createBlock as v, normalizeClass as D, withCtx as y, toDisplayString as V, ref as M, watch as T, createVNode as i, isRef as _, h as g } from "vue";
2
- import { c as m } from "./index-Dj_LwPBy.js";
3
- import { h } from "./moment-h96o7c8I.js";
4
- import { u as k } from "./index-BerQZMQW.js";
5
- import { _ as Y } from "./index.vue_vue_type_script_setup_true_lang-BgTr7KWF.js";
6
- import "@feedmepos/ui-library";
7
- import { g as $ } from "./assets-DjRoCcqv.js";
8
- import { E as K, t as R } from "./index-CKyh0nlu.js";
9
- import { d as L } from "./dinero-CIVmXLL-.js";
10
- import { _ as B } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
11
- import { useCoreStore as G } from "@feedmepos/mf-common";
12
- import { _ as U } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
13
- import { _ as P } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
14
- import { _ as j } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
15
- import { _ as W } from "./SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js";
16
- import { _ as q } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
17
- const z = ["src"], Q = ["src"], H = /* @__PURE__ */ N({
18
- __name: "Gateway",
19
- props: {
20
- row: {},
21
- data: {}
22
- },
23
- setup(f) {
24
- return (o, n) => (p(), C(O, null, [
25
- o.row.original.ecrGateway ? (p(), C("img", {
26
- key: 0,
27
- class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
28
- src: r(K)
29
- }, null, 8, z)) : F("", !0),
30
- d("img", {
31
- class: "rounded-md m-auto border-transparent object-contain w-[32px] h-[32px]",
32
- src: r($)(o.row.original.gateway)
33
- }, null, 8, Q)
34
- ], 64));
35
- }
36
- }), J = /* @__PURE__ */ N({
37
- __name: "Status",
38
- props: {
39
- row: {},
40
- data: {}
41
- },
42
- setup(f) {
43
- const o = f;
44
- function n() {
45
- return o.data === m.F_TERMINAL_TRANSACTION_ACTION.Enum.process ? "!w-[16px] !h-[16px] bg-yellow-400" : o.data === m.F_TERMINAL_TRANSACTION_ACTION.Enum.failed ? "!w-[16px] !h-[16px] bg-red-400" : o.data === m.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
46
- }
47
- return (l, s) => {
48
- const c = I("FmBadge");
49
- return p(), v(c, {
50
- inline: "",
51
- class: D(n())
52
- }, {
53
- default: y(() => [
54
- d("div", null, V(l.data.toUpperCase()), 1)
55
- ]),
56
- _: 1
57
- }, 8, ["class"]);
58
- };
59
- }
60
- }), X = { class: "flex justify-between mb-6 items-start" }, Z = { class: "flex space-x-8 items-start" }, ee = { class: "flex space-x-4 self-center" }, ae = { class: "mb-6" }, ge = /* @__PURE__ */ N({
61
- __name: "TerminalTransaction",
62
- setup(f) {
63
- const { currentRestaurant: o } = G(), n = M(), { dateRange: l, status: s, searchKey: c } = k({
64
- searchKey: "",
65
- status: [m.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
66
- dateRange: {
67
- startDate: h().startOf("day").format("YYYY-MM-DD"),
68
- endDate: h().endOf("day").format("YYYY-MM-DD")
69
- }
70
- });
71
- T([l, s], () => {
72
- var e;
73
- return (e = n.value) == null ? void 0 : e.reset();
74
- }), T(o, () => {
75
- var e;
76
- return (e = n.value) == null ? void 0 : e.reset();
77
- });
78
- let A;
79
- T(c, async () => {
80
- A && clearTimeout(A), A = setTimeout(
81
- () => {
82
- var e;
83
- return (e = n.value) == null ? void 0 : e.reset();
84
- },
85
- 700
86
- );
87
- });
88
- const x = [
89
- {
90
- label: "Success",
91
- value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.success
92
- },
93
- {
94
- label: "Refunded",
95
- value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded
96
- },
97
- {
98
- label: "Process",
99
- value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.process
100
- },
101
- {
102
- label: "Failed",
103
- value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.failed
104
- }
105
- ], b = function(e) {
106
- const a = e;
107
- let u = "-";
108
- return a.details && a.details.amount && (u = L(a.details.amount).toFormat("$0.00")), {
109
- id: e._id,
110
- orderId: e.orderId,
111
- refId: e.refId,
112
- terminalId: e.terminalId,
113
- transactionAt: h(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
114
- action: e.action,
115
- gateway: e.gateway,
116
- ecrGateway: e.ecrGateway,
117
- amount: u
118
- };
119
- }, E = [
120
- {
121
- accessorKey: "id",
122
- header: () => "Transaction ID",
123
- meta: {
124
- textAlign: "left"
125
- },
126
- cell: ({ cell: e }) => g(P, { data: e.getValue() })
127
- },
128
- {
129
- accessorKey: "orderId",
130
- header: () => "Pay ID",
131
- meta: {
132
- textAlign: "left"
133
- }
134
- },
135
- {
136
- accessorKey: "refId",
137
- header: () => "Reference ID",
138
- meta: {
139
- textAlign: "left"
140
- }
141
- },
142
- {
143
- accessorKey: "gateway",
144
- header: () => "Gateway",
145
- meta: {
146
- textAlign: "center",
147
- maxWidth: "128px"
148
- },
149
- cell: ({ cell: e, row: a }) => g(H, { row: a, data: e.getValue() })
150
- },
151
- {
152
- accessorKey: "action",
153
- header: () => "Status",
154
- meta: {
155
- textAlign: "right",
156
- maxWidth: "132px"
157
- },
158
- cell: ({ cell: e, row: a }) => g(J, { row: a, data: e.getValue() })
159
- },
160
- {
161
- accessorKey: "amount",
162
- header: () => "Sales Amount",
163
- meta: {
164
- textAlign: "center"
165
- }
166
- },
167
- {
168
- accessorKey: "terminalId",
169
- header: () => "Terminal ID",
170
- meta: {
171
- textAlign: "left"
172
- }
173
- },
174
- {
175
- accessorKey: "transactionAt",
176
- header: () => "Transaction At",
177
- meta: {
178
- textAlign: "left"
179
- }
180
- }
181
- ];
182
- return (e, a) => {
183
- const u = I("FmSearch"), w = I("FmSelect");
184
- return p(), v(j, {
185
- title: "Terminal Transactions",
186
- description: "Transactions are purchases or payments made in retail using electronic devices such as POS systems, kiosks, terminals, or ECRs.",
187
- loading: !1
188
- }, {
189
- default: y(() => [
190
- d("div", X, [
191
- d("div", Z, [
192
- i(B),
193
- i(u, {
194
- "model-value": r(c),
195
- "onUpdate:modelValue": a[0] || (a[0] = (t) => _(c) ? c.value = t : null),
196
- class: "mr-8",
197
- label: "Search",
198
- placeholder: "Search Transactions ..."
199
- }, null, 8, ["model-value"]),
200
- i(w, {
201
- modelValue: r(s),
202
- "onUpdate:modelValue": a[2] || (a[2] = (t) => _(s) ? s.value = t : null),
203
- class: "mr-6 w-[300px]",
204
- label: "Status",
205
- "label-mark": "required",
206
- multiselect: "",
207
- items: x
208
- }, {
209
- "prepend-menu": y(() => [
210
- i(W, {
211
- modelValue: r(s),
212
- "onUpdate:modelValue": a[1] || (a[1] = (t) => _(s) ? s.value = t : null),
213
- items: x
214
- }, null, 8, ["modelValue"])
215
- ]),
216
- _: 1
217
- }, 8, ["modelValue"])
218
- ]),
219
- d("div", ee, [
220
- i(U, {
221
- button: {
222
- appendIcon: "file_download",
223
- variant: "primary",
224
- label: "Export"
225
- },
226
- handler: () => {
227
- var t;
228
- return r(R).downloadTransactions(((t = n.value) == null ? void 0 : t.data()) ?? []);
229
- }
230
- }, null, 8, ["handler"])
231
- ])
232
- ]),
233
- d("div", ae, [
234
- i(q, {
235
- modelValue: r(l),
236
- "onUpdate:modelValue": a[3] || (a[3] = (t) => _(l) ? l.value = t : null)
237
- }, null, 8, ["modelValue"])
238
- ]),
239
- i(Y, {
240
- ref_key: "controller",
241
- ref: n,
242
- "column-defs": E,
243
- "rows-defs": b,
244
- paginate: (t, S) => r(R).readRestaurantTransactions({
245
- status: r(s),
246
- searchKey: r(c),
247
- limit: t,
248
- cursor: S,
249
- start: r(l).startDate,
250
- end: r(l).endDate
251
- })
252
- }, null, 8, ["paginate"])
253
- ]),
254
- _: 1
255
- });
256
- };
257
- }
258
- });
259
- export {
260
- ge as default
261
- };