@feedmepos/mf-payment 1.0.0-beta.1 → 1.0.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,81 +1,82 @@
1
- import { defineComponent as y, openBlock as _, createElementBlock as x, Fragment as F, unref as t, createCommentVNode as k, createElementVNode as d, resolveComponent as p, createBlock as S, normalizeClass as D, withCtx as R, toDisplayString as V, ref as K, watch as T, createVNode as i, isRef as g, h } from "vue";
2
- import { c as l } from "./index-CWaKb7bG.js";
3
- import { h as I } from "./moment-h96o7c8I.js";
4
- import { u as M } from "./index-7KNaibcq.js";
5
- import { _ as $ } from "./index.vue_vue_type_script_setup_true_lang-JdAFa8vy.js";
1
+ import { defineComponent as N, openBlock as f, createElementBlock as S, Fragment as F, unref as r, createCommentVNode as V, createElementVNode as d, resolveComponent as _, createBlock as C, normalizeClass as k, withCtx as y, toDisplayString as D, ref as K, watch as g, createVNode as c, isRef as p, h as I } from "vue";
2
+ import { c as m } from "./index-CWaKb7bG.js";
3
+ import { h } from "./moment-h96o7c8I.js";
4
+ import { u as $ } from "./index-7KNaibcq.js";
5
+ import { _ as M } from "./index.vue_vue_type_script_setup_true_lang-JdAFa8vy.js";
6
6
  import "@feedmepos/ui-library";
7
7
  import { g as L } from "./assets-NrCec-W0.js";
8
- import { E as B, t as w } from "./index-DbJpbpSs.js";
8
+ import { E as B, t as R } from "./index-DbJpbpSs.js";
9
9
  import { d as G } from "./dinero-CIVmXLL-.js";
10
10
  import { _ as P } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
11
11
  import { useCoreStore as U } from "@feedmepos/mf-common";
12
12
  import { _ as Y } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
13
13
  import { _ as W } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
14
14
  import { _ as j } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
15
- const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
15
+ import { _ as q } from "./SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js";
16
+ const z = ["src"], Q = ["src"], H = /* @__PURE__ */ N({
16
17
  __name: "Gateway",
17
18
  props: {
18
19
  row: {},
19
20
  data: {}
20
21
  },
21
- setup(f) {
22
- return (n, s) => (_(), x(F, null, [
23
- n.row.original.ecrGateway ? (_(), x("img", {
22
+ setup(A) {
23
+ return (o, s) => (f(), S(F, null, [
24
+ o.row.original.ecrGateway ? (f(), S("img", {
24
25
  key: 0,
25
26
  class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
26
- src: t(B)
27
- }, null, 8, q)) : k("", !0),
27
+ src: r(B)
28
+ }, null, 8, z)) : V("", !0),
28
29
  d("img", {
29
30
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
30
- src: t(L)(n.row.original.gateway)
31
- }, null, 8, z)
31
+ src: r(L)(o.row.original.gateway)
32
+ }, null, 8, Q)
32
33
  ], 64));
33
34
  }
34
- }), H = /* @__PURE__ */ y({
35
+ }), J = /* @__PURE__ */ N({
35
36
  __name: "Status",
36
37
  props: {
37
38
  row: {},
38
39
  data: {}
39
40
  },
40
- setup(f) {
41
- const n = f;
41
+ setup(A) {
42
+ const o = A;
42
43
  function s() {
43
- return n.data === l.F_TERMINAL_TRANSACTION_ACTION.Enum.process ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === l.F_TERMINAL_TRANSACTION_ACTION.Enum.failed ? "!w-[16px] !h-[16px] bg-red-400" : n.data === l.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
44
+ return o.data === m.F_TERMINAL_TRANSACTION_ACTION.Enum.process ? "!w-[16px] !h-[16px] bg-yellow-400" : o.data === m.F_TERMINAL_TRANSACTION_ACTION.Enum.failed ? "!w-[16px] !h-[16px] bg-red-400" : o.data === m.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
44
45
  }
45
- return (o, c) => {
46
- const m = p("FmBadge");
47
- return _(), S(m, {
46
+ return (l, n) => {
47
+ const i = _("FmBadge");
48
+ return f(), C(i, {
48
49
  inline: "",
49
- class: D(s())
50
+ class: k(s())
50
51
  }, {
51
- default: R(() => [
52
- d("div", null, V(o.data.toUpperCase()), 1)
52
+ default: y(() => [
53
+ d("div", null, D(l.data.toUpperCase()), 1)
53
54
  ]),
54
55
  _: 1
55
56
  }, 8, ["class"]);
56
57
  };
57
58
  }
58
- }), J = { class: "flex justify-between mb-6 items-start" }, X = { class: "flex space-x-8 items-start" }, Z = { class: "flex space-x-4" }, _e = /* @__PURE__ */ y({
59
+ }), X = { class: "flex justify-between mb-6 items-start" }, Z = { class: "flex space-x-8 items-start" }, ee = { class: "flex space-x-4" }, Ae = /* @__PURE__ */ N({
59
60
  __name: "TerminalTransaction",
60
- setup(f) {
61
- const { currentRestaurant: n } = U(), s = K(), { dateRange: o, status: c, searchKey: m } = M({
61
+ setup(A) {
62
+ const { currentRestaurant: o } = U(), s = K(), { dateRange: l, status: n, searchKey: i } = $({
62
63
  searchKey: "",
63
- status: [l.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
64
+ status: [m.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
64
65
  dateRange: {
65
- startDate: I().startOf("day").toISOString(),
66
- endDate: I().endOf("day").toISOString()
66
+ startDate: h().startOf("day").toISOString(),
67
+ endDate: h().endOf("day").toISOString()
67
68
  }
68
69
  });
69
- T([o, c], () => {
70
+ g([l, n], () => {
70
71
  var e;
71
72
  return (e = s.value) == null ? void 0 : e.reset();
72
- }), T(n, () => {
73
+ }), g(o, () => {
73
74
  var e;
74
75
  return (e = s.value) == null ? void 0 : e.reset();
75
76
  });
76
- let A;
77
- T(m, async () => {
78
- A && clearTimeout(A), A = setTimeout(
77
+ let T;
78
+ g(i, async () => {
79
+ T && clearTimeout(T), T = setTimeout(
79
80
  () => {
80
81
  var e;
81
82
  return (e = s.value) == null ? void 0 : e.reset();
@@ -83,24 +84,24 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
83
84
  700
84
85
  );
85
86
  });
86
- const C = [
87
+ const x = [
87
88
  {
88
89
  label: "Success",
89
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.success
90
+ value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.success
90
91
  },
91
92
  {
92
93
  label: "Refunded",
93
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded
94
+ value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded
94
95
  },
95
96
  {
96
97
  label: "Process",
97
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.process
98
+ value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.process
98
99
  },
99
100
  {
100
101
  label: "Failed",
101
- value: l.F_TERMINAL_TRANSACTION_ACTION.Enum.failed
102
+ value: m.F_TERMINAL_TRANSACTION_ACTION.Enum.failed
102
103
  }
103
- ], E = function(e) {
104
+ ], v = function(e) {
104
105
  const a = e;
105
106
  let u = "-";
106
107
  return a.details && a.details.amount && (u = G(a.details.amount).toFormat("$0.00")), {
@@ -108,20 +109,20 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
108
109
  orderId: e.orderId,
109
110
  refId: e.refId,
110
111
  terminalId: e.terminalId,
111
- transactionAt: I(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
112
+ transactionAt: h(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
112
113
  action: e.action,
113
114
  gateway: e.gateway,
114
115
  ecrGateway: e.ecrGateway,
115
116
  amount: u
116
117
  };
117
- }, O = [
118
+ }, E = [
118
119
  {
119
120
  accessorKey: "id",
120
121
  header: () => "Transaction ID",
121
122
  meta: {
122
123
  textAlign: "left"
123
124
  },
124
- cell: ({ cell: e }) => h(W, { data: e.getValue() })
125
+ cell: ({ cell: e }) => I(W, { data: e.getValue() })
125
126
  },
126
127
  {
127
128
  accessorKey: "orderId",
@@ -144,7 +145,7 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
144
145
  textAlign: "center",
145
146
  maxWidth: "128px"
146
147
  },
147
- cell: ({ cell: e, row: a }) => h(Q, { row: a, data: e.getValue() })
148
+ cell: ({ cell: e, row: a }) => I(H, { row: a, data: e.getValue() })
148
149
  },
149
150
  {
150
151
  accessorKey: "action",
@@ -153,7 +154,7 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
153
154
  textAlign: "right",
154
155
  maxWidth: "132px"
155
156
  },
156
- cell: ({ cell: e, row: a }) => h(H, { row: a, data: e.getValue() })
157
+ cell: ({ cell: e, row: a }) => I(J, { row: a, data: e.getValue() })
157
158
  },
158
159
  {
159
160
  accessorKey: "amount",
@@ -178,64 +179,73 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
178
179
  }
179
180
  ];
180
181
  return (e, a) => {
181
- const u = p("FmSearch"), N = p("FmSelect"), v = p("FmSimpleDateRangePicker");
182
- return _(), S(j, {
182
+ const u = _("FmSearch"), w = _("FmSelect"), O = _("FmSimpleDateRangePicker");
183
+ return f(), C(j, {
183
184
  title: "Offline Transactions",
184
185
  description: "Transactions are purchases or payments made in retail using electronic devices such as POS systems, kiosks, terminals, or ECRs.",
185
186
  loading: !1
186
187
  }, {
187
- default: R(() => [
188
- d("div", J, [
189
- d("div", X, [
190
- i(P),
191
- i(u, {
192
- "model-value": t(m),
193
- "onUpdate:modelValue": a[0] || (a[0] = (r) => g(m) ? m.value = r : null),
188
+ default: y(() => [
189
+ d("div", X, [
190
+ d("div", Z, [
191
+ c(P),
192
+ c(u, {
193
+ "model-value": r(i),
194
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => p(i) ? i.value = t : null),
194
195
  class: "mr-8",
195
196
  label: "Search",
196
197
  placeholder: "Search Transactions ..."
197
198
  }, null, 8, ["model-value"]),
198
- i(N, {
199
- modelValue: t(c),
200
- "onUpdate:modelValue": a[1] || (a[1] = (r) => g(c) ? c.value = r : null),
199
+ c(w, {
200
+ modelValue: r(n),
201
+ "onUpdate:modelValue": a[2] || (a[2] = (t) => p(n) ? n.value = t : null),
201
202
  class: "mr-6 w-[300px]",
202
203
  label: "Status",
203
204
  "label-mark": "required",
204
205
  multiselect: "",
205
- items: C
206
- }, null, 8, ["modelValue"]),
207
- i(v, {
208
- modelValue: t(o),
209
- "onUpdate:modelValue": a[2] || (a[2] = (r) => g(o) ? o.value = r : null),
206
+ items: x
207
+ }, {
208
+ "prepend-menu": y(() => [
209
+ c(q, {
210
+ modelValue: r(n),
211
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => p(n) ? n.value = t : null),
212
+ items: x
213
+ }, null, 8, ["modelValue"])
214
+ ]),
215
+ _: 1
216
+ }, 8, ["modelValue"]),
217
+ c(O, {
218
+ modelValue: r(l),
219
+ "onUpdate:modelValue": a[3] || (a[3] = (t) => p(l) ? l.value = t : null),
210
220
  "show-predefined-range": ""
211
221
  }, null, 8, ["modelValue"])
212
222
  ]),
213
- d("div", Z, [
214
- i(Y, {
223
+ d("div", ee, [
224
+ c(Y, {
215
225
  button: {
216
226
  appendIcon: "file_download",
217
227
  variant: "primary",
218
228
  label: "Export"
219
229
  },
220
230
  handler: () => {
221
- var r;
222
- return t(w).downloadTransactions(((r = s.value) == null ? void 0 : r.data()) ?? []);
231
+ var t;
232
+ return r(R).downloadTransactions(((t = s.value) == null ? void 0 : t.data()) ?? []);
223
233
  }
224
234
  }, null, 8, ["handler"])
225
235
  ])
226
236
  ]),
227
- i($, {
237
+ c(M, {
228
238
  ref_key: "controller",
229
239
  ref: s,
230
- "column-defs": O,
231
- "rows-defs": E,
232
- paginate: (r, b) => t(w).readRestaurantTransactions({
233
- status: t(c),
234
- searchKey: t(m),
235
- limit: r,
240
+ "column-defs": E,
241
+ "rows-defs": v,
242
+ paginate: (t, b) => r(R).readRestaurantTransactions({
243
+ status: r(n),
244
+ searchKey: r(i),
245
+ limit: t,
236
246
  cursor: b,
237
- start: t(o).startDate,
238
- end: t(o).endDate
247
+ start: r(l).startDate,
248
+ end: r(l).endDate
239
249
  })
240
250
  }, null, 8, ["paginate"])
241
251
  ]),
@@ -245,5 +255,5 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ y({
245
255
  }
246
256
  });
247
257
  export {
248
- _e as default
258
+ Ae as default
249
259
  };