@feedmepos/mf-payment 1.0.2-beta.1 → 1.0.2-beta.2

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 (24) hide show
  1. package/dist/{PayoutAccount-B1s3QYgu.js → PayoutAccount-WMo1Wi6d.js} +1 -1
  2. package/dist/{PayoutAccount-C9SN1Nvv.js → PayoutAccount-jO4yRGDD.js} +1 -1
  3. package/dist/Restaurant-BN04ZHox.js +302 -0
  4. package/dist/{SettlementTransactions-Dmhz9p1V.js → SettlementTransactions-DHoHXPTr.js} +1 -1
  5. package/dist/{SettlementTransactions-Xdb_g6jX.js → SettlementTransactions-Ye65VrAA.js} +1 -1
  6. package/dist/{Terminal-D-U0BVTe.js → Terminal-nWQ95k-W.js} +149 -131
  7. package/dist/{TerminalTransaction-Bh9FhkvQ.js → TerminalTransaction-D7Vy3Hn8.js} +181 -152
  8. package/dist/{Transaction-DA_TB9zD.js → Transaction-CeJhi9Hg.js} +1 -1
  9. package/dist/{Transaction-BedQtv8p.js → Transaction-DGoMEHjT.js} +123 -96
  10. package/dist/{app-O6Nt7xIq.js → app-CQiyh6x1.js} +202 -202
  11. package/dist/app.js +1 -1
  12. package/dist/grafana-CqkYm_ru.js +46 -0
  13. package/dist/helpers/grafana.d.ts +7 -0
  14. package/dist/model/transaction.d.ts +1 -0
  15. package/dist/package.json +1 -1
  16. package/dist/{payout-account-B7WTxG7n.js → payout-account-BHUNAuhN.js} +1 -1
  17. package/dist/{transaction-W49zE8RL.js → transaction-DGZWXzQ3.js} +8 -7
  18. package/dist/tsconfig.app.tsbuildinfo +1 -1
  19. package/dist/views/admin/restaurant/cell/LogButton.vue.d.ts +5 -0
  20. package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +3 -1
  21. package/dist/views/admin/transaction/TransactionTable.vue.d.ts +2 -0
  22. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +1 -1
  23. package/package.json +1 -1
  24. package/dist/Restaurant-ewsvVw3P.js +0 -262
@@ -1,18 +1,19 @@
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";
1
+ import { defineComponent as h, openBlock as g, createElementBlock as V, createTextVNode as M, createElementVNode as x, toDisplayString as L, resolveComponent as f, createVNode as v, normalizeClass as z, withCtx as B, createBlock as b, createCommentVNode as F, ref as C, computed as Y, unref as m, watch as K, isRef as P, h as E } from "vue";
2
2
  import "./index-1fXAFo2E.js";
3
- import { h as j } from "./moment-h96o7c8I.js";
4
- import { u as q } from "./index-DdJrUqkm.js";
5
- import { _ as Q } from "./index.vue_vue_type_script_setup_true_lang-GT2x04Bn.js";
6
- import { _ as G } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
3
+ import { h as q } from "./moment-h96o7c8I.js";
4
+ import { u as j } from "./index-DdJrUqkm.js";
5
+ import { _ as G } from "./index.vue_vue_type_script_setup_true_lang-GT2x04Bn.js";
6
+ import { _ as Q } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
7
7
  import { useSnackbar as D, useDialogChild as H, useDialog as J } from "@feedmepos/ui-library";
8
8
  import { t as A } from "./index-DeU3Qyca.js";
9
- import { c as M } from "./clipboard-4jh1WteU.js";
9
+ import { c as O } from "./clipboard-4jh1WteU.js";
10
+ import { g as W } from "./grafana-CqkYm_ru.js";
10
11
  import { u as N } from "./error-K1CakhA9.js";
11
12
  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({
13
+ import { useCoreStore as X } from "@feedmepos/mf-common";
14
+ import { w as Z } from "./Modal-DB8M9o1T.js";
15
+ import { useRouter as ee } from "vue-router";
16
+ const te = { class: "t-caption" }, ne = /* @__PURE__ */ h({
16
17
  __name: "TerminalBindCodeDialog",
17
18
  props: {
18
19
  code: {
@@ -20,145 +21,162 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
20
21
  required: !0
21
22
  }
22
23
  },
23
- setup(v) {
24
- const n = v, a = D();
24
+ setup(y) {
25
+ const o = y, i = D();
25
26
  function r() {
26
27
  try {
27
- M(n.code), a.open({ title: "Text copied to clipboard." }, 1e3);
28
+ O(o.code), i.open({ title: "Text copied to clipboard." }, 1e3);
28
29
  } catch {
29
- a.open({ title: "Clipboard API incompatible." }, 1e3);
30
+ i.open({ title: "Clipboard API incompatible." }, 1e3);
30
31
  }
31
32
  }
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", {
33
+ return (d, a) => (g(), V("div", te, [
34
+ a[1] || (a[1] = M(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
35
+ x("div", {
35
36
  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();
37
+ onClick: a[0] || (a[0] = (n) => {
38
+ n.stopPropagation(), r();
38
39
  })
39
- }, $(v.code), 1)
40
+ }, L(y.code), 1)
40
41
  ]));
41
42
  }
42
- }), ne = /* @__PURE__ */ x({
43
+ }), oe = /* @__PURE__ */ h({
43
44
  __name: "ID",
44
45
  props: {
45
46
  row: {},
46
47
  data: {}
47
48
  },
48
- setup(v) {
49
- const n = v, a = D();
49
+ setup(y) {
50
+ const o = y, i = D();
50
51
  function r() {
51
- return n.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
52
+ return o.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
52
53
  }
53
- function i() {
54
+ function d() {
54
55
  try {
55
- M(n.data), a.open({ title: "Text copied to clipboard." }, 1e3);
56
+ O(o.data), i.open({ title: "Text copied to clipboard." }, 1e3);
56
57
  } catch {
57
- a.open({ title: "Clipboard API incompatible." }, 1e3);
58
+ i.open({ title: "Clipboard API incompatible." }, 1e3);
58
59
  }
59
- n.data;
60
+ o.data;
60
61
  }
61
- return (l, o) => {
62
- const d = p("FmBadge");
63
- return f(), B("div", {
64
- onClick: o[0] || (o[0] = (_) => {
65
- _.stopPropagation(), i();
62
+ return (a, n) => {
63
+ const l = f("FmBadge");
64
+ return g(), V("div", {
65
+ onClick: n[0] || (n[0] = (s) => {
66
+ s.stopPropagation(), d();
66
67
  })
67
68
  }, [
68
- y(d, {
69
+ v(l, {
69
70
  inline: "",
70
71
  class: z(r())
71
72
  }, {
72
- default: V(() => [
73
- h("div", null, $(l.data), 1)
73
+ default: B(() => [
74
+ x("div", null, L(a.data), 1)
74
75
  ]),
75
76
  _: 1
76
77
  }, 8, ["class"])
77
78
  ]);
78
79
  };
79
80
  }
80
- }), oe = { class: "flex" }, ae = /* @__PURE__ */ x({
81
+ }), ae = { class: "flex" }, re = /* @__PURE__ */ h({
81
82
  __name: "Actions",
82
83
  props: {
83
84
  data: {}
84
85
  },
85
86
  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, {
87
+ setup(y, { emit: o }) {
88
+ const i = y, r = o;
89
+ function d() {
90
+ const a = W([
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 l = f("FmButton");
101
+ return g(), V("div", ae, [
102
+ v(l, {
103
+ variant: "plain",
104
+ "prepend-icon": "history",
105
+ onClick: n[0] || (n[0] = (s) => {
106
+ s.stopPropagation(), d();
107
+ })
108
+ }),
109
+ a.data.deviceType === "TERMINAL" && !a.data.deviceId ? (g(), b(l, {
92
110
  key: 0,
93
111
  variant: "plain",
94
112
  "prepend-icon": "link",
95
- onClick: i[0] || (i[0] = (o) => {
96
- o.stopPropagation(), a("link");
113
+ onClick: n[1] || (n[1] = (s) => {
114
+ s.stopPropagation(), r("link");
97
115
  })
98
116
  })) : F("", !0),
99
- r.data.deviceType === "TERMINAL" && r.data.deviceId ? (f(), g(l, {
117
+ a.data.deviceType === "TERMINAL" && a.data.deviceId ? (g(), b(l, {
100
118
  key: 1,
101
119
  variant: "plain",
102
120
  "prepend-icon": "link_off",
103
- onClick: i[1] || (i[1] = (o) => {
104
- o.stopPropagation(), a("unlink");
121
+ onClick: n[2] || (n[2] = (s) => {
122
+ s.stopPropagation(), r("unlink");
105
123
  })
106
124
  })) : F("", !0),
107
- y(l, {
125
+ v(l, {
108
126
  variant: "plain",
109
127
  "prepend-icon": "edit",
110
- onClick: i[2] || (i[2] = (o) => {
111
- o.stopPropagation(), a("edit");
128
+ onClick: n[3] || (n[3] = (s) => {
129
+ s.stopPropagation(), r("edit");
112
130
  })
113
131
  })
114
132
  ]);
115
133
  };
116
134
  }
117
- }), re = /* @__PURE__ */ x({
135
+ }), ie = /* @__PURE__ */ h({
118
136
  __name: "TerminalDialog",
119
137
  props: {
120
138
  terminal: {
121
139
  type: Object
122
140
  }
123
141
  },
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) => ({
142
+ setup(y) {
143
+ var w, _, I;
144
+ const o = y, i = X(), r = H(), d = C(), a = C((w = o.terminal) == null ? void 0 : w.name), n = C((_ = o.terminal) == null ? void 0 : _.referenceId), l = C(((I = o.terminal) == null ? void 0 : I.status) === "Active"), s = Y(() => i.restaurants.value.map((T) => ({
127
145
  label: T.profile.name,
128
146
  value: T._id
129
147
  })));
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,
148
+ return (T, p) => {
149
+ const e = f("FmSelect"), t = f("FmTextField"), u = f("FmSwitch"), k = f("FmButton"), S = f("FmForm");
150
+ return g(), b(S, {
151
+ ref: d.value,
134
152
  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");
153
+ onValidationSuccess: p[3] || (p[3] = () => {
154
+ m(r).emitData({ name: a.value, referenceId: n.value, status: l.value ? "Active" : "Inactive" }), m(r).emitAction("primary");
137
155
  })
138
156
  }, {
139
- default: V(() => [
140
- n.terminal ? F("", !0) : (f(), g(e, {
157
+ default: B(() => [
158
+ o.terminal ? F("", !0) : (g(), b(e, {
141
159
  key: 0,
142
- modelValue: o.value,
143
- "onUpdate:modelValue": u[0] || (u[0] = (s) => o.value = s),
160
+ modelValue: n.value,
161
+ "onUpdate:modelValue": p[0] || (p[0] = (c) => n.value = c),
144
162
  label: "Restaurant",
145
163
  "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())
164
+ items: s.value,
165
+ rules: m(R)(m(U).string())
148
166
  }, null, 8, ["modelValue", "items", "rules"])),
149
- y(t, {
150
- modelValue: l.value,
151
- "onUpdate:modelValue": u[1] || (u[1] = (s) => l.value = s),
167
+ v(t, {
168
+ modelValue: a.value,
169
+ "onUpdate:modelValue": p[1] || (p[1] = (c) => a.value = c),
152
170
  label: "Terminal Name",
153
- rules: c(R)(c(U).string())
171
+ rules: m(R)(m(U).string())
154
172
  }, null, 8, ["modelValue", "rules"]),
155
- n.terminal ? (f(), g(m, {
173
+ o.terminal ? (g(), b(u, {
156
174
  key: 1,
157
- modelValue: d.value,
158
- "onUpdate:modelValue": u[2] || (u[2] = (s) => d.value = s),
175
+ modelValue: l.value,
176
+ "onUpdate:modelValue": p[2] || (p[2] = (c) => l.value = c),
159
177
  label: "Status"
160
178
  }, null, 8, ["modelValue"])) : F("", !0),
161
- y(C, {
179
+ v(k, {
162
180
  type: "submit",
163
181
  label: "Create"
164
182
  })
@@ -167,45 +185,45 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
167
185
  }, 512);
168
186
  };
169
187
  }
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({
188
+ }), le = { class: "flex justify-between mb-6 items-center" }, se = { class: "flex space-x-4" }, ce = { class: "flex space-x-4" }, we = /* @__PURE__ */ h({
171
189
  __name: "Terminal",
172
- setup(v) {
173
- const n = k(), { searchKey: a, deviceType: r } = q({
190
+ setup(y) {
191
+ const o = C(), { searchKey: i, deviceType: r } = j({
174
192
  searchKey: "",
175
193
  deviceType: void 0
176
194
  });
177
195
  K(r, () => {
178
196
  var e;
179
- return (e = n.value) == null ? void 0 : e.reset();
197
+ return (e = o.value) == null ? void 0 : e.reset();
180
198
  });
181
- let i;
182
- K(a, async () => {
183
- i && clearTimeout(i), i = setTimeout(
199
+ let d;
200
+ K(i, async () => {
201
+ d && clearTimeout(d), d = setTimeout(
184
202
  () => {
185
203
  var e;
186
- return (e = n.value) == null ? void 0 : e.reset();
204
+ return (e = o.value) == null ? void 0 : e.reset();
187
205
  },
188
206
  700
189
207
  );
190
208
  });
191
- const l = Z(), o = J(), d = D();
192
- async function _(e) {
193
- X(
194
- o,
209
+ const a = ee(), n = J(), l = D();
210
+ async function s(e) {
211
+ Z(
212
+ n,
195
213
  "Terminal Unbind",
196
214
  "Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
197
215
  async () => {
198
216
  var t;
199
217
  try {
200
- await A.unbind(e), (t = n.value) == null || t.reset(), d.open({
218
+ await A.unbind(e), (t = o.value) == null || t.reset(), l.open({
201
219
  type: "success",
202
220
  message: "Terminal unbind successfully"
203
221
  });
204
- } catch (m) {
205
- d.open({
222
+ } catch (u) {
223
+ l.open({
206
224
  type: "error",
207
225
  title: "Error occurs when unbind terminal",
208
- message: N(m)
226
+ message: N(u)
209
227
  });
210
228
  }
211
229
  }
@@ -213,34 +231,34 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
213
231
  }
214
232
  async function w(e) {
215
233
  const t = await A.getBindCode(e);
216
- o.open({
234
+ n.open({
217
235
  title: "Terminal Bind Code",
218
236
  closeButton: !0,
219
237
  overlay: !0,
220
- contentComponent: te,
238
+ contentComponent: ne,
221
239
  contentComponentProps: { code: t }
222
240
  });
223
241
  }
224
- async function b(e) {
225
- o.open({
242
+ async function _(e) {
243
+ n.open({
226
244
  title: e ? "Update Terminal" : "Create New Terminal",
227
245
  closeButton: !0,
228
246
  overlay: !0,
229
- contentComponent: re,
247
+ contentComponent: ie,
230
248
  contentComponentProps: { terminal: e }
231
249
  }).onPrimary(async (t) => {
232
- var m;
233
- o.close();
250
+ var u;
251
+ n.close();
234
252
  try {
235
- await A.create(t), (m = n.value) == null || m.reset(), d.open({
253
+ await A.create(t), (u = o.value) == null || u.reset(), l.open({
236
254
  type: "success",
237
255
  message: e ? "Terminal udpated successfully" : "Terminal created successfully."
238
256
  });
239
- } catch (C) {
240
- d.open({
257
+ } catch (k) {
258
+ l.open({
241
259
  type: "error",
242
260
  title: "Error occurs when create terminal",
243
- message: N(C)
261
+ message: N(k)
244
262
  });
245
263
  }
246
264
  });
@@ -253,7 +271,7 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
253
271
  name: e.name,
254
272
  deviceId: e.deviceId,
255
273
  deviceType: e.deviceType,
256
- updatedAt: j(e.updatedAt).format("YYYY-MM-DD hh:mm:ss")
274
+ updatedAt: q(e.updatedAt).format("YYYY-MM-DD hh:mm:ss")
257
275
  };
258
276
  }, T = [
259
277
  {
@@ -262,7 +280,7 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
262
280
  meta: {
263
281
  textAlign: "right"
264
282
  },
265
- cell: ({ cell: e, row: t }) => E(ne, { row: t, data: e.getValue() })
283
+ cell: ({ cell: e, row: t }) => E(oe, { row: t, data: e.getValue() })
266
284
  },
267
285
  {
268
286
  accessorKey: "deviceType",
@@ -306,17 +324,17 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
306
324
  textAlign: "center"
307
325
  },
308
326
  cell: ({ row: e }) => {
309
- var m;
310
- const t = (m = n.value) == null ? void 0 : m.pageData().at(e.index);
311
- return E(ae, {
327
+ var u;
328
+ const t = (u = o.value) == null ? void 0 : u.pageData().at(e.index);
329
+ return E(re, {
312
330
  data: t,
313
331
  onLink: () => w(t._id),
314
- onUnlink: () => _(t._id),
315
- onEdit: () => b(t)
332
+ onUnlink: () => s(t._id),
333
+ onEdit: () => _(t)
316
334
  });
317
335
  }
318
336
  }
319
- ], u = [
337
+ ], p = [
320
338
  {
321
339
  label: "POS",
322
340
  value: "POS"
@@ -331,47 +349,47 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
331
349
  }
332
350
  ];
333
351
  return (e, t) => {
334
- const m = p("FmSearch"), C = p("FmSelect"), S = p("FmButton");
335
- return f(), g(G, {
352
+ const u = f("FmSearch"), k = f("FmSelect"), S = f("FmButton");
353
+ return g(), b(Q, {
336
354
  title: "Terminals",
337
355
  loading: !1
338
356
  }, {
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),
357
+ default: B(() => [
358
+ x("div", le, [
359
+ x("div", se, [
360
+ v(u, {
361
+ "model-value": m(i),
362
+ "onUpdate:modelValue": t[0] || (t[0] = (c) => P(i) ? i.value = c : null),
345
363
  class: "mr-8",
346
364
  label: "Search",
347
365
  placeholder: "Search Terminals ..."
348
366
  }, 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),
367
+ v(k, {
368
+ modelValue: m(r),
369
+ "onUpdate:modelValue": t[1] || (t[1] = (c) => P(r) ? r.value = c : null),
352
370
  class: "ml-6 w-[180px]",
353
371
  label: "Device",
354
- items: u
372
+ items: p
355
373
  }, null, 8, ["modelValue"])
356
374
  ]),
357
- h("div", se, [
358
- y(S, {
375
+ x("div", ce, [
376
+ v(S, {
359
377
  label: "Create",
360
378
  icon: "add",
361
- onClick: t[2] || (t[2] = () => b())
379
+ onClick: t[2] || (t[2] = () => _())
362
380
  })
363
381
  ])
364
382
  ]),
365
- y(Q, {
383
+ v(G, {
366
384
  ref_key: "controller",
367
- ref: n,
385
+ ref: o,
368
386
  "column-defs": T,
369
387
  "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({
388
+ paginate: (c, $) => m(A).read({ searchKey: m(i), deviceType: m(r), limit: c, cursor: $ }),
389
+ onRowClick: t[3] || (t[3] = (c) => m(a).push({
372
390
  name: "mf-payment-admin.terminal-setting",
373
391
  params: {
374
- terminalId: s._id
392
+ terminalId: c._id
375
393
  }
376
394
  }))
377
395
  }, null, 8, ["paginate"])
@@ -382,5 +400,5 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
382
400
  }
383
401
  });
384
402
  export {
385
- he as default
403
+ we as default
386
404
  };