@feedmepos/mf-payment 1.4.0 → 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 (26) hide show
  1. package/dist/Actions.vue_vue_type_script_setup_true_lang-CqIt6ELp.js +144 -0
  2. package/dist/{OnboardForm-BUITPCLG.js → OnboardForm-BNyK_Vet.js} +2 -2
  3. package/dist/{OnboardForm-B3Ej-hV_.js → OnboardForm-Cjrcx5AR.js} +2 -2
  4. package/dist/{OnboardSubmission-BoMaHHzE.js → OnboardSubmission-BEy7c_d7.js} +1 -1
  5. package/dist/{OnboardSubmission-C0yZsQjU.js → OnboardSubmission-oe4t2AgG.js} +1 -1
  6. package/dist/{PayoutAccount-D55CjZse.js → PayoutAccount-Bfw-iMZd.js} +1 -1
  7. package/dist/{PayoutAccount-Bz_X_FDJ.js → PayoutAccount-D0IOAymI.js} +3 -3
  8. package/dist/{Settlement-L8ukHWPs.js → Settlement-DW_ElmEK.js} +1 -2
  9. package/dist/{SettlementTransactions-C8o5Atmc.js → SettlementTransactions-BG1btImp.js} +1 -1
  10. package/dist/{SettlementTransactions-DG9nJuLQ.js → SettlementTransactions-CXAt4toA.js} +1 -1
  11. package/dist/{Transaction-CfC0yN9P.js → Transaction-Cl6LzyIv.js} +1 -1
  12. package/dist/Transaction-LDOp9d9W.js +413 -0
  13. package/dist/TransactionOld-DqRQHymo.js +309 -0
  14. package/dist/api/transaction/index.d.ts +4 -2
  15. package/dist/{app-CwgKwO4j.js → app-BBSHlMY3.js} +13 -13
  16. package/dist/app.js +1 -1
  17. package/dist/{assets-D4ayW3GC.js → assets-B67WKlO6.js} +62 -60
  18. package/dist/{index-BM7OisOh.js → index-BvWJrSY2.js} +1 -1
  19. package/dist/package.json +1 -1
  20. package/dist/{payout-account-BNS0PTHj.js → payout-account-CgJxxXw9.js} +2 -2
  21. package/dist/{plugins-DEpfQnZI.js → plugins-BADrx0Dw.js} +1 -1
  22. package/dist/tsconfig.app.tsbuildinfo +1 -1
  23. package/package.json +1 -1
  24. package/dist/Transaction-fhDUanwr.js +0 -250
  25. package/dist/TransactionOld-CObh3uJa.js +0 -99
  26. package/dist/TransactionTable.vue_vue_type_script_setup_true_lang-DPRIp0wx.js +0 -351
@@ -0,0 +1,309 @@
1
+ import { defineComponent as S, ref as K, watch as x, resolveComponent as F, openBlock as Y, createBlock as C, h as A, onMounted as M, unref as i, withCtx as O, createElementVNode as w, createVNode as _, isRef as R } from "vue";
2
+ import { t as v, c as $, b as U } from "./assets-B67WKlO6.js";
3
+ import { u as L } from "./index-C4FfKmPS.js";
4
+ import { useSnackbar as P, useDialog as B } from "@feedmepos/ui-library";
5
+ import { _ as J, a as j, b as G, c as Q } from "./Actions.vue_vue_type_script_setup_true_lang-CqIt6ELp.js";
6
+ import { g as z } from "./grafana-BrdrOUM4.js";
7
+ import { w as k } from "./Modal-DB8M9o1T.js";
8
+ import { u as V } from "./error-K1CakhA9.js";
9
+ import { useCoreStore as N, useI18n as E } from "@feedmepos/mf-common";
10
+ import { h as I } from "./moment-h96o7c8I.js";
11
+ import { _ as H } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
12
+ import { u as W } from "./index-ILoz50zh.js";
13
+ import { _ as X } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
14
+ import { _ as Z } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-DyLnqQYe.js";
15
+ import { _ as aa } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
16
+ const ea = /* @__PURE__ */ S({
17
+ __name: "TransactionTable",
18
+ props: {
19
+ data: {
20
+ type: Array,
21
+ required: !0
22
+ },
23
+ loading: {
24
+ type: Boolean,
25
+ required: !0
26
+ }
27
+ },
28
+ emits: ["row-click"],
29
+ setup(q, { emit: d }) {
30
+ var y, T;
31
+ const o = q, l = K([...o.data]);
32
+ x(
33
+ () => o.data,
34
+ (e) => {
35
+ l.value = [...e];
36
+ },
37
+ { deep: !0, immediate: !0 }
38
+ );
39
+ const D = d, c = P(), m = B(), { sessionUser: r } = N(), { t } = E();
40
+ async function h(e) {
41
+ try {
42
+ const a = await v.refetchTransaction({ transactionId: e.id });
43
+ l.value = l.value.map((n) => n.id === a._id ? $(a) : n), c.open({
44
+ type: "success",
45
+ title: "Transaction queried and updated successfully."
46
+ });
47
+ } catch (a) {
48
+ c.open({
49
+ type: "error",
50
+ title: "Fail to query transaction.",
51
+ message: V(a)
52
+ });
53
+ }
54
+ }
55
+ async function b(e) {
56
+ k(
57
+ m,
58
+ "Refund Transaction",
59
+ "Are you sure to refund transaction? This action cannot be revert!",
60
+ async () => {
61
+ try {
62
+ const a = await v.refundTransaction({
63
+ transactionId: e.id,
64
+ reason: "portal transaction refund",
65
+ amount: e.fdoAmount
66
+ });
67
+ l.value = l.value.map((n) => n.id === a._id ? $(a) : n), c.open({
68
+ type: "success",
69
+ title: "Transaction refund request initiated."
70
+ });
71
+ } catch (a) {
72
+ c.open({
73
+ type: "error",
74
+ title: "Fail to request refund transaction.",
75
+ message: V(a)
76
+ });
77
+ }
78
+ }
79
+ );
80
+ }
81
+ async function g(e) {
82
+ k(
83
+ m,
84
+ "Notify Transaction",
85
+ "Are you sure to perform notify transaction?",
86
+ async () => {
87
+ try {
88
+ await v.renotifyTransaction(e.id), c.open({
89
+ type: "success",
90
+ title: "Transaction notify successfully."
91
+ });
92
+ } catch (a) {
93
+ c.open({
94
+ type: "error",
95
+ title: "Fail to notify transaction.",
96
+ message: V(a)
97
+ });
98
+ }
99
+ }
100
+ );
101
+ }
102
+ async function f(e) {
103
+ const a = z([
104
+ {
105
+ type: "span",
106
+ queryKey: "transaction.id",
107
+ queryValue: e.id
108
+ }
109
+ ], e.transactionAt);
110
+ window.open(a, "_blank");
111
+ }
112
+ const s = K(""), p = [
113
+ {
114
+ header: () => t("payment.transactions.table.id"),
115
+ accessorKey: "id",
116
+ cell: ({ cell: e, row: a }) => {
117
+ var n, u;
118
+ return ((n = r.value) != null && n.role.isStaff || (u = r.value) != null && u.role.isAdmin) && a.original.transactionId ? a.original.id + `
119
+ ID: ` + a.original.transactionId : a.original.id;
120
+ }
121
+ },
122
+ {
123
+ header: () => t("payment.transactions.table.pay_id"),
124
+ accessorKey: "payId"
125
+ },
126
+ {
127
+ header: () => t("payment.transactions.table.gateway_id"),
128
+ accessorKey: "gatewayTransactionId"
129
+ },
130
+ {
131
+ header: () => t("payment.transactions.table.bill_seq"),
132
+ accessorKey: "seqNumber"
133
+ },
134
+ {
135
+ header: () => t("payment.transactions.table.gateway"),
136
+ accessorKey: "gateway",
137
+ meta: {
138
+ textAlign: "center"
139
+ },
140
+ cell: ({ cell: e, row: a }) => a.original.gateway ? A(J, { row: a, data: e.getValue() }) : ""
141
+ },
142
+ {
143
+ header: () => t("payment.transactions.table.method"),
144
+ accessorKey: "method",
145
+ meta: {
146
+ textAlign: "center"
147
+ },
148
+ cell: ({ cell: e, row: a }) => a.original.method ? A(j, { row: a, data: e.getValue() }) : ""
149
+ },
150
+ {
151
+ header: () => t("payment.transactions.table.type"),
152
+ accessorKey: "payFor",
153
+ meta: {
154
+ textAlign: "center"
155
+ }
156
+ },
157
+ {
158
+ header: () => t("payment.transactions.table.status"),
159
+ accessorKey: "status",
160
+ cell: ({ cell: e, row: a }) => A(G, { row: a, data: e.getValue() })
161
+ },
162
+ {
163
+ header: () => t("payment.transactions.table.restaurant"),
164
+ accessorKey: "restaurantId"
165
+ },
166
+ {
167
+ header: () => t("payment.transactions.table.source"),
168
+ accessorKey: "source",
169
+ cell: ({ cell: e, row: a }) => `(${a.original.sourceType}) ${a.original.source}`
170
+ },
171
+ {
172
+ header: () => t("payment.transactions.table.transaction_at"),
173
+ accessorKey: "transactionAt",
174
+ meta: {
175
+ width: "180px"
176
+ },
177
+ cell: ({ cell: e, row: a }) => a.original.status === "REFUNDED" ? a.original.refundedAt : a.original.transactionAt
178
+ },
179
+ {
180
+ header: () => t("payment.transactions.table.sales_amount"),
181
+ accessorKey: "amount",
182
+ cell: ({ cell: e, row: a }) => {
183
+ var n, u;
184
+ return ((n = r.value) != null && n.role.isStaff || (u = r.value) != null && u.role.isAdmin) && a.original.flags.isDelivery ? a.original.amount + "( " + a.original.gatewayAmount + ")" : a.original.amount;
185
+ }
186
+ }
187
+ ];
188
+ return ((y = r.value) != null && y.role.isStaff || (T = r.value) != null && T.role.isAdmin) && p.push({
189
+ header: () => t("payment.transactions.table.actions"),
190
+ accessorKey: "actions",
191
+ cell: ({ row: e }) => A(Q, {
192
+ transaction: e.original,
193
+ onAction: (a) => {
194
+ var n;
195
+ switch (a) {
196
+ case "notify":
197
+ return g(e.original);
198
+ case "query":
199
+ return h(e.original);
200
+ case "refund":
201
+ return (n = r.value) != null && n.role.isStaff ? c.open({
202
+ type: "error",
203
+ title: "You are not allowed to refund transaction."
204
+ }) : b(e.original);
205
+ case "history":
206
+ return f(e.original);
207
+ }
208
+ }
209
+ })
210
+ }), (e, a) => {
211
+ const n = F("FmTable");
212
+ return Y(), C(n, {
213
+ modelValue: s.value,
214
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => s.value = u),
215
+ "column-defs": p,
216
+ "row-data": l.value,
217
+ loading: o.loading,
218
+ onRowClick: a[1] || (a[1] = (u) => D("row-click", l.value.at(u.index)))
219
+ }, null, 8, ["modelValue", "row-data", "loading"]);
220
+ };
221
+ }
222
+ }), ta = { class: "flex justify-between mb-6 items-center" }, na = { class: "flex space-x-8" }, ra = { class: "flex space-x-4 self-center" }, oa = { class: "mb-6" }, Ta = /* @__PURE__ */ S({
223
+ __name: "TransactionOld",
224
+ setup(q) {
225
+ const { dateRange: d, searchKey: o } = W({
226
+ searchKey: "",
227
+ dateRange: {
228
+ startDate: I().startOf("day").format("YYYY-MM-DD"),
229
+ endDate: I().endOf("day").format("YYYY-MM-DD")
230
+ }
231
+ }), { isLoading: l, startAsyncCall: D } = L(!0), { currentRestaurant: c } = N(), { t: m } = E(), r = K([]), t = K([]);
232
+ async function h() {
233
+ await D(async () => {
234
+ const { startDate: f, endDate: s } = d.value, p = await v.readRestaurantTransactions({
235
+ start: f,
236
+ end: s
237
+ });
238
+ if (r.value = U(p), t.value = r.value, o.value > "") {
239
+ var y = new RegExp(o.value, "i");
240
+ t.value = r.value.filter((T) => {
241
+ const e = JSON.stringify(T);
242
+ return y.test(e);
243
+ });
244
+ }
245
+ });
246
+ }
247
+ function b() {
248
+ h();
249
+ }
250
+ M(b), x(c, b), x(d, h);
251
+ let g;
252
+ return x(o, async () => {
253
+ g && clearTimeout(g), g = setTimeout(() => {
254
+ var f = new RegExp(o.value, "i");
255
+ t.value = r.value.filter((s) => {
256
+ const p = JSON.stringify(s);
257
+ return f.test(p);
258
+ });
259
+ }, 700);
260
+ }), (f, s) => {
261
+ const p = F("FmSearch");
262
+ return Y(), C(H, {
263
+ title: i(m)("payment.transactions.title"),
264
+ description: i(m)("payment.transactions.description"),
265
+ loading: i(l)
266
+ }, {
267
+ default: O(() => [
268
+ w("div", ta, [
269
+ w("div", na, [
270
+ _(Z),
271
+ _(p, {
272
+ "model-value": i(o),
273
+ "onUpdate:modelValue": s[0] || (s[0] = (y) => R(o) ? o.value = y : null),
274
+ label: i(m)("payment.transactions.search.title"),
275
+ placeholder: i(m)("payment.transactions.search.placeholder")
276
+ }, null, 8, ["model-value", "label", "placeholder"])
277
+ ]),
278
+ w("div", ra, [
279
+ _(X, {
280
+ button: {
281
+ appendIcon: "file_download",
282
+ variant: "primary",
283
+ label: i(m)("payment.transactions.button.export")
284
+ },
285
+ handler: async () => {
286
+ await i(v).downloadPortalTransactionReport(i(d), r.value, !0);
287
+ }
288
+ }, null, 8, ["button", "handler"])
289
+ ])
290
+ ]),
291
+ w("div", oa, [
292
+ _(aa, {
293
+ modelValue: i(d),
294
+ "onUpdate:modelValue": s[1] || (s[1] = (y) => R(d) ? d.value = y : null)
295
+ }, null, 8, ["modelValue"])
296
+ ]),
297
+ _(ea, {
298
+ loading: i(l),
299
+ data: t.value
300
+ }, null, 8, ["loading", "data"])
301
+ ]),
302
+ _: 1
303
+ }, 8, ["title", "description", "loading"]);
304
+ };
305
+ }
306
+ });
307
+ export {
308
+ Ta as default
309
+ };
@@ -1,6 +1,6 @@
1
1
  import type { PortalPaymentTransaction } from "@/model/transaction";
2
2
  import { FdoPaymentTransactionV2Output, PaymentRefundByTransactionIdDto } from "@feedmepos/payment-entity";
3
- import type { F_PAYMENT_TRANSACTION_STATUS } from "@feedmepos/payment-entity";
3
+ import type { F_PAYMENT_TRANSACTION_STATUS, PaginatedResult } from "@feedmepos/payment-entity";
4
4
  export declare const transactionApi: {
5
5
  readBySettlementId(settlementId: string): Promise<FdoPaymentTransactionV2Output[]>;
6
6
  readTransactions(params: {
@@ -26,7 +26,9 @@ export declare const transactionApi: {
26
26
  by: string;
27
27
  start: string;
28
28
  end: string;
29
- }): Promise<FdoPaymentTransactionV2Output[]>;
29
+ limit: number;
30
+ cursor: string;
31
+ }): Promise<PaginatedResult<FdoPaymentTransactionV2Output>>;
30
32
  readRestaurantTransactionsBySettlementId(settlementId: string): Promise<FdoPaymentTransactionV2Output[]>;
31
33
  downloadPortalTransactionReport(dateRange: {
32
34
  startDate: string;
@@ -383,7 +383,7 @@ const Gn = {
383
383
  sidebarDisplay: "Payout Accounts",
384
384
  section: "payment-gateway"
385
385
  },
386
- component: () => import("./PayoutAccount-D55CjZse.js")
386
+ component: () => import("./PayoutAccount-Bfw-iMZd.js")
387
387
  },
388
388
  {
389
389
  path: "/admin/payout-accounts/:accountId",
@@ -401,7 +401,7 @@ const Gn = {
401
401
  sidebarDisplay: "Payment Onboarding",
402
402
  section: "payment-gateway"
403
403
  },
404
- component: () => import("./OnboardSubmission-C0yZsQjU.js")
404
+ component: () => import("./OnboardSubmission-oe4t2AgG.js")
405
405
  },
406
406
  {
407
407
  path: "/admin/onboarding/:submissionId",
@@ -410,7 +410,7 @@ const Gn = {
410
410
  meta: {
411
411
  parent: "mf-payment-admin.onboard-submission"
412
412
  },
413
- component: () => import("./OnboardForm-BUITPCLG.js")
413
+ component: () => import("./OnboardForm-BNyK_Vet.js")
414
414
  },
415
415
  {
416
416
  path: "/admin/terminal/pos",
@@ -481,7 +481,7 @@ const Gn = {
481
481
  meta: {
482
482
  sidebarDisplay: "Transactions"
483
483
  },
484
- component: () => import("./Transaction-CfC0yN9P.js")
484
+ component: () => import("./Transaction-Cl6LzyIv.js")
485
485
  },
486
486
  {
487
487
  path: "/admin/settlement",
@@ -498,7 +498,7 @@ const Gn = {
498
498
  meta: {
499
499
  parent: "mf-payment-admin.settlement"
500
500
  },
501
- component: () => import("./SettlementTransactions-C8o5Atmc.js")
501
+ component: () => import("./SettlementTransactions-BG1btImp.js")
502
502
  }
503
503
  ], We = [
504
504
  {
@@ -508,7 +508,7 @@ const Gn = {
508
508
  {
509
509
  path: "/payout-account",
510
510
  name: "mf-payment-payout-account",
511
- component: () => import("./PayoutAccount-Bz_X_FDJ.js"),
511
+ component: () => import("./PayoutAccount-D0IOAymI.js"),
512
512
  meta: {
513
513
  sidebarDisplay: "i18n:payment.routes.payout_account"
514
514
  }
@@ -516,7 +516,7 @@ const Gn = {
516
516
  {
517
517
  path: "/onboard-submission",
518
518
  name: "mf-payment-onboard-submission",
519
- component: () => import("./OnboardSubmission-BoMaHHzE.js"),
519
+ component: () => import("./OnboardSubmission-BEy7c_d7.js"),
520
520
  meta: {
521
521
  sidebarDisplay: "i18n:payment.routes.onboard_submission",
522
522
  region: { MY: !0 }
@@ -526,7 +526,7 @@ const Gn = {
526
526
  path: "/onboard-submission/:type/:submission?",
527
527
  name: "mf-payment-onboard-submission-form",
528
528
  props: !0,
529
- component: () => import("./OnboardForm-B3Ej-hV_.js"),
529
+ component: () => import("./OnboardForm-Cjrcx5AR.js"),
530
530
  meta: {
531
531
  parent: "mf-payment-onboard-submission"
532
532
  }
@@ -534,7 +534,7 @@ const Gn = {
534
534
  {
535
535
  path: "/transaction-old",
536
536
  name: "mf-payment-old-transaction",
537
- component: () => import("./TransactionOld-CObh3uJa.js"),
537
+ component: () => import("./TransactionOld-DqRQHymo.js"),
538
538
  meta: {
539
539
  sidebarDisplay: "i18n:payment.routes.transaction"
540
540
  }
@@ -542,7 +542,7 @@ const Gn = {
542
542
  {
543
543
  path: "/transaction",
544
544
  name: "mf-payment-transaction",
545
- component: () => import("./Transaction-fhDUanwr.js"),
545
+ component: () => import("./Transaction-LDOp9d9W.js"),
546
546
  meta: {
547
547
  sidebarDisplay: "i18n:payment.routes.transaction-new",
548
548
  sidebarNew: !0
@@ -551,7 +551,7 @@ const Gn = {
551
551
  {
552
552
  path: "/settlement",
553
553
  name: "mf-payment-settlement",
554
- component: () => import("./Settlement-L8ukHWPs.js"),
554
+ component: () => import("./Settlement-DW_ElmEK.js"),
555
555
  meta: {
556
556
  sidebarDisplay: "i18n:payment.routes.settlement"
557
557
  }
@@ -560,7 +560,7 @@ const Gn = {
560
560
  path: "/settlement/:settlementId",
561
561
  name: "mf-payment-settlement-transaction",
562
562
  props: !0,
563
- component: () => import("./SettlementTransactions-DG9nJuLQ.js"),
563
+ component: () => import("./SettlementTransactions-CXAt4toA.js"),
564
564
  meta: {
565
565
  parent: "mf-payment-settlement"
566
566
  }
@@ -6828,7 +6828,7 @@ const Ra = /* @__PURE__ */ Mt({
6828
6828
  };
6829
6829
  }
6830
6830
  });
6831
- var Ca = { authClientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc" };
6831
+ var Ca = { authClientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com" };
6832
6832
  const xa = /* @__PURE__ */ Mt({
6833
6833
  __name: "App",
6834
6834
  setup(n) {
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { h as e, i as r, f as o } from "./app-CwgKwO4j.js";
1
+ import { h as e, i as r, f as o } from "./app-BBSHlMY3.js";
2
2
  export {
3
3
  e as FmApp,
4
4
  r as i18nMessages,