@feedmepos/mf-payment 1.2.11 → 1.2.13

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 (44) hide show
  1. package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-XC4V0tsX.js +40 -0
  2. package/dist/{PayoutAccount-BPD8f21N.js → PayoutAccount-BallFJB0.js} +5 -5
  3. package/dist/{PayoutAccount-DLhT0cgm.js → PayoutAccount-d7sLsB5J.js} +6 -6
  4. package/dist/{PayoutAccountSetting-Cc2XkDvW.js → PayoutAccountSetting-wKE68NqB.js} +3 -3
  5. package/dist/{Restaurant-QmZ5m6aX.js → Restaurant-CA3nbrzh.js} +5 -5
  6. package/dist/{RestaurantSetting-D0GFUJAg.js → RestaurantSetting-CJdlyxX7.js} +3 -3
  7. package/dist/{Settlement-MJFzi4Zt.js → Settlement-BEXf60UK.js} +4 -4
  8. package/dist/{Settlement-BIk63DvT.js → Settlement-Cnbk9m6D.js} +4 -4
  9. package/dist/SettlementTransactions-D-lWN15V.js +362 -0
  10. package/dist/SettlementTransactions-Pto6c_3v.js +323 -0
  11. package/dist/{Terminal-DYkp1mv0.js → Terminal-B3S_wOTA.js} +5 -5
  12. package/dist/{TerminalSetting-DmPRtCsa.js → TerminalSetting-tSDETEOb.js} +3 -3
  13. package/dist/{Transaction-CimYTaB8.js → Transaction-BY4EF2Z2.js} +125 -94
  14. package/dist/{Transaction-Bh_Psoae.js → Transaction-DsYgbjyl.js} +7 -7
  15. package/dist/{TransactionOld-CiWIwxJ7.js → TransactionOld-BY_4OAOA.js} +4 -4
  16. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-2FzzyKdR.js → TransactionTable.vue_vue_type_script_setup_true_lang-C02jC4yj.js} +115 -93
  17. package/dist/{app-ByopJolk.js → app-BiKLWpiD.js} +347 -347
  18. package/dist/app.js +1 -1
  19. package/dist/{assets-DfdrUzgm.js → assets-C4cUIo0F.js} +3 -2
  20. package/dist/components/AutoCopyCell.vue.d.ts +1 -0
  21. package/dist/{grafana-ey8F5lgL.js → grafana-DRHro6WQ.js} +1 -1
  22. package/dist/{index-GqLxFyy5.js → index-0_vl4Euu.js} +1 -1
  23. package/dist/{index-tX_6kqCz.js → index-4QkP1zBY.js} +1 -1
  24. package/dist/{index-9HYkBEVP.js → index-BTIQHrH_.js} +1 -1
  25. package/dist/{index-D1HPnn1H.js → index-BWaS2Ice.js} +982 -982
  26. package/dist/{index-CxUSH_LL.js → index-Bohmvrj5.js} +1 -1
  27. package/dist/{index-DLoPHbRf.js → index-DJlXGssK.js} +1 -1
  28. package/dist/{index-C9mXyA-9.js → index-DeoktQzV.js} +2 -2
  29. package/dist/{index.vue_vue_type_script_setup_true_lang-xEGnd1Sr.js → index.vue_vue_type_script_setup_true_lang-wZFI0CDi.js} +1 -1
  30. package/dist/model/transaction.d.ts +1 -0
  31. package/dist/package.json +1 -1
  32. package/dist/{payout-account-B7N8ePXF.js → payout-account-CtfOQFPT.js} +3 -3
  33. package/dist/tsconfig.app.tsbuildinfo +1 -1
  34. package/dist/views/admin/settlement/cell/Gateway.vue.d.ts +1 -1
  35. package/dist/views/admin/settlement/cell/Method.vue.d.ts +1 -1
  36. package/dist/views/admin/transaction/cell/Gateway.vue.d.ts +1 -1
  37. package/dist/views/admin/transaction/cell/Method.vue.d.ts +1 -1
  38. package/dist/views/settlement/cell/Gateway.vue.d.ts +1 -1
  39. package/dist/views/settlement/cell/Method.vue.d.ts +1 -1
  40. package/dist/views/transaction/cell/Gateway.vue.d.ts +1 -1
  41. package/package.json +1 -1
  42. package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js +0 -39
  43. package/dist/SettlementTransactions-Diz_eig2.js +0 -336
  44. package/dist/SettlementTransactions-MBqrZMZx.js +0 -297
@@ -1,80 +1,93 @@
1
- import { defineComponent as p, resolveComponent as m, openBlock as u, createBlock as b, normalizeClass as R, withCtx as _, createElementVNode as S, toDisplayString as V, createElementBlock as A, unref as K, createVNode as N, Fragment as U, renderList as B, ref as k, watch as $, h as g } from "vue";
1
+ import { defineComponent as y, resolveComponent as d, openBlock as m, createBlock as f, normalizeClass as R, withCtx as p, createElementVNode as w, toDisplayString as V, unref as K, createElementBlock as N, createVNode as k, Fragment as U, renderList as B, ref as S, watch as $, h as b } from "vue";
2
2
  import { useSnackbar as L, useDialog as G } from "@feedmepos/ui-library";
3
- import { g as O, a as Y, t as h, c as x } from "./assets-DfdrUzgm.js";
4
- import { e as T } from "./index-D1HPnn1H.js";
5
- import { g as j } from "./grafana-ey8F5lgL.js";
3
+ import { g as O, a as Y, t as h, c as x } from "./assets-C4cUIo0F.js";
4
+ import { e as T } from "./index-BWaS2Ice.js";
5
+ import { g as z } from "./grafana-DRHro6WQ.js";
6
6
  import { w as E } from "./Modal-DB8M9o1T.js";
7
- import { u as w } from "./error-K1CakhA9.js";
8
- import { useCoreStore as z, useI18n as Q } from "@feedmepos/mf-common";
9
- const H = /* @__PURE__ */ p({
7
+ import { u as A } from "./error-K1CakhA9.js";
8
+ import { useCoreStore as Q, useI18n as j } from "@feedmepos/mf-common";
9
+ const H = /* @__PURE__ */ y({
10
10
  __name: "Status",
11
11
  props: {
12
12
  row: {},
13
13
  data: {}
14
14
  },
15
15
  setup(c) {
16
- const r = c;
16
+ const o = c;
17
17
  function l() {
18
- return r.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : r.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : r.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
18
+ return o.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : o.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : o.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
19
19
  }
20
- return (a, y) => {
21
- const s = m("FmBadge");
22
- return u(), b(s, {
20
+ return (n, g) => {
21
+ const i = d("FmBadge");
22
+ return m(), f(i, {
23
23
  inline: "",
24
24
  class: R(l())
25
25
  }, {
26
- default: _(() => [
27
- S("div", null, V(a.data), 1)
26
+ default: p(() => [
27
+ w("div", null, V(n.data), 1)
28
28
  ]),
29
29
  _: 1
30
30
  }, 8, ["class"]);
31
31
  };
32
32
  }
33
- }), J = ["src"], W = /* @__PURE__ */ p({
33
+ }), J = ["src"], W = /* @__PURE__ */ y({
34
34
  __name: "Gateway",
35
35
  props: {
36
36
  row: {},
37
37
  data: {}
38
38
  },
39
39
  setup(c) {
40
- return (r, l) => (u(), A("img", {
41
- class: "rounded-md m-auto border-transparent object-contain w-[32px] h-[32px]",
42
- src: K(O)(r.row.original.gateway)
43
- }, null, 8, J));
40
+ return (o, l) => {
41
+ const n = d("FmTooltip");
42
+ return m(), f(n, {
43
+ variant: "plain",
44
+ placement: "top",
45
+ content: o.row.original.gateway,
46
+ "hide-arrow": !0
47
+ }, {
48
+ default: p(() => [
49
+ w("img", {
50
+ class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
51
+ src: K(O)(o.row.original.gateway)
52
+ }, null, 8, J)
53
+ ]),
54
+ _: 1
55
+ }, 8, ["content"]);
56
+ };
44
57
  }
45
- }), X = ["src"], Z = /* @__PURE__ */ p({
58
+ }), X = ["src"], Z = /* @__PURE__ */ y({
46
59
  __name: "Method",
47
60
  props: {
48
61
  row: {},
49
62
  data: {}
50
63
  },
51
64
  setup(c) {
52
- return (r, l) => {
53
- const a = m("FmTooltip");
54
- return u(), b(a, {
65
+ return (o, l) => {
66
+ const n = d("FmTooltip");
67
+ return m(), f(n, {
55
68
  variant: "plain",
56
69
  placement: "top",
57
- content: r.row.original.method.issuer,
70
+ content: o.row.original.method.issuer,
58
71
  "hide-arrow": !0
59
72
  }, {
60
- default: _(() => [
61
- S("img", {
73
+ default: p(() => [
74
+ w("img", {
62
75
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
63
- src: K(Y)(r.row.original.method.issuer, r.row.original.method.variant)
76
+ src: K(Y)(o.row.original.method.issuer, o.row.original.method.variant)
64
77
  }, null, 8, X)
65
78
  ]),
66
79
  _: 1
67
80
  }, 8, ["content"]);
68
81
  };
69
82
  }
70
- }), ee = /* @__PURE__ */ p({
83
+ }), ee = /* @__PURE__ */ y({
71
84
  __name: "Actions",
72
85
  props: {
73
86
  onAction: { type: Function },
74
87
  transaction: {}
75
88
  },
76
89
  setup(c) {
77
- const r = [
90
+ const o = [
78
91
  c.transaction.flags.query && {
79
92
  label: "Query",
80
93
  sublabel: "Perform transaction status inquriy",
@@ -100,25 +113,25 @@ const H = /* @__PURE__ */ p({
100
113
  action: "history"
101
114
  }
102
115
  ];
103
- return (l, a) => {
104
- const y = m("FmIcon"), s = m("FmMenuItem"), f = m("FmMenu");
105
- return u(), A("div", {
106
- onClick: a[0] || (a[0] = (n) => {
107
- n.stopPropagation();
116
+ return (l, n) => {
117
+ const g = d("FmIcon"), i = d("FmMenuItem"), _ = d("FmMenu");
118
+ return m(), N("div", {
119
+ onClick: n[0] || (n[0] = (a) => {
120
+ a.stopPropagation();
108
121
  })
109
122
  }, [
110
- N(f, null, {
111
- "menu-button": _(() => [
112
- N(y, { name: "settings" })
123
+ k(_, null, {
124
+ "menu-button": p(() => [
125
+ k(g, { name: "settings" })
113
126
  ]),
114
- default: _(() => [
115
- (u(!0), A(U, null, B(r.filter((n) => !!n), (n) => (u(), b(s, {
127
+ default: p(() => [
128
+ (m(!0), N(U, null, B(o.filter((a) => !!a), (a) => (m(), f(i, {
116
129
  selectable: !0,
117
- key: n.label,
118
- sublabel: n.sublabel,
119
- label: n.label,
120
- icon: n.icon,
121
- onclick: () => l.onAction(n.action)
130
+ key: a.label,
131
+ sublabel: a.sublabel,
132
+ label: a.label,
133
+ icon: a.icon,
134
+ onclick: () => l.onAction(a.action)
122
135
  }, null, 8, ["sublabel", "label", "icon", "onclick"]))), 128))
123
136
  ]),
124
137
  _: 1
@@ -126,7 +139,7 @@ const H = /* @__PURE__ */ p({
126
139
  ]);
127
140
  };
128
141
  }
129
- }), le = /* @__PURE__ */ p({
142
+ }), le = /* @__PURE__ */ y({
130
143
  __name: "TransactionTable",
131
144
  props: {
132
145
  data: {
@@ -139,35 +152,35 @@ const H = /* @__PURE__ */ p({
139
152
  }
140
153
  },
141
154
  emits: ["row-click"],
142
- setup(c, { emit: r }) {
143
- var q, I;
144
- const l = c, a = k([...l.data]);
155
+ setup(c, { emit: o }) {
156
+ var I, q;
157
+ const l = c, n = S([...l.data]);
145
158
  $(
146
159
  () => l.data,
147
160
  (t) => {
148
- a.value = [...t];
161
+ n.value = [...t];
149
162
  },
150
163
  { deep: !0, immediate: !0 }
151
164
  );
152
- const y = r, s = L(), f = G(), { sessionUser: n } = z(), { t: o } = Q();
165
+ const g = o, i = L(), _ = G(), { sessionUser: a } = Q(), { t: s } = j();
153
166
  async function C(t) {
154
167
  try {
155
168
  const e = await h.refetchTransaction({ transactionId: t.id });
156
- a.value = a.value.map((i) => i.id === e._id ? x(e) : i), s.open({
169
+ n.value = n.value.map((r) => r.id === e._id ? x(e) : r), i.open({
157
170
  type: "success",
158
171
  title: "Transaction queried and updated successfully."
159
172
  });
160
173
  } catch (e) {
161
- s.open({
174
+ i.open({
162
175
  type: "error",
163
176
  title: "Fail to query transaction.",
164
- message: w(e)
177
+ message: A(e)
165
178
  });
166
179
  }
167
180
  }
168
- async function M(t) {
181
+ async function D(t) {
169
182
  E(
170
- f,
183
+ _,
171
184
  "Refund Transaction",
172
185
  "Are you sure to refund transaction? This action cannot be revert!",
173
186
  async () => {
@@ -177,43 +190,43 @@ const H = /* @__PURE__ */ p({
177
190
  reason: "portal transaction refund",
178
191
  amount: t.fdoAmount
179
192
  });
180
- a.value = a.value.map((i) => i.id === e._id ? x(e) : i), s.open({
193
+ n.value = n.value.map((r) => r.id === e._id ? x(e) : r), i.open({
181
194
  type: "success",
182
195
  title: "Transaction refund request initiated."
183
196
  });
184
197
  } catch (e) {
185
- s.open({
198
+ i.open({
186
199
  type: "error",
187
200
  title: "Fail to request refund transaction.",
188
- message: w(e)
201
+ message: A(e)
189
202
  });
190
203
  }
191
204
  }
192
205
  );
193
206
  }
194
- async function D(t) {
207
+ async function M(t) {
195
208
  E(
196
- f,
209
+ _,
197
210
  "Notify Transaction",
198
211
  "Are you sure to perform notify transaction?",
199
212
  async () => {
200
213
  try {
201
- await h.renotifyTransaction(t.id), s.open({
214
+ await h.renotifyTransaction(t.id), i.open({
202
215
  type: "success",
203
216
  title: "Transaction notify successfully."
204
217
  });
205
218
  } catch (e) {
206
- s.open({
219
+ i.open({
207
220
  type: "error",
208
221
  title: "Fail to notify transaction.",
209
- message: w(e)
222
+ message: A(e)
210
223
  });
211
224
  }
212
225
  }
213
226
  );
214
227
  }
215
228
  async function P(t) {
216
- const e = j([
229
+ const e = z([
217
230
  {
218
231
  type: "span",
219
232
  queryKey: "transaction.id",
@@ -222,62 +235,67 @@ const H = /* @__PURE__ */ p({
222
235
  ], t.transactionAt);
223
236
  window.open(e, "_blank");
224
237
  }
225
- const F = k(""), v = [
238
+ const F = S(""), v = [
226
239
  {
227
- header: () => o("payment.transactions.table.id"),
228
- accessorKey: "id"
240
+ header: () => s("payment.transactions.table.id"),
241
+ accessorKey: "id",
242
+ cell: ({ cell: t, row: e }) => {
243
+ var r, u;
244
+ return ((r = a.value) != null && r.role.isStaff || (u = a.value) != null && u.role.isAdmin) && e.original.id !== e.original.transactionId ? e.original.id + `
245
+ ID: ` + e.original.transactionId : e.original.id;
246
+ }
229
247
  },
230
248
  {
231
- header: () => o("payment.transactions.table.pay_id"),
249
+ header: () => s("payment.transactions.table.pay_id"),
232
250
  accessorKey: "payId"
233
251
  },
234
252
  {
235
- header: () => o("payment.transactions.table.gateway_id"),
253
+ header: () => s("payment.transactions.table.gateway_id"),
236
254
  accessorKey: "gatewayTransactionId"
237
255
  },
238
256
  {
239
- header: () => o("payment.transactions.table.bill_seq"),
257
+ header: () => s("payment.transactions.table.bill_seq"),
240
258
  accessorKey: "seqNumber"
241
259
  },
242
260
  {
243
- header: () => o("payment.transactions.table.gateway"),
261
+ header: () => s("payment.transactions.table.gateway"),
244
262
  accessorKey: "gateway",
245
263
  meta: {
246
264
  textAlign: "center"
247
265
  },
248
- cell: ({ cell: t, row: e }) => e.original.gateway ? g(W, { row: e, data: t.getValue() }) : ""
266
+ cell: ({ cell: t, row: e }) => e.original.gateway ? b(W, { row: e, data: t.getValue() }) : ""
249
267
  },
250
268
  {
251
- header: () => o("payment.transactions.table.method"),
269
+ header: () => s("payment.transactions.table.method"),
252
270
  accessorKey: "method",
253
271
  meta: {
254
272
  textAlign: "center"
255
273
  },
256
- cell: ({ cell: t, row: e }) => e.original.method ? g(Z, { row: e, data: t.getValue() }) : ""
274
+ cell: ({ cell: t, row: e }) => e.original.method ? b(Z, { row: e, data: t.getValue() }) : ""
257
275
  },
258
276
  {
259
- header: () => o("payment.transactions.table.type"),
277
+ header: () => s("payment.transactions.table.type"),
260
278
  accessorKey: "payFor",
261
279
  meta: {
262
280
  textAlign: "center"
263
281
  }
264
282
  },
265
283
  {
266
- header: () => o("payment.transactions.table.status"),
284
+ header: () => s("payment.transactions.table.status"),
267
285
  accessorKey: "status",
268
- cell: ({ cell: t, row: e }) => g(H, { row: e, data: t.getValue() })
286
+ cell: ({ cell: t, row: e }) => b(H, { row: e, data: t.getValue() })
269
287
  },
270
288
  {
271
- header: () => o("payment.transactions.table.restaurant"),
289
+ header: () => s("payment.transactions.table.restaurant"),
272
290
  accessorKey: "restaurantId"
273
291
  },
274
292
  {
275
- header: () => o("payment.transactions.table.source"),
293
+ header: () => s("payment.transactions.table.source"),
276
294
  accessorKey: "source",
277
295
  cell: ({ cell: t, row: e }) => `(${e.original.sourceType}) ${e.original.source}`
278
296
  },
279
297
  {
280
- header: () => o("payment.transactions.table.transaction_at"),
298
+ header: () => s("payment.transactions.table.transaction_at"),
281
299
  accessorKey: "transactionAt",
282
300
  meta: {
283
301
  width: "180px"
@@ -285,41 +303,45 @@ const H = /* @__PURE__ */ p({
285
303
  cell: ({ cell: t, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
286
304
  },
287
305
  {
288
- header: () => o("payment.transactions.table.sales_amount"),
306
+ header: () => s("payment.transactions.table.sales_amount"),
289
307
  accessorKey: "amount",
290
308
  cell: ({ cell: t, row: e }) => {
291
- var i, d;
292
- return ((i = n.value) != null && i.role.isStaff || (d = n.value) != null && d.role.isAdmin) && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount;
309
+ var r, u;
310
+ return ((r = a.value) != null && r.role.isStaff || (u = a.value) != null && u.role.isAdmin) && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount;
293
311
  }
294
312
  }
295
313
  ];
296
- return ((q = n.value) != null && q.role.isStaff || (I = n.value) != null && I.role.isAdmin) && v.push({
297
- header: () => o("payment.transactions.table.actions"),
314
+ return ((I = a.value) != null && I.role.isStaff || (q = a.value) != null && q.role.isAdmin) && v.push({
315
+ header: () => s("payment.transactions.table.actions"),
298
316
  accessorKey: "actions",
299
- cell: ({ row: t }) => g(ee, {
317
+ cell: ({ row: t }) => b(ee, {
300
318
  transaction: t.original,
301
319
  onAction: (e) => {
320
+ var r;
302
321
  switch (e) {
303
322
  case "notify":
304
- return D(t.original);
323
+ return M(t.original);
305
324
  case "query":
306
325
  return C(t.original);
307
326
  case "refund":
308
- return M(t.original);
327
+ return (r = a.value) != null && r.role.isStaff ? i.open({
328
+ type: "error",
329
+ title: "You are not allowed to refund transaction."
330
+ }) : D(t.original);
309
331
  case "history":
310
332
  return P(t.original);
311
333
  }
312
334
  }
313
335
  })
314
336
  }), (t, e) => {
315
- const i = m("FmTable");
316
- return u(), b(i, {
337
+ const r = d("FmTable");
338
+ return m(), f(r, {
317
339
  modelValue: F.value,
318
- "onUpdate:modelValue": e[0] || (e[0] = (d) => F.value = d),
340
+ "onUpdate:modelValue": e[0] || (e[0] = (u) => F.value = u),
319
341
  "column-defs": v,
320
- "row-data": a.value,
342
+ "row-data": n.value,
321
343
  loading: l.loading,
322
- onRowClick: e[1] || (e[1] = (d) => y("row-click", a.value.at(d.index)))
344
+ onRowClick: e[1] || (e[1] = (u) => g("row-click", n.value.at(u.index)))
323
345
  }, null, 8, ["modelValue", "row-data", "loading"]);
324
346
  };
325
347
  }