@feedmepos/mf-payment 0.0.0-beta.9 → 1.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. package/dist/AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js +39 -0
  2. package/dist/AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js +42 -0
  3. package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js +40 -0
  4. package/dist/Modal-DB8M9o1T.js +13 -0
  5. package/dist/PayoutAccount-BHRhEZ9h.js +613 -0
  6. package/dist/{PayoutAccount-DLhMMlw_.js → PayoutAccount-Bj5zvmoj.js} +38 -35
  7. package/dist/PayoutAccountSetting-kUQLeAcb.js +780 -0
  8. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js +33 -0
  9. package/dist/Settlement-Crdfq22j.js +149 -0
  10. package/dist/Settlement-JHOJNkhd.js +194 -0
  11. package/dist/{SettlementTransactions-CoEzdtYT.js → SettlementTransactions-BxuLXUR-.js} +99 -105
  12. package/dist/{SettlementTransactions-Dl1H4jvh.js → SettlementTransactions-daWMAmtz.js} +117 -130
  13. package/dist/Terminal-gxGnjFGc.js +372 -0
  14. package/dist/TerminalSetting--ZAJJ_Hf.js +379 -0
  15. package/dist/TerminalTransaction---9nk_4q.js +249 -0
  16. package/dist/TerminalTransaction-B77YK3hF.js +425 -0
  17. package/dist/Transaction-8LlOLPeZ.js +404 -0
  18. package/dist/Transaction-DRQ_uZ30.js +241 -0
  19. package/dist/api/index.d.ts +14 -0
  20. package/dist/api/pagination.d.ts +20 -0
  21. package/dist/api/payment-gateway/index.d.ts +9 -0
  22. package/dist/api/settlement/index.d.ts +12 -13
  23. package/dist/api/terminal/index.d.ts +13 -1
  24. package/dist/api/terminal-transaction/index.d.ts +12 -1
  25. package/dist/api/transaction/index.d.ts +7 -2
  26. package/dist/app-DjzULXn3.js +6356 -0
  27. package/dist/app.js +3 -198
  28. package/dist/assets-NrCec-W0.js +45 -0
  29. package/dist/clipboard-4jh1WteU.js +10 -0
  30. package/dist/components/AsyncButton.vue.d.ts +21 -0
  31. package/dist/components/AutoCopyCell.vue.d.ts +6 -0
  32. package/dist/components/CursorTable/index.vue.d.ts +24 -5
  33. package/dist/components/RestaurantSelector.vue.d.ts +2 -0
  34. package/dist/components/RouteCell.vue.d.ts +8 -0
  35. package/dist/helpers/assets.d.ts +2 -0
  36. package/dist/{index-Bmka-1lQ.js → index-7KNaibcq.js} +1 -1
  37. package/dist/index-BWUtjGg7.js +47 -0
  38. package/dist/{index-CF56zGyu.js → index-BwcJZFsi.js} +1 -1
  39. package/dist/index-CWaKb7bG.js +56107 -0
  40. package/dist/index-CojhNtuG.js +127 -0
  41. package/dist/index-DbJpbpSs.js +52 -0
  42. package/dist/index.vue_vue_type_script_setup_true_lang-JdAFa8vy.js +167 -0
  43. package/dist/model/transaction.d.ts +2 -1
  44. package/dist/package.json +5 -5
  45. package/dist/payout-account-CBT1rfSS.js +1805 -0
  46. package/dist/router/index.d.ts +1 -0
  47. package/dist/stores/payoutAccount.d.ts +4 -4
  48. package/dist/transaction-CQiT7Y_s.js +87 -0
  49. package/dist/tsconfig.app.tsbuildinfo +1 -1
  50. package/dist/validator-D5jtpt9A.js +2877 -0
  51. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
  52. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +81 -0
  53. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
  54. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
  55. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +56 -0
  56. package/dist/views/admin/payout-account/tabs/gateway/GhlGateway.vue.d.ts +50 -0
  57. package/dist/views/admin/payout-account/tabs/gateway/RevenueMonsterGateway.vue.d.ts +52 -0
  58. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +12 -12
  59. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +83 -0
  60. package/dist/views/admin/terminal/TerminalSetting.vue.d.ts +12 -0
  61. package/dist/views/admin/terminal/cell/Actions.vue.d.ts +80 -9
  62. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +94 -0
  63. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +94 -0
  64. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +85 -0
  65. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +94 -0
  66. package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +7 -0
  67. package/dist/views/admin/transaction/TransactionTable.vue.d.ts +6 -2
  68. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +7 -0
  69. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
  70. package/dist/views/settlement/SettlementTable.vue.d.ts +12 -12
  71. package/dist/views/terminal-transaction/TerminalTransaction.vue.d.ts +2 -0
  72. package/dist/views/terminal-transaction/cell/Gateway.vue.d.ts +9 -0
  73. package/dist/views/terminal-transaction/cell/Status.vue.d.ts +9 -0
  74. package/package.json +5 -5
  75. package/dist/AdminLayout.vue_vue_type_script_setup_true_lang-oPYFBeEo.js +0 -42
  76. package/dist/PayoutAccount-xxSxqBTL.js +0 -3485
  77. package/dist/PayoutAccountSetting-CIeos0md.js +0 -425
  78. package/dist/Settlement-BVGACeme.js +0 -136
  79. package/dist/Settlement-Ce48KHrc.js +0 -132
  80. package/dist/Terminal-ByKV2Rof.js +0 -204
  81. package/dist/TerminalTransaction-RuSxBAxf.js +0 -240
  82. package/dist/Transaction-CYo-uLQi.js +0 -241
  83. package/dist/Transaction-Cjw9WwX8.js +0 -242
  84. package/dist/api/auth/index.d.ts +0 -7
  85. package/dist/assets-BuLGUMIx.js +0 -472
  86. package/dist/index-Coz5aeIO.js +0 -61
  87. package/dist/index-DCPNrUDq.js +0 -40075
  88. package/dist/index.vue_vue_type_script_setup_true_lang-CAR-bNaR.js +0 -150
  89. package/dist/mascot-side-3VXskf9y.js +0 -4
  90. package/dist/payout-account-iAM7HPtG.js +0 -3317
  91. package/dist/transaction-vRrBf3FN.js +0 -64
@@ -0,0 +1,372 @@
1
+ import { defineComponent as x, openBlock as f, createElementBlock as B, createTextVNode as L, createElementVNode as h, toDisplayString as U, resolveComponent as p, createVNode as v, normalizeClass as O, withCtx as V, createBlock as g, createCommentVNode as I, ref as k, computed as z, unref as c, watch as D, isRef as K, h as E } from "vue";
2
+ import "./index-CWaKb7bG.js";
3
+ import { h as Y } from "./moment-h96o7c8I.js";
4
+ import { u as j } from "./index-7KNaibcq.js";
5
+ import { _ as q } from "./index.vue_vue_type_script_setup_true_lang-JdAFa8vy.js";
6
+ import { _ as Q } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
7
+ import { useSnackbar as $, useDialogChild as G, useDialog as H } from "@feedmepos/ui-library";
8
+ import { t as A } from "./index-BWUtjGg7.js";
9
+ import { c as J } from "./clipboard-4jh1WteU.js";
10
+ import { u as N } from "./error-K1CakhA9.js";
11
+ import { z as P, a as R } 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 = { class: "t-h1 my-6 text-center" }, ne = /* @__PURE__ */ x({
16
+ __name: "TerminalBindCodeDialog",
17
+ props: {
18
+ code: {
19
+ type: String,
20
+ required: !0
21
+ }
22
+ },
23
+ setup(y) {
24
+ return (n, o) => (f(), B("div", ee, [
25
+ o[0] || (o[0] = L(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
26
+ h("div", te, U(y.code), 1)
27
+ ]));
28
+ }
29
+ }), oe = /* @__PURE__ */ x({
30
+ __name: "ID",
31
+ props: {
32
+ row: {},
33
+ data: {}
34
+ },
35
+ setup(y) {
36
+ const n = y, o = $();
37
+ function r() {
38
+ return n.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
39
+ }
40
+ function l() {
41
+ try {
42
+ J(n.data), o.open({ title: "Text copied to clipboard." }, 1e3);
43
+ } catch {
44
+ o.open({ title: "Clipboard API incompatible." }, 1e3);
45
+ }
46
+ n.data;
47
+ }
48
+ return (s, a) => {
49
+ const d = p("FmBadge");
50
+ return f(), B("div", {
51
+ onClick: a[0] || (a[0] = (_) => {
52
+ _.stopPropagation(), l();
53
+ })
54
+ }, [
55
+ v(d, {
56
+ inline: "",
57
+ class: O(r())
58
+ }, {
59
+ default: V(() => [
60
+ h("div", null, U(s.data), 1)
61
+ ]),
62
+ _: 1
63
+ }, 8, ["class"])
64
+ ]);
65
+ };
66
+ }
67
+ }), ae = { class: "flex" }, re = /* @__PURE__ */ x({
68
+ __name: "Actions",
69
+ props: {
70
+ data: {}
71
+ },
72
+ emits: ["link", "unlink", "edit"],
73
+ setup(y, { emit: n }) {
74
+ const o = n;
75
+ return (r, l) => {
76
+ const s = p("FmButton");
77
+ return f(), B("div", ae, [
78
+ r.data.deviceType === "TERMINAL" && !r.data.deviceId ? (f(), g(s, {
79
+ key: 0,
80
+ variant: "plain",
81
+ "prepend-icon": "link",
82
+ onClick: l[0] || (l[0] = (a) => {
83
+ a.stopPropagation(), o("link");
84
+ })
85
+ })) : I("", !0),
86
+ r.data.deviceType === "TERMINAL" && r.data.deviceId ? (f(), g(s, {
87
+ key: 1,
88
+ variant: "plain",
89
+ "prepend-icon": "link_off",
90
+ onClick: l[1] || (l[1] = (a) => {
91
+ a.stopPropagation(), o("unlink");
92
+ })
93
+ })) : I("", !0),
94
+ v(s, {
95
+ variant: "plain",
96
+ "prepend-icon": "edit",
97
+ onClick: l[2] || (l[2] = (a) => {
98
+ a.stopPropagation(), o("edit");
99
+ })
100
+ })
101
+ ]);
102
+ };
103
+ }
104
+ }), le = /* @__PURE__ */ x({
105
+ __name: "TerminalDialog",
106
+ props: {
107
+ terminal: {
108
+ type: Object
109
+ }
110
+ },
111
+ setup(y) {
112
+ var w, T, F;
113
+ const n = y, o = W(), r = G(), l = k(), s = k((w = n.terminal) == null ? void 0 : w.name), a = k((T = n.terminal) == null ? void 0 : T.referenceId), d = k(((F = n.terminal) == null ? void 0 : F.status) === "Active"), _ = z(() => o.restaurants.value.map((b) => ({
114
+ label: b.profile.name,
115
+ value: b._id
116
+ })));
117
+ return (b, u) => {
118
+ const e = p("FmSelect"), t = p("FmTextField"), m = p("FmSwitch"), C = p("FmButton"), S = p("FmForm");
119
+ return f(), g(S, {
120
+ ref: l.value,
121
+ class: "flex flex-col gap-16 mb-6",
122
+ onValidationSuccess: u[3] || (u[3] = () => {
123
+ c(r).emitData({ name: s.value, referenceId: a.value, status: d.value ? "Active" : "Inactive" }), c(r).emitAction("primary");
124
+ })
125
+ }, {
126
+ default: V(() => [
127
+ n.terminal ? I("", !0) : (f(), g(e, {
128
+ key: 0,
129
+ modelValue: a.value,
130
+ "onUpdate:modelValue": u[0] || (u[0] = (i) => a.value = i),
131
+ label: "Restaurant",
132
+ items: _.value,
133
+ rules: c(P)(c(R).string())
134
+ }, null, 8, ["modelValue", "items", "rules"])),
135
+ v(t, {
136
+ modelValue: s.value,
137
+ "onUpdate:modelValue": u[1] || (u[1] = (i) => s.value = i),
138
+ label: "Terminal Name",
139
+ rules: c(P)(c(R).string())
140
+ }, null, 8, ["modelValue", "rules"]),
141
+ n.terminal ? (f(), g(m, {
142
+ key: 1,
143
+ modelValue: d.value,
144
+ "onUpdate:modelValue": u[2] || (u[2] = (i) => d.value = i),
145
+ label: "Status"
146
+ }, null, 8, ["modelValue"])) : I("", !0),
147
+ v(C, {
148
+ type: "submit",
149
+ label: "Create"
150
+ })
151
+ ]),
152
+ _: 1
153
+ }, 512);
154
+ };
155
+ }
156
+ }), ie = { class: "flex justify-between mb-6 items-center" }, se = { class: "flex space-x-4" }, ce = { class: "flex space-x-4" }, xe = /* @__PURE__ */ x({
157
+ __name: "Terminal",
158
+ setup(y) {
159
+ const n = k(), { searchKey: o, deviceType: r } = j({
160
+ searchKey: "",
161
+ deviceType: void 0
162
+ });
163
+ D(r, () => {
164
+ var e;
165
+ return (e = n.value) == null ? void 0 : e.reset();
166
+ });
167
+ let l;
168
+ D(o, async () => {
169
+ l && clearTimeout(l), l = setTimeout(
170
+ () => {
171
+ var e;
172
+ return (e = n.value) == null ? void 0 : e.reset();
173
+ },
174
+ 700
175
+ );
176
+ });
177
+ const s = Z(), a = H(), d = $();
178
+ async function _(e) {
179
+ X(
180
+ a,
181
+ "Terminal Unbind",
182
+ "Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
183
+ async () => {
184
+ var t;
185
+ try {
186
+ await A.unbind(e), (t = n.value) == null || t.reset(), d.open({
187
+ type: "success",
188
+ message: "Terminal unbind successfully"
189
+ });
190
+ } catch (m) {
191
+ d.open({
192
+ type: "error",
193
+ title: "Error occurs when unbind terminal",
194
+ message: N(m)
195
+ });
196
+ }
197
+ }
198
+ );
199
+ }
200
+ async function w(e) {
201
+ const t = await A.getBindCode(e);
202
+ a.open({
203
+ title: "Terminal Bind Code",
204
+ closeButton: !0,
205
+ overlay: !0,
206
+ contentComponent: ne,
207
+ contentComponentProps: { code: t }
208
+ });
209
+ }
210
+ async function T(e) {
211
+ a.open({
212
+ title: e ? "Update Terminal" : "Create New Terminal",
213
+ closeButton: !0,
214
+ overlay: !0,
215
+ contentComponent: le,
216
+ contentComponentProps: { terminal: e }
217
+ }).onPrimary(async (t) => {
218
+ var m;
219
+ a.close();
220
+ try {
221
+ await A.create(t), (m = n.value) == null || m.reset(), d.open({
222
+ type: "success",
223
+ message: e ? "Terminal udpated successfully" : "Terminal created successfully."
224
+ });
225
+ } catch (C) {
226
+ d.open({
227
+ type: "error",
228
+ title: "Error occurs when create terminal",
229
+ message: N(C)
230
+ });
231
+ }
232
+ });
233
+ }
234
+ const F = function(e) {
235
+ return {
236
+ id: e._id,
237
+ status: e.status,
238
+ referenceId: e.referenceId,
239
+ name: e.name,
240
+ deviceId: e.deviceId,
241
+ deviceType: e.deviceType,
242
+ updatedAt: Y(e.updatedAt).format("YYYY-MM-DD hh:mm:ss")
243
+ };
244
+ }, b = [
245
+ {
246
+ accessorKey: "id",
247
+ header: () => "Terminal ID",
248
+ meta: {
249
+ textAlign: "right"
250
+ },
251
+ cell: ({ cell: e, row: t }) => E(oe, { row: t, data: e.getValue() })
252
+ },
253
+ {
254
+ accessorKey: "deviceType",
255
+ header: () => "Device Type",
256
+ meta: {
257
+ textAlign: "left"
258
+ }
259
+ },
260
+ {
261
+ accessorKey: "name",
262
+ header: () => "Name",
263
+ meta: {
264
+ textAlign: "left"
265
+ }
266
+ },
267
+ {
268
+ accessorKey: "referenceId",
269
+ header: () => "Reference",
270
+ meta: {
271
+ textAlign: "left"
272
+ }
273
+ },
274
+ {
275
+ accessorKey: "deviceId",
276
+ header: () => "Bound Device Id",
277
+ meta: {
278
+ textAlign: "left"
279
+ }
280
+ },
281
+ {
282
+ accessorKey: "updatedAt",
283
+ header: () => "Last Updated",
284
+ meta: {
285
+ textAlign: "left"
286
+ }
287
+ },
288
+ {
289
+ accessorKey: "id",
290
+ header: () => "Actions",
291
+ meta: {
292
+ textAlign: "center"
293
+ },
294
+ cell: ({ row: e }) => {
295
+ var m;
296
+ const t = (m = n.value) == null ? void 0 : m.pageData().at(e.index);
297
+ return E(re, {
298
+ data: t,
299
+ onLink: () => w(t._id),
300
+ onUnlink: () => _(t._id),
301
+ onEdit: () => T(t)
302
+ });
303
+ }
304
+ }
305
+ ], u = [
306
+ {
307
+ label: "POS",
308
+ value: "POS"
309
+ },
310
+ {
311
+ label: "KIOSK",
312
+ value: "KIOSK"
313
+ },
314
+ {
315
+ label: "TERMINAL",
316
+ value: "TERMINAL"
317
+ }
318
+ ];
319
+ return (e, t) => {
320
+ const m = p("FmSearch"), C = p("FmSelect"), S = p("FmButton");
321
+ return f(), g(Q, {
322
+ title: "Terminals",
323
+ loading: !1
324
+ }, {
325
+ default: V(() => [
326
+ h("div", ie, [
327
+ h("div", se, [
328
+ v(m, {
329
+ "model-value": c(o),
330
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => K(o) ? o.value = i : null),
331
+ class: "mr-8",
332
+ label: "Search",
333
+ placeholder: "Search Terminals ..."
334
+ }, null, 8, ["model-value"]),
335
+ v(C, {
336
+ modelValue: c(r),
337
+ "onUpdate:modelValue": t[1] || (t[1] = (i) => K(r) ? r.value = i : null),
338
+ class: "ml-6 w-[180px]",
339
+ label: "Device",
340
+ items: u
341
+ }, null, 8, ["modelValue"])
342
+ ]),
343
+ h("div", ce, [
344
+ v(S, {
345
+ label: "Create",
346
+ icon: "add",
347
+ onClick: t[2] || (t[2] = () => T())
348
+ })
349
+ ])
350
+ ]),
351
+ v(q, {
352
+ ref_key: "controller",
353
+ ref: n,
354
+ "column-defs": b,
355
+ "rows-defs": F,
356
+ paginate: (i, M) => c(A).read({ searchKey: c(o), deviceType: c(r), limit: i, cursor: M }),
357
+ onRowClick: t[3] || (t[3] = (i) => c(s).push({
358
+ name: "mf-payment-admin.terminal-setting",
359
+ params: {
360
+ terminalId: i._id
361
+ }
362
+ }))
363
+ }, null, 8, ["paginate"])
364
+ ]),
365
+ _: 1
366
+ });
367
+ };
368
+ }
369
+ });
370
+ export {
371
+ xe as default
372
+ };