@feedmepos/mf-payment 1.0.17-beta.1 → 1.0.18-beta.1
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.
- package/dist/{PayoutAccount-DVTKC9HU.js → PayoutAccount-DCq9zJ7I.js} +3 -3
- package/dist/{PayoutAccount-DaSWi1Me.js → PayoutAccount-Dlrre2MV.js} +83 -115
- package/dist/PayoutAccountSetting-D6Scsqvm.js +426 -0
- package/dist/{Restaurant-C-pno48_.js → Restaurant-AoDzEhKi.js} +4 -4
- package/dist/{RestaurantSetting-D5BXiTn2.js → RestaurantSetting-CAQfJwaq.js} +137 -115
- package/dist/{Settlement-Cgxts5eu.js → Settlement-anAN-1YR.js} +3 -3
- package/dist/Settlement-kfM1jLO-.js +444 -0
- package/dist/{SettlementTransactions-BXPsJSOI.js → SettlementTransactions-IhEM3Qtp.js} +4 -4
- package/dist/{SettlementTransactions-BWe-hWjq.js → SettlementTransactions-dVE594dr.js} +4 -4
- package/dist/Terminal-C0Irg7I_.js +435 -0
- package/dist/{TerminalSetting-BciOf47B.js → TerminalSetting-mMj1OSGc.js} +3 -3
- package/dist/{TerminalTransaction-BYlEOFjg.js → TerminalTransaction-2Oe5b_rm.js} +176 -188
- package/dist/TerminalTransaction-Coth2MwA.js +269 -0
- package/dist/Transaction-BbbVDMIm.js +247 -0
- package/dist/{Transaction-B362xcHT.js → Transaction-ChE2VgSa.js} +6 -6
- package/dist/{TransactionOld--8HuiCzC.js → TransactionOld-T8CKBB6U.js} +4 -4
- package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-yAM0nD2z.js → TransactionTable.vue_vue_type_script_setup_true_lang-CoPiWynn.js} +2 -2
- package/dist/api/index.d.ts +1 -1
- package/dist/api/settlement/index.d.ts +5 -1
- package/dist/api/terminal/index.d.ts +1 -0
- package/dist/api/terminal-transaction/index.d.ts +2 -2
- package/dist/{app-Dm8kGtux.js → app-B36bwKcX.js} +165 -165
- package/dist/app.js +1 -1
- package/dist/{assets-BDTkzAxB.js → assets-fxpnHIZr.js} +1 -1
- package/dist/grafana-BFQCDk-V.js +54 -0
- package/dist/index-9a-RyWYf.js +52 -0
- package/dist/{index-BroiGVyD.js → index-C2q2ptf8.js} +1 -1
- package/dist/{index-D7Uh09kd.js → index-CC8HNMje.js} +1 -1
- package/dist/{index-DmltKkqh.js → index-CEJAjyRa.js} +1 -1
- package/dist/{index-4uEqQ1dj.js → index-Cj90pU-C.js} +27 -20
- package/dist/{index-CtVHR2Os.js → index-DueuWuxx.js} +1 -1
- package/dist/{index-CZAwC5k6.js → index-ZMBnoQxd.js} +31 -23
- package/dist/{index.vue_vue_type_script_setup_true_lang-3Bmqvkzy.js → index.vue_vue_type_script_setup_true_lang-PfAufXp3.js} +1 -1
- package/dist/package.json +2 -2
- package/dist/{payout-account-BZ-WV3GM.js → payout-account-D-LZ6-Lb.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{transaction-XK-M9o1a.js → transaction-5dZS6JFA.js} +21 -12
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/admin/terminal/cell/Actions.vue.d.ts +2 -0
- package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +293 -0
- package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +147 -0
- package/package.json +2 -2
- package/dist/PayoutAccountSelector.vue_vue_type_script_setup_true_lang-CYE3OEXe.js +0 -110
- package/dist/PayoutAccountSetting-CqWDYDDi.js +0 -758
- package/dist/Settlement-I67N2bqy.js +0 -145
- package/dist/Terminal-o9zfC9WW.js +0 -404
- package/dist/TerminalTransaction-C_2wLJJV.js +0 -820
- package/dist/Transaction-gDdSiqs9.js +0 -145
- package/dist/grafana-Dtn-kbRH.js +0 -49
- package/dist/index-BC85ddk1.js +0 -47
- package/dist/index-CZ9tbaEh.js +0 -28
- package/dist/views/admin/payout-account/cell/IsActive.vue.d.ts +0 -7
- package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +0 -81
- package/dist/views/admin/terminal-transaction/cell/Timestamp.vue.d.ts +0 -7
@@ -1,145 +0,0 @@
|
|
1
|
-
import { defineComponent as h, ref as v, computed as x, resolveComponent as Y, openBlock as g, createBlock as D, h as S, onMounted as A, watch as R, withCtx as V, createElementVNode as m, createVNode as i, unref as n, isRef as $ } from "vue";
|
2
|
-
import { u as b } from "./index-D7Uh09kd.js";
|
3
|
-
import { h as _ } from "./moment-h96o7c8I.js";
|
4
|
-
import { useCoreStore as C } from "@feedmepos/mf-common";
|
5
|
-
import { _ as k } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
6
|
-
import { s as w } from "./index-4uEqQ1dj.js";
|
7
|
-
import "@feedmepos/ui-library";
|
8
|
-
import { d as f } from "./dinero-CIVmXLL-.js";
|
9
|
-
import { _ as F } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
|
10
|
-
import { useRouter as M } from "vue-router";
|
11
|
-
import { u as K } from "./index-CtVHR2Os.js";
|
12
|
-
import { _ as B } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
|
13
|
-
import { _ as I } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-p4qddIbp.js";
|
14
|
-
import { _ as L } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
|
15
|
-
const P = /* @__PURE__ */ h({
|
16
|
-
__name: "SettlementTable",
|
17
|
-
props: {
|
18
|
-
data: {
|
19
|
-
type: Array,
|
20
|
-
required: !0
|
21
|
-
},
|
22
|
-
loading: {
|
23
|
-
type: Boolean,
|
24
|
-
required: !0
|
25
|
-
}
|
26
|
-
},
|
27
|
-
emits: ["row-click"],
|
28
|
-
setup(y, { emit: d }) {
|
29
|
-
const t = y, c = d, r = v(""), u = [
|
30
|
-
{
|
31
|
-
header: () => "Settlement ID",
|
32
|
-
accessorKey: "id",
|
33
|
-
cell: ({ cell: e }) => S(F, { data: e.getValue() })
|
34
|
-
},
|
35
|
-
{
|
36
|
-
header: () => "Created At",
|
37
|
-
accessorKey: "transactionAt",
|
38
|
-
meta: {
|
39
|
-
width: "180px"
|
40
|
-
}
|
41
|
-
},
|
42
|
-
{
|
43
|
-
header: () => "Sales Amount",
|
44
|
-
accessorKey: "amount"
|
45
|
-
},
|
46
|
-
{
|
47
|
-
header: () => "Fee",
|
48
|
-
accessorKey: "fee"
|
49
|
-
},
|
50
|
-
{
|
51
|
-
header: () => "Settlement Amount",
|
52
|
-
accessorKey: "payout"
|
53
|
-
}
|
54
|
-
], s = x(() => t.data.map((e) => ({
|
55
|
-
id: e._id,
|
56
|
-
transactionAt: _(e.createdAt).format("YYYY-MM-DD"),
|
57
|
-
amount: f(e.totalAmount).toFormat("$0.00"),
|
58
|
-
fee: f(e.totalFee).toFormat("$0.00"),
|
59
|
-
payout: f(e.totalPayout).toFormat("$0.00")
|
60
|
-
})));
|
61
|
-
return (e, o) => {
|
62
|
-
const l = Y("FmTable");
|
63
|
-
return g(), D(l, {
|
64
|
-
modelValue: r.value,
|
65
|
-
"onUpdate:modelValue": o[0] || (o[0] = (a) => r.value = a),
|
66
|
-
"row-data": s.value,
|
67
|
-
"column-defs": u,
|
68
|
-
loading: t.loading,
|
69
|
-
onRowClick: o[1] || (o[1] = (a) => c("row-click", t.data.at(a.index)))
|
70
|
-
}, null, 8, ["modelValue", "row-data", "loading"]);
|
71
|
-
};
|
72
|
-
}
|
73
|
-
}), T = { class: "flex justify-between items-center mb-6" }, q = { class: "flex space-x-8 items-center" }, E = { class: "flex space-x-4 self-center" }, N = { class: "mb-6" }, ot = /* @__PURE__ */ h({
|
74
|
-
__name: "Settlement",
|
75
|
-
setup(y) {
|
76
|
-
const d = M(), { dateRange: t } = K({
|
77
|
-
dateRange: {
|
78
|
-
startDate: _().startOf("day").format("YYYY-MM-DD"),
|
79
|
-
endDate: _().endOf("day").format("YYYY-MM-DD")
|
80
|
-
}
|
81
|
-
}), { isLoading: c, startAsyncCall: r } = b(!0), { currentRestaurant: u } = C(), s = v([]);
|
82
|
-
async function e() {
|
83
|
-
await r(async () => {
|
84
|
-
const l = await w.readRestaurantSettlements(
|
85
|
-
{
|
86
|
-
start: t.value.startDate,
|
87
|
-
end: t.value.endDate
|
88
|
-
}
|
89
|
-
);
|
90
|
-
s.value = l;
|
91
|
-
});
|
92
|
-
}
|
93
|
-
function o() {
|
94
|
-
e();
|
95
|
-
}
|
96
|
-
return A(o), R([u, t], o), (l, a) => (g(), D(k, {
|
97
|
-
title: "Settlements",
|
98
|
-
description: "Settlements are the finalization of financial transactions, transferring funds to complete payments.",
|
99
|
-
loading: !1
|
100
|
-
}, {
|
101
|
-
default: V(() => [
|
102
|
-
m("div", T, [
|
103
|
-
m("div", q, [
|
104
|
-
i(I)
|
105
|
-
]),
|
106
|
-
m("div", E, [
|
107
|
-
i(B, {
|
108
|
-
button: {
|
109
|
-
appendIcon: "file_download",
|
110
|
-
variant: "primary",
|
111
|
-
label: "Export"
|
112
|
-
},
|
113
|
-
handler: async () => {
|
114
|
-
await n(w).downloadRestaurantSettlementReport({
|
115
|
-
start: n(t).startDate,
|
116
|
-
end: n(t).endDate
|
117
|
-
});
|
118
|
-
}
|
119
|
-
}, null, 8, ["handler"])
|
120
|
-
])
|
121
|
-
]),
|
122
|
-
m("div", N, [
|
123
|
-
i(L, {
|
124
|
-
modelValue: n(t),
|
125
|
-
"onUpdate:modelValue": a[0] || (a[0] = (p) => $(t) ? t.value = p : null)
|
126
|
-
}, null, 8, ["modelValue"])
|
127
|
-
]),
|
128
|
-
i(P, {
|
129
|
-
loading: n(c),
|
130
|
-
data: s.value,
|
131
|
-
onRowClick: a[1] || (a[1] = (p) => n(d).push({
|
132
|
-
name: "mf-payment-settlement-transaction",
|
133
|
-
params: {
|
134
|
-
settlementId: p._id
|
135
|
-
}
|
136
|
-
}))
|
137
|
-
}, null, 8, ["loading", "data"])
|
138
|
-
]),
|
139
|
-
_: 1
|
140
|
-
}));
|
141
|
-
}
|
142
|
-
});
|
143
|
-
export {
|
144
|
-
ot as default
|
145
|
-
};
|
@@ -1,404 +0,0 @@
|
|
1
|
-
import { defineComponent as h, openBlock as g, createElementBlock as V, createTextVNode as M, createElementVNode as x, toDisplayString as L, resolveComponent as f, createVNode as v, normalizeClass as z, withCtx as B, createBlock as b, createCommentVNode as F, ref as C, computed as Y, unref as m, watch as K, isRef as P, h as E } from "vue";
|
2
|
-
import "./index-D7Uh09kd.js";
|
3
|
-
import { h as q } from "./moment-h96o7c8I.js";
|
4
|
-
import { u as j } from "./index-CtVHR2Os.js";
|
5
|
-
import { _ as H } from "./index.vue_vue_type_script_setup_true_lang-3Bmqvkzy.js";
|
6
|
-
import { _ as G } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
|
7
|
-
import { useSnackbar as D, useDialogChild as Q, useDialog as J } from "@feedmepos/ui-library";
|
8
|
-
import { t as A } from "./index-BC85ddk1.js";
|
9
|
-
import { c as O } from "./clipboard-4jh1WteU.js";
|
10
|
-
import { g as W } from "./grafana-Dtn-kbRH.js";
|
11
|
-
import { u as N } from "./error-K1CakhA9.js";
|
12
|
-
import { z as R, a as U } from "./validator-D5jtpt9A.js";
|
13
|
-
import { useCoreStore as X } from "@feedmepos/mf-common";
|
14
|
-
import { w as Z } from "./Modal-DB8M9o1T.js";
|
15
|
-
import { useRouter as ee } from "vue-router";
|
16
|
-
const te = { class: "t-caption" }, ne = /* @__PURE__ */ h({
|
17
|
-
__name: "TerminalBindCodeDialog",
|
18
|
-
props: {
|
19
|
-
code: {
|
20
|
-
type: String,
|
21
|
-
required: !0
|
22
|
-
}
|
23
|
-
},
|
24
|
-
setup(y) {
|
25
|
-
const o = y, i = D();
|
26
|
-
function r() {
|
27
|
-
try {
|
28
|
-
O(o.code), i.open({ title: "Text copied to clipboard." }, 1e3);
|
29
|
-
} catch {
|
30
|
-
i.open({ title: "Clipboard API incompatible." }, 1e3);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
return (d, a) => (g(), V("div", te, [
|
34
|
-
a[1] || (a[1] = M(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
|
35
|
-
x("div", {
|
36
|
-
class: "my-6 text-center fm-typo-en-title-md-800 tracking-[0.3rem] cursor-pointer hover:text-fm-color-neutral-gray-300",
|
37
|
-
onClick: a[0] || (a[0] = (n) => {
|
38
|
-
n.stopPropagation(), r();
|
39
|
-
})
|
40
|
-
}, L(y.code), 1)
|
41
|
-
]));
|
42
|
-
}
|
43
|
-
}), oe = /* @__PURE__ */ h({
|
44
|
-
__name: "ID",
|
45
|
-
props: {
|
46
|
-
row: {},
|
47
|
-
data: {}
|
48
|
-
},
|
49
|
-
setup(y) {
|
50
|
-
const o = y, i = D();
|
51
|
-
function r() {
|
52
|
-
return o.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
|
53
|
-
}
|
54
|
-
function d() {
|
55
|
-
try {
|
56
|
-
O(o.data), i.open({ title: "Text copied to clipboard." }, 1e3);
|
57
|
-
} catch {
|
58
|
-
i.open({ title: "Clipboard API incompatible." }, 1e3);
|
59
|
-
}
|
60
|
-
o.data;
|
61
|
-
}
|
62
|
-
return (a, n) => {
|
63
|
-
const l = f("FmBadge");
|
64
|
-
return g(), V("div", {
|
65
|
-
onClick: n[0] || (n[0] = (s) => {
|
66
|
-
s.stopPropagation(), d();
|
67
|
-
})
|
68
|
-
}, [
|
69
|
-
v(l, {
|
70
|
-
inline: "",
|
71
|
-
class: z(r())
|
72
|
-
}, {
|
73
|
-
default: B(() => [
|
74
|
-
x("div", null, L(a.data), 1)
|
75
|
-
]),
|
76
|
-
_: 1
|
77
|
-
}, 8, ["class"])
|
78
|
-
]);
|
79
|
-
};
|
80
|
-
}
|
81
|
-
}), ae = { class: "flex" }, re = /* @__PURE__ */ h({
|
82
|
-
__name: "Actions",
|
83
|
-
props: {
|
84
|
-
data: {}
|
85
|
-
},
|
86
|
-
emits: ["link", "unlink", "edit"],
|
87
|
-
setup(y, { emit: o }) {
|
88
|
-
const i = y, r = o;
|
89
|
-
function d() {
|
90
|
-
const a = W([
|
91
|
-
{
|
92
|
-
type: "span",
|
93
|
-
queryKey: "terminal.id",
|
94
|
-
queryValue: i.data._id
|
95
|
-
}
|
96
|
-
]);
|
97
|
-
window.open(a, "_blank");
|
98
|
-
}
|
99
|
-
return (a, n) => {
|
100
|
-
const l = f("FmButton");
|
101
|
-
return g(), V("div", ae, [
|
102
|
-
v(l, {
|
103
|
-
variant: "plain",
|
104
|
-
"prepend-icon": "history",
|
105
|
-
onClick: n[0] || (n[0] = (s) => {
|
106
|
-
s.stopPropagation(), d();
|
107
|
-
})
|
108
|
-
}),
|
109
|
-
a.data.deviceType === "TERMINAL" && !a.data.deviceId ? (g(), b(l, {
|
110
|
-
key: 0,
|
111
|
-
variant: "plain",
|
112
|
-
"prepend-icon": "link",
|
113
|
-
onClick: n[1] || (n[1] = (s) => {
|
114
|
-
s.stopPropagation(), r("link");
|
115
|
-
})
|
116
|
-
})) : F("", !0),
|
117
|
-
a.data.deviceType === "TERMINAL" && a.data.deviceId ? (g(), b(l, {
|
118
|
-
key: 1,
|
119
|
-
variant: "plain",
|
120
|
-
"prepend-icon": "link_off",
|
121
|
-
onClick: n[2] || (n[2] = (s) => {
|
122
|
-
s.stopPropagation(), r("unlink");
|
123
|
-
})
|
124
|
-
})) : F("", !0),
|
125
|
-
v(l, {
|
126
|
-
variant: "plain",
|
127
|
-
"prepend-icon": "edit",
|
128
|
-
onClick: n[3] || (n[3] = (s) => {
|
129
|
-
s.stopPropagation(), r("edit");
|
130
|
-
})
|
131
|
-
})
|
132
|
-
]);
|
133
|
-
};
|
134
|
-
}
|
135
|
-
}), ie = /* @__PURE__ */ h({
|
136
|
-
__name: "TerminalDialog",
|
137
|
-
props: {
|
138
|
-
terminal: {
|
139
|
-
type: Object
|
140
|
-
}
|
141
|
-
},
|
142
|
-
setup(y) {
|
143
|
-
var w, _, I;
|
144
|
-
const o = y, i = X(), r = Q(), d = C(), a = C((w = o.terminal) == null ? void 0 : w.name), n = C((_ = o.terminal) == null ? void 0 : _.referenceId), l = C(((I = o.terminal) == null ? void 0 : I.status) === "Active"), s = Y(() => i.restaurants.value.map((T) => ({
|
145
|
-
label: T.profile.name,
|
146
|
-
value: T._id
|
147
|
-
})));
|
148
|
-
return (T, p) => {
|
149
|
-
const e = f("FmSelect"), t = f("FmTextField"), u = f("FmSwitch"), k = f("FmButton"), S = f("FmForm");
|
150
|
-
return g(), b(S, {
|
151
|
-
ref: d.value,
|
152
|
-
class: "flex flex-col gap-16 mb-6",
|
153
|
-
onValidationSuccess: p[3] || (p[3] = () => {
|
154
|
-
m(r).emitData({ name: a.value, referenceId: n.value, status: l.value ? "Active" : "Inactive" }), m(r).emitAction("primary");
|
155
|
-
})
|
156
|
-
}, {
|
157
|
-
default: B(() => [
|
158
|
-
o.terminal ? F("", !0) : (g(), b(e, {
|
159
|
-
key: 0,
|
160
|
-
modelValue: n.value,
|
161
|
-
"onUpdate:modelValue": p[0] || (p[0] = (c) => n.value = c),
|
162
|
-
label: "Restaurant",
|
163
|
-
"helper-text": "If you can't find the restaurant please change the business to the restaurant's business.",
|
164
|
-
items: s.value,
|
165
|
-
rules: m(R)(m(U).string())
|
166
|
-
}, null, 8, ["modelValue", "items", "rules"])),
|
167
|
-
v(t, {
|
168
|
-
modelValue: a.value,
|
169
|
-
"onUpdate:modelValue": p[1] || (p[1] = (c) => a.value = c),
|
170
|
-
label: "Terminal Name",
|
171
|
-
rules: m(R)(m(U).string())
|
172
|
-
}, null, 8, ["modelValue", "rules"]),
|
173
|
-
o.terminal ? (g(), b(u, {
|
174
|
-
key: 1,
|
175
|
-
modelValue: l.value,
|
176
|
-
"onUpdate:modelValue": p[2] || (p[2] = (c) => l.value = c),
|
177
|
-
label: "Status"
|
178
|
-
}, null, 8, ["modelValue"])) : F("", !0),
|
179
|
-
v(k, {
|
180
|
-
type: "submit",
|
181
|
-
label: "Create"
|
182
|
-
})
|
183
|
-
]),
|
184
|
-
_: 1
|
185
|
-
}, 512);
|
186
|
-
};
|
187
|
-
}
|
188
|
-
}), le = { class: "flex justify-between mb-6 items-center" }, se = { class: "flex space-x-4" }, ce = { class: "flex space-x-4" }, we = /* @__PURE__ */ h({
|
189
|
-
__name: "Terminal",
|
190
|
-
setup(y) {
|
191
|
-
const o = C(), { searchKey: i, deviceType: r } = j({
|
192
|
-
searchKey: "",
|
193
|
-
deviceType: void 0
|
194
|
-
});
|
195
|
-
K(r, () => {
|
196
|
-
var e;
|
197
|
-
return (e = o.value) == null ? void 0 : e.reset();
|
198
|
-
});
|
199
|
-
let d;
|
200
|
-
K(i, async () => {
|
201
|
-
d && clearTimeout(d), d = setTimeout(
|
202
|
-
() => {
|
203
|
-
var e;
|
204
|
-
return (e = o.value) == null ? void 0 : e.reset();
|
205
|
-
},
|
206
|
-
700
|
207
|
-
);
|
208
|
-
});
|
209
|
-
const a = ee(), n = J(), l = D();
|
210
|
-
async function s(e) {
|
211
|
-
Z(
|
212
|
-
n,
|
213
|
-
"Terminal Unbind",
|
214
|
-
"Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
|
215
|
-
async () => {
|
216
|
-
var t;
|
217
|
-
try {
|
218
|
-
await A.unbind(e), (t = o.value) == null || t.reset(), l.open({
|
219
|
-
type: "success",
|
220
|
-
message: "Terminal unbind successfully"
|
221
|
-
});
|
222
|
-
} catch (u) {
|
223
|
-
l.open({
|
224
|
-
type: "error",
|
225
|
-
title: "Error occurs when unbind terminal",
|
226
|
-
message: N(u)
|
227
|
-
});
|
228
|
-
}
|
229
|
-
}
|
230
|
-
);
|
231
|
-
}
|
232
|
-
async function w(e) {
|
233
|
-
const t = await A.getBindCode(e);
|
234
|
-
n.open({
|
235
|
-
title: "Terminal Bind Code",
|
236
|
-
closeButton: !0,
|
237
|
-
overlay: !0,
|
238
|
-
contentComponent: ne,
|
239
|
-
contentComponentProps: { code: t }
|
240
|
-
});
|
241
|
-
}
|
242
|
-
async function _(e) {
|
243
|
-
n.open({
|
244
|
-
title: e ? "Update Terminal" : "Create New Terminal",
|
245
|
-
closeButton: !0,
|
246
|
-
overlay: !0,
|
247
|
-
contentComponent: ie,
|
248
|
-
contentComponentProps: { terminal: e }
|
249
|
-
}).onPrimary(async (t) => {
|
250
|
-
var u;
|
251
|
-
n.close();
|
252
|
-
try {
|
253
|
-
await A.create(t), (u = o.value) == null || u.reset(), l.open({
|
254
|
-
type: "success",
|
255
|
-
message: e ? "Terminal udpated successfully" : "Terminal created successfully."
|
256
|
-
});
|
257
|
-
} catch (k) {
|
258
|
-
l.open({
|
259
|
-
type: "error",
|
260
|
-
title: "Error occurs when create terminal",
|
261
|
-
message: N(k)
|
262
|
-
});
|
263
|
-
}
|
264
|
-
});
|
265
|
-
}
|
266
|
-
const I = function(e) {
|
267
|
-
return {
|
268
|
-
id: e._id,
|
269
|
-
status: e.status,
|
270
|
-
referenceId: e.referenceId,
|
271
|
-
name: e.name,
|
272
|
-
deviceId: e.deviceId,
|
273
|
-
deviceType: e.deviceType,
|
274
|
-
updatedAt: q(e.updatedAt).format("YYYY-MM-DD HH:mm:ss")
|
275
|
-
};
|
276
|
-
}, T = [
|
277
|
-
{
|
278
|
-
accessorKey: "id",
|
279
|
-
header: () => "Terminal ID",
|
280
|
-
meta: {
|
281
|
-
textAlign: "right"
|
282
|
-
},
|
283
|
-
cell: ({ cell: e, row: t }) => E(oe, { row: t, data: e.getValue() })
|
284
|
-
},
|
285
|
-
{
|
286
|
-
accessorKey: "deviceType",
|
287
|
-
header: () => "Device Type",
|
288
|
-
meta: {
|
289
|
-
textAlign: "left"
|
290
|
-
}
|
291
|
-
},
|
292
|
-
{
|
293
|
-
accessorKey: "name",
|
294
|
-
header: () => "Name",
|
295
|
-
meta: {
|
296
|
-
textAlign: "left"
|
297
|
-
}
|
298
|
-
},
|
299
|
-
{
|
300
|
-
accessorKey: "referenceId",
|
301
|
-
header: () => "Reference",
|
302
|
-
meta: {
|
303
|
-
textAlign: "left"
|
304
|
-
}
|
305
|
-
},
|
306
|
-
{
|
307
|
-
accessorKey: "deviceId",
|
308
|
-
header: () => "Bound Device Id",
|
309
|
-
meta: {
|
310
|
-
textAlign: "left"
|
311
|
-
}
|
312
|
-
},
|
313
|
-
{
|
314
|
-
accessorKey: "updatedAt",
|
315
|
-
header: () => "Last Updated",
|
316
|
-
meta: {
|
317
|
-
textAlign: "left"
|
318
|
-
}
|
319
|
-
},
|
320
|
-
{
|
321
|
-
accessorKey: "id",
|
322
|
-
header: () => "Actions",
|
323
|
-
meta: {
|
324
|
-
textAlign: "center"
|
325
|
-
},
|
326
|
-
cell: ({ row: e }) => {
|
327
|
-
var u;
|
328
|
-
const t = (u = o.value) == null ? void 0 : u.pageData().at(e.index);
|
329
|
-
return E(re, {
|
330
|
-
data: t,
|
331
|
-
onLink: () => w(t._id),
|
332
|
-
onUnlink: () => s(t._id),
|
333
|
-
onEdit: () => _(t)
|
334
|
-
});
|
335
|
-
}
|
336
|
-
}
|
337
|
-
], p = [
|
338
|
-
{
|
339
|
-
label: "POS",
|
340
|
-
value: "POS"
|
341
|
-
},
|
342
|
-
{
|
343
|
-
label: "KIOSK",
|
344
|
-
value: "KIOSK"
|
345
|
-
},
|
346
|
-
{
|
347
|
-
label: "TERMINAL",
|
348
|
-
value: "TERMINAL"
|
349
|
-
}
|
350
|
-
];
|
351
|
-
return (e, t) => {
|
352
|
-
const u = f("FmSearch"), k = f("FmSelect"), S = f("FmButton");
|
353
|
-
return g(), b(G, {
|
354
|
-
title: "Terminals",
|
355
|
-
loading: !1
|
356
|
-
}, {
|
357
|
-
default: B(() => [
|
358
|
-
x("div", le, [
|
359
|
-
x("div", se, [
|
360
|
-
v(u, {
|
361
|
-
"model-value": m(i),
|
362
|
-
"onUpdate:modelValue": t[0] || (t[0] = (c) => P(i) ? i.value = c : null),
|
363
|
-
class: "mr-8",
|
364
|
-
label: "Search",
|
365
|
-
placeholder: "Search Terminals ..."
|
366
|
-
}, null, 8, ["model-value"]),
|
367
|
-
v(k, {
|
368
|
-
modelValue: m(r),
|
369
|
-
"onUpdate:modelValue": t[1] || (t[1] = (c) => P(r) ? r.value = c : null),
|
370
|
-
class: "ml-6 w-[180px]",
|
371
|
-
label: "Device",
|
372
|
-
items: p
|
373
|
-
}, null, 8, ["modelValue"])
|
374
|
-
]),
|
375
|
-
x("div", ce, [
|
376
|
-
v(S, {
|
377
|
-
label: "Create",
|
378
|
-
icon: "add",
|
379
|
-
onClick: t[2] || (t[2] = () => _())
|
380
|
-
})
|
381
|
-
])
|
382
|
-
]),
|
383
|
-
v(H, {
|
384
|
-
ref_key: "controller",
|
385
|
-
ref: o,
|
386
|
-
"column-defs": T,
|
387
|
-
"rows-defs": I,
|
388
|
-
paginate: (c, $) => m(A).read({ searchKey: m(i), deviceType: m(r), limit: c, cursor: $ }),
|
389
|
-
onRowClick: t[3] || (t[3] = (c) => m(a).push({
|
390
|
-
name: "mf-payment-admin.terminal-setting",
|
391
|
-
params: {
|
392
|
-
terminalId: c._id
|
393
|
-
}
|
394
|
-
}))
|
395
|
-
}, null, 8, ["paginate"])
|
396
|
-
]),
|
397
|
-
_: 1
|
398
|
-
});
|
399
|
-
};
|
400
|
-
}
|
401
|
-
});
|
402
|
-
export {
|
403
|
-
we as default
|
404
|
-
};
|