@feedmepos/mf-payment 1.4.1 → 1.4.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.
Files changed (22) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-B9x3HkUm.js → Actions.vue_vue_type_script_setup_true_lang-CqIt6ELp.js} +1 -1
  2. package/dist/{OnboardForm-CxRRT1rW.js → OnboardForm-BNyK_Vet.js} +2 -2
  3. package/dist/{OnboardForm-DMSxvjjH.js → OnboardForm-Cjrcx5AR.js} +2 -2
  4. package/dist/{OnboardSubmission-D7G55TdE.js → OnboardSubmission-BEy7c_d7.js} +1 -1
  5. package/dist/{OnboardSubmission-B0tK0WB5.js → OnboardSubmission-oe4t2AgG.js} +1 -1
  6. package/dist/{PayoutAccount-Dq_vnhiW.js → PayoutAccount-Bfw-iMZd.js} +1 -1
  7. package/dist/{PayoutAccount-Z2dgsREV.js → PayoutAccount-D0IOAymI.js} +3 -3
  8. package/dist/{SettlementTransactions-CQ0hG5oX.js → SettlementTransactions-BG1btImp.js} +1 -1
  9. package/dist/{SettlementTransactions-DAKnMkcC.js → SettlementTransactions-CXAt4toA.js} +1 -1
  10. package/dist/{Transaction-BamKY4nZ.js → Transaction-Cl6LzyIv.js} +1 -1
  11. package/dist/Transaction-LDOp9d9W.js +413 -0
  12. package/dist/{TransactionOld-7D5xC-0Y.js → TransactionOld-DqRQHymo.js} +2 -2
  13. package/dist/{app-Tr3kI1Wp.js → app-BBSHlMY3.js} +11 -11
  14. package/dist/app.js +1 -1
  15. package/dist/{assets-D5-bgB4H.js → assets-B67WKlO6.js} +1 -1
  16. package/dist/{index-DtJpO9_s.js → index-BvWJrSY2.js} +1 -1
  17. package/dist/package.json +1 -1
  18. package/dist/{payout-account-DLPHO8by.js → payout-account-CgJxxXw9.js} +2 -2
  19. package/dist/{plugins-BdnYXXEh.js → plugins-BADrx0Dw.js} +1 -1
  20. package/dist/tsconfig.app.tsbuildinfo +1 -1
  21. package/package.json +1 -1
  22. package/dist/Transaction-BAI8L2Xw.js +0 -409
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,409 +0,0 @@
1
- import { defineComponent as j, ref as D, watch as P, computed as q, onMounted as J, resolveComponent as h, openBlock as g, createElementBlock as k, Fragment as Y, unref as n, createBlock as x, createCommentVNode as L, withCtx as S, createVNode as p, renderList as O, createElementVNode as I, isRef as A, h as U } from "vue";
2
- import { t as E, c as w } from "./assets-D5-bgB4H.js";
3
- import { h as B } from "./moment-h96o7c8I.js";
4
- import { useI18n as z, useCoreStore as Q } from "@feedmepos/mf-common";
5
- import { _ as W } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
- import { u as X } from "./index-ILoz50zh.js";
7
- import { _ as Z } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
8
- import { _ as ee } from "./SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js";
9
- import { _ as ae } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
10
- import { p as te } from "./index-BWjmOoX3.js";
11
- import { t as ne } from "./index-C8G7ruiF.js";
12
- import { u as re, p as F } from "./index-C4FfKmPS.js";
13
- import { useSnackbar as se, useDialog as oe } from "@feedmepos/ui-library";
14
- import { _ as le, a as ie, b as ce, c as ue } from "./Actions.vue_vue_type_script_setup_true_lang-B9x3HkUm.js";
15
- import { g as me } from "./grafana-BrdrOUM4.js";
16
- import { w as G } from "./Modal-DB8M9o1T.js";
17
- import { u as $ } from "./error-K1CakhA9.js";
18
- import { _ as de } from "./index.vue_vue_type_script_setup_true_lang-v7o6C5Pg.js";
19
- const pe = /* @__PURE__ */ j({
20
- __name: "SourceSelector",
21
- props: {
22
- id: {},
23
- by: {}
24
- },
25
- emits: ["update:id", "update:by"],
26
- setup(H, { emit: m }) {
27
- const C = m, { t: i } = z(), { restaurants: s, currentBusiness: T, readRestaurants: y } = Q(), { isLoading: f, startAsyncCall: u } = re(!0), _ = D([]), v = D([]), c = D();
28
- P(c, () => {
29
- c.value && (C("update:id", c.value.value), C("update:by", c.value.by));
30
- });
31
- const V = q(() => [
32
- s.value.length > 0 && "payment.components.restaurant",
33
- v.value.length > 0 && "payment.components.device",
34
- _.value.length > 0 && "payment.components.payout_account"
35
- ].filter((t) => !!t)), R = q(() => ({
36
- "payment.components.restaurant": s.value.filter((t) => t.managable).map((t) => ({
37
- by: "RESTAURANT",
38
- prefix: i("payment.components.restaurant"),
39
- label: t.profile.name,
40
- value: t._id
41
- })),
42
- "payment.components.device": v.value.filter((t) => t.deviceType).map((t) => ({
43
- by: "DEVICE",
44
- prefix: i("payment.components.device"),
45
- label: t.deviceType + " | " + (t.deviceType === "TERMINAL" ? t.name : t.restaurant.profile.name),
46
- value: t._id
47
- })),
48
- "payment.components.payout_account": _.value.filter((t) => t.store.event).map((t) => {
49
- var b, a;
50
- return {
51
- by: "PAYOUT_ACCOUNT",
52
- prefix: i("payment.components.payout_account"),
53
- label: t.store.event + " | " + (((a = (b = t.ref) == null ? void 0 : b.profile) == null ? void 0 : a.name) ?? t.ref.name),
54
- value: t._id
55
- };
56
- })
57
- }));
58
- async function K() {
59
- return u(async () => {
60
- let t = await te.readBusinessPayoutAccounts();
61
- t.length !== 0 && (_.value = t);
62
- });
63
- }
64
- async function M() {
65
- return u(async () => {
66
- let t = await ne.getBusinessTerminals();
67
- t.length !== 0 && (v.value = t);
68
- });
69
- }
70
- async function N() {
71
- f.value = !0, await K(), await y(), await M(), f.value = !1;
72
- }
73
- return J(N), P(T, N), (t, b) => {
74
- const a = h("FmCircularProgress"), e = h("FmChip"), r = h("FmMenuItem"), l = h("FmMenu");
75
- return g(), k(Y, null, [
76
- n(f) ? (g(), x(a, {
77
- key: 0,
78
- size: "md"
79
- })) : L("", !0),
80
- n(f) ? L("", !0) : (g(), x(l, { key: 1 }, {
81
- "menu-button": S(() => {
82
- var o;
83
- return [
84
- p(e, {
85
- icon: "account_box",
86
- label: c.value ? c.value.prefix + " > " + ((o = c.value) == null ? void 0 : o.label) : n(i)("payment.components.select"),
87
- removable: !!c.value,
88
- onChipClosed: b[0] || (b[0] = (d) => c.value = void 0)
89
- }, null, 8, ["label", "removable"])
90
- ];
91
- }),
92
- default: S(() => [
93
- (g(!0), k(Y, null, O(V.value, (o) => (g(), x(l, {
94
- placement: "right-start",
95
- width: 200
96
- }, {
97
- "menu-button": S(() => [
98
- p(r, {
99
- label: n(i)(o),
100
- expandable: ""
101
- }, null, 8, ["label"])
102
- ]),
103
- default: S(() => [
104
- (g(!0), k(Y, null, O(R.value[o], (d) => (g(), x(r, {
105
- onClick: (be) => c.value = d,
106
- key: d.value,
107
- label: d.label,
108
- selectable: ""
109
- }, null, 8, ["onClick", "label"]))), 128))
110
- ]),
111
- _: 2
112
- }, 1024))), 256))
113
- ]),
114
- _: 1
115
- }))
116
- ], 64);
117
- };
118
- }
119
- }), ye = { class: "flex justify-between mb-6 items-center" }, fe = { class: "flex space-x-8 items-start" }, _e = { class: "flex space-x-4 self-center" }, ve = { class: "flex space-x-12 mb-6" }, Ye = /* @__PURE__ */ j({
120
- __name: "Transaction",
121
- setup(H) {
122
- var t, b;
123
- const m = se(), C = oe(), { sessionUser: i } = Q(), { t: s } = z(), T = D(), { dateRange: y, searchKey: f, status: u, id: _, by: v } = X({
124
- by: "",
125
- id: "",
126
- searchKey: "",
127
- status: [F.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS],
128
- dateRange: {
129
- startDate: B().startOf("day").format("YYYY-MM-DD"),
130
- endDate: B().endOf("day").format("YYYY-MM-DD")
131
- }
132
- }), c = [
133
- {
134
- label: "Success",
135
- value: F.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS
136
- },
137
- {
138
- label: "Refunded",
139
- value: F.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED
140
- },
141
- {
142
- label: "Process",
143
- value: F.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING
144
- },
145
- {
146
- label: "Failed",
147
- value: F.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED
148
- }
149
- ];
150
- async function V(a, e) {
151
- var r;
152
- try {
153
- const l = await E.refetchTransaction({ transactionId: a.id });
154
- (r = T.value) == null || r.replaceData(e, w(l)), m.open({
155
- type: "success",
156
- title: "Transaction queried and updated successfully."
157
- });
158
- } catch (l) {
159
- m.open({
160
- type: "error",
161
- title: "Fail to query transaction.",
162
- message: $(l)
163
- });
164
- }
165
- }
166
- async function R(a, e) {
167
- G(
168
- C,
169
- "Refund Transaction",
170
- "Are you sure to refund transaction? This action cannot be revert!",
171
- async () => {
172
- var r;
173
- try {
174
- const l = await E.refundTransaction({
175
- transactionId: a.id,
176
- reason: "portal transaction refund",
177
- amount: a.fdoAmount
178
- });
179
- (r = T.value) == null || r.replaceData(e, w(l)), m.open({
180
- type: "success",
181
- title: "Transaction refund request initiated."
182
- });
183
- } catch (l) {
184
- m.open({
185
- type: "error",
186
- title: "Fail to request refund transaction.",
187
- message: $(l)
188
- });
189
- }
190
- }
191
- );
192
- }
193
- async function K(a, e) {
194
- G(
195
- C,
196
- "Notify Transaction",
197
- "Are you sure to perform notify transaction?",
198
- async () => {
199
- try {
200
- await E.renotifyTransaction(a.id), m.open({
201
- type: "success",
202
- title: "Transaction notify successfully."
203
- });
204
- } catch (r) {
205
- m.open({
206
- type: "error",
207
- title: "Fail to notify transaction.",
208
- message: $(r)
209
- });
210
- }
211
- }
212
- );
213
- }
214
- async function M(a, e) {
215
- const r = me([
216
- {
217
- type: "span",
218
- queryKey: "transaction.id",
219
- queryValue: a.id
220
- }
221
- ], a.transactionAt);
222
- window.open(r, "_blank");
223
- }
224
- D("");
225
- const N = [
226
- {
227
- header: () => s("payment.transactions.table.id"),
228
- accessorKey: "id",
229
- cell: ({ cell: a, row: e }) => {
230
- var r, l;
231
- return ((r = i.value) != null && r.role.isStaff || (l = i.value) != null && l.role.isAdmin) && e.original.transactionId ? e.original.id + `
232
- ID: ` + e.original.transactionId : e.original.id;
233
- }
234
- },
235
- {
236
- header: () => s("payment.transactions.table.pay_id"),
237
- accessorKey: "payId"
238
- },
239
- {
240
- header: () => s("payment.transactions.table.gateway_id"),
241
- accessorKey: "gatewayTransactionId"
242
- },
243
- {
244
- header: () => s("payment.transactions.table.bill_seq"),
245
- accessorKey: "seqNumber"
246
- },
247
- {
248
- header: () => s("payment.transactions.table.gateway"),
249
- accessorKey: "gateway",
250
- meta: {
251
- textAlign: "center"
252
- },
253
- cell: ({ cell: a, row: e }) => e.original.gateway ? U(le, { row: e, data: a.getValue() }) : ""
254
- },
255
- {
256
- header: () => s("payment.transactions.table.method"),
257
- accessorKey: "method",
258
- meta: {
259
- textAlign: "center"
260
- },
261
- cell: ({ cell: a, row: e }) => e.original.method ? U(ie, { row: e, data: a.getValue() }) : ""
262
- },
263
- {
264
- header: () => s("payment.transactions.table.type"),
265
- accessorKey: "payFor",
266
- meta: {
267
- textAlign: "center"
268
- }
269
- },
270
- {
271
- header: () => s("payment.transactions.table.status"),
272
- accessorKey: "status",
273
- cell: ({ cell: a, row: e }) => U(ce, { row: e, data: a.getValue() })
274
- },
275
- {
276
- header: () => s("payment.transactions.table.restaurant"),
277
- accessorKey: "restaurantId"
278
- },
279
- {
280
- header: () => s("payment.transactions.table.source"),
281
- accessorKey: "source",
282
- cell: ({ cell: a, row: e }) => `(${e.original.sourceType}) ${e.original.source}`
283
- },
284
- {
285
- header: () => s("payment.transactions.table.transaction_at"),
286
- accessorKey: "transactionAt",
287
- meta: {
288
- width: "180px"
289
- },
290
- cell: ({ cell: a, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
291
- },
292
- {
293
- header: () => s("payment.transactions.table.sales_amount"),
294
- accessorKey: "amount",
295
- cell: ({ cell: a, row: e }) => {
296
- var r, l;
297
- return ((r = i.value) != null && r.role.isStaff || (l = i.value) != null && l.role.isAdmin) && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount;
298
- }
299
- }
300
- ];
301
- return ((t = i.value) != null && t.role.isStaff || (b = i.value) != null && b.role.isAdmin) && N.push({
302
- header: () => s("payment.transactions.table.actions"),
303
- accessorKey: "actions",
304
- cell: ({ row: a }) => U(ue, {
305
- transaction: a.original,
306
- onAction: (e) => {
307
- var r;
308
- switch (e) {
309
- case "notify":
310
- return K(a.original, a.index);
311
- case "query":
312
- return V(a.original, a.index);
313
- case "refund":
314
- return (r = i.value) != null && r.role.isStaff ? m.open({
315
- type: "error",
316
- title: "You are not allowed to refund transaction."
317
- }) : R(a.original, a.index);
318
- case "history":
319
- return M(a.original, a.index);
320
- }
321
- }
322
- })
323
- }), (a, e) => {
324
- const r = h("FmSearch"), l = h("FmSelect");
325
- return g(), x(W, {
326
- title: n(s)("payment.transactions.title"),
327
- description: n(s)("payment.transactions.description"),
328
- loading: !1
329
- }, {
330
- default: S(() => [
331
- I("div", ye, [
332
- I("div", fe, [
333
- p(r, {
334
- "model-value": n(f),
335
- "onUpdate:modelValue": e[0] || (e[0] = (o) => A(f) ? f.value = o : null),
336
- class: "mr-8",
337
- label: n(s)("payment.transactions.search.title"),
338
- placeholder: n(s)("payment.transactions.search.placeholder")
339
- }, null, 8, ["model-value", "label", "placeholder"]),
340
- p(l, {
341
- modelValue: n(u),
342
- "onUpdate:modelValue": e[2] || (e[2] = (o) => A(u) ? u.value = o : null),
343
- class: "mr-6 w-[300px]",
344
- label: n(s)("payment.transactions.status"),
345
- "label-mark": "required",
346
- multiselect: "",
347
- items: c
348
- }, {
349
- "prepend-menu": S(() => [
350
- p(ee, {
351
- modelValue: n(u),
352
- "onUpdate:modelValue": e[1] || (e[1] = (o) => A(u) ? u.value = o : null),
353
- items: c
354
- }, null, 8, ["modelValue"])
355
- ]),
356
- _: 1
357
- }, 8, ["modelValue", "label"])
358
- ]),
359
- I("div", _e, [
360
- p(Z, {
361
- button: {
362
- appendIcon: "file_download",
363
- variant: "primary",
364
- label: n(s)("payment.transactions.button.export")
365
- },
366
- handler: async () => {
367
- var d;
368
- const o = await ((d = T.value) == null ? void 0 : d.allData());
369
- o != null && await n(E).downloadPortalTransactionReport(n(y), o);
370
- }
371
- }, null, 8, ["button", "handler"])
372
- ])
373
- ]),
374
- I("div", ve, [
375
- p(pe, {
376
- id: n(_),
377
- "onUpdate:id": e[3] || (e[3] = (o) => A(_) ? _.value = o : null),
378
- by: n(v),
379
- "onUpdate:by": e[4] || (e[4] = (o) => A(v) ? v.value = o : null)
380
- }, null, 8, ["id", "by"]),
381
- p(ae, {
382
- modelValue: n(y),
383
- "onUpdate:modelValue": e[5] || (e[5] = (o) => A(y) ? y.value = o : null)
384
- }, null, 8, ["modelValue"])
385
- ]),
386
- p(de, {
387
- ref_key: "controller",
388
- ref: T,
389
- "column-defs": N,
390
- "rows-defs": n(w),
391
- paginate: (o, d) => n(E).readTransactionsV2({
392
- limit: o,
393
- cursor: d,
394
- status: n(u),
395
- by: n(v),
396
- id: n(_),
397
- start: n(y).startDate,
398
- end: n(y).endDate
399
- })
400
- }, null, 8, ["rows-defs", "paginate"])
401
- ]),
402
- _: 1
403
- }, 8, ["title", "description"]);
404
- };
405
- }
406
- });
407
- export {
408
- Ye as default
409
- };