@feedmepos/mf-payment 0.0.0-beta.22 → 0.0.0-beta.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-DWoahPJL.js +28 -0
  2. package/dist/{PayoutAccount-C3OOz1oi.js → PayoutAccount-BjGdteR8.js} +5 -5
  3. package/dist/{PayoutAccount-BGSq2B6o.js → PayoutAccount-CdKAjUed.js} +3 -3
  4. package/dist/{PayoutAccountSetting-WxLdT6mv.js → PayoutAccountSetting-DsqjVlIu.js} +5 -5
  5. package/dist/{Settlement-CKxNAHAH.js → Settlement-CY0-gXn5.js} +25 -23
  6. package/dist/{Settlement-DQcrZNvo.js → Settlement-DTE8p3LA.js} +27 -25
  7. package/dist/{SettlementTransactions-CUG4ePP_.js → SettlementTransactions-BJlBWR1G.js} +4 -4
  8. package/dist/{SettlementTransactions-V5fjLv7H.js → SettlementTransactions-C4tIk6nO.js} +4 -4
  9. package/dist/Terminal-C4gOl3zs.js +339 -0
  10. package/dist/{TerminalSetting-BuAaL5qK.js → TerminalSetting-DC9NBozT.js} +3 -3
  11. package/dist/{TerminalTransaction-D4c0ivQg.js → TerminalTransaction-BUT01dUv.js} +33 -31
  12. package/dist/{TerminalTransaction-DbjVvH2P.js → TerminalTransaction-CCdbfxx0.js} +33 -31
  13. package/dist/{Transaction-h2YrauW3.js → Transaction-60yViCMI.js} +53 -53
  14. package/dist/{Transaction-MrC2wj9k.js → Transaction-CoCZaBfu.js} +4 -4
  15. package/dist/api/index.d.ts +1 -0
  16. package/dist/app.js +13 -13
  17. package/dist/{assets-Cj6QBVPU.js → assets-BmFExmpA.js} +1 -1
  18. package/dist/clipboard-4jh1WteU.js +10 -0
  19. package/dist/components/AutoCopyCell.vue.d.ts +6 -0
  20. package/dist/{index-DA_XRfnd.js → index-Bvb4T6xz.js} +1 -1
  21. package/dist/{index-DN6pSWL_.js → index-CDgQhs3k.js} +1 -1
  22. package/dist/index-DeF94ACV.js +34 -0
  23. package/dist/{index-C58XD8h3.js → index-Df0izARr.js} +1 -1
  24. package/dist/{index-DYnNx4du.js → index-Jtghafz6.js} +1 -1
  25. package/dist/{index-De4-LJjg.js → index-_qikPh5K.js} +766 -766
  26. package/dist/{index.vue_vue_type_script_setup_true_lang-J6BwjC-p.js → index.vue_vue_type_script_setup_true_lang-CfU6stly.js} +1 -1
  27. package/dist/package.json +1 -1
  28. package/dist/{payout-account-BBG-e-NS.js → payout-account-CRgYpkAs.js} +147 -147
  29. package/dist/{transaction-BmxtNt6_.js → transaction-B5QUg556.js} +1 -1
  30. package/dist/tsconfig.app.tsbuildinfo +1 -1
  31. package/package.json +1 -1
  32. package/dist/Terminal-C_G_AuJZ.js +0 -318
  33. package/dist/index-CvMai9eW.js +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "0.0.0-beta.22",
3
+ "version": "0.0.0-beta.24",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,318 +0,0 @@
1
- import { defineComponent as x, openBlock as m, createElementBlock as $, createTextVNode as N, createElementVNode as k, toDisplayString as U, resolveComponent as c, createBlock as f, normalizeClass as R, withCtx as I, createCommentVNode as F, createVNode as _, ref as b, computed as z, unref as i, watch as P, isRef as Y, h as V } from "vue";
2
- import "./index-De4-LJjg.js";
3
- import { h as M } from "./moment-h96o7c8I.js";
4
- import { u as j } from "./index-DA_XRfnd.js";
5
- import { _ as L } from "./index.vue_vue_type_script_setup_true_lang-J6BwjC-p.js";
6
- import { _ as q } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
7
- import { useDialogChild as O, useDialog as Q, useSnackbar as G } from "@feedmepos/ui-library";
8
- import { t as w } from "./index-DYnNx4du.js";
9
- import { u as S } from "./error-K1CakhA9.js";
10
- import { z as D, a as K } from "./validator-D5jtpt9A.js";
11
- import { useCoreStore as H } from "@feedmepos/mf-common";
12
- import { w as J } from "./Modal-DB8M9o1T.js";
13
- import { useRouter as W } from "vue-router";
14
- const X = { class: "t-caption" }, Z = { class: "t-h1 my-6 text-center" }, ee = /* @__PURE__ */ x({
15
- __name: "TerminalBindCodeDialog",
16
- props: {
17
- code: {
18
- type: String,
19
- required: !0
20
- }
21
- },
22
- setup(d) {
23
- return (n, o) => (m(), $("div", X, [
24
- o[0] || (o[0] = N(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
25
- k("div", Z, U(d.code), 1)
26
- ]));
27
- }
28
- }), te = /* @__PURE__ */ x({
29
- __name: "ID",
30
- props: {
31
- row: {},
32
- data: {}
33
- },
34
- setup(d) {
35
- const n = d;
36
- function o() {
37
- return n.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
38
- }
39
- return (r, s) => {
40
- const a = c("FmBadge");
41
- return m(), f(a, {
42
- inline: "",
43
- class: R(o())
44
- }, {
45
- default: I(() => [
46
- k("div", null, U(r.data), 1)
47
- ]),
48
- _: 1
49
- }, 8, ["class"]);
50
- };
51
- }
52
- }), ne = { class: "flex" }, oe = /* @__PURE__ */ x({
53
- __name: "Actions",
54
- props: {
55
- data: {}
56
- },
57
- emits: ["link", "unlink", "edit"],
58
- setup(d, { emit: n }) {
59
- const o = n;
60
- return (r, s) => {
61
- const a = c("FmButton");
62
- return m(), $("div", ne, [
63
- r.data.deviceId ? F("", !0) : (m(), f(a, {
64
- key: 0,
65
- variant: "plain",
66
- "prepend-icon": "link",
67
- onClick: s[0] || (s[0] = () => o("link"))
68
- })),
69
- r.data.deviceId ? (m(), f(a, {
70
- key: 1,
71
- variant: "plain",
72
- "prepend-icon": "link_off",
73
- onClick: s[1] || (s[1] = () => o("unlink"))
74
- })) : F("", !0),
75
- _(a, {
76
- variant: "plain",
77
- "prepend-icon": "edit",
78
- onClick: s[2] || (s[2] = () => o("edit"))
79
- })
80
- ]);
81
- };
82
- }
83
- }), ae = /* @__PURE__ */ x({
84
- __name: "TerminalDialog",
85
- props: {
86
- terminal: {
87
- type: Object
88
- }
89
- },
90
- setup(d) {
91
- var g, C, T;
92
- const n = d, o = H(), r = O(), s = b(), a = b((g = n.terminal) == null ? void 0 : g.name), u = b((C = n.terminal) == null ? void 0 : C.referenceId), v = b(((T = n.terminal) == null ? void 0 : T.status) === "Active"), B = z(() => o.restaurants.value.map((t) => ({
93
- label: t.profile.name,
94
- value: t._id
95
- })));
96
- return (t, e) => {
97
- const l = c("FmSelect"), y = c("FmTextField"), p = c("FmSwitch"), A = c("FmButton"), E = c("FmForm");
98
- return m(), f(E, {
99
- ref: s.value,
100
- class: "flex flex-col gap-16 mb-6",
101
- onValidationSuccess: e[3] || (e[3] = () => {
102
- i(r).emitData({ name: a.value, referenceId: u.value, status: v.value ? "Active" : "Inactive" }), i(r).emitAction("primary");
103
- })
104
- }, {
105
- default: I(() => [
106
- n.terminal ? F("", !0) : (m(), f(l, {
107
- key: 0,
108
- modelValue: u.value,
109
- "onUpdate:modelValue": e[0] || (e[0] = (h) => u.value = h),
110
- label: "Restaurant",
111
- items: B.value,
112
- rules: i(D)(i(K).string())
113
- }, null, 8, ["modelValue", "items", "rules"])),
114
- _(y, {
115
- modelValue: a.value,
116
- "onUpdate:modelValue": e[1] || (e[1] = (h) => a.value = h),
117
- label: "Terminal Name",
118
- rules: i(D)(i(K).string())
119
- }, null, 8, ["modelValue", "rules"]),
120
- n.terminal ? (m(), f(p, {
121
- key: 1,
122
- modelValue: v.value,
123
- "onUpdate:modelValue": e[2] || (e[2] = (h) => v.value = h),
124
- label: "Status"
125
- }, null, 8, ["modelValue"])) : F("", !0),
126
- _(A, {
127
- type: "submit",
128
- label: "Create"
129
- })
130
- ]),
131
- _: 1
132
- }, 512);
133
- };
134
- }
135
- }), re = { class: "flex justify-between mb-6 items-center" }, se = { class: "flex space-x-4" }, le = { class: "flex space-x-4" }, ke = /* @__PURE__ */ x({
136
- __name: "Terminal",
137
- setup(d) {
138
- const n = b(), { searchKey: o } = j({
139
- searchKey: ""
140
- });
141
- let r;
142
- P(o, async () => {
143
- r && clearTimeout(r), r = setTimeout(
144
- () => {
145
- var t;
146
- return (t = n.value) == null ? void 0 : t.reset();
147
- },
148
- 700
149
- );
150
- });
151
- const s = W(), a = Q(), u = G();
152
- async function v(t) {
153
- J(
154
- a,
155
- "Terminal Unbind",
156
- "Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
157
- async () => {
158
- var e;
159
- try {
160
- await w.unbind(t), (e = n.value) == null || e.reset(), u.open({
161
- type: "success",
162
- message: "Terminal unbind successfully"
163
- });
164
- } catch (l) {
165
- u.open({
166
- type: "error",
167
- title: "Error occurs when unbind terminal",
168
- message: S(l)
169
- });
170
- }
171
- }
172
- );
173
- }
174
- async function B(t) {
175
- const e = await w.getBindCode(t);
176
- a.open({
177
- title: "Terminal Bind Code",
178
- closeButton: !0,
179
- overlay: !0,
180
- contentComponent: ee,
181
- contentComponentProps: { code: e }
182
- });
183
- }
184
- async function g(t) {
185
- a.open({
186
- title: t ? "Update Terminal" : "Create New Terminal",
187
- closeButton: !0,
188
- overlay: !0,
189
- contentComponent: ae,
190
- contentComponentProps: { terminal: t }
191
- }).onPrimary(async (e) => {
192
- var l;
193
- a.close();
194
- try {
195
- await w.create(e), (l = n.value) == null || l.reset(), u.open({
196
- type: "success",
197
- message: t ? "Terminal udpated successfully" : "Terminal created successfully."
198
- });
199
- } catch (y) {
200
- u.open({
201
- type: "error",
202
- title: "Error occurs when create terminal",
203
- message: S(y)
204
- });
205
- }
206
- });
207
- }
208
- const C = function(t) {
209
- return {
210
- id: t._id,
211
- status: t.status,
212
- referenceId: t.referenceId,
213
- name: t.name,
214
- deviceId: t.deviceId,
215
- updatedAt: M(t.updatedAt).format("YYYY-MM-DD hh:mm:ss")
216
- };
217
- }, T = [
218
- {
219
- accessorKey: "id",
220
- header: () => "Terminal ID",
221
- meta: {
222
- textAlign: "right"
223
- },
224
- cell: ({ cell: t, row: e }) => V(te, { row: e, data: t.getValue() })
225
- },
226
- {
227
- accessorKey: "name",
228
- header: () => "Name",
229
- meta: {
230
- textAlign: "left"
231
- }
232
- },
233
- {
234
- accessorKey: "referenceId",
235
- header: () => "Reference",
236
- meta: {
237
- textAlign: "left"
238
- }
239
- },
240
- {
241
- accessorKey: "deviceId",
242
- header: () => "Bound Device Id",
243
- meta: {
244
- textAlign: "left"
245
- }
246
- },
247
- {
248
- accessorKey: "updatedAt",
249
- header: () => "Last Updated",
250
- meta: {
251
- textAlign: "left"
252
- }
253
- },
254
- {
255
- accessorKey: "id",
256
- header: () => "Actions",
257
- meta: {
258
- textAlign: "center"
259
- },
260
- cell: ({ row: t }) => {
261
- var l;
262
- const e = (l = n.value) == null ? void 0 : l.pageData().at(t.index);
263
- return V(oe, {
264
- data: e,
265
- onLink: () => B(e._id),
266
- onUnlink: () => v(e._id),
267
- onEdit: () => g(e)
268
- });
269
- }
270
- }
271
- ];
272
- return (t, e) => {
273
- const l = c("FmSearch"), y = c("FmButton");
274
- return m(), f(q, {
275
- title: "Terminals",
276
- loading: !1
277
- }, {
278
- default: I(() => [
279
- k("div", re, [
280
- k("div", se, [
281
- _(l, {
282
- "model-value": i(o),
283
- "onUpdate:modelValue": e[0] || (e[0] = (p) => Y(o) ? o.value = p : null),
284
- class: "mr-8",
285
- label: "Search",
286
- placeholder: "Search Terminals ..."
287
- }, null, 8, ["model-value"])
288
- ]),
289
- k("div", le, [
290
- _(y, {
291
- label: "Create",
292
- icon: "add",
293
- onClick: e[1] || (e[1] = () => g())
294
- })
295
- ])
296
- ]),
297
- _(L, {
298
- ref_key: "controller",
299
- ref: n,
300
- "column-defs": T,
301
- "rows-defs": C,
302
- paginate: (p, A) => i(w).read({ searchKey: i(o), limit: p, cursor: A }),
303
- onRowClick: e[2] || (e[2] = (p) => i(s).push({
304
- name: "mf-payment-admin.terminal-setting",
305
- params: {
306
- terminalId: p._id
307
- }
308
- }))
309
- }, null, 8, ["paginate"])
310
- ]),
311
- _: 1
312
- });
313
- };
314
- }
315
- });
316
- export {
317
- ke as default
318
- };
@@ -1,26 +0,0 @@
1
- import { a as n, b as t, r, l as s } from "./index-De4-LJjg.js";
2
- const o = {
3
- async readTransactions(a) {
4
- return n(
5
- await t().get("/payments/terminal-transactions", {
6
- params: a
7
- })
8
- );
9
- },
10
- async readRestaurantTransactions(a) {
11
- return n(
12
- await r().get("/terminal-transactions", {
13
- params: a
14
- })
15
- );
16
- },
17
- async downloadTransactions(a) {
18
- return s(a, {
19
- exclude: ["logs", "owner"],
20
- filename: "terminal-transaction-report.xlsx"
21
- });
22
- }
23
- };
24
- export {
25
- o as t
26
- };