@feedmepos/mf-payment 1.0.0-beta.6 → 1.0.0-beta.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ import { p as z } from "./index-BFYq3eq8.js";
3
3
  import { _ as y, u as S, e as K } from "./index-4meiCsRz.js";
4
4
  import { defineStore as _ } from "pinia";
5
5
  import { useCoreStore as $ } from "@feedmepos/mf-common";
6
- import { c as AA, P as v } from "./payout-account-4O7cL-1_.js";
6
+ import { c as AA, P as v } from "./payout-account-BDflEqrE.js";
7
7
  import { useDialogChild as sA, useDialog as eA } from "@feedmepos/ui-library";
8
8
  import { z as X, a as x } from "./validator-D5jtpt9A.js";
9
9
  import { P as J } from "./PDFViewer-xrBtzrlR.js";
@@ -2,7 +2,7 @@ import { defineComponent as g, resolveComponent as i, openBlock as h, createBloc
2
2
  import { u as S } from "./index-BwFHcZlm.js";
3
3
  import { _ as O } from "./index-4meiCsRz.js";
4
4
  import { _ as K } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
5
- import { P as V } from "./payout-account-4O7cL-1_.js";
5
+ import { P as V } from "./payout-account-BDflEqrE.js";
6
6
  import { p as $ } from "./index-BFYq3eq8.js";
7
7
  import "@feedmepos/ui-library";
8
8
  import { _ as D } from "./index.vue_vue_type_script_setup_true_lang-CKOlikHb.js";
@@ -1,11 +1,11 @@
1
- import { defineComponent as x, openBlock as f, createElementBlock as B, createTextVNode as L, createElementVNode as h, toDisplayString as U, resolveComponent as p, createVNode as v, normalizeClass as O, withCtx as V, createBlock as g, createCommentVNode as I, ref as k, computed as z, unref as c, watch as D, isRef as K, h as E } from "vue";
1
+ import { defineComponent as x, openBlock as f, createElementBlock as B, createTextVNode as L, createElementVNode as k, toDisplayString as U, resolveComponent as p, createVNode as v, normalizeClass as O, withCtx as V, createBlock as g, createCommentVNode as A, ref as C, computed as z, unref as c, watch as D, isRef as K, h as E } from "vue";
2
2
  import "./index-4meiCsRz.js";
3
3
  import { h as Y } from "./moment-h96o7c8I.js";
4
4
  import { u as j } from "./index-BwFHcZlm.js";
5
5
  import { _ as q } from "./index.vue_vue_type_script_setup_true_lang-CKOlikHb.js";
6
6
  import { _ as Q } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
7
7
  import { useSnackbar as $, useDialogChild as G, useDialog as H } from "@feedmepos/ui-library";
8
- import { t as A } from "./index-CBa6eapm.js";
8
+ import { t as I } from "./index-CBa6eapm.js";
9
9
  import { c as J } from "./clipboard-4jh1WteU.js";
10
10
  import { u as N } from "./error-K1CakhA9.js";
11
11
  import { z as P, a as R } from "./validator-D5jtpt9A.js";
@@ -23,7 +23,7 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
23
23
  setup(y) {
24
24
  return (n, o) => (f(), B("div", ee, [
25
25
  o[0] || (o[0] = L(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
26
- h("div", te, U(y.code), 1)
26
+ k("div", te, U(y.code), 1)
27
27
  ]));
28
28
  }
29
29
  }), oe = /* @__PURE__ */ x({
@@ -45,7 +45,7 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
45
45
  }
46
46
  n.data;
47
47
  }
48
- return (s, a) => {
48
+ return (i, a) => {
49
49
  const d = p("FmBadge");
50
50
  return f(), B("div", {
51
51
  onClick: a[0] || (a[0] = (_) => {
@@ -57,7 +57,7 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
57
57
  class: O(r())
58
58
  }, {
59
59
  default: V(() => [
60
- h("div", null, U(s.data), 1)
60
+ k("div", null, U(i.data), 1)
61
61
  ]),
62
62
  _: 1
63
63
  }, 8, ["class"])
@@ -73,25 +73,25 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
73
73
  setup(y, { emit: n }) {
74
74
  const o = n;
75
75
  return (r, l) => {
76
- const s = p("FmButton");
76
+ const i = p("FmButton");
77
77
  return f(), B("div", ae, [
78
- r.data.deviceType === "TERMINAL" && !r.data.deviceId ? (f(), g(s, {
78
+ r.data.deviceType === "TERMINAL" && !r.data.deviceId ? (f(), g(i, {
79
79
  key: 0,
80
80
  variant: "plain",
81
81
  "prepend-icon": "link",
82
82
  onClick: l[0] || (l[0] = (a) => {
83
83
  a.stopPropagation(), o("link");
84
84
  })
85
- })) : I("", !0),
86
- r.data.deviceType === "TERMINAL" && r.data.deviceId ? (f(), g(s, {
85
+ })) : A("", !0),
86
+ r.data.deviceType === "TERMINAL" && r.data.deviceId ? (f(), g(i, {
87
87
  key: 1,
88
88
  variant: "plain",
89
89
  "prepend-icon": "link_off",
90
90
  onClick: l[1] || (l[1] = (a) => {
91
91
  a.stopPropagation(), o("unlink");
92
92
  })
93
- })) : I("", !0),
94
- v(s, {
93
+ })) : A("", !0),
94
+ v(i, {
95
95
  variant: "plain",
96
96
  "prepend-icon": "edit",
97
97
  onClick: l[2] || (l[2] = (a) => {
@@ -110,41 +110,42 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
110
110
  },
111
111
  setup(y) {
112
112
  var w, T, F;
113
- const n = y, o = W(), r = G(), l = k(), s = k((w = n.terminal) == null ? void 0 : w.name), a = k((T = n.terminal) == null ? void 0 : T.referenceId), d = k(((F = n.terminal) == null ? void 0 : F.status) === "Active"), _ = z(() => o.restaurants.value.map((b) => ({
113
+ const n = y, o = W(), r = G(), l = C(), i = C((w = n.terminal) == null ? void 0 : w.name), a = C((T = n.terminal) == null ? void 0 : T.referenceId), d = C(((F = n.terminal) == null ? void 0 : F.status) === "Active"), _ = z(() => o.restaurants.value.map((b) => ({
114
114
  label: b.profile.name,
115
115
  value: b._id
116
116
  })));
117
117
  return (b, u) => {
118
- const e = p("FmSelect"), t = p("FmTextField"), m = p("FmSwitch"), C = p("FmButton"), S = p("FmForm");
118
+ const e = p("FmSelect"), t = p("FmTextField"), m = p("FmSwitch"), h = p("FmButton"), S = p("FmForm");
119
119
  return f(), g(S, {
120
120
  ref: l.value,
121
121
  class: "flex flex-col gap-16 mb-6",
122
122
  onValidationSuccess: u[3] || (u[3] = () => {
123
- c(r).emitData({ name: s.value, referenceId: a.value, status: d.value ? "Active" : "Inactive" }), c(r).emitAction("primary");
123
+ c(r).emitData({ name: i.value, referenceId: a.value, status: d.value ? "Active" : "Inactive" }), c(r).emitAction("primary");
124
124
  })
125
125
  }, {
126
126
  default: V(() => [
127
- n.terminal ? I("", !0) : (f(), g(e, {
127
+ n.terminal ? A("", !0) : (f(), g(e, {
128
128
  key: 0,
129
129
  modelValue: a.value,
130
- "onUpdate:modelValue": u[0] || (u[0] = (i) => a.value = i),
130
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => a.value = s),
131
131
  label: "Restaurant",
132
+ "helper-text": "If you can't find the restaurant please change the business to the restaurant's business.",
132
133
  items: _.value,
133
134
  rules: c(P)(c(R).string())
134
135
  }, null, 8, ["modelValue", "items", "rules"])),
135
136
  v(t, {
136
- modelValue: s.value,
137
- "onUpdate:modelValue": u[1] || (u[1] = (i) => s.value = i),
137
+ modelValue: i.value,
138
+ "onUpdate:modelValue": u[1] || (u[1] = (s) => i.value = s),
138
139
  label: "Terminal Name",
139
140
  rules: c(P)(c(R).string())
140
141
  }, null, 8, ["modelValue", "rules"]),
141
142
  n.terminal ? (f(), g(m, {
142
143
  key: 1,
143
144
  modelValue: d.value,
144
- "onUpdate:modelValue": u[2] || (u[2] = (i) => d.value = i),
145
+ "onUpdate:modelValue": u[2] || (u[2] = (s) => d.value = s),
145
146
  label: "Status"
146
- }, null, 8, ["modelValue"])) : I("", !0),
147
- v(C, {
147
+ }, null, 8, ["modelValue"])) : A("", !0),
148
+ v(h, {
148
149
  type: "submit",
149
150
  label: "Create"
150
151
  })
@@ -153,10 +154,10 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
153
154
  }, 512);
154
155
  };
155
156
  }
156
- }), ie = { class: "flex justify-between mb-6 items-center" }, se = { class: "flex space-x-4" }, ce = { class: "flex space-x-4" }, xe = /* @__PURE__ */ x({
157
+ }), se = { class: "flex justify-between mb-6 items-center" }, ie = { class: "flex space-x-4" }, ce = { class: "flex space-x-4" }, xe = /* @__PURE__ */ x({
157
158
  __name: "Terminal",
158
159
  setup(y) {
159
- const n = k(), { searchKey: o, deviceType: r } = j({
160
+ const n = C(), { searchKey: o, deviceType: r } = j({
160
161
  searchKey: "",
161
162
  deviceType: void 0
162
163
  });
@@ -174,7 +175,7 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
174
175
  700
175
176
  );
176
177
  });
177
- const s = Z(), a = H(), d = $();
178
+ const i = Z(), a = H(), d = $();
178
179
  async function _(e) {
179
180
  X(
180
181
  a,
@@ -183,7 +184,7 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
183
184
  async () => {
184
185
  var t;
185
186
  try {
186
- await A.unbind(e), (t = n.value) == null || t.reset(), d.open({
187
+ await I.unbind(e), (t = n.value) == null || t.reset(), d.open({
187
188
  type: "success",
188
189
  message: "Terminal unbind successfully"
189
190
  });
@@ -198,7 +199,7 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
198
199
  );
199
200
  }
200
201
  async function w(e) {
201
- const t = await A.getBindCode(e);
202
+ const t = await I.getBindCode(e);
202
203
  a.open({
203
204
  title: "Terminal Bind Code",
204
205
  closeButton: !0,
@@ -218,15 +219,15 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
218
219
  var m;
219
220
  a.close();
220
221
  try {
221
- await A.create(t), (m = n.value) == null || m.reset(), d.open({
222
+ await I.create(t), (m = n.value) == null || m.reset(), d.open({
222
223
  type: "success",
223
224
  message: e ? "Terminal udpated successfully" : "Terminal created successfully."
224
225
  });
225
- } catch (C) {
226
+ } catch (h) {
226
227
  d.open({
227
228
  type: "error",
228
229
  title: "Error occurs when create terminal",
229
- message: N(C)
230
+ message: N(h)
230
231
  });
231
232
  }
232
233
  });
@@ -317,30 +318,30 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
317
318
  }
318
319
  ];
319
320
  return (e, t) => {
320
- const m = p("FmSearch"), C = p("FmSelect"), S = p("FmButton");
321
+ const m = p("FmSearch"), h = p("FmSelect"), S = p("FmButton");
321
322
  return f(), g(Q, {
322
323
  title: "Terminals",
323
324
  loading: !1
324
325
  }, {
325
326
  default: V(() => [
326
- h("div", ie, [
327
- h("div", se, [
327
+ k("div", se, [
328
+ k("div", ie, [
328
329
  v(m, {
329
330
  "model-value": c(o),
330
- "onUpdate:modelValue": t[0] || (t[0] = (i) => K(o) ? o.value = i : null),
331
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => K(o) ? o.value = s : null),
331
332
  class: "mr-8",
332
333
  label: "Search",
333
334
  placeholder: "Search Terminals ..."
334
335
  }, null, 8, ["model-value"]),
335
- v(C, {
336
+ v(h, {
336
337
  modelValue: c(r),
337
- "onUpdate:modelValue": t[1] || (t[1] = (i) => K(r) ? r.value = i : null),
338
+ "onUpdate:modelValue": t[1] || (t[1] = (s) => K(r) ? r.value = s : null),
338
339
  class: "ml-6 w-[180px]",
339
340
  label: "Device",
340
341
  items: u
341
342
  }, null, 8, ["modelValue"])
342
343
  ]),
343
- h("div", ce, [
344
+ k("div", ce, [
344
345
  v(S, {
345
346
  label: "Create",
346
347
  icon: "add",
@@ -353,11 +354,11 @@ const ee = { class: "t-caption" }, te = { class: "t-h1 my-6 text-center" }, ne =
353
354
  ref: n,
354
355
  "column-defs": b,
355
356
  "rows-defs": F,
356
- paginate: (i, M) => c(A).read({ searchKey: c(o), deviceType: c(r), limit: i, cursor: M }),
357
- onRowClick: t[3] || (t[3] = (i) => c(s).push({
357
+ paginate: (s, M) => c(I).read({ searchKey: c(o), deviceType: c(r), limit: s, cursor: M }),
358
+ onRowClick: t[3] || (t[3] = (s) => c(i).push({
358
359
  name: "mf-payment-admin.terminal-setting",
359
360
  params: {
360
- terminalId: i._id
361
+ terminalId: s._id
361
362
  }
362
363
  }))
363
364
  }, null, 8, ["paginate"])