@feedmepos/mf-payment 1.0.0-beta.2 → 1.0.0-beta.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,16 @@
1
- import { defineComponent as _, resolveComponent as T, openBlock as f, createBlock as N, normalizeClass as k, withCtx as R, createElementVNode as y, toDisplayString as K, createElementBlock as O, unref as o, ref as A, h as x, onMounted as V, watch as E, createVNode as p, isRef as F } from "vue";
2
- import { t as I, a as C } from "./transaction-CQiT7Y_s.js";
3
- import { e as S, u as P } from "./index-CWaKb7bG.js";
4
- import { useSnackbar as $ } from "@feedmepos/ui-library";
1
+ import { defineComponent as _, resolveComponent as T, openBlock as f, createBlock as N, normalizeClass as O, withCtx as b, createElementVNode as y, toDisplayString as V, createElementBlock as I, unref as o, ref as S, h as x, onMounted as k, watch as E, createVNode as p, isRef as F } from "vue";
2
+ import { t as D, a as C } from "./transaction-B8q7vuqN.js";
3
+ import { e as A, u as M } from "./index-CWaKb7bG.js";
4
+ import "@feedmepos/ui-library";
5
5
  import "./dinero-CIVmXLL-.js";
6
- import { h as b } from "./moment-h96o7c8I.js";
7
- import { g as L, a as B } from "./assets-NrCec-W0.js";
8
- import { useCoreStore as M } from "@feedmepos/mf-common";
9
- import { _ as U } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
10
- import { u as G } from "./index-7KNaibcq.js";
11
- import { _ as Y } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
12
- import { _ as q } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
13
- const J = /* @__PURE__ */ _({
6
+ import { h as R } from "./moment-h96o7c8I.js";
7
+ import { g as Y, a as P } from "./assets-NrCec-W0.js";
8
+ import { useCoreStore as $ } from "@feedmepos/mf-common";
9
+ import { _ as L } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
10
+ import { u as B } from "./index-7KNaibcq.js";
11
+ import { _ as U } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
12
+ import { _ as G } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
13
+ const q = /* @__PURE__ */ _({
14
14
  __name: "Status",
15
15
  props: {
16
16
  row: {},
@@ -19,46 +19,46 @@ const J = /* @__PURE__ */ _({
19
19
  setup(s) {
20
20
  const n = s;
21
21
  function a() {
22
- return n.data === S.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === S.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.data === S.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
22
+ return n.data === A.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === A.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.data === A.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
23
23
  }
24
24
  return (l, c) => {
25
25
  const d = T("FmBadge");
26
26
  return f(), N(d, {
27
27
  inline: "",
28
- class: k(a())
28
+ class: O(a())
29
29
  }, {
30
- default: R(() => [
31
- y("div", null, K(l.data), 1)
30
+ default: b(() => [
31
+ y("div", null, V(l.data), 1)
32
32
  ]),
33
33
  _: 1
34
34
  }, 8, ["class"]);
35
35
  };
36
36
  }
37
- }), j = ["src"], z = /* @__PURE__ */ _({
37
+ }), J = ["src"], j = /* @__PURE__ */ _({
38
38
  __name: "Gateway",
39
39
  props: {
40
40
  row: {},
41
41
  data: {}
42
42
  },
43
43
  setup(s) {
44
- return (n, a) => (f(), O("img", {
44
+ return (n, a) => (f(), I("img", {
45
45
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
46
- src: o(L)(n.row.original.gateway)
47
- }, null, 8, j));
46
+ src: o(Y)(n.row.original.gateway)
47
+ }, null, 8, J));
48
48
  }
49
- }), Q = ["src"], H = /* @__PURE__ */ _({
49
+ }), z = ["src"], Q = /* @__PURE__ */ _({
50
50
  __name: "Method",
51
51
  props: {
52
52
  row: {},
53
53
  data: {}
54
54
  },
55
55
  setup(s) {
56
- return (n, a) => (f(), O("img", {
56
+ return (n, a) => (f(), I("img", {
57
57
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
58
- src: o(B)(n.row.original.method.issuer)
59
- }, null, 8, Q));
58
+ src: o(P)(n.row.original.method.issuer)
59
+ }, null, 8, z));
60
60
  }
61
- }), W = /* @__PURE__ */ _({
61
+ }), H = /* @__PURE__ */ _({
62
62
  __name: "TransactionTable",
63
63
  props: {
64
64
  data: {
@@ -72,7 +72,7 @@ const J = /* @__PURE__ */ _({
72
72
  },
73
73
  emits: ["row-click"],
74
74
  setup(s, { emit: n }) {
75
- const a = s, l = n, c = A(""), d = [
75
+ const a = s, l = n, c = S(""), d = [
76
76
  {
77
77
  header: () => "Transaction ID",
78
78
  accessorKey: "id"
@@ -87,7 +87,7 @@ const J = /* @__PURE__ */ _({
87
87
  meta: {
88
88
  textAlign: "center"
89
89
  },
90
- cell: ({ cell: t, row: e }) => e.original.method ? x(z, { row: e, data: t.getValue() }) : ""
90
+ cell: ({ cell: t, row: e }) => e.original.method ? x(j, { row: e, data: t.getValue() }) : ""
91
91
  },
92
92
  {
93
93
  header: () => "Method",
@@ -95,7 +95,7 @@ const J = /* @__PURE__ */ _({
95
95
  meta: {
96
96
  textAlign: "center"
97
97
  },
98
- cell: ({ cell: t, row: e }) => e.original.method ? x(H, { row: e, data: t.getValue() }) : ""
98
+ cell: ({ cell: t, row: e }) => e.original.method ? x(Q, { row: e, data: t.getValue() }) : ""
99
99
  },
100
100
  {
101
101
  header: () => "Type",
@@ -113,7 +113,7 @@ const J = /* @__PURE__ */ _({
113
113
  {
114
114
  header: () => "Status",
115
115
  accessorKey: "status",
116
- cell: ({ cell: t, row: e }) => x(J, { row: e, data: t.getValue() })
116
+ cell: ({ cell: t, row: e }) => x(q, { row: e, data: t.getValue() })
117
117
  },
118
118
  {
119
119
  header: () => "Transaction At",
@@ -147,29 +147,27 @@ const J = /* @__PURE__ */ _({
147
147
  }, null, 8, ["modelValue", "row-data", "loading"]);
148
148
  };
149
149
  }
150
- }), X = { class: "flex justify-between mb-6 items-center" }, Z = { class: "flex space-x-8" }, ee = { class: "flex space-x-4" }, pe = /* @__PURE__ */ _({
150
+ }), W = { class: "flex justify-between mb-6 items-center" }, X = { class: "flex space-x-8" }, Z = { class: "flex space-x-4" }, me = /* @__PURE__ */ _({
151
151
  __name: "Transaction",
152
152
  setup(s) {
153
- const { dateRange: n, searchKey: a } = G({
153
+ const { dateRange: n, searchKey: a } = B({
154
154
  searchKey: "",
155
155
  dateRange: {
156
- startDate: b().startOf("day").toISOString(),
157
- endDate: b().endOf("day").toISOString()
156
+ startDate: R().startOf("day").format("YYYY-MM-DD"),
157
+ endDate: R().endOf("day").format("YYYY-MM-DD")
158
158
  }
159
- }), { isLoading: l, startAsyncCall: c } = P(!0);
160
- $();
161
- const { currentRestaurant: d } = M(), t = A([]), e = A([]);
159
+ }), { isLoading: l, startAsyncCall: c } = M(!0), { currentRestaurant: d } = $(), t = S([]), e = S([]);
162
160
  async function g() {
163
161
  await c(async () => {
164
- const { startDate: h, endDate: r } = n.value, u = await I.readRestaurantTransactions({
162
+ const { startDate: h, endDate: r } = n.value, u = await D.readRestaurantTransactions({
165
163
  start: h,
166
164
  end: r
167
165
  });
168
166
  if (t.value = C(u), e.value = t.value, a.value > "") {
169
167
  var v = new RegExp(a.value, "i");
170
168
  e.value = t.value.filter((m) => {
171
- const D = JSON.stringify(m);
172
- return v.test(D);
169
+ const K = JSON.stringify(m);
170
+ return v.test(K);
173
171
  });
174
172
  }
175
173
  });
@@ -177,7 +175,7 @@ const J = /* @__PURE__ */ _({
177
175
  function i() {
178
176
  g();
179
177
  }
180
- V(i), E(d, i);
178
+ k(i), E(d, i);
181
179
  let w;
182
180
  return E(a, async () => {
183
181
  w && clearTimeout(w), w = setTimeout(() => {
@@ -189,15 +187,15 @@ const J = /* @__PURE__ */ _({
189
187
  }, 700);
190
188
  }), (h, r) => {
191
189
  const u = T("FmSearch"), v = T("FmSimpleDateRangePicker");
192
- return f(), N(U, {
190
+ return f(), N(L, {
193
191
  title: "Online Transactions",
194
192
  description: "Transactions are purchases or payments made over the internet using electronic methods like cards or digital wallets.",
195
193
  loading: o(l)
196
194
  }, {
197
- default: R(() => [
198
- y("div", X, [
199
- y("div", Z, [
200
- p(q),
195
+ default: b(() => [
196
+ y("div", W, [
197
+ y("div", X, [
198
+ p(G),
201
199
  p(u, {
202
200
  "model-value": o(a),
203
201
  "onUpdate:modelValue": r[0] || (r[0] = (m) => F(a) ? a.value = m : null),
@@ -213,20 +211,20 @@ const J = /* @__PURE__ */ _({
213
211
  "show-predefined-range": ""
214
212
  }, null, 8, ["modelValue"])
215
213
  ]),
216
- y("div", ee, [
217
- p(Y, {
214
+ y("div", Z, [
215
+ p(U, {
218
216
  button: {
219
217
  appendIcon: "file_download",
220
218
  variant: "primary",
221
219
  label: "Export"
222
220
  },
223
221
  handler: async () => {
224
- await o(I).downloadRestaurantTransactionReport(t.value);
222
+ await o(D).downloadRestaurantTransactionReport(t.value);
225
223
  }
226
224
  }, null, 8, ["handler"])
227
225
  ])
228
226
  ]),
229
- p(W, {
227
+ p(H, {
230
228
  loading: o(l),
231
229
  data: e.value
232
230
  }, null, 8, ["loading", "data"])
@@ -237,5 +235,5 @@ const J = /* @__PURE__ */ _({
237
235
  }
238
236
  });
239
237
  export {
240
- pe as default
238
+ me as default
241
239
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as h, resolveComponent as _, openBlock as g, createBlock as E, normalizeClass as $, withCtx as x, createElementVNode as b, toDisplayString as L, createElementBlock as F, unref as m, createVNode as y, Fragment as B, renderList as U, ref as N, h as T, onMounted as G, watch as k, isRef as D } from "vue";
2
- import { t as w, a as J, b as R } from "./transaction-CQiT7Y_s.js";
3
- import { e as S, u as Q } from "./index-CWaKb7bG.js";
4
- import { useSnackbar as Y, useDialog as j } from "@feedmepos/ui-library";
1
+ import { defineComponent as h, resolveComponent as _, openBlock as g, createBlock as E, normalizeClass as Y, withCtx as x, createElementVNode as b, toDisplayString as $, createElementBlock as F, unref as m, createVNode as y, Fragment as L, renderList as B, ref as N, h as T, onMounted as U, watch as D, isRef as k } from "vue";
2
+ import { t as w, a as G, b as M } from "./transaction-B8q7vuqN.js";
3
+ import { e as S, u as J } from "./index-CWaKb7bG.js";
4
+ import { useSnackbar as Q, useDialog as j } from "@feedmepos/ui-library";
5
5
  import "./dinero-CIVmXLL-.js";
6
- import { h as O } from "./moment-h96o7c8I.js";
6
+ import { h as R } from "./moment-h96o7c8I.js";
7
7
  import { g as z, a as H } from "./assets-NrCec-W0.js";
8
8
  import { _ as W } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
9
9
  import { u as X } from "./index-7KNaibcq.js";
@@ -26,10 +26,10 @@ const te = /* @__PURE__ */ h({
26
26
  const s = _("FmBadge");
27
27
  return g(), E(s, {
28
28
  inline: "",
29
- class: $(o())
29
+ class: Y(o())
30
30
  }, {
31
31
  default: x(() => [
32
- b("div", null, L(l.data), 1)
32
+ b("div", null, $(l.data), 1)
33
33
  ]),
34
34
  _: 1
35
35
  }, 8, ["class"]);
@@ -97,7 +97,7 @@ const te = /* @__PURE__ */ h({
97
97
  y(f, { name: "settings" })
98
98
  ]),
99
99
  default: x(() => [
100
- (g(), F(B, null, U(n, (e) => y(s, {
100
+ (g(), F(L, null, B(n, (e) => y(s, {
101
101
  selectable: !0,
102
102
  key: e.label,
103
103
  sublabel: e.sublabel,
@@ -213,17 +213,17 @@ const te = /* @__PURE__ */ h({
213
213
  const { dateRange: n, searchKey: o } = X({
214
214
  searchKey: "",
215
215
  dateRange: {
216
- startDate: O().startOf("day").toISOString(),
217
- endDate: O().endOf("day").toISOString()
216
+ startDate: R().startOf("day").format("YYYY-MM-DD"),
217
+ endDate: R().endOf("day").format("YYYY-MM-DD")
218
218
  }
219
- }), { isLoading: l, startAsyncCall: f } = Q(!0), s = Y(), r = j(), e = N([]), c = N([]);
219
+ }), { isLoading: l, startAsyncCall: f } = J(!0), s = Q(), r = j(), e = N([]), c = N([]);
220
220
  async function v() {
221
221
  await f(async () => {
222
222
  const { startDate: i, endDate: t } = n.value, a = await w.readTransactions({
223
223
  start: i,
224
224
  end: t
225
225
  });
226
- if (e.value = J(a), c.value = e.value, o.value > "") {
226
+ if (e.value = G(a), c.value = e.value, o.value > "") {
227
227
  var u = new RegExp(o.value, "i");
228
228
  c.value = e.value.filter((d) => {
229
229
  const C = JSON.stringify(d);
@@ -235,9 +235,9 @@ const te = /* @__PURE__ */ h({
235
235
  function q() {
236
236
  v();
237
237
  }
238
- G(q);
238
+ U(q);
239
239
  let A;
240
- k(o, async () => {
240
+ D(o, async () => {
241
241
  A && clearTimeout(A), A = setTimeout(() => {
242
242
  var i = new RegExp(o.value, "i");
243
243
  c.value = e.value.filter((t) => {
@@ -245,7 +245,7 @@ const te = /* @__PURE__ */ h({
245
245
  return i.test(a);
246
246
  });
247
247
  }, 700);
248
- }), k(e, async () => {
248
+ }), D(e, async () => {
249
249
  let i = e.value;
250
250
  if (o.value) {
251
251
  var t = new RegExp(o.value, "i");
@@ -268,7 +268,7 @@ const te = /* @__PURE__ */ h({
268
268
  }
269
269
  try {
270
270
  const a = await w.refetchTransaction({ transactionId: t.id }), u = e.value.findIndex((d) => d.id === a._id);
271
- e.value[u] = R(a), s.open({
271
+ e.value[u] = M(a), s.open({
272
272
  type: "success",
273
273
  title: "Transaction queried and updated successfully."
274
274
  });
@@ -280,7 +280,7 @@ const te = /* @__PURE__ */ h({
280
280
  });
281
281
  }
282
282
  }
283
- async function V(i) {
283
+ async function O(i) {
284
284
  const t = c.value.at(i);
285
285
  if (!t) {
286
286
  s.open({
@@ -301,7 +301,7 @@ const te = /* @__PURE__ */ h({
301
301
  reason: "portal transaction refund",
302
302
  amount: t.fdoAmount
303
303
  }), u = e.value.findIndex((d) => d.id === a._id);
304
- e.value[u] = R(a), s.open({
304
+ e.value[u] = M(a), s.open({
305
305
  type: "success",
306
306
  title: "Transaction refund request initiated."
307
307
  });
@@ -315,7 +315,7 @@ const te = /* @__PURE__ */ h({
315
315
  }
316
316
  );
317
317
  }
318
- async function M(i) {
318
+ async function V(i) {
319
319
  const t = c.value.at(i);
320
320
  if (!t) {
321
321
  s.open({
@@ -356,7 +356,7 @@ const te = /* @__PURE__ */ h({
356
356
  b("div", le, [
357
357
  y(a, {
358
358
  "model-value": m(o),
359
- "onUpdate:modelValue": t[0] || (t[0] = (d) => D(o) ? o.value = d : null),
359
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => k(o) ? o.value = d : null),
360
360
  class: "mr-8",
361
361
  label: "Search",
362
362
  placeholder: "Search Transactions ..."
@@ -364,7 +364,7 @@ const te = /* @__PURE__ */ h({
364
364
  y(u, {
365
365
  modelValue: m(n),
366
366
  "onUpdate:modelValue": [
367
- t[1] || (t[1] = (d) => D(n) ? n.value = d : null),
367
+ t[1] || (t[1] = (d) => k(n) ? n.value = d : null),
368
368
  v
369
369
  ],
370
370
  "show-predefined-range": ""
@@ -390,8 +390,8 @@ const te = /* @__PURE__ */ h({
390
390
  loading: m(l),
391
391
  data: c.value,
392
392
  onQuery: K,
393
- onRefund: V,
394
- onNotify: M
393
+ onRefund: O,
394
+ onNotify: V
395
395
  }, null, 8, ["loading", "data"])
396
396
  ]),
397
397
  _: 1