@feedmepos/mf-payment 1.9.3-dev → 1.9.5-dev

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 (75) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-C9cv5yKo.js → Actions.vue_vue_type_script_setup_true_lang-D9eFw5GT.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-NKO6-sgg.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-tqt-P5jM.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-uhnNKle-.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-wts-x4-q.js} +2 -2
  4. package/dist/{Chargeback-C5c2ggX9.js → Chargeback-D9ezofj9.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-DbDKfWJX.js → DocumentViewer.vue_vue_type_script_setup_true_lang-B53mbAw2.js} +1 -1
  6. package/dist/ExternalTerminal-DHVCjDqS.js +484 -0
  7. package/dist/{OnboardForm-CVuu8ixt.js → OnboardForm-CE_z1TWy.js} +6 -6
  8. package/dist/{OnboardForm-COJfmIJt.js → OnboardForm-DHY3cskz.js} +6 -6
  9. package/dist/{OnboardSubmission-CuH1DxWt.js → OnboardSubmission-DAf8-PMR.js} +3 -3
  10. package/dist/{OnboardSubmission-Tl3HQgov.js → OnboardSubmission-vkH_ZjQd.js} +6 -6
  11. package/dist/{PayoutAccount-PXQSHup9.js → PayoutAccount-CLYNzn8n.js} +7 -7
  12. package/dist/{PayoutAccount-CmHNLOdq.js → PayoutAccount-rs-jPdOb.js} +5 -5
  13. package/dist/{PayoutAccountSetting-cV5Ts_Qq.js → PayoutAccountSetting-CeVVbTpp.js} +6 -6
  14. package/dist/{Restaurant-LzRSv42P.js → Restaurant-DUeCpGQz.js} +4 -4
  15. package/dist/{RestaurantSetting-CsnW19gh.js → RestaurantSetting-DPnjaSZP.js} +3 -3
  16. package/dist/{Settlement-BycHPszE.js → Settlement-Bvh2SjD-.js} +3 -3
  17. package/dist/{Settlement-eq9msmbN.js → Settlement-DOWtSotU.js} +4 -4
  18. package/dist/{SettlementTransactions-BiDjpqc3.js → SettlementTransactions-D3J51WrT.js} +5 -5
  19. package/dist/{SettlementTransactions-Ccm_gaYg.js → SettlementTransactions-K-J0ovnq.js} +5 -5
  20. package/dist/{Status.vue_vue_type_script_setup_true_lang-DuVSuCqQ.js → Status.vue_vue_type_script_setup_true_lang-CvJ6L1_a.js} +1 -1
  21. package/dist/{Terminal-ZRi75g3B.js → Terminal-CO3PpKg9.js} +427 -403
  22. package/dist/{TerminalSetting-CpIOhxYF.js → TerminalSetting-DN4d9lH9.js} +1066 -973
  23. package/dist/{Transaction-Dfty1Pkq.js → Transaction-CDcgKp1w.js} +11 -11
  24. package/dist/{Transaction-ClDKUNW6.js → Transaction-CTZ89Wbs.js} +10 -10
  25. package/dist/{TransactionOld-CkoAQGox.js → TransactionOld-C_95omc8.js} +7 -7
  26. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-BU1aDd8a.js → TransactionStatus.vue_vue_type_script_setup_true_lang-D1-vczoG.js} +1 -1
  27. package/dist/api/external-terminal/index.d.ts +2 -1
  28. package/dist/{app-BO87oXyA.js → app-Cs0_lCUQ.js} +24 -24
  29. package/dist/app.js +1 -1
  30. package/dist/{assets-CEy6OF2t.js → assets-D3ALZiYC.js} +1 -1
  31. package/dist/{grafana-BL6EdH24.js → grafana-DgZsQuHZ.js} +1 -1
  32. package/dist/{index-By1YYoRG.js → index-6pMHqVXQ.js} +1 -1
  33. package/dist/{index-zzOpgyK_.js → index-8HjTWFUv.js} +11 -9
  34. package/dist/{index-NcS-Zyhu.js → index-9wT3znSS.js} +1 -1
  35. package/dist/{index--870P92-.js → index-BuXolnO9.js} +2 -2
  36. package/dist/{index-nn5zFo8I.js → index-CD3vR04K.js} +1 -1
  37. package/dist/{index-DEPKBu9W.js → index-Cc2oWXJD.js} +1 -1
  38. package/dist/{index-CGfEnp2P.js → index-CjC49DkQ.js} +1 -1
  39. package/dist/{index-CAd13T_z.js → index-CrRToXMG.js} +1 -1
  40. package/dist/index-DFN4_x7R.js +52 -0
  41. package/dist/{index-CXpoEy-p.js → index-DblBoips.js} +1 -1
  42. package/dist/{index.vue_vue_type_script_setup_true_lang-DZQR-ukK.js → index.vue_vue_type_script_setup_true_lang-BVloZZBn.js} +1 -1
  43. package/dist/{onboard-submission-29LM4jfB.js → onboard-submission-DEJSQhGY.js} +1 -1
  44. package/dist/package.json +2 -2
  45. package/dist/{payout-account-HS9MHh85.js → payout-account-bky0BGyg.js} +3 -3
  46. package/dist/tsconfig.app.tsbuildinfo +1 -1
  47. package/dist/views/admin/external-terminal/ExternalTerminalPairDialog.vue.d.ts +16 -16
  48. package/dist/views/admin/external-terminal/{ExternalTerminalDialog.vue.d.ts → ExternalTerminalSideSheet.vue.d.ts} +39 -18
  49. package/dist/views/admin/external-terminal/pair/BRITerminal.vue.d.ts +16 -16
  50. package/dist/views/admin/external-terminal/pair/BeamTerminal.vue.d.ts +16 -16
  51. package/dist/views/admin/terminal/TerminalSideSheet.vue.d.ts +196 -0
  52. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +42 -32
  53. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +42 -32
  54. package/dist/views/admin/terminal/tabs/PaymentCheckout.vue.d.ts +42 -32
  55. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +42 -32
  56. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +42 -32
  57. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +42 -32
  58. package/dist/views/admin/terminal/{TerminalDialog.vue.d.ts → tabs/ecr/BeamGateway.vue.d.ts} +53 -32
  59. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +42 -32
  60. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +42 -32
  61. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +42 -32
  62. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +42 -32
  63. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +42 -32
  64. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +42 -32
  65. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +42 -32
  66. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +42 -32
  67. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +42 -32
  68. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +42 -32
  69. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +42 -32
  70. package/dist/views/admin/terminal/tabs/ecr/RevenueGateway.vue.d.ts +42 -32
  71. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +42 -32
  72. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +42 -32
  73. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +42 -32
  74. package/package.json +2 -2
  75. package/dist/ExternalTerminal-Cd_azqjT.js +0 -502
@@ -2,18 +2,19 @@ import { type PropType } from 'vue';
2
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
3
  terminal: {
4
4
  type: PropType<{
5
- name?: string | null | undefined;
6
- deviceId?: string | null | undefined;
7
- bindCode?: string | null | undefined;
8
5
  secretKey?: string | null | undefined;
9
- token?: string | null | undefined;
6
+ name?: string | null | undefined;
10
7
  gateways?: {
11
8
  config?: {
12
- packageId: string;
13
9
  uniqueId: string;
10
+ packageId: string;
14
11
  } | null | undefined;
15
- gateway: "Fiuu" | "Digio" | "Maybank" | "Tyro" | "Maybank2" | "Maybank3" | "Nets" | "Ghl" | "Ghl2" | "Ghl3" | "Cash" | "Softspace" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
12
+ gateway: "Fiuu" | "Digio" | "Maybank" | "Tyro" | "Ghl" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue" | "Cash" | "Softspace";
16
13
  }[] | null | undefined;
14
+ deletedAt?: string | null | undefined;
15
+ deviceId?: string | null | undefined;
16
+ bindCode?: string | null | undefined;
17
+ token?: string | null | undefined;
17
18
  ecrs?: ({
18
19
  config?: {
19
20
  terminalId: string;
@@ -22,10 +23,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
22
23
  } | {
23
24
  config?: {
24
25
  privateKey?: string | null | undefined;
25
- terminalId: string;
26
26
  merchantId: string;
27
+ terminalId: string;
27
28
  } | null | undefined;
28
29
  gateway: "Ghl";
30
+ } | {
31
+ config?: {
32
+ externalTerminalId: string;
33
+ } | null | undefined;
34
+ gateway: "Beam";
29
35
  })[] | null | undefined;
30
36
  ecrIntegrations?: {
31
37
  config?: {
@@ -37,7 +43,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
37
43
  } | null | undefined;
38
44
  receiptName?: string | null | undefined;
39
45
  dialogConfig?: Record<string, any> | null | undefined;
40
- gateway: "Maybank" | "Maybank2" | "Maybank3" | "Nets" | "Ghl2" | "Ghl3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
46
+ gateway: "Maybank" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
41
47
  }[] | null | undefined;
42
48
  qrIntegrations?: ({
43
49
  config?: {
@@ -53,13 +59,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
53
59
  gateway: "MOCK";
54
60
  })[] | null | undefined;
55
61
  paymentCheckouts?: {
56
- account?: string | null | undefined;
57
- action?: string | null | undefined;
58
- appId?: string | null | undefined;
62
+ extra?: Record<string, any> | null | undefined;
59
63
  receiptPaymentName?: string | null | undefined;
64
+ appId?: string | null | undefined;
65
+ action?: string | null | undefined;
66
+ account?: string | null | undefined;
60
67
  fallbackCardTypes?: string[] | null | undefined;
61
- extra?: Record<string, any> | null | undefined;
62
- type: "card" | "ecr" | "ecr_qr" | "qr" | "scanpay";
68
+ type: "card" | "scanpay" | "ecr" | "ecr_qr" | "qr";
63
69
  gateway: string;
64
70
  icon: string | null;
65
71
  id: string;
@@ -70,32 +76,32 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
70
76
  sortOrder: number;
71
77
  enabled: boolean;
72
78
  }[] | null | undefined;
73
- deletedAt?: string | null | undefined;
74
79
  status: "Active" | "Inactive";
75
80
  referenceId: string;
76
81
  _id: string;
82
+ updatedAt: string;
83
+ createdAt: string;
77
84
  securityCode: string;
78
85
  deviceType: "TERMINAL" | "POS" | "KIOSK" | "FOODCOURT";
79
- createdAt: string;
80
- updatedAt: string;
81
86
  }>;
82
87
  required: true;
83
88
  };
84
89
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
85
90
  terminal: {
86
91
  type: PropType<{
87
- name?: string | null | undefined;
88
- deviceId?: string | null | undefined;
89
- bindCode?: string | null | undefined;
90
92
  secretKey?: string | null | undefined;
91
- token?: string | null | undefined;
93
+ name?: string | null | undefined;
92
94
  gateways?: {
93
95
  config?: {
94
- packageId: string;
95
96
  uniqueId: string;
97
+ packageId: string;
96
98
  } | null | undefined;
97
- gateway: "Fiuu" | "Digio" | "Maybank" | "Tyro" | "Maybank2" | "Maybank3" | "Nets" | "Ghl" | "Ghl2" | "Ghl3" | "Cash" | "Softspace" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
99
+ gateway: "Fiuu" | "Digio" | "Maybank" | "Tyro" | "Ghl" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue" | "Cash" | "Softspace";
98
100
  }[] | null | undefined;
101
+ deletedAt?: string | null | undefined;
102
+ deviceId?: string | null | undefined;
103
+ bindCode?: string | null | undefined;
104
+ token?: string | null | undefined;
99
105
  ecrs?: ({
100
106
  config?: {
101
107
  terminalId: string;
@@ -104,10 +110,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
104
110
  } | {
105
111
  config?: {
106
112
  privateKey?: string | null | undefined;
107
- terminalId: string;
108
113
  merchantId: string;
114
+ terminalId: string;
109
115
  } | null | undefined;
110
116
  gateway: "Ghl";
117
+ } | {
118
+ config?: {
119
+ externalTerminalId: string;
120
+ } | null | undefined;
121
+ gateway: "Beam";
111
122
  })[] | null | undefined;
112
123
  ecrIntegrations?: {
113
124
  config?: {
@@ -119,7 +130,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
119
130
  } | null | undefined;
120
131
  receiptName?: string | null | undefined;
121
132
  dialogConfig?: Record<string, any> | null | undefined;
122
- gateway: "Maybank" | "Maybank2" | "Maybank3" | "Nets" | "Ghl2" | "Ghl3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
133
+ gateway: "Maybank" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
123
134
  }[] | null | undefined;
124
135
  qrIntegrations?: ({
125
136
  config?: {
@@ -135,13 +146,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
135
146
  gateway: "MOCK";
136
147
  })[] | null | undefined;
137
148
  paymentCheckouts?: {
138
- account?: string | null | undefined;
139
- action?: string | null | undefined;
140
- appId?: string | null | undefined;
149
+ extra?: Record<string, any> | null | undefined;
141
150
  receiptPaymentName?: string | null | undefined;
151
+ appId?: string | null | undefined;
152
+ action?: string | null | undefined;
153
+ account?: string | null | undefined;
142
154
  fallbackCardTypes?: string[] | null | undefined;
143
- extra?: Record<string, any> | null | undefined;
144
- type: "card" | "ecr" | "ecr_qr" | "qr" | "scanpay";
155
+ type: "card" | "scanpay" | "ecr" | "ecr_qr" | "qr";
145
156
  gateway: string;
146
157
  icon: string | null;
147
158
  id: string;
@@ -152,14 +163,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
152
163
  sortOrder: number;
153
164
  enabled: boolean;
154
165
  }[] | null | undefined;
155
- deletedAt?: string | null | undefined;
156
166
  status: "Active" | "Inactive";
157
167
  referenceId: string;
158
168
  _id: string;
169
+ updatedAt: string;
170
+ createdAt: string;
159
171
  securityCode: string;
160
172
  deviceType: "TERMINAL" | "POS" | "KIOSK" | "FOODCOURT";
161
- createdAt: string;
162
- updatedAt: string;
163
173
  }>;
164
174
  required: true;
165
175
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "1.9.3-dev",
3
+ "version": "1.9.5-dev",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -23,7 +23,7 @@
23
23
  "@feedmepos/hrm-permission": "1.0.6",
24
24
  "@feedmepos/mf-common": "^1.26.8",
25
25
  "@feedmepos/mf-financing": "0.0.24-dev",
26
- "@feedmepos/payment-entity": "0.1.90",
26
+ "@feedmepos/payment-entity": "0.1.91",
27
27
  "@feedmepos/ui-library": "^1.10.13",
28
28
  "@tanstack/vue-query": "^5.101.0",
29
29
  "axios": "^0.27.2",
@@ -1,502 +0,0 @@
1
- import { defineComponent as E, resolveComponent as c, openBlock as _, createElementBlock as S, createVNode as p, normalizeClass as j, withCtx as k, createElementVNode as b, toDisplayString as q, createBlock as w, ref as f, unref as u, createCommentVNode as M, createTextVNode as A, computed as U, resolveDynamicComponent as z, normalizeProps as O, guardReactiveProps as Y, watch as H, isRef as L, h as R } from "vue";
2
- import { h as Q } from "./moment-h96o7c8I.js";
3
- import { useCoreStore as W } from "@feedmepos/mf-common";
4
- import { u as G } from "./index-CAd13T_z.js";
5
- import { _ as J } from "./index.vue_vue_type_script_setup_true_lang-DZQR-ukK.js";
6
- import { _ as X } from "./AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js";
7
- import { useSnackbar as K, useDialogChild as N, useDialog as Z } from "@feedmepos/ui-library";
8
- import { g as B, b as P, a as ee, p as te } from "./index-zzOpgyK_.js";
9
- import { c as ae } from "./clipboard-4jh1WteU.js";
10
- import { z as h, a as D } from "./validator-CTlVogBQ.js";
11
- import { _ as ne } from "./AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-uhnNKle-.js";
12
- import { u as $ } from "./error-K1CakhA9.js";
13
- import { w as re } from "./Modal-DB8M9o1T.js";
14
- const V = {
15
- async create(r) {
16
- return B(
17
- await P().post("/payments/external-terminals", r)
18
- );
19
- },
20
- async read(r) {
21
- return ee(
22
- await P().get("/payments/external-terminals", {
23
- params: { ...r }
24
- })
25
- );
26
- },
27
- async readById(r) {
28
- return B(
29
- await P().get(`/payments/external-terminals/${r}`)
30
- );
31
- },
32
- async updateById(r, a) {
33
- return B(
34
- await P().put(
35
- `/payments/external-terminals/${r}`,
36
- a
37
- )
38
- );
39
- },
40
- async pair(r, a) {
41
- return B(
42
- await P().post(
43
- `/payments/external-terminals/${r}/pair`,
44
- a
45
- )
46
- );
47
- },
48
- async delete(r) {
49
- return B(
50
- await P().delete(`/payments/external-terminals/${r}`)
51
- );
52
- }
53
- }, oe = /* @__PURE__ */ E({
54
- __name: "ID",
55
- props: {
56
- row: {},
57
- data: {}
58
- },
59
- setup(r) {
60
- const a = r, o = K();
61
- function i() {
62
- return a.row.original.status === "READY" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-amber-400";
63
- }
64
- function l() {
65
- try {
66
- ae(a.data), o.open({ title: "Text copied to clipboard." }, 1e3);
67
- } catch {
68
- o.open({ title: "Clipboard API incompatible." }, 1e3);
69
- }
70
- }
71
- return (n, t) => {
72
- const d = c("FmBadge");
73
- return _(), S("div", {
74
- onClick: t[0] || (t[0] = (y) => {
75
- y.stopPropagation(), l();
76
- })
77
- }, [
78
- p(d, {
79
- inline: "",
80
- class: j(i())
81
- }, {
82
- default: k(() => [
83
- b("div", null, q(r.data), 1)
84
- ]),
85
- _: 1
86
- }, 8, ["class"])
87
- ]);
88
- };
89
- }
90
- }), le = { class: "flex items-center justify-center" }, se = {
91
- key: 1,
92
- class: "t-caption text-fm-color-neutral-gray-500 whitespace-nowrap"
93
- }, ie = /* @__PURE__ */ E({
94
- __name: "Actions",
95
- props: {
96
- data: {}
97
- },
98
- emits: ["pair", "edit", "delete"],
99
- setup(r, { emit: a }) {
100
- const o = a;
101
- return (i, l) => {
102
- const n = c("FmButton");
103
- return _(), S("div", le, [
104
- r.data.status === "NEW" ? (_(), w(n, {
105
- key: 0,
106
- variant: "tertiary",
107
- label: "Pair",
108
- "prepend-icon": "link",
109
- onClick: l[0] || (l[0] = (t) => {
110
- t.stopPropagation(), o("pair");
111
- })
112
- })) : (_(), S("div", se, " Ready to use ")),
113
- p(n, {
114
- variant: "plain",
115
- "prepend-icon": "edit",
116
- onClick: l[1] || (l[1] = (t) => {
117
- t.stopPropagation(), o("edit");
118
- })
119
- }),
120
- p(n, {
121
- variant: "plain",
122
- "prepend-icon": "delete",
123
- onClick: l[2] || (l[2] = (t) => {
124
- t.stopPropagation(), o("delete");
125
- })
126
- })
127
- ]);
128
- };
129
- }
130
- }), me = /* @__PURE__ */ E({
131
- __name: "ExternalTerminalDialog",
132
- props: {
133
- terminal: {
134
- type: Object
135
- }
136
- },
137
- setup(r) {
138
- var x, g, I;
139
- const a = r, o = N(), i = f(), l = f((x = a.terminal) == null ? void 0 : x.name), n = f(((g = a.terminal) == null ? void 0 : g.restaurantId) ?? ""), t = f((I = a.terminal) == null ? void 0 : I.type), d = te.FdoExternalTerminalProvider.options.map((v) => ({
140
- label: v,
141
- value: v
142
- }));
143
- function y() {
144
- const v = {
145
- name: l.value,
146
- restaurantId: n.value || null
147
- };
148
- o.emitData(a.terminal ? v : { ...v, type: t.value }), o.emitAction("primary");
149
- }
150
- return (v, e) => {
151
- const s = c("FmSelect"), m = c("FmTextField"), F = c("FmButton"), T = c("FmForm");
152
- return _(), w(T, {
153
- ref: i.value,
154
- class: "flex flex-col gap-16 mb-6",
155
- onValidationSuccess: y
156
- }, {
157
- default: k(() => [
158
- a.terminal ? M("", !0) : (_(), w(s, {
159
- key: 0,
160
- modelValue: t.value,
161
- "onUpdate:modelValue": e[0] || (e[0] = (C) => t.value = C),
162
- label: "Provider",
163
- items: u(d),
164
- rules: u(h)(u(D).string().min(1, "Provider is required"))
165
- }, null, 8, ["modelValue", "items", "rules"])),
166
- p(ne, {
167
- modelValue: n.value,
168
- "onUpdate:modelValue": e[1] || (e[1] = (C) => n.value = C),
169
- label: "Restaurant",
170
- placeholder: "Unassigned",
171
- "search-placeholder": "Search restaurants"
172
- }, null, 8, ["modelValue"]),
173
- p(m, {
174
- modelValue: l.value,
175
- "onUpdate:modelValue": e[2] || (e[2] = (C) => l.value = C),
176
- label: "Terminal Name",
177
- rules: u(h)(u(D).string().min(1))
178
- }, null, 8, ["modelValue", "rules"]),
179
- p(F, {
180
- type: "submit",
181
- label: a.terminal ? "Update" : "Create"
182
- }, null, 8, ["label"])
183
- ]),
184
- _: 1
185
- }, 512);
186
- };
187
- }
188
- }), ue = { class: "t-caption" }, ce = /* @__PURE__ */ E({
189
- __name: "BeamTerminal",
190
- props: {
191
- terminal: {
192
- type: Object,
193
- required: !0
194
- },
195
- onPair: {
196
- type: Function,
197
- required: !0
198
- }
199
- },
200
- setup(r) {
201
- const a = r, o = f(), i = f("");
202
- return (l, n) => {
203
- const t = c("FmTextField"), d = c("FmButton"), y = c("FmForm");
204
- return _(), w(y, {
205
- ref: o.value,
206
- class: "flex flex-col gap-16 mb-6",
207
- onValidationSuccess: n[1] || (n[1] = () => a.onPair({ type: "BEAM", pairCode: i.value }))
208
- }, {
209
- default: k(() => [
210
- b("div", ue, [
211
- n[2] || (n[2] = A(" Enter the pairing code shown on ", -1)),
212
- b("b", null, q(a.terminal.name), 1),
213
- n[3] || (n[3] = A(" to register it with Bolt Connect. ", -1))
214
- ]),
215
- p(t, {
216
- modelValue: i.value,
217
- "onUpdate:modelValue": n[0] || (n[0] = (x) => i.value = x),
218
- label: "Pair Code",
219
- "label-mark": "required",
220
- rules: u(h)(u(D).string().min(1, "Pair code is required"))
221
- }, null, 8, ["modelValue", "rules"]),
222
- p(d, {
223
- type: "submit",
224
- label: "Pair"
225
- })
226
- ]),
227
- _: 1
228
- }, 512);
229
- };
230
- }
231
- }), pe = { class: "t-caption" }, de = /* @__PURE__ */ E({
232
- __name: "BRITerminal",
233
- props: {
234
- terminal: {
235
- type: Object,
236
- required: !0
237
- },
238
- onPair: {
239
- type: Function,
240
- required: !0
241
- }
242
- },
243
- setup(r) {
244
- const a = r, o = f(), i = f(""), l = f("");
245
- return (n, t) => {
246
- const d = c("FmTextField"), y = c("FmButton"), x = c("FmForm");
247
- return _(), w(x, {
248
- ref: o.value,
249
- class: "flex flex-col gap-16 mb-6",
250
- onValidationSuccess: t[2] || (t[2] = () => a.onPair({ type: "BRI", pairCode: i.value, edcId: l.value }))
251
- }, {
252
- default: k(() => [
253
- b("div", pe, [
254
- t[3] || (t[3] = A(" Enter the pairing code and EDC ID shown on ", -1)),
255
- b("b", null, q(a.terminal.name), 1),
256
- t[4] || (t[4] = A(" to register it with BRI. ", -1))
257
- ]),
258
- p(d, {
259
- modelValue: i.value,
260
- "onUpdate:modelValue": t[0] || (t[0] = (g) => i.value = g),
261
- label: "Pair Code",
262
- "label-mark": "required",
263
- rules: u(h)(u(D).string().min(1, "Pair code is required"))
264
- }, null, 8, ["modelValue", "rules"]),
265
- p(d, {
266
- modelValue: l.value,
267
- "onUpdate:modelValue": t[1] || (t[1] = (g) => l.value = g),
268
- label: "EDC ID",
269
- "label-mark": "required",
270
- rules: u(h)(u(D).string().min(1, "EDC ID is required"))
271
- }, null, 8, ["modelValue", "rules"]),
272
- p(y, {
273
- type: "submit",
274
- label: "Pair"
275
- })
276
- ]),
277
- _: 1
278
- }, 512);
279
- };
280
- }
281
- }), ye = /* @__PURE__ */ E({
282
- __name: "ExternalTerminalPairDialog",
283
- props: {
284
- terminal: {
285
- type: Object,
286
- required: !0
287
- }
288
- },
289
- setup(r) {
290
- const a = r, o = N(), i = {
291
- BEAM: ce,
292
- BRI: de
293
- }, l = U(() => i[a.terminal.type]);
294
- function n(t) {
295
- o.emitData(t), o.emitAction("primary");
296
- }
297
- return (t, d) => (_(), w(z(l.value), O(Y({
298
- terminal: a.terminal,
299
- onPair: n
300
- })), null, 16));
301
- }
302
- }), fe = { class: "flex justify-between mb-6 items-center" }, _e = { class: "flex space-x-4" }, xe = { class: "flex space-x-4" }, ke = /* @__PURE__ */ E({
303
- __name: "ExternalTerminal",
304
- setup(r) {
305
- const a = f(), { searchKey: o } = G({
306
- searchKey: ""
307
- });
308
- let i;
309
- H(o, async () => {
310
- i && clearTimeout(i), i = setTimeout(
311
- () => {
312
- var e;
313
- return (e = a.value) == null ? void 0 : e.reset();
314
- },
315
- 700
316
- );
317
- });
318
- const l = W(), n = Z(), t = K(), d = U(() => new Map(
319
- l.restaurants.value.map((e) => [e._id, e.profile.name])
320
- ));
321
- async function y(e) {
322
- n.open({
323
- title: e ? "Update External Terminal" : "Create New External Terminal",
324
- closeButton: !0,
325
- overlay: !0,
326
- contentComponent: me,
327
- contentComponentProps: { terminal: e }
328
- }).onPrimary(async (s) => {
329
- var m;
330
- n.close();
331
- try {
332
- await (e ? V.updateById(e._id, s) : V.create(s)), (m = a.value) == null || m.reset(), t.open({
333
- type: "success",
334
- message: e ? "External terminal updated successfully." : "External terminal created successfully."
335
- });
336
- } catch (F) {
337
- t.open({
338
- type: "error",
339
- title: e ? "Error occurs when update external terminal" : "Error occurs when create external terminal",
340
- message: $(F)
341
- });
342
- }
343
- });
344
- }
345
- async function x(e) {
346
- n.open({
347
- title: "Pair External Terminal",
348
- closeButton: !0,
349
- overlay: !0,
350
- contentComponent: ye,
351
- contentComponentProps: { terminal: e }
352
- }).onPrimary(async (s) => {
353
- var m;
354
- n.close();
355
- try {
356
- await V.pair(e._id, s), (m = a.value) == null || m.reset(), t.open({
357
- type: "success",
358
- message: "External terminal paired successfully."
359
- });
360
- } catch (F) {
361
- t.open({
362
- type: "error",
363
- title: "Error occurs when pair external terminal",
364
- message: $(F)
365
- });
366
- }
367
- });
368
- }
369
- async function g(e) {
370
- re(
371
- n,
372
- "Delete External Terminal",
373
- "Are you sure to delete this external terminal? This action cannot be revert!",
374
- async () => {
375
- var s;
376
- try {
377
- await V.delete(e), (s = a.value) == null || s.reset(), t.open({
378
- type: "success",
379
- message: "External terminal deleted successfully."
380
- });
381
- } catch (m) {
382
- t.open({
383
- type: "error",
384
- title: "Error occurs when delete external terminal",
385
- message: $(m)
386
- });
387
- }
388
- }
389
- );
390
- }
391
- const I = function(e) {
392
- return {
393
- id: e._id,
394
- status: e.status,
395
- name: e.name,
396
- type: e.type,
397
- restaurant: e.restaurantId ? d.value.get(e.restaurantId) ?? e.restaurantId : "-",
398
- updatedAt: Q(e.updatedAt).format("YYYY-MM-DD HH:mm:ss")
399
- };
400
- }, v = [
401
- {
402
- accessorKey: "id",
403
- header: () => "Terminal ID",
404
- meta: {
405
- textAlign: "right"
406
- },
407
- cell: ({ cell: e, row: s }) => R(oe, { row: s, data: e.getValue() })
408
- },
409
- {
410
- accessorKey: "name",
411
- header: () => "Name",
412
- meta: {
413
- textAlign: "left"
414
- }
415
- },
416
- {
417
- accessorKey: "type",
418
- header: () => "Provider",
419
- meta: {
420
- textAlign: "left"
421
- }
422
- },
423
- {
424
- accessorKey: "restaurant",
425
- header: () => "Restaurant",
426
- meta: {
427
- textAlign: "left"
428
- }
429
- },
430
- {
431
- accessorKey: "status",
432
- header: () => "Status",
433
- meta: {
434
- textAlign: "left"
435
- }
436
- },
437
- {
438
- accessorKey: "updatedAt",
439
- header: () => "Last Updated",
440
- meta: {
441
- textAlign: "left"
442
- }
443
- },
444
- {
445
- accessorKey: "id",
446
- header: () => "Actions",
447
- meta: {
448
- textAlign: "center"
449
- },
450
- cell: ({ row: e }) => {
451
- var m;
452
- const s = (m = a.value) == null ? void 0 : m.pageData().at(e.index);
453
- return R(ie, {
454
- data: s,
455
- onPair: () => x(s),
456
- onEdit: () => y(s),
457
- onDelete: () => g(s._id)
458
- });
459
- }
460
- }
461
- ];
462
- return (e, s) => {
463
- const m = c("FmSearch"), F = c("FmButton");
464
- return _(), w(X, {
465
- title: "External Terminals",
466
- loading: !1
467
- }, {
468
- default: k(() => [
469
- b("div", fe, [
470
- b("div", _e, [
471
- p(m, {
472
- "model-value": u(o),
473
- "onUpdate:modelValue": s[0] || (s[0] = (T) => L(o) ? o.value = T : null),
474
- class: "mr-8",
475
- label: "Search",
476
- placeholder: "Search ..."
477
- }, null, 8, ["model-value"])
478
- ]),
479
- b("div", xe, [
480
- p(F, {
481
- label: "Create",
482
- icon: "add",
483
- onClick: s[1] || (s[1] = () => y())
484
- })
485
- ])
486
- ]),
487
- p(J, {
488
- ref_key: "controller",
489
- ref: a,
490
- "column-defs": v,
491
- "rows-defs": I,
492
- paginate: (T, C) => u(V).read({ searchKey: u(o), limit: T, cursor: C })
493
- }, null, 8, ["paginate"])
494
- ]),
495
- _: 1
496
- });
497
- };
498
- }
499
- });
500
- export {
501
- ke as default
502
- };