@feedmepos/mf-payment 1.1.0-beta.1 → 1.1.0-beta.3

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 (38) hide show
  1. package/dist/{PayoutAccount-BHJpjUqD.js → PayoutAccount-Dm__V5FS.js} +5 -5
  2. package/dist/{PayoutAccount-DCkf_1yL.js → PayoutAccount-aXUZqVC4.js} +360 -360
  3. package/dist/{PayoutAccountSetting-Bk-g7ucZ.js → PayoutAccountSetting-EbYjEXDF.js} +3 -3
  4. package/dist/{Restaurant-D2qq84VL.js → Restaurant-DLM9C8nc.js} +4 -4
  5. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-hJAJYKmE.js +33 -0
  6. package/dist/{RestaurantSetting-DAtrtX6S.js → RestaurantSetting-GoDOJmXC.js} +3 -3
  7. package/dist/{Settlement-Cx1tc5wt.js → Settlement-BCGCz02p.js} +3 -3
  8. package/dist/Settlement-CsLlypA1.js +445 -0
  9. package/dist/{SettlementTransactions-C82DyYlO.js → SettlementTransactions-BXDX1-4U.js} +3 -3
  10. package/dist/SettlementTransactions-DtbZ2BMA.js +291 -0
  11. package/dist/{Terminal-Az2k8E6F.js → Terminal-BhZitu-W.js} +5 -5
  12. package/dist/{TerminalSetting-C-xlLYXa.js → TerminalSetting-lTAsTN8h.js} +3 -3
  13. package/dist/{Transaction-Y_mc0yQv.js → Transaction-AwhwSbRY.js} +5 -5
  14. package/dist/Transaction-CCTdVAZg.js +250 -0
  15. package/dist/TransactionOld-DLjym0JG.js +99 -0
  16. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-dwwesT4_.js → TransactionTable.vue_vue_type_script_setup_true_lang-xSb40MKu.js} +83 -78
  17. package/dist/{app-OBp4HaEY.js → app-348rfspt.js} +936 -649
  18. package/dist/app.d.ts +292 -0
  19. package/dist/app.js +4 -3
  20. package/dist/{assets-pLBp82yE.js → assets-CizBCu1u.js} +57 -43
  21. package/dist/{grafana-hv7inD36.js → grafana-NU2yqPXT.js} +1 -1
  22. package/dist/{index-DD5mEX0D.js → index-BDCzfWFu.js} +1 -1
  23. package/dist/{index-oM4Z9ffu.js → index-D9Cv_ZfD.js} +1 -1
  24. package/dist/{index-DGKxdJVj.js → index-DEvTHjDK.js} +2812 -2814
  25. package/dist/{index-CFYD8Dv4.js → index-Dvg8rPAD.js} +1 -1
  26. package/dist/{index-Cqq3p9PP.js → index-GlBLcdqs.js} +1 -1
  27. package/dist/{index-1xF00w89.js → index-OD8n4-_f.js} +1 -1
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-C9tnqgzY.js → index.vue_vue_type_script_setup_true_lang-D-xbKBxe.js} +1 -1
  29. package/dist/model/transaction.d.ts +2 -0
  30. package/dist/package.json +8 -7
  31. package/dist/{payout-account-DPaS3dIs.js → payout-account-5sqoL9UC.js} +2 -2
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/package.json +8 -7
  34. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-p4qddIbp.js +0 -33
  35. package/dist/Settlement-BVIsszEJ.js +0 -447
  36. package/dist/SettlementTransactions-CeN4SRWa.js +0 -291
  37. package/dist/Transaction-CC8hc8_r.js +0 -250
  38. package/dist/TransactionOld-BxhI-wwm.js +0 -99
@@ -0,0 +1,99 @@
1
+ import { defineComponent as T, ref as h, onMounted as Y, watch as f, resolveComponent as V, openBlock as C, createBlock as M, unref as t, withCtx as O, createElementVNode as u, createVNode as i, isRef as y } from "vue";
2
+ import { t as g, b as S } from "./assets-CizBCu1u.js";
3
+ import { u as $ } from "./index-DEvTHjDK.js";
4
+ import { _ as N } from "./TransactionTable.vue_vue_type_script_setup_true_lang-xSb40MKu.js";
5
+ import { h as x } from "./moment-h96o7c8I.js";
6
+ import { useCoreStore as k, useI18n as E } from "@feedmepos/mf-common";
7
+ import { _ as L } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
8
+ import { u as P } from "./index-OD8n4-_f.js";
9
+ import { _ as A } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
10
+ import { _ as B } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-hJAJYKmE.js";
11
+ import { _ as F } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
12
+ const I = { class: "flex justify-between mb-6 items-center" }, J = { class: "flex space-x-8" }, K = { class: "flex space-x-4 self-center" }, U = { class: "mb-6" }, nt = /* @__PURE__ */ T({
13
+ __name: "TransactionOld",
14
+ setup(j) {
15
+ const { dateRange: n, searchKey: a } = P({
16
+ searchKey: "",
17
+ dateRange: {
18
+ startDate: x().startOf("day").format("YYYY-MM-DD"),
19
+ endDate: x().endOf("day").format("YYYY-MM-DD")
20
+ }
21
+ }), { isLoading: p, startAsyncCall: b } = $(!0), { currentRestaurant: w } = k(), { t: o } = E(), s = h([]), c = h([]);
22
+ async function _() {
23
+ await b(async () => {
24
+ const { startDate: d, endDate: e } = n.value, r = await g.readRestaurantTransactions({
25
+ start: d,
26
+ end: e
27
+ });
28
+ if (s.value = S(r), c.value = s.value, a.value > "") {
29
+ var l = new RegExp(a.value, "i");
30
+ c.value = s.value.filter((D) => {
31
+ const R = JSON.stringify(D);
32
+ return l.test(R);
33
+ });
34
+ }
35
+ });
36
+ }
37
+ function v() {
38
+ _();
39
+ }
40
+ Y(v), f(w, v), f(n, _);
41
+ let m;
42
+ return f(a, async () => {
43
+ m && clearTimeout(m), m = setTimeout(() => {
44
+ var d = new RegExp(a.value, "i");
45
+ c.value = s.value.filter((e) => {
46
+ const r = JSON.stringify(e);
47
+ return d.test(r);
48
+ });
49
+ }, 700);
50
+ }), (d, e) => {
51
+ const r = V("FmSearch");
52
+ return C(), M(L, {
53
+ title: t(o)("transactions.title"),
54
+ description: t(o)("transactions.description"),
55
+ loading: t(p)
56
+ }, {
57
+ default: O(() => [
58
+ u("div", I, [
59
+ u("div", J, [
60
+ i(B),
61
+ i(r, {
62
+ "model-value": t(a),
63
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => y(a) ? a.value = l : null),
64
+ label: t(o)("transactions.search.title"),
65
+ placeholder: t(o)("transactions.search.placeholder")
66
+ }, null, 8, ["model-value", "label", "placeholder"])
67
+ ]),
68
+ u("div", K, [
69
+ i(A, {
70
+ button: {
71
+ appendIcon: "file_download",
72
+ variant: "primary",
73
+ label: t(o)("transactions.button.export")
74
+ },
75
+ handler: async () => {
76
+ await t(g).downloadPortalTransactionReport(t(n), s.value);
77
+ }
78
+ }, null, 8, ["button", "handler"])
79
+ ])
80
+ ]),
81
+ u("div", U, [
82
+ i(F, {
83
+ modelValue: t(n),
84
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => y(n) ? n.value = l : null)
85
+ }, null, 8, ["modelValue"])
86
+ ]),
87
+ i(N, {
88
+ loading: t(p),
89
+ data: c.value
90
+ }, null, 8, ["loading", "data"])
91
+ ]),
92
+ _: 1
93
+ }, 8, ["title", "description", "loading"]);
94
+ };
95
+ }
96
+ });
97
+ export {
98
+ nt as default
99
+ };
@@ -1,80 +1,80 @@
1
- import { defineComponent as m, resolveComponent as d, openBlock as l, createBlock as y, normalizeClass as M, withCtx as f, createElementVNode as x, toDisplayString as D, createElementBlock as A, unref as S, createVNode as I, Fragment as P, renderList as v, ref as R, h as p } from "vue";
2
- import { useSnackbar as V, useDialog as B } from "@feedmepos/ui-library";
3
- import { g as U, a as G, t as h, c as N } from "./assets-pLBp82yE.js";
4
- import { e as b } from "./index-DGKxdJVj.js";
5
- import { g as L } from "./grafana-hv7inD36.js";
1
+ import { defineComponent as m, resolveComponent as d, openBlock as l, createBlock as f, normalizeClass as v, withCtx as y, createElementVNode as x, toDisplayString as P, createElementBlock as w, unref as E, createVNode as I, Fragment as R, renderList as V, ref as D, h as p } from "vue";
2
+ import { useSnackbar as U, useDialog as B } from "@feedmepos/ui-library";
3
+ import { g as $, a as L, t as b, c as N } from "./assets-CizBCu1u.js";
4
+ import { e as h } from "./index-DEvTHjDK.js";
5
+ import { g as G } from "./grafana-NU2yqPXT.js";
6
6
  import { w as k } from "./Modal-DB8M9o1T.js";
7
7
  import { u as T } from "./error-K1CakhA9.js";
8
- import { useCoreStore as $ } from "@feedmepos/mf-common";
9
- const O = /* @__PURE__ */ m({
8
+ import { useCoreStore as O, useI18n as Y } from "@feedmepos/mf-common";
9
+ const j = /* @__PURE__ */ m({
10
10
  __name: "Status",
11
11
  props: {
12
12
  row: {},
13
13
  data: {}
14
14
  },
15
15
  setup(r) {
16
- const n = r;
17
- function a() {
18
- return n.data === b.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === b.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.data === b.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
16
+ const a = r;
17
+ function o() {
18
+ return a.data === h.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : a.data === h.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : a.data === h.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
19
19
  }
20
20
  return (i, s) => {
21
21
  const u = d("FmBadge");
22
- return l(), y(u, {
22
+ return l(), f(u, {
23
23
  inline: "",
24
- class: M(a())
24
+ class: v(o())
25
25
  }, {
26
- default: f(() => [
27
- x("div", null, D(i.data), 1)
26
+ default: y(() => [
27
+ x("div", null, P(i.data), 1)
28
28
  ]),
29
29
  _: 1
30
30
  }, 8, ["class"]);
31
31
  };
32
32
  }
33
- }), Y = ["src"], j = /* @__PURE__ */ m({
33
+ }), z = ["src"], Q = /* @__PURE__ */ m({
34
34
  __name: "Gateway",
35
35
  props: {
36
36
  row: {},
37
37
  data: {}
38
38
  },
39
39
  setup(r) {
40
- return (n, a) => (l(), A("img", {
40
+ return (a, o) => (l(), w("img", {
41
41
  class: "rounded-md m-auto border-transparent object-contain w-[32px] h-[32px]",
42
- src: S(U)(n.row.original.gateway)
43
- }, null, 8, Y));
42
+ src: E($)(a.row.original.gateway)
43
+ }, null, 8, z));
44
44
  }
45
- }), z = ["src"], Q = /* @__PURE__ */ m({
45
+ }), H = ["src"], J = /* @__PURE__ */ m({
46
46
  __name: "Method",
47
47
  props: {
48
48
  row: {},
49
49
  data: {}
50
50
  },
51
51
  setup(r) {
52
- return (n, a) => {
52
+ return (a, o) => {
53
53
  const i = d("FmTooltip");
54
- return l(), y(i, {
54
+ return l(), f(i, {
55
55
  variant: "plain",
56
56
  placement: "top",
57
- content: n.row.original.method.issuer,
57
+ content: a.row.original.method.issuer,
58
58
  "hide-arrow": !0
59
59
  }, {
60
- default: f(() => [
60
+ default: y(() => [
61
61
  x("img", {
62
62
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
63
- src: S(G)(n.row.original.method.issuer, n.row.original.method.variant)
64
- }, null, 8, z)
63
+ src: E(L)(a.row.original.method.issuer, a.row.original.method.variant)
64
+ }, null, 8, H)
65
65
  ]),
66
66
  _: 1
67
67
  }, 8, ["content"]);
68
68
  };
69
69
  }
70
- }), H = /* @__PURE__ */ m({
70
+ }), W = /* @__PURE__ */ m({
71
71
  __name: "Actions",
72
72
  props: {
73
73
  onAction: { type: Function },
74
74
  transaction: {}
75
75
  },
76
76
  setup(r) {
77
- const n = [
77
+ const a = [
78
78
  r.transaction.flags.query && {
79
79
  label: "Query",
80
80
  sublabel: "Perform transaction status inquriy",
@@ -100,25 +100,25 @@ const O = /* @__PURE__ */ m({
100
100
  action: "history"
101
101
  }
102
102
  ];
103
- return (a, i) => {
103
+ return (o, i) => {
104
104
  const s = d("FmIcon"), u = d("FmMenuItem"), g = d("FmMenu");
105
- return l(), A("div", {
106
- onClick: i[0] || (i[0] = (o) => {
107
- o.stopPropagation();
105
+ return l(), w("div", {
106
+ onClick: i[0] || (i[0] = (n) => {
107
+ n.stopPropagation();
108
108
  })
109
109
  }, [
110
110
  I(g, null, {
111
- "menu-button": f(() => [
111
+ "menu-button": y(() => [
112
112
  I(s, { name: "settings" })
113
113
  ]),
114
- default: f(() => [
115
- (l(!0), A(P, null, v(n.filter((o) => !!o), (o) => (l(), y(u, {
114
+ default: y(() => [
115
+ (l(!0), w(R, null, V(a.filter((n) => !!n), (n) => (l(), f(u, {
116
116
  selectable: !0,
117
- key: o.label,
118
- sublabel: o.sublabel,
119
- label: o.label,
120
- icon: o.icon,
121
- onclick: () => a.onAction(o.action)
117
+ key: n.label,
118
+ sublabel: n.sublabel,
119
+ label: n.label,
120
+ icon: n.icon,
121
+ onclick: () => o.onAction(n.action)
122
122
  }, null, 8, ["sublabel", "label", "icon", "onclick"]))), 128))
123
123
  ]),
124
124
  _: 1
@@ -126,7 +126,7 @@ const O = /* @__PURE__ */ m({
126
126
  ]);
127
127
  };
128
128
  }
129
- }), oe = /* @__PURE__ */ m({
129
+ }), se = /* @__PURE__ */ m({
130
130
  __name: "TransactionTable",
131
131
  props: {
132
132
  data: {
@@ -139,13 +139,13 @@ const O = /* @__PURE__ */ m({
139
139
  }
140
140
  },
141
141
  emits: ["row-click"],
142
- setup(r, { emit: n }) {
142
+ setup(r, { emit: a }) {
143
143
  var q;
144
- const a = r, i = n, s = V(), u = B(), { sessionUser: g } = $();
145
- async function o(t) {
144
+ const o = r, i = a, s = U(), u = B(), { sessionUser: g } = O(), { t: n } = Y();
145
+ async function S(t) {
146
146
  try {
147
- const e = await h.refetchTransaction({ transactionId: t.id });
148
- a.data.map((c) => c.id === e._id ? N(e) : c), s.open({
147
+ const e = await b.refetchTransaction({ transactionId: t.id });
148
+ o.data.map((c) => c.id === e._id ? N(e) : c), s.open({
149
149
  type: "success",
150
150
  title: "Transaction queried and updated successfully."
151
151
  });
@@ -157,19 +157,19 @@ const O = /* @__PURE__ */ m({
157
157
  });
158
158
  }
159
159
  }
160
- async function E(t) {
160
+ async function C(t) {
161
161
  k(
162
162
  u,
163
163
  "Refund Transaction",
164
164
  "Are you sure to refund transaction? This action cannot be revert!",
165
165
  async () => {
166
166
  try {
167
- const e = await h.refundTransaction({
167
+ const e = await b.refundTransaction({
168
168
  transactionId: t.id,
169
169
  reason: "portal transaction refund",
170
170
  amount: t.fdoAmount
171
171
  });
172
- a.data.map((c) => c.id === e._id ? N(e) : c), s.open({
172
+ o.data.map((c) => c.id === e._id ? N(e) : c), s.open({
173
173
  type: "success",
174
174
  title: "Transaction refund request initiated."
175
175
  });
@@ -183,14 +183,14 @@ const O = /* @__PURE__ */ m({
183
183
  }
184
184
  );
185
185
  }
186
- async function C(t) {
186
+ async function K(t) {
187
187
  k(
188
188
  u,
189
189
  "Notify Transaction",
190
190
  "Are you sure to perform notify transaction?",
191
191
  async () => {
192
192
  try {
193
- await h.renotifyTransaction(t.id), s.open({
193
+ await b.renotifyTransaction(t.id), s.open({
194
194
  type: "success",
195
195
  title: "Transaction notify successfully."
196
196
  });
@@ -204,8 +204,8 @@ const O = /* @__PURE__ */ m({
204
204
  }
205
205
  );
206
206
  }
207
- async function K(t) {
208
- const e = L([
207
+ async function M(t) {
208
+ const e = G([
209
209
  {
210
210
  type: "span",
211
211
  queryKey: "transaction.id",
@@ -214,49 +214,54 @@ const O = /* @__PURE__ */ m({
214
214
  ], t.transactionAt);
215
215
  window.open(e, "_blank");
216
216
  }
217
- const w = R(""), F = [
217
+ const A = D(""), F = [
218
218
  {
219
- header: () => "Transaction ID",
219
+ header: () => n("transactions.table.id"),
220
220
  accessorKey: "id"
221
221
  },
222
222
  {
223
- header: () => "Pay ID",
223
+ header: () => n("transactions.table.pay_id"),
224
224
  accessorKey: "payId"
225
225
  },
226
226
  {
227
- header: () => "Bill Seq No",
227
+ header: () => n("transactions.table.bill_seq"),
228
228
  accessorKey: "seqNumber"
229
229
  },
230
230
  {
231
- header: () => "Gateway",
231
+ header: () => n("transactions.table.gateway"),
232
232
  accessorKey: "gateway",
233
233
  meta: {
234
234
  textAlign: "center"
235
235
  },
236
- cell: ({ cell: t, row: e }) => e.original.method ? p(j, { row: e, data: t.getValue() }) : ""
236
+ cell: ({ cell: t, row: e }) => e.original.method ? p(Q, { row: e, data: t.getValue() }) : ""
237
237
  },
238
238
  {
239
- header: () => "Method",
239
+ header: () => n("transactions.table.method"),
240
240
  accessorKey: "method",
241
241
  meta: {
242
242
  textAlign: "center"
243
243
  },
244
- cell: ({ cell: t, row: e }) => e.original.method ? p(Q, { row: e, data: t.getValue() }) : ""
244
+ cell: ({ cell: t, row: e }) => e.original.method ? p(J, { row: e, data: t.getValue() }) : ""
245
245
  },
246
246
  {
247
- header: () => "Type",
247
+ header: () => n("transactions.table.type"),
248
248
  accessorKey: "payFor",
249
249
  meta: {
250
250
  textAlign: "center"
251
251
  }
252
252
  },
253
253
  {
254
- header: () => "Status",
254
+ header: () => n("transactions.table.status"),
255
255
  accessorKey: "status",
256
- cell: ({ cell: t, row: e }) => p(O, { row: e, data: t.getValue() })
256
+ cell: ({ cell: t, row: e }) => p(j, { row: e, data: t.getValue() })
257
+ },
258
+ {
259
+ header: () => n("transactions.table.source"),
260
+ accessorKey: "source",
261
+ cell: ({ cell: t, row: e }) => `(${e.original.sourceType}) ${e.original.source}`
257
262
  },
258
263
  {
259
- header: () => "Transaction At",
264
+ header: () => n("transactions.table.transaction_at"),
260
265
  accessorKey: "transactionAt",
261
266
  meta: {
262
267
  width: "180px"
@@ -264,41 +269,41 @@ const O = /* @__PURE__ */ m({
264
269
  cell: ({ cell: t, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
265
270
  },
266
271
  {
267
- header: () => "Sales Amount",
272
+ header: () => n("transactions.table.sales_amount"),
268
273
  accessorKey: "amount"
269
274
  }
270
275
  ];
271
276
  return (q = g.value) != null && q.isInternal && F.push({
272
- header: () => "Actions",
277
+ header: () => n("transactions.table.actions"),
273
278
  accessorKey: "actions",
274
- cell: ({ row: t }) => p(H, {
279
+ cell: ({ row: t }) => p(W, {
275
280
  transaction: t.original,
276
281
  onAction: (e) => {
277
282
  switch (e) {
278
283
  case "notify":
279
- return C(t.original);
284
+ return K(t.original);
280
285
  case "query":
281
- return o(t.original);
286
+ return S(t.original);
282
287
  case "refund":
283
- return E(t.original);
288
+ return C(t.original);
284
289
  case "history":
285
- return K(t.original);
290
+ return M(t.original);
286
291
  }
287
292
  }
288
293
  })
289
294
  }), (t, e) => {
290
295
  const c = d("FmTable");
291
- return l(), y(c, {
292
- modelValue: w.value,
293
- "onUpdate:modelValue": e[0] || (e[0] = (_) => w.value = _),
296
+ return l(), f(c, {
297
+ modelValue: A.value,
298
+ "onUpdate:modelValue": e[0] || (e[0] = (_) => A.value = _),
294
299
  "column-defs": F,
295
- "row-data": a.data,
296
- loading: a.loading,
297
- onRowClick: e[1] || (e[1] = (_) => i("row-click", a.data.at(_.index)))
300
+ "row-data": o.data,
301
+ loading: o.loading,
302
+ onRowClick: e[1] || (e[1] = (_) => i("row-click", o.data.at(_.index)))
298
303
  }, null, 8, ["modelValue", "row-data", "loading"]);
299
304
  };
300
305
  }
301
306
  });
302
307
  export {
303
- oe as _
308
+ se as _
304
309
  };