@feedmepos/mf-payment 1.0.0 → 1.0.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-Bxz83we4.js} +93 -83
  6. package/dist/{PayoutAccount-DZaKHWcy.js → PayoutAccount-DLxO15Kf.js} +259 -258
  7. package/dist/{PayoutAccountSetting-BzmNuLFj.js → PayoutAccountSetting-C1yeSNv8.js} +161 -183
  8. package/dist/Restaurant-B02jty0J.js +262 -0
  9. package/dist/RestaurantSetting-CWZAKz1A.js +389 -0
  10. package/dist/SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js +42 -0
  11. package/dist/Settlement-CAHgJIuH.js +145 -0
  12. package/dist/{Settlement-Bx3zAkIw.js → Settlement-D8nayzFt.js} +41 -43
  13. package/dist/{SettlementTransactions-D_SVuKyR.js → SettlementTransactions-DfXEf1fm.js} +10 -10
  14. package/dist/{SettlementTransactions-AaYyTH96.js → SettlementTransactions-JJyQEOMw.js} +41 -41
  15. package/dist/{Terminal-68OQnhM3.js → Terminal-DX8v8WpM.js} +117 -103
  16. package/dist/TerminalSetting-qklmRz3H.js +387 -0
  17. package/dist/TerminalTransaction-BjwvTbGu.js +261 -0
  18. package/dist/TerminalTransaction-D-mJRP0T.js +485 -0
  19. package/dist/Transaction-CZkNzH-m.js +238 -0
  20. package/dist/{Transaction-a1VfiCP_.js → Transaction-CvrsRuuz.js} +125 -127
  21. package/dist/api/restaurant/index.d.ts +6 -0
  22. package/dist/{app-C9FRsUfb.js → app-FuKCNfJl.js} +174 -144
  23. package/dist/app.js +1 -1
  24. package/dist/{assets-Bji7O2YD.js → assets-DjRoCcqv.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-BEFlDEyV.js +28 -0
  36. package/dist/index-BWFqxSU3.js +19 -0
  37. package/dist/{index-DjDGwRX8.js → index-BerQZMQW.js} +1 -1
  38. package/dist/{index-DSuZG0l6.js → index-CFjLufVa.js} +1 -1
  39. package/dist/{index-_0TroOJr.js → index-CTSM9lSC.js} +1 -1
  40. package/dist/{index-DBfZnaV1.js → index-CWGSYCJG.js} +1 -1
  41. package/dist/{index-CLYePgWW.js → index-DFePh4ct.js} +1 -1
  42. package/dist/{index-Bt_OgDYn.js → index-Dj_LwPBy.js} +32176 -32166
  43. package/dist/{index.vue_vue_type_script_setup_true_lang-Jlcg1hAB.js → index.vue_vue_type_script_setup_true_lang-BgTr7KWF.js} +64 -61
  44. package/dist/package.json +2 -2
  45. package/dist/{payout-account-BWcq7OJy.js → payout-account-YJZlBDSF.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-CIYqsLqc.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
@@ -0,0 +1,387 @@
1
+ import { defineComponent as T, openBlock as b, createElementBlock as N, Fragment as Y, createElementVNode as g, createTextVNode as V, toDisplayString as S, toRef as M, ref as F, watch as D, onMounted as G, computed as O, resolveComponent as f, unref as k, createVNode as I, createBlock as _, withCtx as q, createCommentVNode as B, isRef as h, resolveDynamicComponent as L, normalizeProps as j, mergeProps as E } from "vue";
2
+ import { u as R, e as U } from "./index-Dj_LwPBy.js";
3
+ import { useRouter as A } from "vue-router";
4
+ import { t as C } from "./index-DFePh4ct.js";
5
+ import { _ as z } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
+ import { u as H } from "./index-BerQZMQW.js";
7
+ import { useSnackbar as Q } from "@feedmepos/ui-library";
8
+ import { u as J } from "./error-K1CakhA9.js";
9
+ import { useCoreStore as $ } from "@feedmepos/mf-common";
10
+ const W = /* @__PURE__ */ T({
11
+ __name: "Information",
12
+ props: {
13
+ terminal: {
14
+ type: Object,
15
+ required: !0
16
+ }
17
+ },
18
+ setup(y) {
19
+ return (d, e) => (b(), N(Y, null, [
20
+ e[0] || (e[0] = g("b", null, "Name", -1)),
21
+ V(": " + S(y.terminal.name), 1),
22
+ e[1] || (e[1] = g("br", null, null, -1)),
23
+ e[2] || (e[2] = g("b", null, "Status", -1)),
24
+ V(": " + S(y.terminal.status), 1),
25
+ e[3] || (e[3] = g("br", null, null, -1)),
26
+ e[4] || (e[4] = g("b", null, "Device ID", -1)),
27
+ V(": " + S(y.terminal.deviceId ?? "-"), 1),
28
+ e[5] || (e[5] = g("br", null, null, -1)),
29
+ e[6] || (e[6] = g("b", null, "Device Type", -1)),
30
+ V(": " + S(y.terminal.deviceType ?? "-"), 1),
31
+ e[7] || (e[7] = g("br", null, null, -1))
32
+ ], 64));
33
+ }
34
+ }), X = {
35
+ key: 0,
36
+ class: "flex items-center justify-center min-h-[80vh]"
37
+ }, Z = { class: "flex mt-6 space-x-6" }, ee = /* @__PURE__ */ T({
38
+ __name: "TerminalGateway",
39
+ props: {
40
+ terminal: {
41
+ type: Object,
42
+ required: !0
43
+ },
44
+ onUpdate: {
45
+ type: Function,
46
+ required: !0
47
+ }
48
+ },
49
+ setup(y) {
50
+ const { isLoading: d, startAsyncCall: e } = R(), c = y, a = M(() => c.terminal), o = F(), v = F(), n = F(-1), p = F({
51
+ terminalId: ""
52
+ }), i = () => {
53
+ p.value.terminalId = "", n.value = -1;
54
+ }, l = () => {
55
+ if (e(async () => {
56
+ o.value = await C.getTerminals(c.terminal.referenceId);
57
+ }), !c.terminal.ecrs)
58
+ return i();
59
+ const t = c.terminal.ecrs.findIndex((m) => m && m.gateway && m.gateway === "FeedMe");
60
+ if (t === -1)
61
+ return i();
62
+ n.value = t;
63
+ const r = c.terminal.ecrs.at(t);
64
+ r.gateway === "FeedMe" && r.config && (p.value = {
65
+ terminalId: r.config.terminalId
66
+ });
67
+ };
68
+ D(a, l), G(l);
69
+ const s = O(() => (o.value ?? []).map((t) => ({
70
+ label: t.name ?? t._id,
71
+ value: t._id
72
+ })));
73
+ async function u(t) {
74
+ var r;
75
+ (r = c.terminal.ecrs) == null || r.splice(t, 1), c.onUpdate(c.terminal);
76
+ }
77
+ return (t, r) => {
78
+ const m = f("FmCircularProgress"), x = f("FmSelect"), w = f("FmButton"), K = f("FmForm");
79
+ return k(d) ? (b(), N("div", X, [
80
+ I(m, { size: "xxl" })
81
+ ])) : (b(), _(K, {
82
+ key: 1,
83
+ ref: v.value,
84
+ class: "flex flex-col gap-16 w-[500px]",
85
+ onValidationSuccess: r[1] || (r[1] = () => {
86
+ n.value > -1 ? a.value.ecrs[n.value] = { gateway: "FeedMe", config: p.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "FeedMe", config: p.value })), c.onUpdate(a.value);
87
+ })
88
+ }, {
89
+ default: q(() => [
90
+ I(x, {
91
+ modelValue: p.value.terminalId,
92
+ "onUpdate:modelValue": r[0] || (r[0] = (P) => p.value.terminalId = P),
93
+ label: "Terminal ID",
94
+ items: s.value
95
+ }, null, 8, ["modelValue", "items"]),
96
+ g("div", Z, [
97
+ n.value > -1 ? (b(), _(w, {
98
+ key: 0,
99
+ class: "flex-1",
100
+ variant: "secondary",
101
+ label: "Delete",
102
+ onclick: () => u(n.value)
103
+ }, null, 8, ["onclick"])) : B("", !0),
104
+ I(w, {
105
+ type: "submit",
106
+ class: "flex-1",
107
+ variant: "primary",
108
+ label: "Save"
109
+ })
110
+ ])
111
+ ]),
112
+ _: 1
113
+ }, 512));
114
+ };
115
+ }
116
+ }), ae = { class: "flex mt-6 space-x-6" }, te = /* @__PURE__ */ T({
117
+ __name: "FiuuGateway",
118
+ props: {
119
+ terminal: {
120
+ type: Object,
121
+ required: !0
122
+ },
123
+ onUpdate: {
124
+ type: Function,
125
+ required: !0
126
+ }
127
+ },
128
+ setup(y) {
129
+ const d = y, e = $().currentCountry, c = [
130
+ {
131
+ label: "Fiuu Malaysia",
132
+ value: "cc.feedme.payment.rms",
133
+ region: U.F_COUNTRY.enum.MY
134
+ },
135
+ {
136
+ label: "Fiuu Malaysia V2",
137
+ value: "cc.feedme.payment.fiuu_my",
138
+ region: U.F_COUNTRY.enum.MY
139
+ },
140
+ {
141
+ label: "Fiuu Singapore",
142
+ value: "cc.feedme.payment.fiuu_sg",
143
+ region: U.F_COUNTRY.enum.SG
144
+ }
145
+ ], a = M(() => d.terminal), o = F(), v = F(-1), n = F({
146
+ packageId: "",
147
+ uniqueId: ""
148
+ }), p = () => {
149
+ n.value.uniqueId = "", n.value.packageId = "", v.value = -1;
150
+ }, i = () => {
151
+ if (!a.value.gateways)
152
+ return p();
153
+ const s = a.value.gateways.findIndex((t) => t && t.gateway && t.gateway === "Fiuu");
154
+ if (s === -1)
155
+ return p();
156
+ v.value = s;
157
+ const u = a.value.gateways.at(s);
158
+ u.gateway === "Fiuu" && u.config && (n.value = {
159
+ packageId: u.config.packageId,
160
+ uniqueId: u.config.uniqueId
161
+ });
162
+ };
163
+ D(a, i), G(i);
164
+ async function l(s) {
165
+ var u;
166
+ (u = a.value.gateways) == null || u.splice(s, 1), d.onUpdate(a.value);
167
+ }
168
+ return (s, u) => {
169
+ const t = f("FmSelect"), r = f("FmTextField"), m = f("FmButton"), x = f("FmForm");
170
+ return b(), _(x, {
171
+ ref: o.value,
172
+ class: "flex flex-col gap-16 w-[500px]",
173
+ onValidationSuccess: u[2] || (u[2] = () => {
174
+ v.value > -1 ? a.value.gateways[v.value] = { gateway: "Fiuu", config: n.value } : (a.value.gateways || (a.value.gateways = []), a.value.gateways.push({ gateway: "Fiuu", config: n.value })), d.onUpdate(a.value);
175
+ })
176
+ }, {
177
+ default: q(() => [
178
+ I(t, {
179
+ modelValue: n.value.packageId,
180
+ "onUpdate:modelValue": u[0] || (u[0] = (w) => n.value.packageId = w),
181
+ label: "Package ID",
182
+ items: c.filter((w) => w.region === k(e))
183
+ }, null, 8, ["modelValue", "items"]),
184
+ I(r, {
185
+ modelValue: n.value.uniqueId,
186
+ "onUpdate:modelValue": u[1] || (u[1] = (w) => n.value.uniqueId = w),
187
+ label: "Unique ID"
188
+ }, null, 8, ["modelValue"]),
189
+ g("div", ae, [
190
+ v.value > -1 ? (b(), _(m, {
191
+ key: 0,
192
+ class: "flex-1",
193
+ variant: "secondary",
194
+ label: "Delete",
195
+ onclick: () => l(v.value)
196
+ }, null, 8, ["onclick"])) : B("", !0),
197
+ I(m, {
198
+ type: "submit",
199
+ class: "flex-1",
200
+ variant: "primary",
201
+ label: "Save"
202
+ })
203
+ ])
204
+ ]),
205
+ _: 1
206
+ }, 512);
207
+ };
208
+ }
209
+ }), ne = { class: "flex mt-6 space-x-6" }, le = /* @__PURE__ */ T({
210
+ __name: "GhlGateway",
211
+ props: {
212
+ terminal: {
213
+ type: Object,
214
+ required: !0
215
+ },
216
+ onUpdate: {
217
+ type: Function,
218
+ required: !0
219
+ }
220
+ },
221
+ setup(y) {
222
+ const d = y, e = M(() => d.terminal), c = F(), a = F(-1), o = F({
223
+ merchantId: "",
224
+ terminalId: "",
225
+ privateKey: ""
226
+ }), v = () => {
227
+ o.value.merchantId = "", o.value.terminalId = "", o.value.privateKey = "", a.value = -1;
228
+ }, n = () => {
229
+ if (!e.value.ecrs)
230
+ return v();
231
+ const i = e.value.ecrs.findIndex((s) => s && s.gateway && s.gateway === "Ghl");
232
+ if (i === -1)
233
+ return v();
234
+ a.value = i;
235
+ const l = e.value.ecrs.at(i);
236
+ l.gateway === "Ghl" && l.config && (o.value = {
237
+ merchantId: l.config.merchantId,
238
+ terminalId: l.config.terminalId,
239
+ privateKey: l.config.privateKey
240
+ });
241
+ };
242
+ D(e, n), G(n);
243
+ async function p(i) {
244
+ var l;
245
+ (l = e.value.ecrs) == null || l.splice(i, 1), d.onUpdate(e.value);
246
+ }
247
+ return (i, l) => {
248
+ const s = f("FmTextField"), u = f("FmTextarea"), t = f("FmButton"), r = f("FmForm");
249
+ return b(), _(r, {
250
+ ref: c.value,
251
+ class: "flex flex-col gap-16 w-[500px]",
252
+ onValidationSuccess: l[3] || (l[3] = () => {
253
+ a.value > -1 ? e.value.ecrs[a.value] = { gateway: "Ghl", config: o.value } : (e.value.ecrs || (e.value.ecrs = []), e.value.ecrs.push({ gateway: "Ghl", config: o.value })), d.onUpdate(e.value);
254
+ })
255
+ }, {
256
+ default: q(() => [
257
+ I(s, {
258
+ modelValue: o.value.merchantId,
259
+ "onUpdate:modelValue": l[0] || (l[0] = (m) => o.value.merchantId = m),
260
+ label: "Merchant ID"
261
+ }, null, 8, ["modelValue"]),
262
+ I(s, {
263
+ modelValue: o.value.terminalId,
264
+ "onUpdate:modelValue": l[1] || (l[1] = (m) => o.value.terminalId = m),
265
+ label: "Terminal ID"
266
+ }, null, 8, ["modelValue"]),
267
+ I(u, {
268
+ modelValue: o.value.privateKey,
269
+ "onUpdate:modelValue": l[2] || (l[2] = (m) => o.value.privateKey = m),
270
+ label: "Private Key"
271
+ }, null, 8, ["modelValue"]),
272
+ g("div", ne, [
273
+ a.value > -1 ? (b(), _(t, {
274
+ key: 0,
275
+ class: "flex-1",
276
+ variant: "secondary",
277
+ label: "Delete",
278
+ onclick: () => p(a.value)
279
+ }, null, 8, ["onclick"])) : B("", !0),
280
+ I(t, {
281
+ type: "submit",
282
+ class: "flex-1",
283
+ variant: "primary",
284
+ label: "Save"
285
+ })
286
+ ])
287
+ ]),
288
+ _: 1
289
+ }, 512);
290
+ };
291
+ }
292
+ }), pe = /* @__PURE__ */ T({
293
+ __name: "TerminalSetting",
294
+ props: {
295
+ terminalId: {
296
+ type: String,
297
+ required: !0
298
+ }
299
+ },
300
+ setup(y) {
301
+ const d = y, { tab: e } = H({
302
+ tab: "information"
303
+ }), { isLoading: c, startAsyncCall: a } = R(!0), o = A(), v = Q(), n = F();
304
+ async function p(t) {
305
+ a(async () => {
306
+ try {
307
+ await C.updateById(
308
+ d.terminalId,
309
+ {
310
+ name: t.name,
311
+ status: t.status,
312
+ ecrs: t.ecrs ?? [],
313
+ gateways: t.gateways ?? []
314
+ }
315
+ ), n.value = await C.readById(d.terminalId), v.open({
316
+ type: "success",
317
+ message: "Terminal updated successfully"
318
+ });
319
+ } catch (r) {
320
+ v.open({
321
+ type: "error",
322
+ title: "Error occurs when update terminal",
323
+ message: J(r)
324
+ });
325
+ }
326
+ });
327
+ }
328
+ const i = [
329
+ {
330
+ label: "Information",
331
+ value: "information",
332
+ icon: "overview",
333
+ render: W
334
+ },
335
+ {
336
+ label: "Fiuu",
337
+ value: "fiuu",
338
+ icon: "payment",
339
+ render: te
340
+ }
341
+ ], l = $().currentCountry, s = O(() => {
342
+ var t;
343
+ return (t = i.find((r) => r.value === e.value)) == null ? void 0 : t.render;
344
+ });
345
+ async function u() {
346
+ a(async () => {
347
+ n.value = await C.readById(d.terminalId), n.value.deviceType !== "TERMINAL" && (i.push({
348
+ label: "FeedMe Terminal",
349
+ value: "terminal",
350
+ icon: "shopping_cart_checkout",
351
+ render: ee
352
+ }), l.value === U.F_COUNTRY.enum.MY && i.push({
353
+ label: "GHL Terminal (V2)",
354
+ value: "ghl",
355
+ icon: "shopping_cart_checkout",
356
+ render: le
357
+ }));
358
+ });
359
+ }
360
+ return G(u), (t, r) => {
361
+ var x;
362
+ const m = f("FmTabs");
363
+ return b(), _(z, {
364
+ title: `Terminal (${(x = n.value) == null ? void 0 : x._id})`,
365
+ loading: k(c),
366
+ onBack: k(o).back
367
+ }, {
368
+ default: q(() => [
369
+ I(m, {
370
+ "model-value": k(e),
371
+ "onUpdate:modelValue": r[0] || (r[0] = (w) => h(e) ? e.value = w : null),
372
+ class: "mb-6",
373
+ items: i
374
+ }, null, 8, ["model-value"]),
375
+ k(e) ? (b(), _(L(s.value), j(E({ key: 0 }, {
376
+ terminal: n.value,
377
+ onUpdate: p
378
+ })), null, 16)) : B("", !0)
379
+ ]),
380
+ _: 1
381
+ }, 8, ["title", "loading", "onBack"]);
382
+ };
383
+ }
384
+ });
385
+ export {
386
+ pe as default
387
+ };
@@ -0,0 +1,261 @@
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-CFjLufVa.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
+ };