@feedmepos/mf-payment 0.0.0-beta.28 → 0.0.0-beta.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ import { defineComponent as b, resolveComponent as m, openBlock as g, createBloc
2
2
  import { u as S } from "./index-BYz1HdLk.js";
3
3
  import { _ as O } from "./index-CTWoVKkI.js";
4
4
  import { _ as K } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
5
- import { P as V } from "./payout-account-CgvGA6_e.js";
5
+ import { P as V } from "./payout-account-BT8stlNQ.js";
6
6
  import { p as D } from "./index-BvPakrCi.js";
7
7
  import "@feedmepos/ui-library";
8
8
  import { _ as T } from "./index.vue_vue_type_script_setup_true_lang-X-K_s8fy.js";
@@ -3,7 +3,7 @@ import { p as z } from "./index-BvPakrCi.js";
3
3
  import { _ as I, u as S, e as h } from "./index-CTWoVKkI.js";
4
4
  import { defineStore as _ } from "pinia";
5
5
  import { useCoreStore as $ } from "@feedmepos/mf-common";
6
- import { c as AA, P as j } from "./payout-account-CgvGA6_e.js";
6
+ import { c as AA, P as j } from "./payout-account-BT8stlNQ.js";
7
7
  import { useDialogChild as sA, useDialog as eA } from "@feedmepos/ui-library";
8
8
  import { z as f, a as q } from "./validator-D5jtpt9A.js";
9
9
  import { P as K } from "./PDFViewer-CjH_C1uT.js";
@@ -0,0 +1,254 @@
1
+ import { defineComponent as k, openBlock as w, createElementBlock as U, Fragment as N, createElementVNode as v, createTextVNode as V, toDisplayString as S, ref as y, onMounted as q, computed as C, resolveComponent as d, unref as I, createVNode as g, createBlock as T, withCtx as B, isRef as P, resolveDynamicComponent as E, normalizeProps as L, mergeProps as M, createCommentVNode as O } from "vue";
2
+ import { u as _ } from "./index-CTWoVKkI.js";
3
+ import { useRouter as $ } from "vue-router";
4
+ import { t as b } from "./index-DvBq8FZH.js";
5
+ import { _ as j } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
6
+ import { u as A } from "./index-BYz1HdLk.js";
7
+ import { useSnackbar as G } from "@feedmepos/ui-library";
8
+ import { u as R } from "./error-K1CakhA9.js";
9
+ const z = /* @__PURE__ */ k({
10
+ __name: "Information",
11
+ props: {
12
+ terminal: {
13
+ type: Object,
14
+ required: !0
15
+ }
16
+ },
17
+ setup(t) {
18
+ return (u, a) => (w(), U(N, null, [
19
+ a[0] || (a[0] = v("b", null, "Name", -1)),
20
+ V(": " + S(t.terminal.name), 1),
21
+ a[1] || (a[1] = v("br", null, null, -1)),
22
+ a[2] || (a[2] = v("b", null, "Status", -1)),
23
+ V(": " + S(t.terminal.status), 1),
24
+ a[3] || (a[3] = v("br", null, null, -1)),
25
+ a[4] || (a[4] = v("b", null, "Device ID", -1)),
26
+ V(": " + S(t.terminal.deviceId ?? "-"), 1),
27
+ a[5] || (a[5] = v("br", null, null, -1))
28
+ ], 64));
29
+ }
30
+ }), Q = {
31
+ key: 0,
32
+ class: "flex items-center justify-center min-h-[80vh]"
33
+ }, H = /* @__PURE__ */ k({
34
+ __name: "TerminalGateway",
35
+ props: {
36
+ terminal: {
37
+ type: Object,
38
+ required: !0
39
+ },
40
+ onUpdate: {
41
+ type: Function,
42
+ required: !0
43
+ }
44
+ },
45
+ setup(t) {
46
+ const { isLoading: u, startAsyncCall: a } = _(), m = t, f = y(), i = y(), o = y(-1), e = y({
47
+ terminalId: ""
48
+ });
49
+ q(() => {
50
+ if (a(async () => {
51
+ f.value = await b.getTerminals(m.terminal.referenceId);
52
+ }), !m.terminal.gateways)
53
+ return;
54
+ const n = m.terminal.gateways.findIndex((c) => c && c.gateway && c.gateway === "Terminal");
55
+ if (n === -1)
56
+ return;
57
+ o.value = n;
58
+ const r = m.terminal.gateways.at(n);
59
+ r.gateway === "Terminal" && r.config && (e.value = {
60
+ terminalId: r.config.terminalId
61
+ });
62
+ });
63
+ const s = C(() => (f.value ?? []).map((n) => ({
64
+ label: n.name ?? n._id,
65
+ value: n._id
66
+ })));
67
+ return (n, r) => {
68
+ const c = d("FmCircularProgress"), l = d("FmSelect"), p = d("FmButton"), x = d("FmForm");
69
+ return I(u) ? (w(), U("div", Q, [
70
+ g(c, { size: "xxl" })
71
+ ])) : (w(), T(x, {
72
+ key: 1,
73
+ ref: i.value,
74
+ class: "flex flex-col gap-16 w-[500px]",
75
+ onValidationSuccess: r[1] || (r[1] = () => {
76
+ o.value > -1 ? t.terminal.gateways[o.value] = { gateway: "Terminal", config: e.value } : (t.terminal.gateways || (t.terminal.gateways = []), t.terminal.gateways.push({ gateway: "Terminal", config: e.value })), m.onUpdate(t.terminal);
77
+ })
78
+ }, {
79
+ default: B(() => [
80
+ g(l, {
81
+ modelValue: e.value.terminalId,
82
+ "onUpdate:modelValue": r[0] || (r[0] = (F) => e.value.terminalId = F),
83
+ label: "Terminal ID",
84
+ items: s.value
85
+ }, null, 8, ["modelValue", "items"]),
86
+ g(p, {
87
+ type: "submit",
88
+ label: "Save"
89
+ })
90
+ ]),
91
+ _: 1
92
+ }, 512));
93
+ };
94
+ }
95
+ }), J = /* @__PURE__ */ k({
96
+ __name: "FiuuGateway",
97
+ props: {
98
+ terminal: {
99
+ type: Object,
100
+ required: !0
101
+ },
102
+ onUpdate: {
103
+ type: Function,
104
+ required: !0
105
+ }
106
+ },
107
+ setup(t) {
108
+ const u = t, a = [
109
+ {
110
+ label: "Fiuu Malaysia",
111
+ value: "cc.feedme.payment.rms"
112
+ },
113
+ {
114
+ label: "Fiuu Malaysia V2",
115
+ value: "cc.feedme.payment.fiuu_my"
116
+ },
117
+ {
118
+ label: "Fiuu Singapore",
119
+ value: "cc.feedme.payment.fiuu_sg"
120
+ }
121
+ ], m = y(), f = y(-1), i = y({
122
+ packageId: "",
123
+ uniqueId: ""
124
+ });
125
+ return q(() => {
126
+ if (!u.terminal.gateways)
127
+ return;
128
+ const o = u.terminal.gateways.findIndex((s) => s && s.gateway && s.gateway === "Fiuu");
129
+ if (o === -1)
130
+ return;
131
+ f.value = o;
132
+ const e = u.terminal.gateways.at(o);
133
+ e.gateway === "Fiuu" && e.config && (i.value = {
134
+ packageId: e.config.packageId,
135
+ uniqueId: e.config.uniqueId
136
+ });
137
+ }), (o, e) => {
138
+ const s = d("FmSelect"), n = d("FmTextField"), r = d("FmButton"), c = d("FmForm");
139
+ return w(), T(c, {
140
+ ref: m.value,
141
+ class: "flex flex-col gap-16 w-[500px]",
142
+ onValidationSuccess: e[2] || (e[2] = () => {
143
+ f.value > -1 ? t.terminal.gateways[f.value] = { gateway: "Fiuu", config: i.value } : (t.terminal.gateways || (t.terminal.gateways = []), t.terminal.gateways.push({ gateway: "Fiuu", config: i.value })), u.onUpdate(t.terminal);
144
+ })
145
+ }, {
146
+ default: B(() => [
147
+ g(s, {
148
+ modelValue: i.value.packageId,
149
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => i.value.packageId = l),
150
+ label: "Package ID",
151
+ items: a
152
+ }, null, 8, ["modelValue"]),
153
+ g(n, {
154
+ modelValue: i.value.uniqueId,
155
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => i.value.uniqueId = l),
156
+ label: "Unique ID"
157
+ }, null, 8, ["modelValue"]),
158
+ g(r, {
159
+ type: "submit",
160
+ label: "Save"
161
+ })
162
+ ]),
163
+ _: 1
164
+ }, 512);
165
+ };
166
+ }
167
+ }), te = /* @__PURE__ */ k({
168
+ __name: "TerminalSetting",
169
+ props: {
170
+ terminalId: {
171
+ type: String,
172
+ required: !0
173
+ }
174
+ },
175
+ setup(t) {
176
+ const u = t, { tab: a } = A({
177
+ tab: "information"
178
+ }), { isLoading: m, startAsyncCall: f } = _(!0), i = $(), o = G(), e = y();
179
+ async function s(l) {
180
+ try {
181
+ await b.updateById(
182
+ u.terminalId,
183
+ {
184
+ name: l.name,
185
+ status: l.status,
186
+ gateways: l.gateways ?? []
187
+ }
188
+ ), e.value = await b.readById(u.terminalId), o.open({
189
+ type: "success",
190
+ message: "Terminal updated successfully"
191
+ });
192
+ } catch (p) {
193
+ o.open({
194
+ type: "error",
195
+ title: "Error occurs when update terminal",
196
+ message: R(p)
197
+ });
198
+ }
199
+ }
200
+ const n = [
201
+ {
202
+ label: "Information",
203
+ value: "information",
204
+ icon: "overview",
205
+ render: z
206
+ },
207
+ {
208
+ label: "Fiuu",
209
+ value: "fiuu",
210
+ icon: "payment",
211
+ render: J
212
+ }
213
+ ], r = C(() => {
214
+ var l;
215
+ return (l = n.find((p) => p.value === a.value)) == null ? void 0 : l.render;
216
+ });
217
+ async function c() {
218
+ f(async () => {
219
+ e.value = await b.readById(u.terminalId), e.value.deviceType !== "TERMINAL" && n.push({
220
+ label: "Terminal",
221
+ value: "terminal",
222
+ icon: "shopping_cart_checkout",
223
+ render: H
224
+ });
225
+ });
226
+ }
227
+ return q(c), (l, p) => {
228
+ var F;
229
+ const x = d("FmTabs");
230
+ return w(), T(j, {
231
+ title: `Terminal (${(F = e.value) == null ? void 0 : F._id})`,
232
+ loading: I(m),
233
+ onBack: I(i).back
234
+ }, {
235
+ default: B(() => [
236
+ g(x, {
237
+ "model-value": I(a),
238
+ "onUpdate:modelValue": p[0] || (p[0] = (D) => P(a) ? a.value = D : null),
239
+ class: "mb-6",
240
+ items: n
241
+ }, null, 8, ["model-value"]),
242
+ I(a) ? (w(), T(E(r.value), L(M({ key: 0 }, {
243
+ terminal: e.value,
244
+ onUpdate: s
245
+ })), null, 16)) : O("", !0)
246
+ ]),
247
+ _: 1
248
+ }, 8, ["title", "loading", "onBack"]);
249
+ };
250
+ }
251
+ });
252
+ export {
253
+ te as default
254
+ };
package/dist/app.js CHANGED
@@ -9,7 +9,7 @@ const f = [
9
9
  meta: {
10
10
  sidebarDisplay: "Payout Accounts"
11
11
  },
12
- component: () => import("./PayoutAccount-DhS_swJU.js")
12
+ component: () => import("./PayoutAccount-CRpuF7oc.js")
13
13
  },
14
14
  {
15
15
  path: "/admin/payout-accounts/:accountId",
@@ -51,7 +51,7 @@ const f = [
51
51
  path: "/admin/terminal/:terminalId",
52
52
  name: "mf-payment-admin.terminal-setting",
53
53
  props: !0,
54
- component: () => import("./TerminalSetting-ByALrF_k.js")
54
+ component: () => import("./TerminalSetting-DJ-_DZr_.js")
55
55
  },
56
56
  {
57
57
  path: "/admin/terminal-transaction",
@@ -69,7 +69,7 @@ const f = [
69
69
  {
70
70
  path: "/payout-account",
71
71
  name: "mf-payment-payout-account",
72
- component: () => import("./PayoutAccount-B_q3YWPn.js"),
72
+ component: () => import("./PayoutAccount-DGZmraWC.js"),
73
73
  meta: {
74
74
  sidebarDisplay: "Payout Accounts"
75
75
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "0.0.0-beta.28",
3
+ "version": "0.0.0-beta.29",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"