@feedmepos/mf-payment 1.1.0-beta.1 → 1.1.0-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 (37) hide show
  1. package/dist/{PayoutAccount-BHJpjUqD.js → PayoutAccount-BpMu58oE.js} +5 -5
  2. package/dist/{PayoutAccount-DCkf_1yL.js → PayoutAccount-z-gdodfR.js} +360 -360
  3. package/dist/{PayoutAccountSetting-Bk-g7ucZ.js → PayoutAccountSetting-jZJu4WWL.js} +3 -3
  4. package/dist/{Restaurant-D2qq84VL.js → Restaurant-DfBX5uPS.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-KPtRoif-.js} +3 -3
  7. package/dist/{Settlement-Cx1tc5wt.js → Settlement-DbMQAA0_.js} +3 -3
  8. package/dist/Settlement-smC2PDKA.js +445 -0
  9. package/dist/{SettlementTransactions-C82DyYlO.js → SettlementTransactions-Bs8Il-GO.js} +3 -3
  10. package/dist/SettlementTransactions-Cw9DnODr.js +291 -0
  11. package/dist/{Terminal-Az2k8E6F.js → Terminal-HLOGtr0x.js} +5 -5
  12. package/dist/{TerminalSetting-C-xlLYXa.js → TerminalSetting-DraCszpQ.js} +3 -3
  13. package/dist/Transaction-B8cHQbbP.js +250 -0
  14. package/dist/{Transaction-Y_mc0yQv.js → Transaction-_CB4VTT9.js} +5 -5
  15. package/dist/TransactionOld-BhzUSu5h.js +99 -0
  16. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-dwwesT4_.js → TransactionTable.vue_vue_type_script_setup_true_lang-UcnQKwQ5.js} +87 -87
  17. package/dist/{app-OBp4HaEY.js → app-DWRPKvx2.js} +721 -448
  18. package/dist/app.d.ts +278 -0
  19. package/dist/app.js +4 -3
  20. package/dist/{assets-pLBp82yE.js → assets-BImh8bhR.js} +1 -1
  21. package/dist/{grafana-hv7inD36.js → grafana-CPOGSE20.js} +1 -1
  22. package/dist/{index-1xF00w89.js → index-8eCaI4jI.js} +1 -1
  23. package/dist/{index-DGKxdJVj.js → index-CNZFZxie.js} +1 -1
  24. package/dist/{index-DD5mEX0D.js → index-D5DlMaeB.js} +1 -1
  25. package/dist/{index-oM4Z9ffu.js → index-DtT3I2PI.js} +1 -1
  26. package/dist/{index-Cqq3p9PP.js → index-DuSw-EaU.js} +1 -1
  27. package/dist/{index-CFYD8Dv4.js → index-eznEOmAe.js} +1 -1
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-C9tnqgzY.js → index.vue_vue_type_script_setup_true_lang-DNXWZt8k.js} +1 -1
  29. package/dist/package.json +8 -7
  30. package/dist/{payout-account-DPaS3dIs.js → payout-account-CjDkY3wf.js} +2 -2
  31. package/dist/tsconfig.app.tsbuildinfo +1 -1
  32. package/package.json +8 -7
  33. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-p4qddIbp.js +0 -33
  34. package/dist/Settlement-BVIsszEJ.js +0 -447
  35. package/dist/SettlementTransactions-CeN4SRWa.js +0 -291
  36. package/dist/Transaction-CC8hc8_r.js +0 -250
  37. 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-BImh8bhR.js";
3
+ import { u as $ } from "./index-CNZFZxie.js";
4
+ import { _ as N } from "./TransactionTable.vue_vue_type_script_setup_true_lang-UcnQKwQ5.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-8eCaI4jI.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 y, normalizeClass as v, withCtx as f, 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 L, a as $, t as b, c as N } from "./assets-BImh8bhR.js";
4
+ import { e as h } from "./index-CNZFZxie.js";
5
+ import { g as G } from "./grafana-CPOGSE20.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
22
  return l(), y(u, {
23
23
  inline: "",
24
- class: M(a())
24
+ class: v(o())
25
25
  }, {
26
26
  default: f(() => [
27
- x("div", null, D(i.data), 1)
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(L)(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
54
  return l(), y(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
60
  default: f(() => [
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($)(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,11 +100,11 @@ 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, {
@@ -112,13 +112,13 @@ const O = /* @__PURE__ */ m({
112
112
  I(s, { name: "settings" })
113
113
  ]),
114
114
  default: f(() => [
115
- (l(!0), A(P, null, v(n.filter((o) => !!o), (o) => (l(), y(u, {
115
+ (l(!0), w(R, null, V(a.filter((n) => !!n), (n) => (l(), y(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
+ }), st = /* @__PURE__ */ m({
130
130
  __name: "TransactionTable",
131
131
  props: {
132
132
  data: {
@@ -139,166 +139,166 @@ 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(e) {
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 t = await b.refetchTransaction({ transactionId: e.id });
148
+ o.data.map((c) => c.id === t._id ? N(t) : c), s.open({
149
149
  type: "success",
150
150
  title: "Transaction queried and updated successfully."
151
151
  });
152
- } catch (e) {
152
+ } catch (t) {
153
153
  s.open({
154
154
  type: "error",
155
155
  title: "Fail to query transaction.",
156
- message: T(e)
156
+ message: T(t)
157
157
  });
158
158
  }
159
159
  }
160
- async function E(t) {
160
+ async function C(e) {
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({
168
- transactionId: t.id,
167
+ const t = await b.refundTransaction({
168
+ transactionId: e.id,
169
169
  reason: "portal transaction refund",
170
- amount: t.fdoAmount
170
+ amount: e.fdoAmount
171
171
  });
172
- a.data.map((c) => c.id === e._id ? N(e) : c), s.open({
172
+ o.data.map((c) => c.id === t._id ? N(t) : c), s.open({
173
173
  type: "success",
174
174
  title: "Transaction refund request initiated."
175
175
  });
176
- } catch (e) {
176
+ } catch (t) {
177
177
  s.open({
178
178
  type: "error",
179
179
  title: "Fail to request refund transaction.",
180
- message: T(e)
180
+ message: T(t)
181
181
  });
182
182
  }
183
183
  }
184
184
  );
185
185
  }
186
- async function C(t) {
186
+ async function K(e) {
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(e.id), s.open({
194
194
  type: "success",
195
195
  title: "Transaction notify successfully."
196
196
  });
197
- } catch (e) {
197
+ } catch (t) {
198
198
  s.open({
199
199
  type: "error",
200
200
  title: "Fail to notify transaction.",
201
- message: T(e)
201
+ message: T(t)
202
202
  });
203
203
  }
204
204
  }
205
205
  );
206
206
  }
207
- async function K(t) {
208
- const e = L([
207
+ async function M(e) {
208
+ const t = G([
209
209
  {
210
210
  type: "span",
211
211
  queryKey: "transaction.id",
212
- queryValue: t.id
212
+ queryValue: e.id
213
213
  }
214
- ], t.transactionAt);
215
- window.open(e, "_blank");
214
+ ], e.transactionAt);
215
+ window.open(t, "_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: e, row: t }) => t.original.method ? p(Q, { row: t, data: e.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: e, row: t }) => t.original.method ? p(J, { row: t, data: e.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: e, row: t }) => p(j, { row: t, data: e.getValue() })
257
257
  },
258
258
  {
259
- header: () => "Transaction At",
259
+ header: () => n("transactions.table.transaction_at"),
260
260
  accessorKey: "transactionAt",
261
261
  meta: {
262
262
  width: "180px"
263
263
  },
264
- cell: ({ cell: t, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
264
+ cell: ({ cell: e, row: t }) => t.original.status === "REFUNDED" ? t.original.refundedAt : t.original.transactionAt
265
265
  },
266
266
  {
267
- header: () => "Sales Amount",
267
+ header: () => n("transactions.table.sales_amount"),
268
268
  accessorKey: "amount"
269
269
  }
270
270
  ];
271
271
  return (q = g.value) != null && q.isInternal && F.push({
272
- header: () => "Actions",
272
+ header: () => n("transactions.table.actions"),
273
273
  accessorKey: "actions",
274
- cell: ({ row: t }) => p(H, {
275
- transaction: t.original,
276
- onAction: (e) => {
277
- switch (e) {
274
+ cell: ({ row: e }) => p(W, {
275
+ transaction: e.original,
276
+ onAction: (t) => {
277
+ switch (t) {
278
278
  case "notify":
279
- return C(t.original);
279
+ return K(e.original);
280
280
  case "query":
281
- return o(t.original);
281
+ return S(e.original);
282
282
  case "refund":
283
- return E(t.original);
283
+ return C(e.original);
284
284
  case "history":
285
- return K(t.original);
285
+ return M(e.original);
286
286
  }
287
287
  }
288
288
  })
289
- }), (t, e) => {
289
+ }), (e, t) => {
290
290
  const c = d("FmTable");
291
291
  return l(), y(c, {
292
- modelValue: w.value,
293
- "onUpdate:modelValue": e[0] || (e[0] = (_) => w.value = _),
292
+ modelValue: A.value,
293
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => A.value = _),
294
294
  "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)))
295
+ "row-data": o.data,
296
+ loading: o.loading,
297
+ onRowClick: t[1] || (t[1] = (_) => i("row-click", o.data.at(_.index)))
298
298
  }, null, 8, ["modelValue", "row-data", "loading"]);
299
299
  };
300
300
  }
301
301
  });
302
302
  export {
303
- oe as _
303
+ st as _
304
304
  };