@feedmepos/mf-payment 1.1.19 → 1.1.20-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 (34) hide show
  1. package/dist/Forbidden-BvhtA1Ni.js +37 -0
  2. package/dist/{PayoutAccount-BrMo_bdc.js → PayoutAccount-DbVJmcOa.js} +6 -6
  3. package/dist/{PayoutAccount-ClQ35qju.js → PayoutAccount-DtxvkRZg.js} +28 -28
  4. package/dist/{PayoutAccountSetting-DBMWIQ6u.js → PayoutAccountSetting-DcbImWD5.js} +3 -3
  5. package/dist/{Restaurant-DudOcIKg.js → Restaurant-DrTIWONb.js} +4 -4
  6. package/dist/{RestaurantSetting-BJo_ixHt.js → RestaurantSetting-39Xu_7Bm.js} +3 -3
  7. package/dist/{Settlement-CAKn73UQ.js → Settlement-DuWPx6DN.js} +3 -3
  8. package/dist/{Settlement-CJdBUfbZ.js → Settlement-oCVhqcmP.js} +3 -3
  9. package/dist/{SettlementTransactions-BCzKxoIi.js → SettlementTransactions-B1N9DToN.js} +3 -3
  10. package/dist/{SettlementTransactions-pgo_qyD-.js → SettlementTransactions-BPEDOI4q.js} +3 -3
  11. package/dist/{Terminal-BGLOmnl_.js → Terminal-CHNjzVtT.js} +6 -6
  12. package/dist/{TerminalSetting-CiyAJdLj.js → TerminalSetting-BEP2XCkv.js} +28 -22
  13. package/dist/{Transaction-DwxmCKcG.js → Transaction-Bth0jDaE.js} +7 -7
  14. package/dist/{Transaction-qyJAJekb.js → Transaction-Cb15psyP.js} +147 -147
  15. package/dist/{TransactionOld-LES765mv.js → TransactionOld-BPnBP2cu.js} +4 -4
  16. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-BEHZCoq6.js → TransactionTable.vue_vue_type_script_setup_true_lang-BdPgL0W8.js} +57 -53
  17. package/dist/{app-YY9yj-vq.js → app-BfnnIbRB.js} +393 -377
  18. package/dist/app.js +1 -1
  19. package/dist/{assets-Bka69roC.js → assets-Bne2NJOR.js} +25 -22
  20. package/dist/{grafana-CZhYcWzi.js → grafana-DpsdWu10.js} +2 -2
  21. package/dist/{index-DSsEAgyG.js → index-B0zGQtbr.js} +1 -1
  22. package/dist/{index-CtbszYV4.js → index-B1EyQdUg.js} +1 -1
  23. package/dist/{index-F2ifB2oW.js → index-BJaJ2nSQ.js} +1 -1
  24. package/dist/{index-DIG1I3Ka.js → index-BSl3VmjZ.js} +1 -1
  25. package/dist/{index-CGg0eJIr.js → index-Bm2MGtsS.js} +1430 -1430
  26. package/dist/{index-BkOR4M1w.js → index-C5ARs2NW.js} +1 -1
  27. package/dist/{index-ZXI0wUjr.js → index-sQT526AQ.js} +2 -2
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-DMZricqL.js → index.vue_vue_type_script_setup_true_lang-CV3EXPH9.js} +19 -19
  29. package/dist/model/transaction.d.ts +2 -0
  30. package/dist/package.json +1 -1
  31. package/dist/{payout-account-9HPKjwEG.js → payout-account-CX7Sx9yz.js} +3 -3
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/views/Forbidden.vue.d.ts +2 -0
  34. package/package.json +1 -1
@@ -1,8 +1,8 @@
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 q, Fragment as R, renderList as V, ref as D, h as p } from "vue";
1
+ import { defineComponent as m, resolveComponent as d, openBlock as l, createBlock as g, normalizeClass as M, withCtx as f, createElementVNode as x, toDisplayString as D, createElementBlock as w, unref as E, createVNode as I, Fragment as P, renderList as R, ref as V, h as y } from "vue";
2
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-Bka69roC.js";
4
- import { e as h } from "./index-CGg0eJIr.js";
5
- import { g as G } from "./grafana-CZhYcWzi.js";
3
+ import { g as $, a as L, t as b, c as N } from "./assets-Bne2NJOR.js";
4
+ import { e as h } from "./index-Bm2MGtsS.js";
5
+ import { g as G } from "./grafana-DpsdWu10.js";
6
6
  import { w as k } from "./Modal-DB8M9o1T.js";
7
7
  import { u as T } from "./error-K1CakhA9.js";
8
8
  import { useCoreStore as O, useI18n as Y } from "@feedmepos/mf-common";
@@ -12,19 +12,19 @@ const j = /* @__PURE__ */ m({
12
12
  row: {},
13
13
  data: {}
14
14
  },
15
- setup(o) {
16
- const n = o;
15
+ setup(s) {
16
+ const n = s;
17
17
  function r() {
18
18
  return n.data === h.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === h.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.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
- return (i, s) => {
20
+ return (c, i) => {
21
21
  const u = d("FmBadge");
22
- return l(), f(u, {
22
+ return l(), g(u, {
23
23
  inline: "",
24
- class: v(r())
24
+ class: M(r())
25
25
  }, {
26
- default: y(() => [
27
- x("div", null, P(i.data), 1)
26
+ default: f(() => [
27
+ x("div", null, D(c.data), 1)
28
28
  ]),
29
29
  _: 1
30
30
  }, 8, ["class"]);
@@ -36,7 +36,7 @@ const j = /* @__PURE__ */ m({
36
36
  row: {},
37
37
  data: {}
38
38
  },
39
- setup(o) {
39
+ setup(s) {
40
40
  return (n, r) => (l(), w("img", {
41
41
  class: "rounded-md m-auto border-transparent object-contain w-[32px] h-[32px]",
42
42
  src: E($)(n.row.original.gateway)
@@ -48,16 +48,16 @@ const j = /* @__PURE__ */ m({
48
48
  row: {},
49
49
  data: {}
50
50
  },
51
- setup(o) {
51
+ setup(s) {
52
52
  return (n, r) => {
53
- const i = d("FmTooltip");
54
- return l(), f(i, {
53
+ const c = d("FmTooltip");
54
+ return l(), g(c, {
55
55
  variant: "plain",
56
56
  placement: "top",
57
57
  content: n.row.original.method.issuer,
58
58
  "hide-arrow": !0
59
59
  }, {
60
- default: y(() => [
60
+ default: f(() => [
61
61
  x("img", {
62
62
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
63
63
  src: E(L)(n.row.original.method.issuer, n.row.original.method.variant)
@@ -73,21 +73,21 @@ const j = /* @__PURE__ */ m({
73
73
  onAction: { type: Function },
74
74
  transaction: {}
75
75
  },
76
- setup(o) {
76
+ setup(s) {
77
77
  const n = [
78
- o.transaction.flags.query && {
78
+ s.transaction.flags.query && {
79
79
  label: "Query",
80
80
  sublabel: "Perform transaction status inquriy",
81
81
  icon: "question_answer",
82
82
  action: "query"
83
83
  },
84
- o.transaction.flags.refund && {
84
+ s.transaction.flags.refund && {
85
85
  label: "Refund",
86
86
  sublabel: "Perform transaction refund request",
87
87
  icon: "request_page",
88
88
  action: "refund"
89
89
  },
90
- o.transaction.flags.notify && {
90
+ s.transaction.flags.notify && {
91
91
  label: "Notify",
92
92
  sublabel: "Perform webhook notification for transaction",
93
93
  icon: "webhook",
@@ -100,19 +100,19 @@ const j = /* @__PURE__ */ m({
100
100
  action: "history"
101
101
  }
102
102
  ];
103
- return (r, i) => {
104
- const s = d("FmIcon"), u = d("FmMenuItem"), g = d("FmMenu");
103
+ return (r, c) => {
104
+ const i = d("FmIcon"), u = d("FmMenuItem"), p = d("FmMenu");
105
105
  return l(), w("div", {
106
- onClick: i[0] || (i[0] = (a) => {
106
+ onClick: c[0] || (c[0] = (a) => {
107
107
  a.stopPropagation();
108
108
  })
109
109
  }, [
110
- q(g, null, {
111
- "menu-button": y(() => [
112
- q(s, { name: "settings" })
110
+ I(p, null, {
111
+ "menu-button": f(() => [
112
+ I(i, { name: "settings" })
113
113
  ]),
114
- default: y(() => [
115
- (l(!0), w(R, null, V(n.filter((a) => !!a), (a) => (l(), f(u, {
114
+ default: f(() => [
115
+ (l(!0), w(P, null, R(n.filter((a) => !!a), (a) => (l(), g(u, {
116
116
  selectable: !0,
117
117
  key: a.label,
118
118
  sublabel: a.sublabel,
@@ -139,25 +139,25 @@ const j = /* @__PURE__ */ m({
139
139
  }
140
140
  },
141
141
  emits: ["row-click"],
142
- setup(o, { emit: n }) {
143
- var I;
144
- const r = o, i = n, s = U(), u = B(), { sessionUser: g } = O(), { t: a } = Y();
145
- async function K(t) {
142
+ setup(s, { emit: n }) {
143
+ var q;
144
+ const r = s, c = n, i = U(), u = B(), { sessionUser: p } = O(), { t: a } = Y();
145
+ async function S(t) {
146
146
  try {
147
147
  const e = await b.refetchTransaction({ transactionId: t.id });
148
- r.data.map((c) => c.id === e._id ? N(e) : c), s.open({
148
+ r.data.map((o) => o.id === e._id ? N(e) : o), i.open({
149
149
  type: "success",
150
150
  title: "Transaction queried and updated successfully."
151
151
  });
152
152
  } catch (e) {
153
- s.open({
153
+ i.open({
154
154
  type: "error",
155
155
  title: "Fail to query transaction.",
156
156
  message: T(e)
157
157
  });
158
158
  }
159
159
  }
160
- async function S(t) {
160
+ async function K(t) {
161
161
  k(
162
162
  u,
163
163
  "Refund Transaction",
@@ -169,12 +169,12 @@ const j = /* @__PURE__ */ m({
169
169
  reason: "portal transaction refund",
170
170
  amount: t.fdoAmount
171
171
  });
172
- r.data.map((c) => c.id === e._id ? N(e) : c), s.open({
172
+ r.data.map((o) => o.id === e._id ? N(e) : o), i.open({
173
173
  type: "success",
174
174
  title: "Transaction refund request initiated."
175
175
  });
176
176
  } catch (e) {
177
- s.open({
177
+ i.open({
178
178
  type: "error",
179
179
  title: "Fail to request refund transaction.",
180
180
  message: T(e)
@@ -190,12 +190,12 @@ const j = /* @__PURE__ */ m({
190
190
  "Are you sure to perform notify transaction?",
191
191
  async () => {
192
192
  try {
193
- await b.renotifyTransaction(t.id), s.open({
193
+ await b.renotifyTransaction(t.id), i.open({
194
194
  type: "success",
195
195
  title: "Transaction notify successfully."
196
196
  });
197
197
  } catch (e) {
198
- s.open({
198
+ i.open({
199
199
  type: "error",
200
200
  title: "Fail to notify transaction.",
201
201
  message: T(e)
@@ -204,7 +204,7 @@ const j = /* @__PURE__ */ m({
204
204
  }
205
205
  );
206
206
  }
207
- async function M(t) {
207
+ async function v(t) {
208
208
  const e = G([
209
209
  {
210
210
  type: "span",
@@ -214,7 +214,7 @@ const j = /* @__PURE__ */ m({
214
214
  ], t.transactionAt);
215
215
  window.open(e, "_blank");
216
216
  }
217
- const A = D(""), F = [
217
+ const A = V(""), F = [
218
218
  {
219
219
  header: () => a("payment.transactions.table.id"),
220
220
  accessorKey: "id"
@@ -237,7 +237,7 @@ const j = /* @__PURE__ */ m({
237
237
  meta: {
238
238
  textAlign: "center"
239
239
  },
240
- cell: ({ cell: t, row: e }) => e.original.gateway ? p(Q, { row: e, data: t.getValue() }) : ""
240
+ cell: ({ cell: t, row: e }) => e.original.gateway ? y(Q, { row: e, data: t.getValue() }) : ""
241
241
  },
242
242
  {
243
243
  header: () => a("payment.transactions.table.method"),
@@ -245,7 +245,7 @@ const j = /* @__PURE__ */ m({
245
245
  meta: {
246
246
  textAlign: "center"
247
247
  },
248
- cell: ({ cell: t, row: e }) => e.original.method ? p(J, { row: e, data: t.getValue() }) : ""
248
+ cell: ({ cell: t, row: e }) => e.original.method ? y(J, { row: e, data: t.getValue() }) : ""
249
249
  },
250
250
  {
251
251
  header: () => a("payment.transactions.table.type"),
@@ -257,7 +257,7 @@ const j = /* @__PURE__ */ m({
257
257
  {
258
258
  header: () => a("payment.transactions.table.status"),
259
259
  accessorKey: "status",
260
- cell: ({ cell: t, row: e }) => p(j, { row: e, data: t.getValue() })
260
+ cell: ({ cell: t, row: e }) => y(j, { row: e, data: t.getValue() })
261
261
  },
262
262
  {
263
263
  header: () => a("payment.transactions.table.restaurant"),
@@ -278,36 +278,40 @@ const j = /* @__PURE__ */ m({
278
278
  },
279
279
  {
280
280
  header: () => a("payment.transactions.table.sales_amount"),
281
- accessorKey: "amount"
281
+ accessorKey: "amount",
282
+ cell: ({ cell: t, row: e }) => {
283
+ var o;
284
+ return (o = p.value) != null && o.role.isStaff && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount;
285
+ }
282
286
  }
283
287
  ];
284
- return (I = g.value) != null && I.isInternal && F.push({
288
+ return (q = p.value) != null && q.role.isStaff && F.push({
285
289
  header: () => a("payment.transactions.table.actions"),
286
290
  accessorKey: "actions",
287
- cell: ({ row: t }) => p(W, {
291
+ cell: ({ row: t }) => y(W, {
288
292
  transaction: t.original,
289
293
  onAction: (e) => {
290
294
  switch (e) {
291
295
  case "notify":
292
296
  return C(t.original);
293
297
  case "query":
294
- return K(t.original);
295
- case "refund":
296
298
  return S(t.original);
299
+ case "refund":
300
+ return K(t.original);
297
301
  case "history":
298
- return M(t.original);
302
+ return v(t.original);
299
303
  }
300
304
  }
301
305
  })
302
306
  }), (t, e) => {
303
- const c = d("FmTable");
304
- return l(), f(c, {
307
+ const o = d("FmTable");
308
+ return l(), g(o, {
305
309
  modelValue: A.value,
306
310
  "onUpdate:modelValue": e[0] || (e[0] = (_) => A.value = _),
307
311
  "column-defs": F,
308
312
  "row-data": r.data,
309
313
  loading: r.loading,
310
- onRowClick: e[1] || (e[1] = (_) => i("row-click", r.data.at(_.index)))
314
+ onRowClick: e[1] || (e[1] = (_) => c("row-click", r.data.at(_.index)))
311
315
  }, null, 8, ["modelValue", "row-data", "loading"]);
312
316
  };
313
317
  }