@feedmepos/mf-payment 1.0.17-beta.1 → 1.0.18-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 (54) hide show
  1. package/dist/{PayoutAccount-DVTKC9HU.js → PayoutAccount-DCq9zJ7I.js} +3 -3
  2. package/dist/{PayoutAccount-DaSWi1Me.js → PayoutAccount-Dlrre2MV.js} +83 -115
  3. package/dist/PayoutAccountSetting-D6Scsqvm.js +426 -0
  4. package/dist/{Restaurant-C-pno48_.js → Restaurant-AoDzEhKi.js} +4 -4
  5. package/dist/{RestaurantSetting-D5BXiTn2.js → RestaurantSetting-CAQfJwaq.js} +137 -115
  6. package/dist/{Settlement-Cgxts5eu.js → Settlement-anAN-1YR.js} +3 -3
  7. package/dist/Settlement-kfM1jLO-.js +444 -0
  8. package/dist/{SettlementTransactions-BXPsJSOI.js → SettlementTransactions-IhEM3Qtp.js} +4 -4
  9. package/dist/{SettlementTransactions-BWe-hWjq.js → SettlementTransactions-dVE594dr.js} +4 -4
  10. package/dist/Terminal-C0Irg7I_.js +435 -0
  11. package/dist/{TerminalSetting-BciOf47B.js → TerminalSetting-mMj1OSGc.js} +3 -3
  12. package/dist/{TerminalTransaction-BYlEOFjg.js → TerminalTransaction-2Oe5b_rm.js} +176 -188
  13. package/dist/TerminalTransaction-Coth2MwA.js +269 -0
  14. package/dist/Transaction-BbbVDMIm.js +247 -0
  15. package/dist/{Transaction-B362xcHT.js → Transaction-ChE2VgSa.js} +6 -6
  16. package/dist/{TransactionOld--8HuiCzC.js → TransactionOld-T8CKBB6U.js} +4 -4
  17. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-yAM0nD2z.js → TransactionTable.vue_vue_type_script_setup_true_lang-CoPiWynn.js} +2 -2
  18. package/dist/api/index.d.ts +1 -1
  19. package/dist/api/settlement/index.d.ts +5 -1
  20. package/dist/api/terminal/index.d.ts +1 -0
  21. package/dist/api/terminal-transaction/index.d.ts +2 -2
  22. package/dist/{app-Dm8kGtux.js → app-B36bwKcX.js} +165 -165
  23. package/dist/app.js +1 -1
  24. package/dist/{assets-BDTkzAxB.js → assets-fxpnHIZr.js} +1 -1
  25. package/dist/grafana-BFQCDk-V.js +54 -0
  26. package/dist/index-9a-RyWYf.js +52 -0
  27. package/dist/{index-BroiGVyD.js → index-C2q2ptf8.js} +1 -1
  28. package/dist/{index-D7Uh09kd.js → index-CC8HNMje.js} +1 -1
  29. package/dist/{index-DmltKkqh.js → index-CEJAjyRa.js} +1 -1
  30. package/dist/{index-4uEqQ1dj.js → index-Cj90pU-C.js} +27 -20
  31. package/dist/{index-CtVHR2Os.js → index-DueuWuxx.js} +1 -1
  32. package/dist/{index-CZAwC5k6.js → index-ZMBnoQxd.js} +31 -23
  33. package/dist/{index.vue_vue_type_script_setup_true_lang-3Bmqvkzy.js → index.vue_vue_type_script_setup_true_lang-PfAufXp3.js} +1 -1
  34. package/dist/package.json +2 -2
  35. package/dist/{payout-account-BZ-WV3GM.js → payout-account-D-LZ6-Lb.js} +2 -2
  36. package/dist/style.css +1 -1
  37. package/dist/{transaction-XK-M9o1a.js → transaction-5dZS6JFA.js} +21 -12
  38. package/dist/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/views/admin/terminal/cell/Actions.vue.d.ts +2 -0
  40. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +293 -0
  41. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +147 -0
  42. package/package.json +2 -2
  43. package/dist/PayoutAccountSelector.vue_vue_type_script_setup_true_lang-CYE3OEXe.js +0 -110
  44. package/dist/PayoutAccountSetting-CqWDYDDi.js +0 -758
  45. package/dist/Settlement-I67N2bqy.js +0 -145
  46. package/dist/Terminal-o9zfC9WW.js +0 -404
  47. package/dist/TerminalTransaction-C_2wLJJV.js +0 -820
  48. package/dist/Transaction-gDdSiqs9.js +0 -145
  49. package/dist/grafana-Dtn-kbRH.js +0 -49
  50. package/dist/index-BC85ddk1.js +0 -47
  51. package/dist/index-CZ9tbaEh.js +0 -28
  52. package/dist/views/admin/payout-account/cell/IsActive.vue.d.ts +0 -7
  53. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +0 -81
  54. package/dist/views/admin/terminal-transaction/cell/Timestamp.vue.d.ts +0 -7
@@ -0,0 +1,435 @@
1
+ import { defineComponent as A, openBlock as f, createElementBlock as D, createTextVNode as Y, createElementVNode as h, toDisplayString as O, resolveComponent as p, createVNode as v, normalizeClass as q, withCtx as K, createBlock as b, createCommentVNode as I, ref as x, computed as j, unref as d, watch as E, isRef as N, h as R } from "vue";
2
+ import "./index-CC8HNMje.js";
3
+ import { h as H } from "./moment-h96o7c8I.js";
4
+ import { u as G } from "./index-DueuWuxx.js";
5
+ import { _ as Q } from "./index.vue_vue_type_script_setup_true_lang-PfAufXp3.js";
6
+ import { _ as J } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
7
+ import { useSnackbar as P, useDialogChild as W, useDialog as X } from "@feedmepos/ui-library";
8
+ import { t as _ } from "./index-9a-RyWYf.js";
9
+ import { c as $ } from "./clipboard-4jh1WteU.js";
10
+ import { g as Z } from "./grafana-BFQCDk-V.js";
11
+ import { u as V } from "./error-K1CakhA9.js";
12
+ import { z as U, a as L } from "./validator-D5jtpt9A.js";
13
+ import { useCoreStore as ee } from "@feedmepos/mf-common";
14
+ import { w as M } from "./Modal-DB8M9o1T.js";
15
+ import { useRouter as te } from "vue-router";
16
+ const ne = { class: "t-caption" }, oe = /* @__PURE__ */ A({
17
+ __name: "TerminalBindCodeDialog",
18
+ props: {
19
+ code: {
20
+ type: String,
21
+ required: !0
22
+ }
23
+ },
24
+ setup(y) {
25
+ const o = y, i = P();
26
+ function l() {
27
+ try {
28
+ $(o.code), i.open({ title: "Text copied to clipboard." }, 1e3);
29
+ } catch {
30
+ i.open({ title: "Clipboard API incompatible." }, 1e3);
31
+ }
32
+ }
33
+ return (m, a) => (f(), D("div", ne, [
34
+ a[1] || (a[1] = Y(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
35
+ h("div", {
36
+ class: "my-6 text-center fm-typo-en-title-md-800 tracking-[0.3rem] cursor-pointer hover:text-fm-color-neutral-gray-300",
37
+ onClick: a[0] || (a[0] = (n) => {
38
+ n.stopPropagation(), l();
39
+ })
40
+ }, O(y.code), 1)
41
+ ]));
42
+ }
43
+ }), ae = /* @__PURE__ */ A({
44
+ __name: "ID",
45
+ props: {
46
+ row: {},
47
+ data: {}
48
+ },
49
+ setup(y) {
50
+ const o = y, i = P();
51
+ function l() {
52
+ return o.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
53
+ }
54
+ function m() {
55
+ try {
56
+ $(o.data), i.open({ title: "Text copied to clipboard." }, 1e3);
57
+ } catch {
58
+ i.open({ title: "Clipboard API incompatible." }, 1e3);
59
+ }
60
+ o.data;
61
+ }
62
+ return (a, n) => {
63
+ const r = p("FmBadge");
64
+ return f(), D("div", {
65
+ onClick: n[0] || (n[0] = (s) => {
66
+ s.stopPropagation(), m();
67
+ })
68
+ }, [
69
+ v(r, {
70
+ inline: "",
71
+ class: q(l())
72
+ }, {
73
+ default: K(() => [
74
+ h("div", null, O(a.data), 1)
75
+ ]),
76
+ _: 1
77
+ }, 8, ["class"])
78
+ ]);
79
+ };
80
+ }
81
+ }), re = { class: "flex" }, le = /* @__PURE__ */ A({
82
+ __name: "Actions",
83
+ props: {
84
+ data: {}
85
+ },
86
+ emits: ["link", "unlink", "edit", "delete"],
87
+ setup(y, { emit: o }) {
88
+ const i = y, l = o;
89
+ function m() {
90
+ const a = Z([
91
+ {
92
+ type: "span",
93
+ queryKey: "terminal.id",
94
+ queryValue: i.data._id
95
+ }
96
+ ]);
97
+ window.open(a, "_blank");
98
+ }
99
+ return (a, n) => {
100
+ const r = p("FmButton");
101
+ return f(), D("div", re, [
102
+ v(r, {
103
+ variant: "plain",
104
+ "prepend-icon": "history",
105
+ onClick: n[0] || (n[0] = (s) => {
106
+ s.stopPropagation(), m();
107
+ })
108
+ }),
109
+ a.data.deviceType === "TERMINAL" && !a.data.deviceId ? (f(), b(r, {
110
+ key: 0,
111
+ variant: "plain",
112
+ "prepend-icon": "link",
113
+ onClick: n[1] || (n[1] = (s) => {
114
+ s.stopPropagation(), l("link");
115
+ })
116
+ })) : I("", !0),
117
+ a.data.deviceType === "TERMINAL" && a.data.deviceId ? (f(), b(r, {
118
+ key: 1,
119
+ variant: "plain",
120
+ "prepend-icon": "link_off",
121
+ onClick: n[2] || (n[2] = (s) => {
122
+ s.stopPropagation(), l("unlink");
123
+ })
124
+ })) : I("", !0),
125
+ v(r, {
126
+ variant: "plain",
127
+ "prepend-icon": "edit",
128
+ onClick: n[3] || (n[3] = (s) => {
129
+ s.stopPropagation(), l("edit");
130
+ })
131
+ }),
132
+ a.data.deviceType === "TERMINAL" ? (f(), b(r, {
133
+ key: 2,
134
+ variant: "plain",
135
+ "prepend-icon": "delete",
136
+ onClick: n[4] || (n[4] = (s) => {
137
+ s.stopPropagation(), l("delete");
138
+ })
139
+ })) : I("", !0)
140
+ ]);
141
+ };
142
+ }
143
+ }), ie = /* @__PURE__ */ A({
144
+ __name: "TerminalDialog",
145
+ props: {
146
+ terminal: {
147
+ type: Object
148
+ }
149
+ },
150
+ setup(y) {
151
+ var F, k, S;
152
+ const o = y, i = ee(), l = W(), m = x(), a = x((F = o.terminal) == null ? void 0 : F.name), n = x((k = o.terminal) == null ? void 0 : k.referenceId), r = x(((S = o.terminal) == null ? void 0 : S.status) === "Active"), s = j(() => i.restaurants.value.map((C) => ({
153
+ label: C.profile.name,
154
+ value: C._id
155
+ })));
156
+ return (C, u) => {
157
+ const B = p("FmSelect"), e = p("FmTextField"), t = p("FmSwitch"), c = p("FmButton"), w = p("FmForm");
158
+ return f(), b(w, {
159
+ ref: m.value,
160
+ class: "flex flex-col gap-16 mb-6",
161
+ onValidationSuccess: u[3] || (u[3] = () => {
162
+ d(l).emitData({ name: a.value, referenceId: n.value, status: r.value ? "Active" : "Inactive" }), d(l).emitAction("primary");
163
+ })
164
+ }, {
165
+ default: K(() => [
166
+ o.terminal ? I("", !0) : (f(), b(B, {
167
+ key: 0,
168
+ modelValue: n.value,
169
+ "onUpdate:modelValue": u[0] || (u[0] = (g) => n.value = g),
170
+ label: "Restaurant",
171
+ "helper-text": "If you can't find the restaurant please change the business to the restaurant's business.",
172
+ items: s.value,
173
+ rules: d(U)(d(L).string())
174
+ }, null, 8, ["modelValue", "items", "rules"])),
175
+ v(e, {
176
+ modelValue: a.value,
177
+ "onUpdate:modelValue": u[1] || (u[1] = (g) => a.value = g),
178
+ label: "Terminal Name",
179
+ rules: d(U)(d(L).string())
180
+ }, null, 8, ["modelValue", "rules"]),
181
+ o.terminal ? (f(), b(t, {
182
+ key: 1,
183
+ modelValue: r.value,
184
+ "onUpdate:modelValue": u[2] || (u[2] = (g) => r.value = g),
185
+ label: "Status"
186
+ }, null, 8, ["modelValue"])) : I("", !0),
187
+ v(c, {
188
+ type: "submit",
189
+ label: "Create"
190
+ })
191
+ ]),
192
+ _: 1
193
+ }, 512);
194
+ };
195
+ }
196
+ }), se = { class: "flex justify-between mb-6 items-center" }, ce = { class: "flex space-x-4" }, de = { class: "flex space-x-4" }, Ie = /* @__PURE__ */ A({
197
+ __name: "Terminal",
198
+ setup(y) {
199
+ const o = x(), { searchKey: i, deviceType: l } = G({
200
+ searchKey: "",
201
+ deviceType: void 0
202
+ });
203
+ E(l, () => {
204
+ var e;
205
+ return (e = o.value) == null ? void 0 : e.reset();
206
+ });
207
+ let m;
208
+ E(i, async () => {
209
+ m && clearTimeout(m), m = setTimeout(
210
+ () => {
211
+ var e;
212
+ return (e = o.value) == null ? void 0 : e.reset();
213
+ },
214
+ 700
215
+ );
216
+ });
217
+ const a = te(), n = X(), r = P();
218
+ async function s(e) {
219
+ M(
220
+ n,
221
+ "Terminal Unbind",
222
+ "Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
223
+ async () => {
224
+ var t;
225
+ try {
226
+ await _.unbind(e), (t = o.value) == null || t.reset(), r.open({
227
+ type: "success",
228
+ message: "Terminal unbind successfully"
229
+ });
230
+ } catch (c) {
231
+ r.open({
232
+ type: "error",
233
+ title: "Error occurs when unbind terminal",
234
+ message: V(c)
235
+ });
236
+ }
237
+ }
238
+ );
239
+ }
240
+ async function F(e) {
241
+ const t = await _.getBindCode(e);
242
+ n.open({
243
+ title: "Terminal Bind Code",
244
+ closeButton: !0,
245
+ overlay: !0,
246
+ contentComponent: oe,
247
+ contentComponentProps: { code: t }
248
+ });
249
+ }
250
+ async function k(e) {
251
+ n.open({
252
+ title: e ? "Update Terminal" : "Create New Terminal",
253
+ closeButton: !0,
254
+ overlay: !0,
255
+ contentComponent: ie,
256
+ contentComponentProps: { terminal: e }
257
+ }).onPrimary(async (t) => {
258
+ var c;
259
+ n.close();
260
+ try {
261
+ await (e ? _.updateById(e._id, t) : _.create(t)), (c = o.value) == null || c.reset(), r.open({
262
+ type: "success",
263
+ message: e ? "Terminal udpated successfully" : "Terminal created successfully."
264
+ });
265
+ } catch (w) {
266
+ r.open({
267
+ type: "error",
268
+ title: "Error occurs when create terminal",
269
+ message: V(w)
270
+ });
271
+ }
272
+ });
273
+ }
274
+ async function S(e) {
275
+ M(
276
+ n,
277
+ "Delete Terminal",
278
+ "Are you sure to delete terminal? This action cannot be revert and device will be logged out!",
279
+ async () => {
280
+ var t;
281
+ try {
282
+ await _.delete(e), (t = o.value) == null || t.reset(), r.open({
283
+ type: "success",
284
+ message: "Terminal delete successfully"
285
+ });
286
+ } catch (c) {
287
+ r.open({
288
+ type: "error",
289
+ title: "Error occurs when delete terminal",
290
+ message: V(c)
291
+ });
292
+ }
293
+ }
294
+ );
295
+ }
296
+ const C = function(e) {
297
+ return {
298
+ id: e._id,
299
+ status: e.status,
300
+ referenceId: e.referenceId,
301
+ name: e.name,
302
+ deviceId: e.deviceId,
303
+ deviceType: e.deviceType,
304
+ updatedAt: H(e.updatedAt).format("YYYY-MM-DD HH:mm:ss")
305
+ };
306
+ }, u = [
307
+ {
308
+ accessorKey: "id",
309
+ header: () => "Terminal ID",
310
+ meta: {
311
+ textAlign: "right"
312
+ },
313
+ cell: ({ cell: e, row: t }) => R(ae, { row: t, data: e.getValue() })
314
+ },
315
+ {
316
+ accessorKey: "deviceType",
317
+ header: () => "Device Type",
318
+ meta: {
319
+ textAlign: "left"
320
+ }
321
+ },
322
+ {
323
+ accessorKey: "name",
324
+ header: () => "Name",
325
+ meta: {
326
+ textAlign: "left"
327
+ }
328
+ },
329
+ {
330
+ accessorKey: "referenceId",
331
+ header: () => "Reference",
332
+ meta: {
333
+ textAlign: "left"
334
+ }
335
+ },
336
+ {
337
+ accessorKey: "deviceId",
338
+ header: () => "Bound Device Id",
339
+ meta: {
340
+ textAlign: "left"
341
+ }
342
+ },
343
+ {
344
+ accessorKey: "updatedAt",
345
+ header: () => "Last Updated",
346
+ meta: {
347
+ textAlign: "left"
348
+ }
349
+ },
350
+ {
351
+ accessorKey: "id",
352
+ header: () => "Actions",
353
+ meta: {
354
+ textAlign: "center"
355
+ },
356
+ cell: ({ row: e }) => {
357
+ var c;
358
+ const t = (c = o.value) == null ? void 0 : c.pageData().at(e.index);
359
+ return R(le, {
360
+ data: t,
361
+ onLink: () => F(t._id),
362
+ onUnlink: () => s(t._id),
363
+ onEdit: () => k(t),
364
+ onDelete: () => S(t._id)
365
+ });
366
+ }
367
+ }
368
+ ], B = [
369
+ {
370
+ label: "POS",
371
+ value: "POS"
372
+ },
373
+ {
374
+ label: "KIOSK",
375
+ value: "KIOSK"
376
+ },
377
+ {
378
+ label: "TERMINAL",
379
+ value: "TERMINAL"
380
+ }
381
+ ];
382
+ return (e, t) => {
383
+ const c = p("FmSearch"), w = p("FmSelect"), g = p("FmButton");
384
+ return f(), b(J, {
385
+ title: "Terminals",
386
+ loading: !1
387
+ }, {
388
+ default: K(() => [
389
+ h("div", se, [
390
+ h("div", ce, [
391
+ v(c, {
392
+ "model-value": d(i),
393
+ "onUpdate:modelValue": t[0] || (t[0] = (T) => N(i) ? i.value = T : null),
394
+ class: "mr-8",
395
+ label: "Search",
396
+ placeholder: "Search Terminals ..."
397
+ }, null, 8, ["model-value"]),
398
+ v(w, {
399
+ modelValue: d(l),
400
+ "onUpdate:modelValue": t[1] || (t[1] = (T) => N(l) ? l.value = T : null),
401
+ class: "ml-6 w-[180px]",
402
+ label: "Device",
403
+ items: B
404
+ }, null, 8, ["modelValue"])
405
+ ]),
406
+ h("div", de, [
407
+ v(g, {
408
+ label: "Create",
409
+ icon: "add",
410
+ onClick: t[2] || (t[2] = () => k())
411
+ })
412
+ ])
413
+ ]),
414
+ v(Q, {
415
+ ref_key: "controller",
416
+ ref: o,
417
+ "column-defs": u,
418
+ "rows-defs": C,
419
+ paginate: (T, z) => d(_).read({ searchKey: d(i), deviceType: d(l), limit: T, cursor: z }),
420
+ onRowClick: t[3] || (t[3] = (T) => d(a).push({
421
+ name: "mf-payment-admin.terminal-setting",
422
+ params: {
423
+ terminalId: T._id
424
+ }
425
+ }))
426
+ }, null, 8, ["paginate"])
427
+ ]),
428
+ _: 1
429
+ });
430
+ };
431
+ }
432
+ });
433
+ export {
434
+ Ie as default
435
+ };
@@ -1,9 +1,9 @@
1
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 _, createVNode as I, createBlock as x, withCtx as q, createCommentVNode as B, isRef as h, resolveDynamicComponent as L, normalizeProps as j, mergeProps as z } from "vue";
2
- import { u as R, e as U } from "./index-D7Uh09kd.js";
2
+ import { u as R, e as U } from "./index-CC8HNMje.js";
3
3
  import { useRouter as E } from "vue-router";
4
- import { t as C } from "./index-BC85ddk1.js";
4
+ import { t as C } from "./index-9a-RyWYf.js";
5
5
  import { _ as A } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
- import { u as H } from "./index-CtVHR2Os.js";
6
+ import { u as H } from "./index-DueuWuxx.js";
7
7
  import { useSnackbar as Q } from "@feedmepos/ui-library";
8
8
  import { u as J } from "./error-K1CakhA9.js";
9
9
  import { z as W, a as X } from "./validator-D5jtpt9A.js";