@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,27 +1,28 @@
1
- import { defineComponent as g, resolveComponent as _, openBlock as y, createBlock as D, normalizeClass as Y, withCtx as x, createElementVNode as v, toDisplayString as $, createElementBlock as A, unref as d, createVNode as f, Fragment as L, renderList as B, ref as E, h as T, onMounted as U, watch as I, isRef as M } from "vue";
2
- import { t as b, a as G, b as k } from "./transaction-W49zE8RL.js";
3
- import { e as N, u as J } from "./index-1fXAFo2E.js";
4
- import { useSnackbar as Q, useDialog as j } from "@feedmepos/ui-library";
1
+ import { defineComponent as g, resolveComponent as _, openBlock as y, createBlock as D, normalizeClass as Y, withCtx as x, createElementVNode as T, toDisplayString as $, createElementBlock as A, unref as d, createVNode as f, Fragment as U, renderList as B, ref as E, h as b, onMounted as G, watch as I, isRef as q } from "vue";
2
+ import { t as w, a as J, b as M } from "./transaction-DGZWXzQ3.js";
3
+ import { e as N, u as Q } from "./index-1fXAFo2E.js";
4
+ import { useSnackbar as j, useDialog as z } from "@feedmepos/ui-library";
5
5
  import "./dinero-CIVmXLL-.js";
6
- import { h as R } from "./moment-h96o7c8I.js";
7
- import { g as z, a as H } from "./assets-8c19wXSV.js";
8
- import { _ as W } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
9
- import { u as X } from "./index-DdJrUqkm.js";
10
- import { _ as Z } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
11
- import { _ as ee } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
12
- import { w as q } from "./Modal-DB8M9o1T.js";
6
+ import { h as k } from "./moment-h96o7c8I.js";
7
+ import { g as H, a as W } from "./assets-8c19wXSV.js";
8
+ import { _ as X } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
9
+ import { u as Z } from "./index-DdJrUqkm.js";
10
+ import { _ as ee } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
11
+ import { _ as te } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
12
+ import { w as R } from "./Modal-DB8M9o1T.js";
13
13
  import { u as S } from "./error-K1CakhA9.js";
14
- import { _ as te } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
15
- const ae = /* @__PURE__ */ g({
14
+ import { _ as ae } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
15
+ import { g as ne } from "./grafana-CqkYm_ru.js";
16
+ const oe = /* @__PURE__ */ g({
16
17
  __name: "Status",
17
18
  props: {
18
19
  row: {},
19
20
  data: {}
20
21
  },
21
22
  setup(m) {
22
- const a = m;
23
+ const n = m;
23
24
  function o() {
24
- return a.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : a.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : a.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
25
+ return n.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
25
26
  }
26
27
  return (u, p) => {
27
28
  const s = _("FmBadge");
@@ -30,43 +31,43 @@ const ae = /* @__PURE__ */ g({
30
31
  class: Y(o())
31
32
  }, {
32
33
  default: x(() => [
33
- v("div", null, $(u.data), 1)
34
+ T("div", null, $(u.data), 1)
34
35
  ]),
35
36
  _: 1
36
37
  }, 8, ["class"]);
37
38
  };
38
39
  }
39
- }), ne = ["src"], oe = /* @__PURE__ */ g({
40
+ }), re = ["src"], se = /* @__PURE__ */ g({
40
41
  __name: "Gateway",
41
42
  props: {
42
43
  row: {},
43
44
  data: {}
44
45
  },
45
46
  setup(m) {
46
- return (a, o) => (y(), A("img", {
47
+ return (n, o) => (y(), A("img", {
47
48
  class: "rounded-md m-auto border-transparent object-contain w-[32px] h-[32px]",
48
- src: d(z)(a.row.original.gateway)
49
- }, null, 8, ne));
49
+ src: d(H)(n.row.original.gateway)
50
+ }, null, 8, re));
50
51
  }
51
- }), re = ["src"], se = /* @__PURE__ */ g({
52
+ }), ie = ["src"], ce = /* @__PURE__ */ g({
52
53
  __name: "Method",
53
54
  props: {
54
55
  row: {},
55
56
  data: {}
56
57
  },
57
58
  setup(m) {
58
- return (a, o) => (y(), A("img", {
59
+ return (n, o) => (y(), A("img", {
59
60
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
60
- src: d(H)(a.row.original.method.issuer)
61
- }, null, 8, re));
61
+ src: d(W)(n.row.original.method.issuer)
62
+ }, null, 8, ie));
62
63
  }
63
- }), ie = /* @__PURE__ */ g({
64
+ }), le = /* @__PURE__ */ g({
64
65
  __name: "Actions",
65
66
  props: {
66
67
  onAction: { type: Function }
67
68
  },
68
69
  setup(m) {
69
- const a = [
70
+ const n = [
70
71
  {
71
72
  label: "Query",
72
73
  sublabel: "Perform transaction status inquriy",
@@ -84,6 +85,12 @@ const ae = /* @__PURE__ */ g({
84
85
  sublabel: "Perform webhook notification for transaction",
85
86
  icon: "webhook",
86
87
  action: "notify"
88
+ },
89
+ {
90
+ label: "Log",
91
+ sublabel: "Inspect transaction historical actions, requests and responses.",
92
+ icon: "history",
93
+ action: "history"
87
94
  }
88
95
  ];
89
96
  return (o, u) => {
@@ -98,7 +105,7 @@ const ae = /* @__PURE__ */ g({
98
105
  f(p, { name: "settings" })
99
106
  ]),
100
107
  default: x(() => [
101
- (y(), A(L, null, B(a, (e) => f(s, {
108
+ (y(), A(U, null, B(n, (e) => f(s, {
102
109
  selectable: !0,
103
110
  key: e.label,
104
111
  sublabel: e.sublabel,
@@ -112,7 +119,7 @@ const ae = /* @__PURE__ */ g({
112
119
  ]);
113
120
  };
114
121
  }
115
- }), ce = /* @__PURE__ */ g({
122
+ }), ue = /* @__PURE__ */ g({
116
123
  __name: "TransactionTable",
117
124
  props: {
118
125
  data: {
@@ -124,13 +131,13 @@ const ae = /* @__PURE__ */ g({
124
131
  required: !0
125
132
  }
126
133
  },
127
- emits: ["query", "refund", "notify"],
128
- setup(m, { emit: a }) {
129
- const o = m, u = a, p = E(""), s = [
134
+ emits: ["query", "refund", "notify", "history"],
135
+ setup(m, { emit: n }) {
136
+ const o = m, u = n, p = E(""), s = [
130
137
  {
131
138
  header: () => "Transaction ID",
132
139
  accessorKey: "id",
133
- cell: ({ cell: r }) => T(W, { data: r.getValue() })
140
+ cell: ({ cell: r }) => b(X, { data: r.getValue() })
134
141
  },
135
142
  {
136
143
  header: () => "Pay ID",
@@ -142,7 +149,7 @@ const ae = /* @__PURE__ */ g({
142
149
  meta: {
143
150
  textAlign: "center"
144
151
  },
145
- cell: ({ cell: r, row: e }) => e.original.method ? T(oe, { row: e, data: r.getValue() }) : ""
152
+ cell: ({ cell: r, row: e }) => e.original.method ? b(se, { row: e, data: r.getValue() }) : ""
146
153
  },
147
154
  {
148
155
  header: () => "Method",
@@ -150,7 +157,7 @@ const ae = /* @__PURE__ */ g({
150
157
  meta: {
151
158
  textAlign: "center"
152
159
  },
153
- cell: ({ cell: r, row: e }) => e.original.method ? T(se, { row: e, data: r.getValue() }) : ""
160
+ cell: ({ cell: r, row: e }) => e.original.method ? b(ce, { row: e, data: r.getValue() }) : ""
154
161
  },
155
162
  {
156
163
  header: () => "Type",
@@ -168,7 +175,7 @@ const ae = /* @__PURE__ */ g({
168
175
  {
169
176
  header: () => "Status",
170
177
  accessorKey: "status",
171
- cell: ({ cell: r, row: e }) => T(ae, { row: e, data: r.getValue() })
178
+ cell: ({ cell: r, row: e }) => b(oe, { row: e, data: r.getValue() })
172
179
  },
173
180
  {
174
181
  header: () => "Transaction At",
@@ -192,73 +199,73 @@ const ae = /* @__PURE__ */ g({
192
199
  {
193
200
  header: () => "Actions",
194
201
  accessorKey: "actions",
195
- cell: ({ row: r }) => T(ie, {
202
+ cell: ({ row: r }) => b(le, {
196
203
  onAction: (e) => u(e, r.index)
197
204
  })
198
205
  }
199
206
  ];
200
207
  return (r, e) => {
201
- const l = _("FmTable");
202
- return y(), D(l, {
208
+ const c = _("FmTable");
209
+ return y(), D(c, {
203
210
  modelValue: p.value,
204
- "onUpdate:modelValue": e[0] || (e[0] = (w) => p.value = w),
211
+ "onUpdate:modelValue": e[0] || (e[0] = (v) => p.value = v),
205
212
  "column-defs": s,
206
213
  "row-data": o.data,
207
214
  loading: o.loading
208
215
  }, null, 8, ["modelValue", "row-data", "loading"]);
209
216
  };
210
217
  }
211
- }), le = { class: "flex justify-between mb-6 items-center" }, ue = { class: "flex space-x-4" }, de = { class: "flex space-x-4 self-center" }, me = { class: "mb-6" }, Ne = /* @__PURE__ */ g({
218
+ }), de = { class: "flex justify-between mb-6 items-center" }, me = { class: "flex space-x-4" }, pe = { class: "flex space-x-4 self-center" }, fe = { class: "mb-6" }, De = /* @__PURE__ */ g({
212
219
  __name: "Transaction",
213
220
  setup(m) {
214
- const { dateRange: a, searchKey: o } = X({
221
+ const { dateRange: n, searchKey: o } = Z({
215
222
  searchKey: "",
216
223
  dateRange: {
217
- startDate: R().startOf("day").format("YYYY-MM-DD"),
218
- endDate: R().endOf("day").format("YYYY-MM-DD")
224
+ startDate: k().startOf("day").format("YYYY-MM-DD"),
225
+ endDate: k().endOf("day").format("YYYY-MM-DD")
219
226
  }
220
- }), { isLoading: u, startAsyncCall: p } = J(!0), s = Q(), r = j(), e = E([]), l = E([]);
221
- async function w() {
227
+ }), { isLoading: u, startAsyncCall: p } = Q(!0), s = j(), r = z(), e = E([]), c = E([]);
228
+ async function v() {
222
229
  await p(async () => {
223
- const { startDate: i, endDate: t } = a.value, n = await b.readTransactions({
230
+ const { startDate: i, endDate: t } = n.value, a = await w.readTransactions({
224
231
  start: i,
225
232
  end: t
226
233
  });
227
- if (e.value = G(n), l.value = e.value, o.value > "") {
228
- var c = new RegExp(o.value, "i");
229
- l.value = e.value.filter((h) => {
234
+ if (e.value = J(a), c.value = e.value, o.value > "") {
235
+ var l = new RegExp(o.value, "i");
236
+ c.value = e.value.filter((h) => {
230
237
  const C = JSON.stringify(h);
231
- return c.test(C);
238
+ return l.test(C);
232
239
  });
233
240
  }
234
241
  });
235
242
  }
236
243
  function K() {
237
- w();
244
+ v();
238
245
  }
239
- U(K), I(a, w);
246
+ G(K), I(n, v);
240
247
  let F;
241
248
  I(o, async () => {
242
249
  F && clearTimeout(F), F = setTimeout(() => {
243
250
  var i = new RegExp(o.value, "i");
244
- l.value = e.value.filter((t) => {
245
- const n = JSON.stringify(t);
246
- return i.test(n);
251
+ c.value = e.value.filter((t) => {
252
+ const a = JSON.stringify(t);
253
+ return i.test(a);
247
254
  });
248
255
  }, 700);
249
256
  }), I(e, async () => {
250
257
  let i = e.value;
251
258
  if (o.value) {
252
259
  var t = new RegExp(o.value, "i");
253
- i = e.value.filter((n) => {
254
- const c = JSON.stringify(n);
255
- return t.test(c);
260
+ i = e.value.filter((a) => {
261
+ const l = JSON.stringify(a);
262
+ return t.test(l);
256
263
  });
257
264
  }
258
- l.value = i;
265
+ c.value = i;
259
266
  }, { deep: !0 });
260
267
  async function O(i) {
261
- const t = l.value.at(i);
268
+ const t = c.value.at(i);
262
269
  if (!t) {
263
270
  s.open({
264
271
  type: "error",
@@ -268,21 +275,21 @@ const ae = /* @__PURE__ */ g({
268
275
  return;
269
276
  }
270
277
  try {
271
- const n = await b.refetchTransaction({ transactionId: t.id }), c = e.value.findIndex((h) => h.id === n._id);
272
- e.value[c] = k(n), s.open({
278
+ const a = await w.refetchTransaction({ transactionId: t.id }), l = e.value.findIndex((h) => h.id === a._id);
279
+ e.value[l] = M(a), s.open({
273
280
  type: "success",
274
281
  title: "Transaction queried and updated successfully."
275
282
  });
276
- } catch (n) {
283
+ } catch (a) {
277
284
  s.open({
278
285
  type: "error",
279
286
  title: "Fail to query transaction.",
280
- message: S(n)
287
+ message: S(a)
281
288
  });
282
289
  }
283
290
  }
284
291
  async function V(i) {
285
- const t = l.value.at(i);
292
+ const t = c.value.at(i);
286
293
  if (!t) {
287
294
  s.open({
288
295
  type: "error",
@@ -291,33 +298,33 @@ const ae = /* @__PURE__ */ g({
291
298
  });
292
299
  return;
293
300
  }
294
- q(
301
+ R(
295
302
  r,
296
303
  "Refund Transaction",
297
304
  "Are you sure to refund transaction? This action cannot be revert!",
298
305
  async () => {
299
306
  try {
300
- const n = await b.refundTransaction({
307
+ const a = await w.refundTransaction({
301
308
  transactionId: t.id,
302
309
  reason: "portal transaction refund",
303
310
  amount: t.fdoAmount
304
- }), c = e.value.findIndex((h) => h.id === n._id);
305
- e.value[c] = k(n), s.open({
311
+ }), l = e.value.findIndex((h) => h.id === a._id);
312
+ e.value[l] = M(a), s.open({
306
313
  type: "success",
307
314
  title: "Transaction refund request initiated."
308
315
  });
309
- } catch (n) {
316
+ } catch (a) {
310
317
  s.open({
311
318
  type: "error",
312
319
  title: "Fail to request refund transaction.",
313
- message: S(n)
320
+ message: S(a)
314
321
  });
315
322
  }
316
323
  }
317
324
  );
318
325
  }
319
- async function P(i) {
320
- const t = l.value.at(i);
326
+ async function L(i) {
327
+ const t = c.value.at(i);
321
328
  if (!t) {
322
329
  s.open({
323
330
  type: "error",
@@ -326,71 +333,91 @@ const ae = /* @__PURE__ */ g({
326
333
  });
327
334
  return;
328
335
  }
329
- q(
336
+ R(
330
337
  r,
331
338
  "Notify Transaction",
332
339
  "Are you sure to perform notify transaction?",
333
340
  async () => {
334
341
  try {
335
- await b.renotifyTransaction(t.id), s.open({
342
+ await w.renotifyTransaction(t.id), s.open({
336
343
  type: "success",
337
344
  title: "Transaction notify successfully."
338
345
  });
339
- } catch (n) {
346
+ } catch (a) {
340
347
  s.open({
341
348
  type: "error",
342
349
  title: "Fail to notify transaction.",
343
- message: S(n)
350
+ message: S(a)
344
351
  });
345
352
  }
346
353
  }
347
354
  );
348
355
  }
356
+ async function P(i) {
357
+ const t = c.value.at(i);
358
+ if (!t) {
359
+ s.open({
360
+ type: "error",
361
+ title: "Something went wrong",
362
+ message: "Fail to find transactions from the displayed transactions."
363
+ });
364
+ return;
365
+ }
366
+ const a = ne([
367
+ {
368
+ type: "span",
369
+ queryKey: "transaction.id",
370
+ queryValue: t.id
371
+ }
372
+ ], t.createdAt);
373
+ window.open(a, "_blank");
374
+ }
349
375
  return (i, t) => {
350
- const n = _("FmSearch");
351
- return y(), D(Z, {
376
+ const a = _("FmSearch");
377
+ return y(), D(ee, {
352
378
  title: "Online Transactions",
353
379
  loading: d(u)
354
380
  }, {
355
381
  default: x(() => [
356
- v("div", le, [
357
- v("div", ue, [
358
- f(n, {
382
+ T("div", de, [
383
+ T("div", me, [
384
+ f(a, {
359
385
  "model-value": d(o),
360
- "onUpdate:modelValue": t[0] || (t[0] = (c) => M(o) ? o.value = c : null),
386
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => q(o) ? o.value = l : null),
361
387
  class: "mr-8",
362
388
  label: "Search",
363
389
  placeholder: "Search Transactions ..."
364
390
  }, null, 8, ["model-value"])
365
391
  ]),
366
- v("div", de, [
367
- f(ee, {
392
+ T("div", pe, [
393
+ f(te, {
368
394
  button: {
369
395
  appendIcon: "file_download",
370
396
  variant: "primary",
371
397
  label: "Export"
372
398
  },
373
399
  handler: async () => {
374
- await d(b).downloadTransactionReport({
375
- start: d(a).startDate,
376
- end: d(a).endDate
400
+ await d(w).downloadTransactionReport({
401
+ start: d(n).startDate,
402
+ end: d(n).endDate
377
403
  });
378
404
  }
379
405
  }, null, 8, ["handler"])
380
406
  ])
381
407
  ]),
382
- v("div", me, [
383
- f(te, {
384
- modelValue: d(a),
385
- "onUpdate:modelValue": t[1] || (t[1] = (c) => M(a) ? a.value = c : null)
408
+ T("div", fe, [
409
+ f(ae, {
410
+ modelValue: d(n),
411
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => q(n) ? n.value = l : null)
386
412
  }, null, 8, ["modelValue"])
387
413
  ]),
388
- f(ce, {
414
+ f(ue, {
389
415
  loading: d(u),
390
- data: l.value,
416
+ data: c.value,
391
417
  onQuery: O,
392
418
  onRefund: V,
393
- onNotify: P
419
+ onNotify: L,
420
+ onHistory: P
394
421
  }, null, 8, ["loading", "data"])
395
422
  ]),
396
423
  _: 1
@@ -399,5 +426,5 @@ const ae = /* @__PURE__ */ g({
399
426
  }
400
427
  });
401
428
  export {
402
- Ne as default
429
+ De as default
403
430
  };