@feedmepos/mf-payment 1.0.2-beta.1 → 1.0.2-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.
- package/dist/{PayoutAccount-B1s3QYgu.js → PayoutAccount-WMo1Wi6d.js} +1 -1
- package/dist/{PayoutAccount-C9SN1Nvv.js → PayoutAccount-jO4yRGDD.js} +1 -1
- package/dist/Restaurant-BN04ZHox.js +302 -0
- package/dist/{SettlementTransactions-Dmhz9p1V.js → SettlementTransactions-DHoHXPTr.js} +1 -1
- package/dist/{SettlementTransactions-Xdb_g6jX.js → SettlementTransactions-Ye65VrAA.js} +1 -1
- package/dist/{Terminal-D-U0BVTe.js → Terminal-nWQ95k-W.js} +149 -131
- package/dist/{TerminalTransaction-Bh9FhkvQ.js → TerminalTransaction-D7Vy3Hn8.js} +181 -152
- package/dist/{Transaction-DA_TB9zD.js → Transaction-CeJhi9Hg.js} +1 -1
- package/dist/{Transaction-BedQtv8p.js → Transaction-DGoMEHjT.js} +123 -96
- package/dist/{app-O6Nt7xIq.js → app-CQiyh6x1.js} +202 -202
- package/dist/app.js +1 -1
- package/dist/grafana-CqkYm_ru.js +46 -0
- package/dist/helpers/grafana.d.ts +7 -0
- package/dist/model/transaction.d.ts +1 -0
- package/dist/package.json +1 -1
- package/dist/{payout-account-B7WTxG7n.js → payout-account-BHUNAuhN.js} +1 -1
- package/dist/{transaction-W49zE8RL.js → transaction-DGZWXzQ3.js} +8 -7
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/admin/restaurant/cell/LogButton.vue.d.ts +5 -0
- package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +3 -1
- package/dist/views/admin/transaction/TransactionTable.vue.d.ts +2 -0
- package/dist/views/admin/transaction/cell/Actions.vue.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Restaurant-ewsvVw3P.js +0 -262
@@ -1,18 +1,19 @@
|
|
1
|
-
import { defineComponent as
|
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
2
|
import "./index-1fXAFo2E.js";
|
3
|
-
import { h as
|
4
|
-
import { u as
|
5
|
-
import { _ as
|
6
|
-
import { _ as
|
3
|
+
import { h as q } from "./moment-h96o7c8I.js";
|
4
|
+
import { u as j } from "./index-DdJrUqkm.js";
|
5
|
+
import { _ as G } from "./index.vue_vue_type_script_setup_true_lang-GT2x04Bn.js";
|
6
|
+
import { _ as Q } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
|
7
7
|
import { useSnackbar as D, useDialogChild as H, useDialog as J } from "@feedmepos/ui-library";
|
8
8
|
import { t as A } from "./index-DeU3Qyca.js";
|
9
|
-
import { c as
|
9
|
+
import { c as O } from "./clipboard-4jh1WteU.js";
|
10
|
+
import { g as W } from "./grafana-CqkYm_ru.js";
|
10
11
|
import { u as N } from "./error-K1CakhA9.js";
|
11
12
|
import { z as R, a as U } from "./validator-D5jtpt9A.js";
|
12
|
-
import { useCoreStore as
|
13
|
-
import { w as
|
14
|
-
import { useRouter as
|
15
|
-
const
|
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({
|
16
17
|
__name: "TerminalBindCodeDialog",
|
17
18
|
props: {
|
18
19
|
code: {
|
@@ -20,145 +21,162 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
20
21
|
required: !0
|
21
22
|
}
|
22
23
|
},
|
23
|
-
setup(
|
24
|
-
const
|
24
|
+
setup(y) {
|
25
|
+
const o = y, i = D();
|
25
26
|
function r() {
|
26
27
|
try {
|
27
|
-
|
28
|
+
O(o.code), i.open({ title: "Text copied to clipboard." }, 1e3);
|
28
29
|
} catch {
|
29
|
-
|
30
|
+
i.open({ title: "Clipboard API incompatible." }, 1e3);
|
30
31
|
}
|
31
32
|
}
|
32
|
-
return (
|
33
|
-
|
34
|
-
|
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", {
|
35
36
|
class: "my-6 text-center fm-typo-en-title-md-800 tracking-[0.3rem] cursor-pointer hover:text-fm-color-neutral-gray-300",
|
36
|
-
onClick:
|
37
|
-
|
37
|
+
onClick: a[0] || (a[0] = (n) => {
|
38
|
+
n.stopPropagation(), r();
|
38
39
|
})
|
39
|
-
},
|
40
|
+
}, L(y.code), 1)
|
40
41
|
]));
|
41
42
|
}
|
42
|
-
}),
|
43
|
+
}), oe = /* @__PURE__ */ h({
|
43
44
|
__name: "ID",
|
44
45
|
props: {
|
45
46
|
row: {},
|
46
47
|
data: {}
|
47
48
|
},
|
48
|
-
setup(
|
49
|
-
const
|
49
|
+
setup(y) {
|
50
|
+
const o = y, i = D();
|
50
51
|
function r() {
|
51
|
-
return
|
52
|
+
return o.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
|
52
53
|
}
|
53
|
-
function
|
54
|
+
function d() {
|
54
55
|
try {
|
55
|
-
|
56
|
+
O(o.data), i.open({ title: "Text copied to clipboard." }, 1e3);
|
56
57
|
} catch {
|
57
|
-
|
58
|
+
i.open({ title: "Clipboard API incompatible." }, 1e3);
|
58
59
|
}
|
59
|
-
|
60
|
+
o.data;
|
60
61
|
}
|
61
|
-
return (
|
62
|
-
const
|
63
|
-
return
|
64
|
-
onClick:
|
65
|
-
|
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();
|
66
67
|
})
|
67
68
|
}, [
|
68
|
-
|
69
|
+
v(l, {
|
69
70
|
inline: "",
|
70
71
|
class: z(r())
|
71
72
|
}, {
|
72
|
-
default:
|
73
|
-
|
73
|
+
default: B(() => [
|
74
|
+
x("div", null, L(a.data), 1)
|
74
75
|
]),
|
75
76
|
_: 1
|
76
77
|
}, 8, ["class"])
|
77
78
|
]);
|
78
79
|
};
|
79
80
|
}
|
80
|
-
}),
|
81
|
+
}), ae = { class: "flex" }, re = /* @__PURE__ */ h({
|
81
82
|
__name: "Actions",
|
82
83
|
props: {
|
83
84
|
data: {}
|
84
85
|
},
|
85
86
|
emits: ["link", "unlink", "edit"],
|
86
|
-
setup(
|
87
|
-
const
|
88
|
-
|
89
|
-
const
|
90
|
-
|
91
|
-
|
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, {
|
92
110
|
key: 0,
|
93
111
|
variant: "plain",
|
94
112
|
"prepend-icon": "link",
|
95
|
-
onClick:
|
96
|
-
|
113
|
+
onClick: n[1] || (n[1] = (s) => {
|
114
|
+
s.stopPropagation(), r("link");
|
97
115
|
})
|
98
116
|
})) : F("", !0),
|
99
|
-
|
117
|
+
a.data.deviceType === "TERMINAL" && a.data.deviceId ? (g(), b(l, {
|
100
118
|
key: 1,
|
101
119
|
variant: "plain",
|
102
120
|
"prepend-icon": "link_off",
|
103
|
-
onClick:
|
104
|
-
|
121
|
+
onClick: n[2] || (n[2] = (s) => {
|
122
|
+
s.stopPropagation(), r("unlink");
|
105
123
|
})
|
106
124
|
})) : F("", !0),
|
107
|
-
|
125
|
+
v(l, {
|
108
126
|
variant: "plain",
|
109
127
|
"prepend-icon": "edit",
|
110
|
-
onClick:
|
111
|
-
|
128
|
+
onClick: n[3] || (n[3] = (s) => {
|
129
|
+
s.stopPropagation(), r("edit");
|
112
130
|
})
|
113
131
|
})
|
114
132
|
]);
|
115
133
|
};
|
116
134
|
}
|
117
|
-
}),
|
135
|
+
}), ie = /* @__PURE__ */ h({
|
118
136
|
__name: "TerminalDialog",
|
119
137
|
props: {
|
120
138
|
terminal: {
|
121
139
|
type: Object
|
122
140
|
}
|
123
141
|
},
|
124
|
-
setup(
|
125
|
-
var w,
|
126
|
-
const
|
142
|
+
setup(y) {
|
143
|
+
var w, _, I;
|
144
|
+
const o = y, i = X(), r = H(), 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) => ({
|
127
145
|
label: T.profile.name,
|
128
146
|
value: T._id
|
129
147
|
})));
|
130
|
-
return (T,
|
131
|
-
const e =
|
132
|
-
return
|
133
|
-
ref:
|
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,
|
134
152
|
class: "flex flex-col gap-16 mb-6",
|
135
|
-
onValidationSuccess:
|
136
|
-
|
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");
|
137
155
|
})
|
138
156
|
}, {
|
139
|
-
default:
|
140
|
-
|
157
|
+
default: B(() => [
|
158
|
+
o.terminal ? F("", !0) : (g(), b(e, {
|
141
159
|
key: 0,
|
142
|
-
modelValue:
|
143
|
-
"onUpdate:modelValue":
|
160
|
+
modelValue: n.value,
|
161
|
+
"onUpdate:modelValue": p[0] || (p[0] = (c) => n.value = c),
|
144
162
|
label: "Restaurant",
|
145
163
|
"helper-text": "If you can't find the restaurant please change the business to the restaurant's business.",
|
146
|
-
items:
|
147
|
-
rules:
|
164
|
+
items: s.value,
|
165
|
+
rules: m(R)(m(U).string())
|
148
166
|
}, null, 8, ["modelValue", "items", "rules"])),
|
149
|
-
|
150
|
-
modelValue:
|
151
|
-
"onUpdate:modelValue":
|
167
|
+
v(t, {
|
168
|
+
modelValue: a.value,
|
169
|
+
"onUpdate:modelValue": p[1] || (p[1] = (c) => a.value = c),
|
152
170
|
label: "Terminal Name",
|
153
|
-
rules:
|
171
|
+
rules: m(R)(m(U).string())
|
154
172
|
}, null, 8, ["modelValue", "rules"]),
|
155
|
-
|
173
|
+
o.terminal ? (g(), b(u, {
|
156
174
|
key: 1,
|
157
|
-
modelValue:
|
158
|
-
"onUpdate:modelValue":
|
175
|
+
modelValue: l.value,
|
176
|
+
"onUpdate:modelValue": p[2] || (p[2] = (c) => l.value = c),
|
159
177
|
label: "Status"
|
160
178
|
}, null, 8, ["modelValue"])) : F("", !0),
|
161
|
-
|
179
|
+
v(k, {
|
162
180
|
type: "submit",
|
163
181
|
label: "Create"
|
164
182
|
})
|
@@ -167,45 +185,45 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
167
185
|
}, 512);
|
168
186
|
};
|
169
187
|
}
|
170
|
-
}), le = { class: "flex justify-between mb-6 items-center" },
|
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({
|
171
189
|
__name: "Terminal",
|
172
|
-
setup(
|
173
|
-
const
|
190
|
+
setup(y) {
|
191
|
+
const o = C(), { searchKey: i, deviceType: r } = j({
|
174
192
|
searchKey: "",
|
175
193
|
deviceType: void 0
|
176
194
|
});
|
177
195
|
K(r, () => {
|
178
196
|
var e;
|
179
|
-
return (e =
|
197
|
+
return (e = o.value) == null ? void 0 : e.reset();
|
180
198
|
});
|
181
|
-
let
|
182
|
-
K(
|
183
|
-
|
199
|
+
let d;
|
200
|
+
K(i, async () => {
|
201
|
+
d && clearTimeout(d), d = setTimeout(
|
184
202
|
() => {
|
185
203
|
var e;
|
186
|
-
return (e =
|
204
|
+
return (e = o.value) == null ? void 0 : e.reset();
|
187
205
|
},
|
188
206
|
700
|
189
207
|
);
|
190
208
|
});
|
191
|
-
const
|
192
|
-
async function
|
193
|
-
|
194
|
-
|
209
|
+
const a = ee(), n = J(), l = D();
|
210
|
+
async function s(e) {
|
211
|
+
Z(
|
212
|
+
n,
|
195
213
|
"Terminal Unbind",
|
196
214
|
"Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
|
197
215
|
async () => {
|
198
216
|
var t;
|
199
217
|
try {
|
200
|
-
await A.unbind(e), (t =
|
218
|
+
await A.unbind(e), (t = o.value) == null || t.reset(), l.open({
|
201
219
|
type: "success",
|
202
220
|
message: "Terminal unbind successfully"
|
203
221
|
});
|
204
|
-
} catch (
|
205
|
-
|
222
|
+
} catch (u) {
|
223
|
+
l.open({
|
206
224
|
type: "error",
|
207
225
|
title: "Error occurs when unbind terminal",
|
208
|
-
message: N(
|
226
|
+
message: N(u)
|
209
227
|
});
|
210
228
|
}
|
211
229
|
}
|
@@ -213,34 +231,34 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
213
231
|
}
|
214
232
|
async function w(e) {
|
215
233
|
const t = await A.getBindCode(e);
|
216
|
-
|
234
|
+
n.open({
|
217
235
|
title: "Terminal Bind Code",
|
218
236
|
closeButton: !0,
|
219
237
|
overlay: !0,
|
220
|
-
contentComponent:
|
238
|
+
contentComponent: ne,
|
221
239
|
contentComponentProps: { code: t }
|
222
240
|
});
|
223
241
|
}
|
224
|
-
async function
|
225
|
-
|
242
|
+
async function _(e) {
|
243
|
+
n.open({
|
226
244
|
title: e ? "Update Terminal" : "Create New Terminal",
|
227
245
|
closeButton: !0,
|
228
246
|
overlay: !0,
|
229
|
-
contentComponent:
|
247
|
+
contentComponent: ie,
|
230
248
|
contentComponentProps: { terminal: e }
|
231
249
|
}).onPrimary(async (t) => {
|
232
|
-
var
|
233
|
-
|
250
|
+
var u;
|
251
|
+
n.close();
|
234
252
|
try {
|
235
|
-
await A.create(t), (
|
253
|
+
await A.create(t), (u = o.value) == null || u.reset(), l.open({
|
236
254
|
type: "success",
|
237
255
|
message: e ? "Terminal udpated successfully" : "Terminal created successfully."
|
238
256
|
});
|
239
|
-
} catch (
|
240
|
-
|
257
|
+
} catch (k) {
|
258
|
+
l.open({
|
241
259
|
type: "error",
|
242
260
|
title: "Error occurs when create terminal",
|
243
|
-
message: N(
|
261
|
+
message: N(k)
|
244
262
|
});
|
245
263
|
}
|
246
264
|
});
|
@@ -253,7 +271,7 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
253
271
|
name: e.name,
|
254
272
|
deviceId: e.deviceId,
|
255
273
|
deviceType: e.deviceType,
|
256
|
-
updatedAt:
|
274
|
+
updatedAt: q(e.updatedAt).format("YYYY-MM-DD hh:mm:ss")
|
257
275
|
};
|
258
276
|
}, T = [
|
259
277
|
{
|
@@ -262,7 +280,7 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
262
280
|
meta: {
|
263
281
|
textAlign: "right"
|
264
282
|
},
|
265
|
-
cell: ({ cell: e, row: t }) => E(
|
283
|
+
cell: ({ cell: e, row: t }) => E(oe, { row: t, data: e.getValue() })
|
266
284
|
},
|
267
285
|
{
|
268
286
|
accessorKey: "deviceType",
|
@@ -306,17 +324,17 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
306
324
|
textAlign: "center"
|
307
325
|
},
|
308
326
|
cell: ({ row: e }) => {
|
309
|
-
var
|
310
|
-
const t = (
|
311
|
-
return E(
|
327
|
+
var u;
|
328
|
+
const t = (u = o.value) == null ? void 0 : u.pageData().at(e.index);
|
329
|
+
return E(re, {
|
312
330
|
data: t,
|
313
331
|
onLink: () => w(t._id),
|
314
|
-
onUnlink: () =>
|
315
|
-
onEdit: () =>
|
332
|
+
onUnlink: () => s(t._id),
|
333
|
+
onEdit: () => _(t)
|
316
334
|
});
|
317
335
|
}
|
318
336
|
}
|
319
|
-
],
|
337
|
+
], p = [
|
320
338
|
{
|
321
339
|
label: "POS",
|
322
340
|
value: "POS"
|
@@ -331,47 +349,47 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
331
349
|
}
|
332
350
|
];
|
333
351
|
return (e, t) => {
|
334
|
-
const
|
335
|
-
return
|
352
|
+
const u = f("FmSearch"), k = f("FmSelect"), S = f("FmButton");
|
353
|
+
return g(), b(Q, {
|
336
354
|
title: "Terminals",
|
337
355
|
loading: !1
|
338
356
|
}, {
|
339
|
-
default:
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
"model-value":
|
344
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
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),
|
345
363
|
class: "mr-8",
|
346
364
|
label: "Search",
|
347
365
|
placeholder: "Search Terminals ..."
|
348
366
|
}, null, 8, ["model-value"]),
|
349
|
-
|
350
|
-
modelValue:
|
351
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
367
|
+
v(k, {
|
368
|
+
modelValue: m(r),
|
369
|
+
"onUpdate:modelValue": t[1] || (t[1] = (c) => P(r) ? r.value = c : null),
|
352
370
|
class: "ml-6 w-[180px]",
|
353
371
|
label: "Device",
|
354
|
-
items:
|
372
|
+
items: p
|
355
373
|
}, null, 8, ["modelValue"])
|
356
374
|
]),
|
357
|
-
|
358
|
-
|
375
|
+
x("div", ce, [
|
376
|
+
v(S, {
|
359
377
|
label: "Create",
|
360
378
|
icon: "add",
|
361
|
-
onClick: t[2] || (t[2] = () =>
|
379
|
+
onClick: t[2] || (t[2] = () => _())
|
362
380
|
})
|
363
381
|
])
|
364
382
|
]),
|
365
|
-
|
383
|
+
v(G, {
|
366
384
|
ref_key: "controller",
|
367
|
-
ref:
|
385
|
+
ref: o,
|
368
386
|
"column-defs": T,
|
369
387
|
"rows-defs": I,
|
370
|
-
paginate: (
|
371
|
-
onRowClick: t[3] || (t[3] = (
|
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({
|
372
390
|
name: "mf-payment-admin.terminal-setting",
|
373
391
|
params: {
|
374
|
-
terminalId:
|
392
|
+
terminalId: c._id
|
375
393
|
}
|
376
394
|
}))
|
377
395
|
}, null, 8, ["paginate"])
|
@@ -382,5 +400,5 @@ const ee = { class: "t-caption" }, te = /* @__PURE__ */ x({
|
|
382
400
|
}
|
383
401
|
});
|
384
402
|
export {
|
385
|
-
|
403
|
+
we as default
|
386
404
|
};
|