@feedmepos/mf-payment 0.0.0-beta.14 → 0.0.0-beta.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/dist/{PayoutAccount-DuqITwjB.js → PayoutAccount-CNVWd22h.js} +5 -5
  2. package/dist/{PayoutAccount-BHwKD9si.js → PayoutAccount-DqNPOjFg.js} +3 -3
  3. package/dist/PayoutAccountSetting-uiFglxyj.js +702 -0
  4. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js +33 -0
  5. package/dist/{Settlement-Dr6Rmkid.js → Settlement-DLFEvFiY.js} +3 -3
  6. package/dist/{Settlement-JkH7-Wd_.js → Settlement-DuT2FxzJ.js} +28 -26
  7. package/dist/{SettlementTransactions-CSz0G9iE.js → SettlementTransactions--BvqHEHi.js} +110 -116
  8. package/dist/{SettlementTransactions-BGfDReId.js → SettlementTransactions-BQpqcrAK.js} +99 -105
  9. package/dist/{Terminal-DQqtUzV2.js → Terminal-C6ns-w6k.js} +4 -4
  10. package/dist/{TerminalSetting-T0Sxq_z0.js → TerminalSetting-Dditd6yX.js} +3 -3
  11. package/dist/{TerminalTransaction-C0g2mMBJ.js → TerminalTransaction-CxkG6chg.js} +61 -69
  12. package/dist/TerminalTransaction-DYlm_3zt.js +230 -0
  13. package/dist/Transaction-CHHwlo39.js +242 -0
  14. package/dist/Transaction-CkRaGtkz.js +243 -0
  15. package/dist/api/pagination.d.ts +20 -0
  16. package/dist/api/payment-gateway/index.d.ts +9 -0
  17. package/dist/api/terminal-transaction/index.d.ts +8 -0
  18. package/dist/app.js +56 -48
  19. package/dist/{assets-nIQ0r4oP.js → assets-DB7pg43Y.js} +1 -1
  20. package/dist/components/RestaurantSelector.vue.d.ts +2 -0
  21. package/dist/{index-CxYMbN69.js → index-7_iwp3ZF.js} +1 -1
  22. package/dist/{index-DflgpHga.js → index-BBTjdV3w.js} +2 -2
  23. package/dist/index-BVmZTFl8.js +20 -0
  24. package/dist/{index-CIIojtd5.js → index-Bboaan5m.js} +1 -1
  25. package/dist/{index-DhPhiNvt.js → index-BuCL5h0R.js} +1 -1
  26. package/dist/{index-DqQBDo_Y.js → index-DIT7Btp7.js} +1 -1
  27. package/dist/{index.vue_vue_type_script_setup_true_lang-CcY9Uu6G.js → index.vue_vue_type_script_setup_true_lang-CcT6hjAl.js} +1 -1
  28. package/dist/package.json +1 -1
  29. package/dist/{payout-account-FNZygqj-.js → payout-account-BFlecjFI.js} +306 -306
  30. package/dist/{transaction-B4rEbejx.js → transaction-CSqbF07L.js} +1 -1
  31. package/dist/tsconfig.app.tsbuildinfo +1 -1
  32. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +81 -0
  33. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +56 -0
  34. package/dist/views/admin/payout-account/tabs/gateway/RevenueMonsterGateway.vue.d.ts +52 -0
  35. package/dist/views/terminal-transaction/TerminalTransaction.vue.d.ts +2 -0
  36. package/dist/views/terminal-transaction/cell/Gateway.vue.d.ts +9 -0
  37. package/dist/views/terminal-transaction/cell/Status.vue.d.ts +9 -0
  38. package/package.json +1 -1
  39. package/dist/PayoutAccountSetting-cOThY31e.js +0 -425
  40. package/dist/Transaction-BKBh8jOT.js +0 -249
  41. package/dist/Transaction-DVS8SkBi.js +0 -247
@@ -0,0 +1,81 @@
1
+ import { type PropType } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ payoutAccount: {
4
+ type: PropType<{
5
+ enable?: boolean | null | undefined;
6
+ ref?: any;
7
+ status: "NEW" | "PENDING" | "APPROVED";
8
+ _id: string;
9
+ store: {
10
+ bank?: {
11
+ type?: "OTHER" | "CURRENT_ACCOUNT" | "SAVING_ACCOUNT" | null | undefined;
12
+ accountNumber?: string | null | undefined;
13
+ holderName?: string | null | undefined;
14
+ name: string;
15
+ } | null | undefined;
16
+ ssm?: string | null | undefined;
17
+ bankStatement?: string | null | undefined;
18
+ exteriorPhoto?: string | null | undefined;
19
+ keyPerson?: {
20
+ name: string;
21
+ phone: string;
22
+ email: string;
23
+ } | null | undefined;
24
+ id: string;
25
+ event: "ORDERING" | "MARKETING";
26
+ };
27
+ notifyUrl: string;
28
+ methods: {
29
+ rate?: {
30
+ amount: number;
31
+ precision: number;
32
+ } | null | undefined;
33
+ tPlus?: number | null | undefined;
34
+ issuer: "OTHER" | "FEEDME" | "ALIPAY" | "BOOST" | "GRABPAY" | "MAYBANKQRPAY" | "PRESTOPAY" | "RAZERPAY" | "SHOPEEPAY" | "TOUCHNGO" | "WECHATPAY" | "CARD" | "DUITNOW" | "FPX" | "DEBITCARD" | "CREDITCARD" | "UNIONPAY" | "ATOME" | "VISA" | "MASTER" | "MYDEBIT";
35
+ variant: string;
36
+ }[];
37
+ businessId: string;
38
+ }>;
39
+ required: true;
40
+ };
41
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
42
+ payoutAccount: {
43
+ type: PropType<{
44
+ enable?: boolean | null | undefined;
45
+ ref?: any;
46
+ status: "NEW" | "PENDING" | "APPROVED";
47
+ _id: string;
48
+ store: {
49
+ bank?: {
50
+ type?: "OTHER" | "CURRENT_ACCOUNT" | "SAVING_ACCOUNT" | null | undefined;
51
+ accountNumber?: string | null | undefined;
52
+ holderName?: string | null | undefined;
53
+ name: string;
54
+ } | null | undefined;
55
+ ssm?: string | null | undefined;
56
+ bankStatement?: string | null | undefined;
57
+ exteriorPhoto?: string | null | undefined;
58
+ keyPerson?: {
59
+ name: string;
60
+ phone: string;
61
+ email: string;
62
+ } | null | undefined;
63
+ id: string;
64
+ event: "ORDERING" | "MARKETING";
65
+ };
66
+ notifyUrl: string;
67
+ methods: {
68
+ rate?: {
69
+ amount: number;
70
+ precision: number;
71
+ } | null | undefined;
72
+ tPlus?: number | null | undefined;
73
+ issuer: "OTHER" | "FEEDME" | "ALIPAY" | "BOOST" | "GRABPAY" | "MAYBANKQRPAY" | "PRESTOPAY" | "RAZERPAY" | "SHOPEEPAY" | "TOUCHNGO" | "WECHATPAY" | "CARD" | "DUITNOW" | "FPX" | "DEBITCARD" | "CREDITCARD" | "UNIONPAY" | "ATOME" | "VISA" | "MASTER" | "MYDEBIT";
74
+ variant: string;
75
+ }[];
76
+ businessId: string;
77
+ }>;
78
+ required: true;
79
+ };
80
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
81
+ export default _default;
@@ -0,0 +1,56 @@
1
+ import type { FdoPaymentGateway } from '@feedmepos/payment-entity';
2
+ import type { PropType } from 'vue';
3
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ onUpdate: {
5
+ type: PropType<(g: any) => void>;
6
+ required: true;
7
+ };
8
+ onDelete: {
9
+ type: PropType<(g: FdoPaymentGateway) => void>;
10
+ required: true;
11
+ };
12
+ gateway: {
13
+ type: PropType<{
14
+ _id: string;
15
+ _rev: string;
16
+ paymentGateway: "RAZER_MERCHANT_SERVICE";
17
+ active: boolean;
18
+ config: {
19
+ applicationCode?: string | null | undefined;
20
+ offlineSecret?: string | null | undefined;
21
+ uniqueId: string;
22
+ merchantId: string;
23
+ secretKey: string;
24
+ verifyKey: string;
25
+ };
26
+ } | undefined>;
27
+ required: true;
28
+ };
29
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
+ onUpdate: {
31
+ type: PropType<(g: any) => void>;
32
+ required: true;
33
+ };
34
+ onDelete: {
35
+ type: PropType<(g: FdoPaymentGateway) => void>;
36
+ required: true;
37
+ };
38
+ gateway: {
39
+ type: PropType<{
40
+ _id: string;
41
+ _rev: string;
42
+ paymentGateway: "RAZER_MERCHANT_SERVICE";
43
+ active: boolean;
44
+ config: {
45
+ applicationCode?: string | null | undefined;
46
+ offlineSecret?: string | null | undefined;
47
+ uniqueId: string;
48
+ merchantId: string;
49
+ secretKey: string;
50
+ verifyKey: string;
51
+ };
52
+ } | undefined>;
53
+ required: true;
54
+ };
55
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
56
+ export default _default;
@@ -0,0 +1,52 @@
1
+ import type { FdoPaymentGateway } from '@feedmepos/payment-entity';
2
+ import type { PropType } from 'vue';
3
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ onUpdate: {
5
+ type: PropType<(g: any) => void>;
6
+ required: true;
7
+ };
8
+ onDelete: {
9
+ type: PropType<(g: FdoPaymentGateway) => void>;
10
+ required: true;
11
+ };
12
+ gateway: {
13
+ type: PropType<{
14
+ _id: string;
15
+ _rev: string;
16
+ paymentGateway: "REVENUE_MONSTER";
17
+ active: boolean;
18
+ config: {
19
+ clientId: string;
20
+ clientPrivateKey: string;
21
+ clientSecret: string;
22
+ storeId: string;
23
+ };
24
+ } | undefined>;
25
+ required: true;
26
+ };
27
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
28
+ onUpdate: {
29
+ type: PropType<(g: any) => void>;
30
+ required: true;
31
+ };
32
+ onDelete: {
33
+ type: PropType<(g: FdoPaymentGateway) => void>;
34
+ required: true;
35
+ };
36
+ gateway: {
37
+ type: PropType<{
38
+ _id: string;
39
+ _rev: string;
40
+ paymentGateway: "REVENUE_MONSTER";
41
+ active: boolean;
42
+ config: {
43
+ clientId: string;
44
+ clientPrivateKey: string;
45
+ clientSecret: string;
46
+ storeId: string;
47
+ };
48
+ } | undefined>;
49
+ required: true;
50
+ };
51
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
52
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { type Row } from '@feedmepos/ui-library';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ row: Row<any>;
4
+ data: unknown;
5
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
6
+ row: Row<any>;
7
+ data: unknown;
8
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { type Row } from '@feedmepos/ui-library';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ row: Row<any>;
4
+ data: unknown;
5
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
6
+ row: Row<any>;
7
+ data: unknown;
8
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "0.0.0-beta.14",
3
+ "version": "0.0.0-beta.16",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,425 +0,0 @@
1
- import { defineComponent as S, resolveComponent as i, openBlock as v, createElementBlock as C, Fragment as B, createElementVNode as o, createVNode as u, withCtx as b, createTextVNode as g, toDisplayString as F, createCommentVNode as V, createBlock as P, ref as w, watch as E, computed as R, unref as k, isRef as h, h as T, onMounted as q, resolveDynamicComponent as _, normalizeProps as D, mergeProps as z } from "vue";
2
- import { p as $ } from "./index-DqQBDo_Y.js";
3
- import { u as H } from "./index-DflgpHga.js";
4
- import { _ as K } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
5
- import { useRouter as O } from "vue-router";
6
- import { u as M } from "./index-CIIojtd5.js";
7
- import { P as U } from "./PDFViewer-CjH_C1uT.js";
8
- import { useSnackbar as G } from "@feedmepos/ui-library";
9
- import { u as L } from "./error-K1CakhA9.js";
10
- const Q = { class: "flex gap-16 mb-6" }, W = ["src"], J = /* @__PURE__ */ S({
11
- __name: "Information",
12
- props: {
13
- payoutAccount: {
14
- type: Object,
15
- required: !0
16
- }
17
- },
18
- setup(t) {
19
- return (c, e) => {
20
- const d = i("FmCardHeader"), s = i("FmCardSection"), m = i("FmCard");
21
- return v(), C(B, null, [
22
- o("div", Q, [
23
- u(m, {
24
- horizontal: "",
25
- class: "flex-1 p-6",
26
- variant: "elevated"
27
- }, {
28
- default: b(() => [
29
- u(s, { class: "flex flex-col gap-16 justify-between" }, {
30
- default: b(() => [
31
- u(d, {
32
- class: "p-0",
33
- title: "Account Info",
34
- subtitle: ""
35
- }),
36
- u(s, { class: "p-0" }, {
37
- default: b(() => {
38
- var r, y, f, a, n;
39
- return [
40
- e[0] || (e[0] = o("b", null, "For", -1)),
41
- g(": " + F((y = (r = t.payoutAccount) == null ? void 0 : r.store) == null ? void 0 : y.event) + " ", 1),
42
- e[1] || (e[1] = o("br", null, null, -1)),
43
- e[2] || (e[2] = o("b", null, "Reference", -1)),
44
- g(": " + F((a = (f = t.payoutAccount) == null ? void 0 : f.store) == null ? void 0 : a.id), 1),
45
- e[3] || (e[3] = o("br", null, null, -1)),
46
- e[4] || (e[4] = o("b", null, "Business", -1)),
47
- g(": " + F((n = t.payoutAccount) == null ? void 0 : n.businessId), 1),
48
- e[5] || (e[5] = o("br", null, null, -1))
49
- ];
50
- }),
51
- _: 1
52
- })
53
- ]),
54
- _: 1
55
- })
56
- ]),
57
- _: 1
58
- }),
59
- u(m, {
60
- horizontal: "",
61
- class: "flex-1 p-6",
62
- variant: "elevated"
63
- }, {
64
- default: b(() => [
65
- u(s, { class: "flex flex-col gap-16 justify-between" }, {
66
- default: b(() => [
67
- u(d, {
68
- class: "p-0",
69
- title: "Key Person",
70
- subtitle: ""
71
- }),
72
- u(s, { class: "p-0" }, {
73
- default: b(() => {
74
- var r, y, f, a, n, l, p, x;
75
- return [
76
- e[6] || (e[6] = o("b", null, "Email", -1)),
77
- g(": " + F((f = (y = (r = t.payoutAccount) == null ? void 0 : r.store) == null ? void 0 : y.keyPerson) == null ? void 0 : f.email) + " ", 1),
78
- e[7] || (e[7] = o("br", null, null, -1)),
79
- e[8] || (e[8] = o("b", null, "Name", -1)),
80
- g(": " + F((l = (n = (a = t.payoutAccount) == null ? void 0 : a.store) == null ? void 0 : n.keyPerson) == null ? void 0 : l.name), 1),
81
- e[9] || (e[9] = o("br", null, null, -1)),
82
- e[10] || (e[10] = o("b", null, "Phone", -1)),
83
- g(": " + F((x = (p = t.payoutAccount) == null ? void 0 : p.store.keyPerson) == null ? void 0 : x.phone), 1),
84
- e[11] || (e[11] = o("br", null, null, -1))
85
- ];
86
- }),
87
- _: 1
88
- })
89
- ]),
90
- _: 1
91
- })
92
- ]),
93
- _: 1
94
- })
95
- ]),
96
- e[12] || (e[12] = o("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
97
- t.payoutAccount.store.exteriorPhoto ? (v(), C("img", {
98
- key: 0,
99
- src: t.payoutAccount.store.exteriorPhoto
100
- }, null, 8, W)) : V("", !0)
101
- ], 64);
102
- };
103
- }
104
- }), X = { class: "flex gap-16 mt-6" }, Y = { class: "flex-1" }, Z = { class: "flex-1" }, ee = /* @__PURE__ */ S({
105
- __name: "Settlement",
106
- props: {
107
- payoutAccount: {
108
- type: Object,
109
- required: !0
110
- }
111
- },
112
- setup(t) {
113
- return (c, e) => {
114
- const d = i("FmCardHeader"), s = i("FmCardSection"), m = i("FmCard");
115
- return v(), C(B, null, [
116
- u(m, {
117
- horizontal: "",
118
- class: "flex-1 p-6 mx-6",
119
- variant: "elevated"
120
- }, {
121
- default: b(() => [
122
- u(s, { class: "flex flex-col gap-16 justify-between" }, {
123
- default: b(() => [
124
- u(d, {
125
- class: "p-0",
126
- title: "Bank Info",
127
- subtitle: ""
128
- }),
129
- u(s, { class: "p-0" }, {
130
- default: b(() => {
131
- var r, y, f, a, n, l;
132
- return [
133
- e[0] || (e[0] = o("b", null, "Bank", -1)),
134
- g(": " + F((y = (r = t.payoutAccount) == null ? void 0 : r.store.bank) == null ? void 0 : y.name), 1),
135
- e[1] || (e[1] = o("br", null, null, -1)),
136
- e[2] || (e[2] = o("b", null, "Name", -1)),
137
- g(": " + F((a = (f = t.payoutAccount) == null ? void 0 : f.store.bank) == null ? void 0 : a.holderName), 1),
138
- e[3] || (e[3] = o("br", null, null, -1)),
139
- e[4] || (e[4] = o("b", null, "Number", -1)),
140
- g(": " + F((l = (n = t.payoutAccount) == null ? void 0 : n.store.bank) == null ? void 0 : l.accountNumber), 1)
141
- ];
142
- }),
143
- _: 1
144
- })
145
- ]),
146
- _: 1
147
- })
148
- ]),
149
- _: 1
150
- }),
151
- o("div", X, [
152
- o("div", Y, [
153
- e[5] || (e[5] = o("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
154
- t.payoutAccount.store.ssm ? (v(), P(U, {
155
- key: 0,
156
- pdf: t.payoutAccount.store.ssm,
157
- "disable-text-layer": !0,
158
- "disable-annotation-layer": !0
159
- }, null, 8, ["pdf"])) : V("", !0)
160
- ]),
161
- o("div", Z, [
162
- e[6] || (e[6] = o("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
163
- t.payoutAccount.store.bankStatement ? (v(), P(U, {
164
- key: 0,
165
- pdf: t.payoutAccount.store.bankStatement,
166
- "disable-text-layer": !0,
167
- "disable-annotation-layer": !0
168
- }, null, 8, ["pdf"])) : V("", !0)
169
- ])
170
- ])
171
- ], 64);
172
- };
173
- }
174
- }), te = /* @__PURE__ */ S({
175
- __name: "RateInput",
176
- props: {
177
- data: {},
178
- onChange: { type: Function }
179
- },
180
- setup(t) {
181
- const c = t, e = w(c.data.toString());
182
- return E(e, (d) => {
183
- c.onChange(parseFloat(d));
184
- }), (d, s) => {
185
- const m = i("FmTextField");
186
- return v(), P(m, {
187
- inputmode: "decimal",
188
- modelValue: e.value,
189
- "onUpdate:modelValue": s[0] || (s[0] = (r) => e.value = r)
190
- }, {
191
- append: b(() => s[1] || (s[1] = [
192
- g("%")
193
- ])),
194
- _: 1
195
- }, 8, ["modelValue"]);
196
- };
197
- }
198
- }), ne = /* @__PURE__ */ S({
199
- __name: "TPlusInput",
200
- props: {
201
- data: {},
202
- onChange: { type: Function }
203
- },
204
- setup(t) {
205
- const c = t, e = w(c.data.toString());
206
- return E(e, (d) => {
207
- c.onChange(parseInt(d));
208
- }), (d, s) => {
209
- const m = i("FmTextField");
210
- return v(), P(m, {
211
- inputmode: "numeric",
212
- modelValue: e.value,
213
- "onUpdate:modelValue": s[0] || (s[0] = (r) => e.value = r)
214
- }, null, 8, ["modelValue"]);
215
- };
216
- }
217
- }), oe = { class: "flex gap-16 mt-6" }, ae = { class: "flex-1" }, le = { class: "flex-1" }, ue = { class: "my-6 w-full flex justify-end" }, se = { class: "w-[320px]" }, re = /* @__PURE__ */ S({
218
- __name: "PaymentStatus",
219
- props: {
220
- onUpdate: {
221
- type: Function,
222
- required: !0
223
- },
224
- payoutAccount: {
225
- type: Object,
226
- required: !0
227
- }
228
- },
229
- setup(t) {
230
- const c = t, e = w(!1), d = G(), s = async (a) => {
231
- try {
232
- e.value = !0, await c.onUpdate(a), d.open({
233
- type: "success",
234
- title: "Payout account update succesfully"
235
- });
236
- } catch (n) {
237
- d.open({
238
- type: "error",
239
- title: "Error occurs when updating payout account",
240
- message: L(n)
241
- });
242
- } finally {
243
- e.value = !1;
244
- }
245
- }, { search: m } = M({
246
- search: ""
247
- }), r = R(() => {
248
- const { ssm: a, bank: n, bankStatement: l } = c.payoutAccount.store;
249
- return a && n && n.name && n.accountNumber && n.holderName && l;
250
- }), y = w(""), f = [
251
- {
252
- header: () => "Payment Method",
253
- accessorKey: "issuer",
254
- cell: (a) => `${a.row.original.issuer} (${a.row.original.variant})`
255
- },
256
- {
257
- header: () => "Rate",
258
- accessorKey: "rate",
259
- cell: ({ row: a }) => {
260
- let n = 0;
261
- return a.original.rate && (n = a.original.rate.amount / Math.pow(10, a.original.rate.precision)), T(te, {
262
- data: n,
263
- onChange: (l) => {
264
- const p = c.payoutAccount.methods.at(a.index);
265
- p.rate || (p.rate = {
266
- amount: 0,
267
- precision: 4
268
- }), p.rate.amount = l * Math.pow(10, p.rate.precision);
269
- }
270
- });
271
- }
272
- },
273
- {
274
- header: () => "T plus",
275
- accessorKey: "tPlus",
276
- cell: ({ row: a }) => T(ne, {
277
- data: a.original.tPlus ?? 0,
278
- onChange: (n) => {
279
- const l = c.payoutAccount.methods.at(a.index);
280
- l.tPlus = n;
281
- }
282
- })
283
- }
284
- ];
285
- return (a, n) => {
286
- const l = i("FmRadio"), p = i("FmRadioGroup"), x = i("FmSwitch"), I = i("FmSearch"), N = i("FmTable"), j = i("FmButton");
287
- return v(), C(B, null, [
288
- o("div", oe, [
289
- o("div", ae, [
290
- u(p, {
291
- modelValue: t.payoutAccount.status,
292
- "onUpdate:modelValue": n[0] || (n[0] = (A) => t.payoutAccount.status = A),
293
- label: "Account Status"
294
- }, {
295
- default: b(() => [
296
- u(l, {
297
- value: "NEW",
298
- label: "New"
299
- }),
300
- u(l, {
301
- value: "PENDING",
302
- label: "Pending"
303
- }),
304
- u(l, {
305
- value: "APPROVED",
306
- label: "Approved"
307
- })
308
- ]),
309
- _: 1
310
- }, 8, ["modelValue"])
311
- ]),
312
- o("div", le, [
313
- u(x, {
314
- modelValue: t.payoutAccount.enable,
315
- "onUpdate:modelValue": n[1] || (n[1] = (A) => t.payoutAccount.enable = A),
316
- disabled: !r.value,
317
- label: "Enabled",
318
- sublabel: "Merchant can use online features such as e-payment, settlement"
319
- }, null, 8, ["modelValue", "disabled"])
320
- ])
321
- ]),
322
- t.payoutAccount.enable ? (v(), C(B, { key: 0 }, [
323
- o("div", ue, [
324
- o("div", se, [
325
- u(I, {
326
- modelValue: k(m),
327
- "onUpdate:modelValue": n[2] || (n[2] = (A) => h(m) ? m.value = A : null),
328
- placeholder: "Search Method ..."
329
- }, null, 8, ["modelValue"])
330
- ])
331
- ]),
332
- u(N, {
333
- class: "mt-6",
334
- modelValue: y.value,
335
- "onUpdate:modelValue": n[3] || (n[3] = (A) => y.value = A),
336
- "search-value": k(m),
337
- "row-data": t.payoutAccount.methods,
338
- "column-defs": f
339
- }, null, 8, ["modelValue", "search-value", "row-data"])
340
- ], 64)) : V("", !0),
341
- u(j, {
342
- class: "w-full mt-6",
343
- variant: "primary",
344
- label: "Save",
345
- loading: e.value,
346
- onclick: () => s(t.payoutAccount)
347
- }, null, 8, ["loading", "onclick"])
348
- ], 64);
349
- };
350
- }
351
- }), ge = /* @__PURE__ */ S({
352
- __name: "PayoutAccountSetting",
353
- props: {
354
- accountId: {
355
- type: String,
356
- required: !0
357
- }
358
- },
359
- setup(t) {
360
- const c = t, { tab: e } = M({
361
- tab: "information"
362
- }), { isLoading: d, startAsyncCall: s } = H(!0), m = O(), r = w();
363
- async function y(l) {
364
- await $.updateById(
365
- c.accountId,
366
- l
367
- ), r.value = await $.readById(c.accountId);
368
- }
369
- function f() {
370
- s(async () => {
371
- r.value = await $.readById(c.accountId);
372
- });
373
- }
374
- q(f);
375
- const a = [
376
- {
377
- label: "Information",
378
- value: "information",
379
- icon: "overview",
380
- render: J
381
- },
382
- {
383
- label: "Settlement",
384
- value: "settlement",
385
- icon: "payments",
386
- render: ee
387
- },
388
- {
389
- label: "Payment",
390
- value: "payment",
391
- icon: "request_quote",
392
- render: re
393
- }
394
- ], n = R(() => {
395
- var l;
396
- return (l = a.find((p) => p.value === e.value)) == null ? void 0 : l.render;
397
- });
398
- return (l, p) => {
399
- var I;
400
- const x = i("FmTabs");
401
- return v(), P(K, {
402
- title: `Payout Account (${(I = r.value) == null ? void 0 : I._id})`,
403
- loading: k(d),
404
- onBack: k(m).back
405
- }, {
406
- default: b(() => [
407
- u(x, {
408
- "model-value": k(e),
409
- "onUpdate:modelValue": p[0] || (p[0] = (N) => h(e) ? e.value = N : null),
410
- class: "mb-6",
411
- items: a
412
- }, null, 8, ["model-value"]),
413
- k(e) ? (v(), P(_(n.value), D(z({ key: 0 }, {
414
- payoutAccount: r.value,
415
- onUpdate: y
416
- })), null, 16)) : V("", !0)
417
- ]),
418
- _: 1
419
- }, 8, ["title", "loading", "onBack"]);
420
- };
421
- }
422
- });
423
- export {
424
- ge as default
425
- };