@feedmepos/mf-payment 1.5.77 → 1.5.78-dev

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 (119) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-D_PoXVbz.js → Actions.vue_vue_type_script_setup_true_lang-CkOYpI0o.js} +1 -1
  2. package/dist/{Chargeback-CzwL8PJv.js → Chargeback-C5vvqZPC.js} +7 -7
  3. package/dist/{DateRangePicker.vue_vue_type_script_setup_true_lang-CDjdQf-E.js → DateRangePicker.vue_vue_type_script_setup_true_lang-BNVnvrVY.js} +1 -1
  4. package/dist/{no-data-BRmo6XOO.js → DocumentViewer.vue_vue_type_script_setup_true_lang-DF7Bz7mG.js} +92 -2
  5. package/dist/{OnboardForm-DZeWRzRD.js → OnboardForm-D1UEL7nA.js} +554 -482
  6. package/dist/{OnboardForm-C6LuVVyr.js → OnboardForm-Jk61FTsk.js} +6 -6
  7. package/dist/OnboardSubmission-CJ8Wz4Z5.js +446 -0
  8. package/dist/{OnboardSubmission-C2BYK2p1.js → OnboardSubmission-VVsokhdH.js} +27 -27
  9. package/dist/{PayoutAccount-VbRd7cmv.js → PayoutAccount-BJupz1C5.js} +101 -102
  10. package/dist/{PayoutAccount-BMQZ5bOZ.js → PayoutAccount-CgmR-Kft.js} +5 -5
  11. package/dist/PayoutAccountSetting-D18R7415.js +1502 -0
  12. package/dist/{Restaurant-4cO60aVP.js → Restaurant-CYzqYWvJ.js} +4 -4
  13. package/dist/{RestaurantSetting-Bvk0dnCI.js → RestaurantSetting-BjmaAH2A.js} +325 -243
  14. package/dist/{Settlement-CklF8pz7.js → Settlement-BgksUxPW.js} +4 -4
  15. package/dist/{Settlement-Cme1wMB-.js → Settlement-TT5-yT7m.js} +5 -5
  16. package/dist/{SettlementTransactions-DD285bSJ.js → SettlementTransactions-COjlsFX-.js} +4 -4
  17. package/dist/{SettlementTransactions-3F4EOoyz.js → SettlementTransactions-Cd0zM7MD.js} +4 -4
  18. package/dist/{Status.vue_vue_type_script_setup_true_lang-CUnCf_fx.js → Status.vue_vue_type_script_setup_true_lang-C0vazu3N.js} +1 -1
  19. package/dist/{Terminal-CK6ULW6U.js → Terminal-Chq-Kp8B.js} +6 -6
  20. package/dist/{TerminalSetting-CEQG3OV6.js → TerminalSetting-CZv6obZH.js} +887 -712
  21. package/dist/{TextInputDialog.vue_vue_type_script_setup_true_lang-BvGYVca0.js → TextInputDialog.vue_vue_type_script_setup_true_lang-D8W8_SO2.js} +1 -1
  22. package/dist/Transaction-BLooVLyD.js +507 -0
  23. package/dist/{Transaction-DjzWqLtN.js → Transaction-BoFiQSqu.js} +99 -102
  24. package/dist/TransactionOld-BGf-ROT_.js +313 -0
  25. package/dist/api/onboard-submission/index.d.ts +3 -1
  26. package/dist/api/terminal/index.d.ts +1 -0
  27. package/dist/app-B4Scdw84.js +9185 -0
  28. package/dist/app.d.ts +96 -1
  29. package/dist/app.js +5 -4
  30. package/dist/{assets-DIbq1BVX.js → assets-Bqo86swf.js} +81 -79
  31. package/dist/composable/async-poller/index.d.ts +22 -0
  32. package/dist/{grafana-B0iQmK6j.js → grafana-DpTMPSvF.js} +1 -1
  33. package/dist/{index-B0L21J1j.js → index-A5VPgbH5.js} +1 -1
  34. package/dist/{index-BkQ7t3F6.js → index-Bga288jX.js} +1 -1
  35. package/dist/{index-BHCs_NnD.js → index-C0KJhQjz.js} +1 -1
  36. package/dist/{index-CnN_MV2-.js → index-C4nXco1m.js} +24 -9
  37. package/dist/{index-C80a7-Ks.js → index-CU0pfEVD.js} +1 -1
  38. package/dist/{index-CxnWUe_K.js → index-CuktSZEC.js} +3 -3
  39. package/dist/{index-D0j1LZAB.js → index-DNKuiv7L.js} +9430 -9267
  40. package/dist/{index-C_Y5Sfc9.js → index-GF2nlppI.js} +1 -1
  41. package/dist/index-JP_7k-Ja.js +63 -0
  42. package/dist/index-MdV54cWO.js +58 -0
  43. package/dist/{index.vue_vue_type_script_setup_true_lang-BksGFeSf.js → index.vue_vue_type_script_setup_true_lang-Cs_vaAfF.js} +1 -1
  44. package/dist/main.d.ts +1 -0
  45. package/dist/model/payout-account.d.ts +2 -2
  46. package/dist/package.json +4 -3
  47. package/dist/{payout-account-B7OikYn5.js → payout-account-Bklp9Lrq.js} +37 -37
  48. package/dist/stores/payoutAccount.d.ts +44 -34
  49. package/dist/tsconfig.app.tsbuildinfo +1 -1
  50. package/dist/tyro-BovmsorS.js +5 -0
  51. package/dist/utils/permission.d.ts +1 -0
  52. package/dist/{validator-CTlVogBQ.js → validator-DzjyJnvv.js} +0 -1
  53. package/dist/views/admin/onboard-submission/forms/NTTSubmission.vue.d.ts +16 -16
  54. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +16 -16
  55. package/dist/views/admin/onboard-submission/forms/TyroSubmission.vue.d.ts +81 -0
  56. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +44 -34
  57. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +64 -54
  58. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +64 -54
  59. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +44 -34
  60. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +44 -43
  61. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +64 -54
  62. package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +2 -2
  63. package/dist/views/admin/payout-account/tabs/gateway/DigioGateway.vue.d.ts +2 -2
  64. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +2 -2
  65. package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +4 -4
  66. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +2 -2
  67. package/dist/views/admin/payout-account/tabs/gateway/TyroGateway.vue.d.ts +39 -0
  68. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  69. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  70. package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  71. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +4 -4
  72. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  73. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +4 -4
  74. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +4 -4
  75. package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +6 -6
  76. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  77. package/dist/views/admin/restaurant/tabs/gateway/MaybankGateway.vue.d.ts +6 -6
  78. package/dist/views/admin/restaurant/tabs/gateway/MonetapayGateway.vue.d.ts +48 -0
  79. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
  80. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +6 -4
  81. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +24 -24
  82. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +2 -2
  83. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +2 -2
  84. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +2 -2
  85. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +2 -2
  86. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +2 -2
  87. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +4 -4
  88. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +2 -2
  89. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +2 -2
  90. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +2 -2
  91. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +2 -2
  92. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +2 -2
  93. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +2 -2
  94. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +2 -2
  95. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +2 -2
  96. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +2 -2
  97. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +2 -2
  98. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +2 -2
  99. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +2 -2
  100. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +2 -2
  101. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +2 -2
  102. package/dist/views/admin/terminal/tabs/useTyroSoftposGateway.d.ts +12 -0
  103. package/dist/views/onboard-submission/tyro-submission-polling.d.ts +27 -0
  104. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +88 -68
  105. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +84 -84
  106. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +42 -42
  107. package/dist/views/settlement/SettlementTable.vue.d.ts +24 -24
  108. package/dist/views/transaction/TransactionTable.vue.d.ts +2 -2
  109. package/package.json +4 -3
  110. package/dist/DocumentViewer.vue_vue_type_script_setup_true_lang-KebV8Zws.js +0 -94
  111. package/dist/Forbidden-1aaq-Ilm.js +0 -38
  112. package/dist/OnboardSubmission-DvWwQFy6.js +0 -222
  113. package/dist/PayoutAccountSetting-DzzABgzs.js +0 -1765
  114. package/dist/Transaction-D-Z3zRd7.js +0 -517
  115. package/dist/TransactionOld-BXjA15Dd.js +0 -314
  116. package/dist/app-CEy5Ojtg.js +0 -7661
  117. package/dist/index-XTdSN6CV.js +0 -60
  118. package/dist/softspace-D9cEyOQT.js +0 -4
  119. package/dist/views/admin/payout-account/tabs/SettlementEditDialog.vue.d.ts +0 -56
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as _, ref as b, resolveComponent as l, openBlock as x, createBlock as y, withCtx as V, createVNode as r, unref as s, createElementVNode as v } from "vue";
2
2
  import { useDialogChild as g } from "@feedmepos/ui-library";
3
- import { s as m, z as C } from "./validator-CTlVogBQ.js";
3
+ import { s as m, z as C } from "./validator-DzjyJnvv.js";
4
4
  const T = { class: "flex justify-end mb-2" }, j = /* @__PURE__ */ _({
5
5
  __name: "TextInputDialog",
6
6
  props: {
@@ -0,0 +1,507 @@
1
+ import { defineComponent as w, ref as x, watch as k, onMounted as Q, resolveComponent as h, unref as n, openBlock as R, createBlock as O, createElementBlock as Y, createVNode as d, withCtx as M, createElementVNode as N, Fragment as H, renderList as W, createTextVNode as X, toDisplayString as Z, onBeforeUnmount as ee, isRef as F, h as I } from "vue";
2
+ import { t as P } from "./index-C0KJhQjz.js";
3
+ import { h as G } from "./moment-h96o7c8I.js";
4
+ import { useI18n as j, useCoreStore as J } from "@feedmepos/mf-common";
5
+ import { _ as te } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
6
+ import { t as ae, b as ne, _ as re } from "./assets-Bqo86swf.js";
7
+ import { u as se } from "./index-Bga288jX.js";
8
+ import { _ as oe } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
9
+ import { _ as le } from "./SelectAll.vue_vue_type_script_setup_true_lang-BNZTqdoF.js";
10
+ import { _ as ie } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-BNVnvrVY.js";
11
+ import { p as ce } from "./index-CU0pfEVD.js";
12
+ import { t as ue } from "./index-JP_7k-Ja.js";
13
+ import { u as me, p as D } from "./index-DNKuiv7L.js";
14
+ import { useSnackbar as de, useDialog as pe } from "@feedmepos/ui-library";
15
+ import { _ as ye, a as fe, b as _e } from "./Actions.vue_vue_type_script_setup_true_lang-CkOYpI0o.js";
16
+ import { g as ge } from "./grafana-DpTMPSvF.js";
17
+ import { w as z } from "./Modal-DB8M9o1T.js";
18
+ import { u as L } from "./error-K1CakhA9.js";
19
+ import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-Cs_vaAfF.js";
20
+ import { u as Te, a as ve } from "./index-BwdnN4a2.js";
21
+ import { h as q } from "./app-B4Scdw84.js";
22
+ const he = {
23
+ key: 1,
24
+ class: "inline-flex"
25
+ }, Ae = { class: "relative" }, Se = { class: "sticky top-0 py-8 bg-white translate-y-[-12px]" }, Ne = /* @__PURE__ */ w({
26
+ __name: "SourceSelector",
27
+ props: {
28
+ id: {},
29
+ by: {},
30
+ excludePayoutAccount: { type: Boolean },
31
+ excludeOrderingPayoutAccount: { type: Boolean },
32
+ excludeMarketingPayoutAccount: { type: Boolean },
33
+ excludeRestaurant: { type: Boolean },
34
+ excludeDevice: { type: Boolean }
35
+ },
36
+ emits: ["update:id", "update:by"],
37
+ setup(U, { emit: f }) {
38
+ const _ = U, b = f, { t: r } = j(), { currentBusiness: $, readRestaurants: T } = J(), { isLoading: u, startAsyncCall: g } = me(!0), m = x([]), c = x(), p = x(""), v = x([]);
39
+ let A;
40
+ k(p, async () => {
41
+ A && clearTimeout(A), A = setTimeout(() => {
42
+ var l = new RegExp(p.value, "i");
43
+ v.value = m.value.filter((s) => {
44
+ const a = JSON.stringify(s);
45
+ return l.test(a);
46
+ });
47
+ }, 700);
48
+ }), k(c, () => {
49
+ var l, s;
50
+ b("update:id", (l = c.value) == null ? void 0 : l.value), b("update:by", (s = c.value) == null ? void 0 : s.by);
51
+ });
52
+ async function B() {
53
+ return g(async () => {
54
+ try {
55
+ let l = await ce.readBusinessPayoutAccounts();
56
+ return l.length === 0 ? [] : l;
57
+ } catch {
58
+ return [];
59
+ }
60
+ });
61
+ }
62
+ async function K() {
63
+ return g(async () => {
64
+ try {
65
+ let l = await ue.getBusinessTerminals();
66
+ return l.length === 0 ? [] : l;
67
+ } catch {
68
+ return [];
69
+ }
70
+ });
71
+ }
72
+ async function C() {
73
+ u.value = !0;
74
+ const l = [];
75
+ if (!_.excludePayoutAccount) {
76
+ let s = await B();
77
+ _.excludeMarketingPayoutAccount && (s = s == null ? void 0 : s.filter((a) => a.store.event !== "MARKETING")), _.excludeOrderingPayoutAccount && (s = s == null ? void 0 : s.filter((a) => a.store.event !== "ORDERING")), l.push(
78
+ ...(s || []).map((a) => {
79
+ var E, S, t, e;
80
+ return {
81
+ by: "PAYOUT_ACCOUNT",
82
+ value: a._id,
83
+ prefix: r("payment.components.payout_account"),
84
+ type: "Payout Account - " + a.store.event,
85
+ label: ((S = (E = a.ref) == null ? void 0 : E.profile) == null ? void 0 : S.name) ?? a.ref.name,
86
+ chipLabel: "Payout Account: " + (((e = (t = a.ref) == null ? void 0 : t.profile) == null ? void 0 : e.name) ?? a.ref.name)
87
+ };
88
+ })
89
+ );
90
+ }
91
+ if (!_.excludeRestaurant) {
92
+ const s = await T();
93
+ l.push(
94
+ ...(s || []).map((a) => ({
95
+ by: "RESTAURANT",
96
+ value: a._id,
97
+ prefix: r("payment.components.restaurant"),
98
+ type: "Restaurant",
99
+ label: a.profile.name + " (" + (a.profile.code ?? "--") + ")",
100
+ chipLabel: "Restaurant: " + a.profile.name + " (" + (a.profile.code ?? "--") + ")"
101
+ }))
102
+ );
103
+ }
104
+ if (!_.excludeDevice) {
105
+ const s = await K();
106
+ l.push(
107
+ ...(s || []).map((a) => ({
108
+ by: "DEVICE",
109
+ value: a._id,
110
+ prefix: r("payment.components.device"),
111
+ type: "Device - " + a.deviceType,
112
+ label: a.deviceType === "TERMINAL" ? a.name : a.restaurant.profile.name,
113
+ chipLabel: a.deviceType + ": " + (a.deviceType === "TERMINAL" ? a.name : a.restaurant.profile.name)
114
+ }))
115
+ );
116
+ }
117
+ m.value = l, v.value = m.value, u.value = !1;
118
+ }
119
+ return Q(C), k($, C), (l, s) => {
120
+ const a = h("FmCircularProgress"), E = h("FmChip"), S = h("FmSearch"), t = h("FmMenuItem"), e = h("FmMenu");
121
+ return n(u) ? (R(), O(a, {
122
+ key: 0,
123
+ size: "md"
124
+ })) : (R(), Y("div", he, [
125
+ d(e, { "close-on-click": !0 }, {
126
+ "menu-button": M(() => {
127
+ var o;
128
+ return [
129
+ d(E, {
130
+ icon: "account_box",
131
+ label: ((o = c.value) == null ? void 0 : o.chipLabel) ?? n(r)("payment.components.select"),
132
+ removable: !!c.value,
133
+ onChipClosed: s[0] || (s[0] = (y) => c.value = void 0)
134
+ }, null, 8, ["label", "removable"])
135
+ ];
136
+ }),
137
+ default: M(() => [
138
+ N("div", Ae, [
139
+ N("div", Se, [
140
+ d(S, {
141
+ "model-value": p.value,
142
+ "onUpdate:modelValue": s[1] || (s[1] = (o) => p.value = o),
143
+ placeholder: n(r)("payment.components.select")
144
+ }, null, 8, ["model-value", "placeholder"])
145
+ ]),
146
+ N("div", null, [
147
+ (R(!0), Y(H, null, W(v.value, (o) => (R(), O(t, {
148
+ key: o.value,
149
+ label: o.label,
150
+ sublabel: o.type,
151
+ onClick: () => c.value = o
152
+ }, null, 8, ["label", "sublabel", "onClick"]))), 128))
153
+ ])
154
+ ])
155
+ ]),
156
+ _: 1
157
+ })
158
+ ]));
159
+ };
160
+ }
161
+ }), Ee = { class: "flex items-center gap-1" }, Fe = /* @__PURE__ */ w({
162
+ __name: "BillSeqNumber",
163
+ props: {
164
+ row: {},
165
+ data: {}
166
+ },
167
+ setup(U) {
168
+ return (f, _) => {
169
+ const b = h("FmIcon");
170
+ return R(), Y("span", Ee, [
171
+ X(Z(U.row.original.seqNumber) + " ", 1),
172
+ d(b, {
173
+ size: "md",
174
+ name: "check",
175
+ color: "#16a34a"
176
+ })
177
+ ]);
178
+ };
179
+ }
180
+ }), Ie = { class: "flex justify-between mb-6 items-center" }, De = { class: "flex space-x-8 items-start" }, xe = { class: "flex space-x-4 self-center" }, Re = { class: "flex space-x-12 mb-6" }, Xe = /* @__PURE__ */ w({
181
+ __name: "Transaction",
182
+ setup(U) {
183
+ const f = de(), _ = pe(), { sessionUser: b } = J(), { t: r } = j(), { getBillLink: $ } = ve(), T = x(), { dateRange: u, searchKey: g, status: m, id: c, by: p } = se({
184
+ by: "",
185
+ id: "",
186
+ searchKey: "",
187
+ status: [D.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS],
188
+ dateRange: {
189
+ startDate: G().startOf("day").format("YYYY-MM-DD"),
190
+ endDate: G().endOf("day").format("YYYY-MM-DD")
191
+ }
192
+ });
193
+ let v;
194
+ const A = () => {
195
+ v && (clearTimeout(v), v = void 0);
196
+ }, {
197
+ promptSuggestion: B,
198
+ closeSuggestion: K
199
+ } = Te({
200
+ searchKey: g,
201
+ dateRange: u,
202
+ onBeforeApply: A
203
+ });
204
+ k(g, () => {
205
+ A(), B(), v = setTimeout(() => {
206
+ var t;
207
+ return (t = T.value) == null ? void 0 : t.reset();
208
+ }, 700);
209
+ }), k([u, m, c, p], () => {
210
+ var t;
211
+ (t = T.value) == null || t.reset();
212
+ }), ee(() => {
213
+ A(), K();
214
+ });
215
+ const C = [
216
+ {
217
+ label: "Success",
218
+ value: D.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS
219
+ },
220
+ {
221
+ label: "Refunded",
222
+ value: D.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED
223
+ },
224
+ {
225
+ label: "Process",
226
+ value: D.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING
227
+ },
228
+ {
229
+ label: "Pending Settlement",
230
+ value: D.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING_SETTLEMENT
231
+ },
232
+ {
233
+ label: "Failed",
234
+ value: D.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED
235
+ }
236
+ ];
237
+ async function l(t, e) {
238
+ var o;
239
+ try {
240
+ const y = await P.refetchTransaction({
241
+ transactionId: t.id
242
+ });
243
+ (o = T.value) == null || o.replaceData(e, y), f.open({
244
+ type: "success",
245
+ title: "Transaction queried and updated successfully."
246
+ });
247
+ } catch (y) {
248
+ f.open({
249
+ type: "error",
250
+ title: "Fail to query transaction.",
251
+ message: L(y)
252
+ });
253
+ }
254
+ }
255
+ async function s(t, e) {
256
+ z(
257
+ _,
258
+ "Refund Transaction",
259
+ "Are you sure to refund transaction? This action cannot be revert!",
260
+ async () => {
261
+ var o;
262
+ try {
263
+ const y = await P.refundTransaction({
264
+ transactionId: t.id,
265
+ reason: "portal transaction refund",
266
+ amount: t.fdoAmount
267
+ });
268
+ (o = T.value) == null || o.replaceData(e, y), f.open({
269
+ type: "success",
270
+ title: "Transaction refund request initiated."
271
+ });
272
+ } catch (y) {
273
+ f.open({
274
+ type: "error",
275
+ title: "Fail to request refund transaction.",
276
+ message: L(y)
277
+ });
278
+ }
279
+ }
280
+ );
281
+ }
282
+ async function a(t, e) {
283
+ z(
284
+ _,
285
+ "Notify Transaction",
286
+ "Are you sure to perform notify transaction?",
287
+ async () => {
288
+ try {
289
+ await P.renotifyTransaction(t.id), f.open({
290
+ type: "success",
291
+ title: "Transaction notify successfully."
292
+ });
293
+ } catch (o) {
294
+ f.open({
295
+ type: "error",
296
+ title: "Fail to notify transaction.",
297
+ message: L(o)
298
+ });
299
+ }
300
+ }
301
+ );
302
+ }
303
+ async function E(t, e) {
304
+ const o = ge(
305
+ [
306
+ {
307
+ type: "span",
308
+ queryKey: "transaction.id",
309
+ queryValue: t.id
310
+ }
311
+ ],
312
+ t.transactionAt
313
+ );
314
+ window.open(o, "_blank");
315
+ }
316
+ x("");
317
+ const S = [
318
+ {
319
+ header: () => r("payment.transactions.table.id"),
320
+ accessorKey: "id",
321
+ cell: ({ cell: t, row: e }) => q(b.value) && e.original.transactionId ? e.original.id + `
322
+ ID: ` + e.original.transactionId : e.original.id
323
+ },
324
+ {
325
+ header: () => r("payment.transactions.table.pay_id"),
326
+ accessorKey: "payId",
327
+ cell: ({ cell: t, row: e }) => {
328
+ const o = $(e.original);
329
+ return o ? I(
330
+ "a",
331
+ {
332
+ href: o,
333
+ class: "text-blue-600 underline"
334
+ },
335
+ t.getValue()
336
+ ) : t.getValue();
337
+ }
338
+ },
339
+ {
340
+ header: () => r("payment.transactions.table.gateway_id"),
341
+ accessorKey: "gatewayTransactionId"
342
+ },
343
+ {
344
+ header: () => r("payment.transactions.table.bill_seq"),
345
+ accessorKey: "seqNumber",
346
+ cell: ({ cell: t, row: e }) => e.original.seqNumberBinded ? I(Fe, { row: e, data: t.getValue() }) : e.original.seqNumber
347
+ },
348
+ {
349
+ header: () => r("payment.transactions.table.gateway"),
350
+ accessorKey: "gateway",
351
+ meta: {
352
+ textAlign: "center"
353
+ },
354
+ cell: ({ cell: t, row: e }) => e.original.gateway ? I(ye, { row: e, data: t.getValue() }) : ""
355
+ },
356
+ {
357
+ header: () => r("payment.transactions.table.method"),
358
+ accessorKey: "method",
359
+ meta: {
360
+ textAlign: "center"
361
+ },
362
+ cell: ({ cell: t, row: e }) => e.original.method ? I(fe, { row: e, data: t.getValue() }) : ""
363
+ },
364
+ {
365
+ header: () => r("payment.transactions.table.type"),
366
+ accessorKey: "payFor",
367
+ meta: {
368
+ textAlign: "center"
369
+ }
370
+ },
371
+ {
372
+ header: () => r("payment.transactions.table.status"),
373
+ accessorKey: "status",
374
+ cell: ({ cell: t }) => I(re, { data: t.getValue() })
375
+ },
376
+ {
377
+ header: () => r("payment.transactions.table.restaurant"),
378
+ accessorKey: "restaurantId"
379
+ },
380
+ {
381
+ header: () => r("payment.transactions.table.source"),
382
+ accessorKey: "source",
383
+ cell: ({ cell: t, row: e }) => `(${e.original.sourceType}) ${e.original.source}`
384
+ },
385
+ {
386
+ header: () => r("payment.transactions.table.transaction_at"),
387
+ accessorKey: "transactionAt",
388
+ meta: {
389
+ width: "180px"
390
+ },
391
+ cell: ({ cell: t, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
392
+ },
393
+ {
394
+ header: () => r("payment.transactions.table.sales_amount"),
395
+ accessorKey: "amount",
396
+ cell: ({ cell: t, row: e }) => q(b.value) && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount
397
+ }
398
+ ];
399
+ return q(b.value) && S.push({
400
+ header: () => r("payment.transactions.table.actions"),
401
+ accessorKey: "actions",
402
+ cell: ({ row: t }) => I(_e, {
403
+ transaction: t.original,
404
+ onAction: (e) => {
405
+ switch (e) {
406
+ case "notify":
407
+ return a(t.original, t.index);
408
+ case "query":
409
+ return l(t.original, t.index);
410
+ case "refund":
411
+ return s(t.original, t.index);
412
+ case "history":
413
+ return E(t.original, t.index);
414
+ }
415
+ }
416
+ })
417
+ }), (t, e) => {
418
+ const o = h("FmSearch"), y = h("FmSelect");
419
+ return R(), O(te, {
420
+ title: n(r)("payment.transactions.title"),
421
+ description: n(r)("payment.transactions.description"),
422
+ loading: !1
423
+ }, {
424
+ default: M(() => [
425
+ N("div", Ie, [
426
+ N("div", De, [
427
+ d(o, {
428
+ "model-value": n(g),
429
+ "onUpdate:modelValue": e[0] || (e[0] = (i) => F(g) ? g.value = i : null),
430
+ class: "mr-8",
431
+ label: n(r)("payment.transactions.search.title"),
432
+ placeholder: n(r)("payment.transactions.search.placeholder")
433
+ }, null, 8, ["model-value", "label", "placeholder"]),
434
+ d(y, {
435
+ modelValue: n(m),
436
+ "onUpdate:modelValue": e[2] || (e[2] = (i) => F(m) ? m.value = i : null),
437
+ class: "mr-6 w-[300px]",
438
+ label: n(r)("payment.transactions.status"),
439
+ "label-mark": "required",
440
+ multiselect: "",
441
+ items: C
442
+ }, {
443
+ "prepend-menu": M(() => [
444
+ d(le, {
445
+ modelValue: n(m),
446
+ "onUpdate:modelValue": e[1] || (e[1] = (i) => F(m) ? m.value = i : null),
447
+ items: C
448
+ }, null, 8, ["modelValue"])
449
+ ]),
450
+ _: 1
451
+ }, 8, ["modelValue", "label"])
452
+ ]),
453
+ N("div", xe, [
454
+ d(oe, {
455
+ button: {
456
+ appendIcon: "file_download",
457
+ variant: "primary",
458
+ label: n(r)("payment.transactions.button.export")
459
+ },
460
+ handler: async () => {
461
+ var V;
462
+ const i = await ((V = T.value) == null ? void 0 : V.allData());
463
+ i != null && await n(P).downloadPortalTransactionReport(
464
+ n(u),
465
+ n(ae)(i)
466
+ );
467
+ }
468
+ }, null, 8, ["button", "handler"])
469
+ ])
470
+ ]),
471
+ N("div", Re, [
472
+ d(Ne, {
473
+ id: n(c),
474
+ "onUpdate:id": e[3] || (e[3] = (i) => F(c) ? c.value = i : null),
475
+ by: n(p),
476
+ "onUpdate:by": e[4] || (e[4] = (i) => F(p) ? p.value = i : null)
477
+ }, null, 8, ["id", "by"]),
478
+ d(ie, {
479
+ modelValue: n(u),
480
+ "onUpdate:modelValue": e[5] || (e[5] = (i) => F(u) ? u.value = i : null)
481
+ }, null, 8, ["modelValue"])
482
+ ]),
483
+ d(be, {
484
+ ref_key: "controller",
485
+ ref: T,
486
+ "column-defs": S,
487
+ "rows-defs": n(ne),
488
+ paginate: (i, V) => n(P).readTransactionsV2({
489
+ limit: i,
490
+ cursor: V,
491
+ status: n(m),
492
+ by: n(p),
493
+ id: n(c),
494
+ search: n(g),
495
+ start: n(u).startDate,
496
+ end: n(u).endDate
497
+ })
498
+ }, null, 8, ["rows-defs", "paginate"])
499
+ ]),
500
+ _: 1
501
+ }, 8, ["title", "description"]);
502
+ };
503
+ }
504
+ });
505
+ export {
506
+ Xe as default
507
+ };