@feedmepos/mf-payment 1.9.7-dev → 1.9.9-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 (84) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-BZcsnsum.js → Actions.vue_vue_type_script_setup_true_lang-DfxD6HRe.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-CgINTFXl.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-DoPYwuAl.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-Dq2Edu64.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-zvCtrYWK.js} +2 -2
  4. package/dist/{Chargeback-D1KlZKJD.js → Chargeback-y23IgpQO.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-B9yPSEWW.js → DocumentViewer.vue_vue_type_script_setup_true_lang-DniTxikv.js} +1 -1
  6. package/dist/ExternalTerminal-Bk8qxe6i.js +563 -0
  7. package/dist/{OnboardForm-CH48O1XF.js → OnboardForm-BB72Mj2R.js} +6 -6
  8. package/dist/{OnboardForm-DO69195z.js → OnboardForm-BNnb0ZFK.js} +6 -6
  9. package/dist/{OnboardSubmission-C8vuAVey.js → OnboardSubmission-B1iGfA_R.js} +6 -6
  10. package/dist/{OnboardSubmission-Dye6TVj1.js → OnboardSubmission-B2mNX4r6.js} +3 -3
  11. package/dist/{PayoutAccount-B-mUH5k_.js → PayoutAccount-B5NmFVFd.js} +5 -5
  12. package/dist/{PayoutAccount-VVOvJlHK.js → PayoutAccount-C7Z20H0i.js} +7 -7
  13. package/dist/{PayoutAccountSetting-CcPxgJ8D.js → PayoutAccountSetting-CP3mAkze.js} +6 -6
  14. package/dist/{Restaurant-Dm407idD.js → Restaurant-Bs7PK0p2.js} +4 -4
  15. package/dist/{RestaurantSetting--JkIxrXu.js → RestaurantSetting-IiHMuUrM.js} +3 -3
  16. package/dist/{Settlement-DMnPPWm8.js → Settlement-BdvHrraK.js} +4 -4
  17. package/dist/{Settlement-nI7u4nhD.js → Settlement-DBcfw_OC.js} +3 -3
  18. package/dist/{SettlementTransactions-CYk6UGS9.js → SettlementTransactions-CZZtHLKA.js} +5 -5
  19. package/dist/{SettlementTransactions-DCkpOyt5.js → SettlementTransactions-kSVYYRvX.js} +5 -5
  20. package/dist/{Status.vue_vue_type_script_setup_true_lang-D_7OKts9.js → Status.vue_vue_type_script_setup_true_lang-CEcaBwZC.js} +1 -1
  21. package/dist/{Terminal-DLXFcFec.js → Terminal-DaFVqAc2.js} +6 -6
  22. package/dist/{TerminalSetting-9WPx0VGD.js → TerminalSetting-hawEQ10h.js} +781 -688
  23. package/dist/{Transaction-Bi_8xljd.js → Transaction-CJMf4YVA.js} +10 -10
  24. package/dist/{Transaction-DLwzAbcQ.js → Transaction-DAWg8xVq.js} +11 -11
  25. package/dist/{TransactionOld-BcacyYJV.js → TransactionOld-D7XYMEdw.js} +7 -7
  26. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-BX7-QE5c.js → TransactionStatus.vue_vue_type_script_setup_true_lang-CYrTUdLd.js} +1 -1
  27. package/dist/{app-DZTbOw2r.js → app-BuMHnFUt.js} +24 -24
  28. package/dist/app.js +1 -1
  29. package/dist/{assets-BmBw7sbJ.js → assets-BKwc3NSl.js} +51 -50
  30. package/dist/{grafana-C_DIpBzo.js → grafana-B9TF3CfK.js} +1 -1
  31. package/dist/{index-AOcQiqce.js → index-B6ZuvMmn.js} +1 -1
  32. package/dist/{index-C5gOk5nZ.js → index-BBh3QTy7.js} +1 -1
  33. package/dist/{index-DzR-1F2a.js → index-ByyhRgBv.js} +1 -1
  34. package/dist/{index-CKMH3irr.js → index-CFafSlH1.js} +1 -1
  35. package/dist/{index-CZPUptsd.js → index-CV1iIZ2p.js} +1 -1
  36. package/dist/{index-B9wv-Z7c.js → index-D7tNqv0L.js} +1 -1
  37. package/dist/{index-Dgmie4RK.js → index-DZ4-ye11.js} +2 -2
  38. package/dist/{index-xMYjfBuw.js → index-evtV0Mxj.js} +10301 -10100
  39. package/dist/{index-DdVYri9L.js → index-vXtzdGjn.js} +1 -1
  40. package/dist/{index-CW9ACt8t.js → index-z-OalSFY.js} +1 -1
  41. package/dist/{index.vue_vue_type_script_setup_true_lang-DFvDNfOk.js → index.vue_vue_type_script_setup_true_lang-DE2SAW-f.js} +1 -1
  42. package/dist/{onboard-submission-U49O3Zxc.js → onboard-submission-B6oTOtch.js} +1 -1
  43. package/dist/package.json +3 -3
  44. package/dist/{payout-account-CLCqR7oI.js → payout-account-RdE34Fy5.js} +3 -3
  45. package/dist/tsconfig.app.tsbuildinfo +1 -1
  46. package/dist/views/admin/external-terminal/ExternalTerminalPairDialog.vue.d.ts +26 -18
  47. package/dist/views/admin/external-terminal/ExternalTerminalSideSheet.vue.d.ts +52 -20
  48. package/dist/views/admin/external-terminal/config/BRITerminal.vue.d.ts +18 -0
  49. package/dist/views/admin/external-terminal/pair/BRITerminal.vue.d.ts +26 -18
  50. package/dist/views/admin/external-terminal/pair/BeamTerminal.vue.d.ts +26 -18
  51. package/dist/views/admin/onboard-submission/forms/NTTSubmission.vue.d.ts +8 -8
  52. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +8 -8
  53. package/dist/views/admin/onboard-submission/forms/TyroSubmission.vue.d.ts +8 -8
  54. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +4 -4
  55. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +4 -4
  56. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +4 -4
  57. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  58. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  59. package/dist/views/admin/terminal/TerminalSideSheet.vue.d.ts +42 -32
  60. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +42 -32
  61. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +42 -32
  62. package/dist/views/admin/terminal/tabs/PaymentCheckout.vue.d.ts +42 -32
  63. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +42 -32
  64. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +42 -32
  65. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +42 -32
  66. package/dist/views/admin/terminal/tabs/ecr/BeamGateway.vue.d.ts +42 -32
  67. package/dist/views/admin/terminal/tabs/ecr/BriGateway.vue.d.ts +196 -0
  68. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +42 -32
  69. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +42 -32
  70. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +42 -32
  71. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +42 -32
  72. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +42 -32
  73. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +42 -32
  74. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +42 -32
  75. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +42 -32
  76. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +42 -32
  77. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +42 -32
  78. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +42 -32
  79. package/dist/views/admin/terminal/tabs/ecr/RevenueGateway.vue.d.ts +42 -32
  80. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +42 -32
  81. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +42 -32
  82. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +42 -32
  83. package/package.json +2 -2
  84. package/dist/ExternalTerminal-C1Zp6jsh.js +0 -491
@@ -2,19 +2,18 @@ import { type PropType } from 'vue';
2
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
3
  terminal: {
4
4
  type: PropType<{
5
- secretKey?: string | null | undefined;
6
5
  name?: string | null | undefined;
6
+ deviceId?: string | null | undefined;
7
+ bindCode?: string | null | undefined;
8
+ secretKey?: string | null | undefined;
9
+ token?: string | null | undefined;
7
10
  gateways?: {
8
11
  config?: {
9
- uniqueId: string;
10
12
  packageId: string;
13
+ uniqueId: string;
11
14
  } | null | undefined;
12
- gateway: "Fiuu" | "Digio" | "Maybank" | "Tyro" | "Ghl" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue" | "Cash" | "Softspace";
15
+ gateway: "Fiuu" | "Digio" | "Maybank" | "Beam" | "Tyro" | "Maybank2" | "Maybank3" | "Nets" | "Ghl" | "Ghl2" | "Ghl3" | "Cash" | "Softspace" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue" | "Bri";
13
16
  }[] | null | undefined;
14
- deletedAt?: string | null | undefined;
15
- deviceId?: string | null | undefined;
16
- bindCode?: string | null | undefined;
17
- token?: string | null | undefined;
18
17
  ecrs?: ({
19
18
  config?: {
20
19
  terminalId: string;
@@ -23,8 +22,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
23
22
  } | {
24
23
  config?: {
25
24
  privateKey?: string | null | undefined;
26
- merchantId: string;
27
25
  terminalId: string;
26
+ merchantId: string;
28
27
  } | null | undefined;
29
28
  gateway: "Ghl";
30
29
  } | {
@@ -32,6 +31,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
32
31
  externalTerminalId: string;
33
32
  } | null | undefined;
34
33
  gateway: "Beam";
34
+ } | {
35
+ config?: {
36
+ externalTerminalId: string;
37
+ } | null | undefined;
38
+ gateway: "Bri";
35
39
  })[] | null | undefined;
36
40
  ecrIntegrations?: {
37
41
  config?: {
@@ -43,7 +47,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
43
47
  } | null | undefined;
44
48
  receiptName?: string | null | undefined;
45
49
  dialogConfig?: Record<string, any> | null | undefined;
46
- gateway: "Maybank" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
50
+ gateway: "Maybank" | "Maybank2" | "Maybank3" | "Nets" | "Ghl2" | "Ghl3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
47
51
  }[] | null | undefined;
48
52
  qrIntegrations?: ({
49
53
  config?: {
@@ -59,13 +63,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
59
63
  gateway: "MOCK";
60
64
  })[] | null | undefined;
61
65
  paymentCheckouts?: {
62
- extra?: Record<string, any> | null | undefined;
63
- receiptPaymentName?: string | null | undefined;
64
- appId?: string | null | undefined;
65
- action?: string | null | undefined;
66
66
  account?: string | null | undefined;
67
+ action?: string | null | undefined;
68
+ appId?: string | null | undefined;
69
+ receiptPaymentName?: string | null | undefined;
67
70
  fallbackCardTypes?: string[] | null | undefined;
68
- type: "card" | "scanpay" | "ecr" | "ecr_qr" | "qr";
71
+ extra?: Record<string, any> | null | undefined;
72
+ type: "card" | "ecr" | "ecr_qr" | "qr" | "scanpay";
69
73
  gateway: string;
70
74
  icon: string | null;
71
75
  id: string;
@@ -76,32 +80,32 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
76
80
  sortOrder: number;
77
81
  enabled: boolean;
78
82
  }[] | null | undefined;
83
+ deletedAt?: string | null | undefined;
79
84
  status: "Active" | "Inactive";
80
85
  referenceId: string;
81
86
  _id: string;
82
- updatedAt: string;
83
- createdAt: string;
84
87
  securityCode: string;
85
88
  deviceType: "TERMINAL" | "POS" | "KIOSK" | "FOODCOURT";
89
+ createdAt: string;
90
+ updatedAt: string;
86
91
  }>;
87
92
  required: true;
88
93
  };
89
94
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
90
95
  terminal: {
91
96
  type: PropType<{
92
- secretKey?: string | null | undefined;
93
97
  name?: string | null | undefined;
98
+ deviceId?: string | null | undefined;
99
+ bindCode?: string | null | undefined;
100
+ secretKey?: string | null | undefined;
101
+ token?: string | null | undefined;
94
102
  gateways?: {
95
103
  config?: {
96
- uniqueId: string;
97
104
  packageId: string;
105
+ uniqueId: string;
98
106
  } | null | undefined;
99
- gateway: "Fiuu" | "Digio" | "Maybank" | "Tyro" | "Ghl" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue" | "Cash" | "Softspace";
107
+ gateway: "Fiuu" | "Digio" | "Maybank" | "Beam" | "Tyro" | "Maybank2" | "Maybank3" | "Nets" | "Ghl" | "Ghl2" | "Ghl3" | "Cash" | "Softspace" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue" | "Bri";
100
108
  }[] | null | undefined;
101
- deletedAt?: string | null | undefined;
102
- deviceId?: string | null | undefined;
103
- bindCode?: string | null | undefined;
104
- token?: string | null | undefined;
105
109
  ecrs?: ({
106
110
  config?: {
107
111
  terminalId: string;
@@ -110,8 +114,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
110
114
  } | {
111
115
  config?: {
112
116
  privateKey?: string | null | undefined;
113
- merchantId: string;
114
117
  terminalId: string;
118
+ merchantId: string;
115
119
  } | null | undefined;
116
120
  gateway: "Ghl";
117
121
  } | {
@@ -119,6 +123,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
119
123
  externalTerminalId: string;
120
124
  } | null | undefined;
121
125
  gateway: "Beam";
126
+ } | {
127
+ config?: {
128
+ externalTerminalId: string;
129
+ } | null | undefined;
130
+ gateway: "Bri";
122
131
  })[] | null | undefined;
123
132
  ecrIntegrations?: {
124
133
  config?: {
@@ -130,7 +139,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
130
139
  } | null | undefined;
131
140
  receiptName?: string | null | undefined;
132
141
  dialogConfig?: Record<string, any> | null | undefined;
133
- gateway: "Maybank" | "Ghl2" | "Ghl3" | "Nets" | "Maybank2" | "Maybank3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
142
+ gateway: "Maybank" | "Maybank2" | "Maybank3" | "Nets" | "Ghl2" | "Ghl3" | "Kbank" | "Hlbb" | "GlobalPayments" | "Oma" | "Revenue";
134
143
  }[] | null | undefined;
135
144
  qrIntegrations?: ({
136
145
  config?: {
@@ -146,13 +155,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
146
155
  gateway: "MOCK";
147
156
  })[] | null | undefined;
148
157
  paymentCheckouts?: {
149
- extra?: Record<string, any> | null | undefined;
150
- receiptPaymentName?: string | null | undefined;
151
- appId?: string | null | undefined;
152
- action?: string | null | undefined;
153
158
  account?: string | null | undefined;
159
+ action?: string | null | undefined;
160
+ appId?: string | null | undefined;
161
+ receiptPaymentName?: string | null | undefined;
154
162
  fallbackCardTypes?: string[] | null | undefined;
155
- type: "card" | "scanpay" | "ecr" | "ecr_qr" | "qr";
163
+ extra?: Record<string, any> | null | undefined;
164
+ type: "card" | "ecr" | "ecr_qr" | "qr" | "scanpay";
156
165
  gateway: string;
157
166
  icon: string | null;
158
167
  id: string;
@@ -163,13 +172,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
163
172
  sortOrder: number;
164
173
  enabled: boolean;
165
174
  }[] | null | undefined;
175
+ deletedAt?: string | null | undefined;
166
176
  status: "Active" | "Inactive";
167
177
  referenceId: string;
168
178
  _id: string;
169
- updatedAt: string;
170
- createdAt: string;
171
179
  securityCode: string;
172
180
  deviceType: "TERMINAL" | "POS" | "KIOSK" | "FOODCOURT";
181
+ createdAt: string;
182
+ updatedAt: string;
173
183
  }>;
174
184
  required: true;
175
185
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "1.9.7-dev",
3
+ "version": "1.9.9-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.91",
26
+ "@feedmepos/payment-entity": "0.1.92",
27
27
  "@feedmepos/ui-library": "^1.10.13",
28
28
  "@tanstack/vue-query": "^5.101.0",
29
29
  "axios": "^0.27.2",
@@ -1,491 +0,0 @@
1
- import { defineComponent as w, resolveComponent as u, openBlock as v, createElementBlock as U, createVNode as c, normalizeClass as z, withCtx as h, createElementVNode as b, toDisplayString as q, createBlock as C, useModel as H, ref as _, computed as $, watch as O, unref as m, createCommentVNode as N, mergeModels as M, createTextVNode as k, resolveDynamicComponent as G, normalizeProps as L, guardReactiveProps as Q, isRef as W, h as K } from "vue";
2
- import { h as J } from "./moment-h96o7c8I.js";
3
- import { useCoreStore as Y } from "@feedmepos/mf-common";
4
- import { u as X } from "./index-CZPUptsd.js";
5
- import { _ as Z } from "./index.vue_vue_type_script_setup_true_lang-DFvDNfOk.js";
6
- import { _ as ee } from "./AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js";
7
- import { useSnackbar as j, useDialogChild as te, useDialog as ae } from "@feedmepos/ui-library";
8
- import { e as S } from "./index-DzR-1F2a.js";
9
- import { c as ne } from "./clipboard-4jh1WteU.js";
10
- import { z as P, a as B } from "./validator-CTlVogBQ.js";
11
- import { _ as re } from "./AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-Dq2Edu64.js";
12
- import { e as A, p as oe } from "./index-xMYjfBuw.js";
13
- import { u as R } from "./error-K1CakhA9.js";
14
- import { w as le } from "./Modal-DB8M9o1T.js";
15
- const se = /* @__PURE__ */ w({
16
- __name: "ID",
17
- props: {
18
- row: {},
19
- data: {}
20
- },
21
- setup(d) {
22
- const o = d, n = j();
23
- function s() {
24
- return o.row.original.status === "READY" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-amber-400";
25
- }
26
- function l() {
27
- try {
28
- ne(o.data), n.open({ title: "Text copied to clipboard." }, 1e3);
29
- } catch {
30
- n.open({ title: "Clipboard API incompatible." }, 1e3);
31
- }
32
- }
33
- return (r, e) => {
34
- const i = u("FmBadge");
35
- return v(), U("div", {
36
- onClick: e[0] || (e[0] = (p) => {
37
- p.stopPropagation(), l();
38
- })
39
- }, [
40
- c(i, {
41
- inline: "",
42
- class: z(s())
43
- }, {
44
- default: h(() => [
45
- b("div", null, q(d.data), 1)
46
- ]),
47
- _: 1
48
- }, 8, ["class"])
49
- ]);
50
- };
51
- }
52
- }), ie = { class: "flex items-center justify-center" }, me = {
53
- key: 1,
54
- class: "t-caption text-fm-color-neutral-gray-500 whitespace-nowrap"
55
- }, ue = /* @__PURE__ */ w({
56
- __name: "Actions",
57
- props: {
58
- data: {}
59
- },
60
- emits: ["pair", "edit", "delete"],
61
- setup(d, { emit: o }) {
62
- const n = o;
63
- return (s, l) => {
64
- const r = u("FmButton");
65
- return v(), U("div", ie, [
66
- d.data.status === "NEW" ? (v(), C(r, {
67
- key: 0,
68
- variant: "tertiary",
69
- label: "Pair",
70
- "prepend-icon": "link",
71
- onClick: l[0] || (l[0] = (e) => {
72
- e.stopPropagation(), n("pair");
73
- })
74
- })) : (v(), U("div", me, " Ready to use ")),
75
- c(r, {
76
- variant: "plain",
77
- "prepend-icon": "edit",
78
- onClick: l[1] || (l[1] = (e) => {
79
- e.stopPropagation(), n("edit");
80
- })
81
- }),
82
- c(r, {
83
- variant: "plain",
84
- "prepend-icon": "delete",
85
- onClick: l[2] || (l[2] = (e) => {
86
- e.stopPropagation(), n("delete");
87
- })
88
- })
89
- ]);
90
- };
91
- }
92
- }), ce = /* @__PURE__ */ w({
93
- __name: "ExternalTerminalSideSheet",
94
- props: /* @__PURE__ */ M({
95
- terminal: {
96
- type: Object
97
- }
98
- }, {
99
- modelValue: { type: Boolean, default: !1 },
100
- modelModifiers: {}
101
- }),
102
- emits: /* @__PURE__ */ M(["submit"], ["update:modelValue"]),
103
- setup(d, { emit: o }) {
104
- const n = d, s = o, l = H(d, "modelValue"), r = _(), e = _(""), i = _(""), p = _(), F = {
105
- BEAM: [A.F_COUNTRY.enum.TH],
106
- BRI: [A.F_COUNTRY.enum.ID]
107
- }, V = Y().currentCountry, D = $(
108
- () => oe.FdoExternalTerminalProvider.options.filter(
109
- (x) => F[x].includes(V.value ?? A.F_COUNTRY.enum.MY)
110
- ).map((x) => ({
111
- label: x,
112
- value: x
113
- }))
114
- );
115
- O(l, (x) => {
116
- var y, t, a;
117
- x && (e.value = ((y = n.terminal) == null ? void 0 : y.name) ?? "", i.value = ((t = n.terminal) == null ? void 0 : t.restaurantId) ?? "", p.value = (a = n.terminal) == null ? void 0 : a.type);
118
- });
119
- function I() {
120
- s("submit", {
121
- name: e.value,
122
- restaurantId: i.value,
123
- type: p.value
124
- }), l.value = !1;
125
- }
126
- return (x, y) => {
127
- const t = u("FmSelect"), a = u("FmTextField"), f = u("FmButton"), T = u("FmForm"), E = u("FmSideSheet");
128
- return v(), C(E, {
129
- modelValue: l.value,
130
- "onUpdate:modelValue": y[3] || (y[3] = (g) => l.value = g),
131
- header: n.terminal ? "Update External Terminal" : "Create New External Terminal",
132
- "close-button": ""
133
- }, {
134
- default: h(() => [
135
- c(T, {
136
- ref: r.value,
137
- class: "flex flex-col gap-16 px-4 py-6",
138
- onValidationSuccess: I
139
- }, {
140
- default: h(() => [
141
- n.terminal ? N("", !0) : (v(), C(t, {
142
- key: 0,
143
- modelValue: p.value,
144
- "onUpdate:modelValue": y[0] || (y[0] = (g) => p.value = g),
145
- label: "Provider",
146
- items: D.value,
147
- rules: m(P)(m(B).string().min(1, "Provider is required"))
148
- }, null, 8, ["modelValue", "items", "rules"])),
149
- n.terminal ? N("", !0) : (v(), C(re, {
150
- key: 1,
151
- modelValue: i.value,
152
- "onUpdate:modelValue": y[1] || (y[1] = (g) => i.value = g),
153
- label: "Restaurant",
154
- "search-placeholder": "Search restaurants",
155
- rules: m(P)(m(B).string().min(1, "Restaurant is required"))
156
- }, null, 8, ["modelValue", "rules"])),
157
- c(a, {
158
- modelValue: e.value,
159
- "onUpdate:modelValue": y[2] || (y[2] = (g) => e.value = g),
160
- label: "Terminal Name",
161
- rules: m(P)(m(B).string().min(1))
162
- }, null, 8, ["modelValue", "rules"]),
163
- c(f, {
164
- type: "submit",
165
- label: n.terminal ? "Update" : "Create"
166
- }, null, 8, ["label"])
167
- ]),
168
- _: 1
169
- }, 512)
170
- ]),
171
- _: 1
172
- }, 8, ["modelValue", "header"]);
173
- };
174
- }
175
- }), de = { class: "t-caption" }, pe = /* @__PURE__ */ w({
176
- __name: "BeamTerminal",
177
- props: {
178
- terminal: {
179
- type: Object,
180
- required: !0
181
- },
182
- onPair: {
183
- type: Function,
184
- required: !0
185
- }
186
- },
187
- setup(d) {
188
- const o = d, n = _(), s = _("");
189
- return (l, r) => {
190
- const e = u("FmTextField"), i = u("FmButton"), p = u("FmForm");
191
- return v(), C(p, {
192
- ref: n.value,
193
- class: "flex flex-col gap-16 mb-6",
194
- onValidationSuccess: r[1] || (r[1] = () => o.onPair({ type: "BEAM", pairCode: s.value }))
195
- }, {
196
- default: h(() => [
197
- b("div", de, [
198
- r[2] || (r[2] = k(" Enter the pairing code shown on ", -1)),
199
- b("b", null, q(o.terminal.name), 1),
200
- r[3] || (r[3] = k(" to register it with Bolt Connect. ", -1))
201
- ]),
202
- c(e, {
203
- modelValue: s.value,
204
- "onUpdate:modelValue": r[0] || (r[0] = (F) => s.value = F),
205
- label: "Pair Code",
206
- "label-mark": "required",
207
- rules: m(P)(m(B).string().min(1, "Pair code is required"))
208
- }, null, 8, ["modelValue", "rules"]),
209
- c(i, {
210
- type: "submit",
211
- label: "Pair"
212
- })
213
- ]),
214
- _: 1
215
- }, 512);
216
- };
217
- }
218
- }), fe = { class: "t-caption" }, ye = /* @__PURE__ */ w({
219
- __name: "BRITerminal",
220
- props: {
221
- terminal: {
222
- type: Object,
223
- required: !0
224
- },
225
- onPair: {
226
- type: Function,
227
- required: !0
228
- }
229
- },
230
- setup(d) {
231
- const o = d, n = _(), s = _(""), l = _("");
232
- return (r, e) => {
233
- const i = u("FmTextField"), p = u("FmButton"), F = u("FmForm");
234
- return v(), C(F, {
235
- ref: n.value,
236
- class: "flex flex-col gap-16 mb-6",
237
- onValidationSuccess: e[2] || (e[2] = () => o.onPair({ type: "BRI", pairCode: s.value, edcId: l.value }))
238
- }, {
239
- default: h(() => [
240
- b("div", fe, [
241
- e[3] || (e[3] = k(" Enter the pairing code and EDC ID shown on ", -1)),
242
- b("b", null, q(o.terminal.name), 1),
243
- e[4] || (e[4] = k(" to register it with BRI. ", -1))
244
- ]),
245
- c(i, {
246
- modelValue: s.value,
247
- "onUpdate:modelValue": e[0] || (e[0] = (V) => s.value = V),
248
- label: "Pair Code",
249
- "label-mark": "required",
250
- rules: m(P)(m(B).string().min(1, "Pair code is required"))
251
- }, null, 8, ["modelValue", "rules"]),
252
- c(i, {
253
- modelValue: l.value,
254
- "onUpdate:modelValue": e[1] || (e[1] = (V) => l.value = V),
255
- label: "EDC ID",
256
- "label-mark": "required",
257
- rules: m(P)(m(B).string().min(1, "EDC ID is required"))
258
- }, null, 8, ["modelValue", "rules"]),
259
- c(p, {
260
- type: "submit",
261
- label: "Pair"
262
- })
263
- ]),
264
- _: 1
265
- }, 512);
266
- };
267
- }
268
- }), _e = /* @__PURE__ */ w({
269
- __name: "ExternalTerminalPairDialog",
270
- props: {
271
- terminal: {
272
- type: Object,
273
- required: !0
274
- }
275
- },
276
- setup(d) {
277
- const o = d, n = te(), s = {
278
- BEAM: pe,
279
- BRI: ye
280
- }, l = $(() => s[o.terminal.type]);
281
- function r(e) {
282
- n.emitData(e), n.emitAction("primary");
283
- }
284
- return (e, i) => (v(), C(G(l.value), L(Q({
285
- terminal: o.terminal,
286
- onPair: r
287
- })), null, 16));
288
- }
289
- }), ve = { class: "flex justify-between mb-6 items-center" }, xe = { class: "flex space-x-4" }, ge = { class: "flex space-x-4" }, Ae = /* @__PURE__ */ w({
290
- __name: "ExternalTerminal",
291
- setup(d) {
292
- const o = _(), { searchKey: n } = X({
293
- searchKey: ""
294
- });
295
- let s;
296
- O(n, async () => {
297
- s && clearTimeout(s), s = setTimeout(() => {
298
- var t;
299
- return (t = o.value) == null ? void 0 : t.reset();
300
- }, 700);
301
- });
302
- const l = Y(), r = ae(), e = j();
303
- $(
304
- () => new Map(l.restaurants.value.map((t) => [t._id, t.profile.name]))
305
- );
306
- const i = _(!1), p = _();
307
- function F(t) {
308
- p.value = t, i.value = !0;
309
- }
310
- async function V(t) {
311
- var f;
312
- const a = p.value;
313
- try {
314
- a ? await S.updateById(a._id, {
315
- name: t.name
316
- }) : await S.create(t), (f = o.value) == null || f.reset(), e.open({
317
- type: "success",
318
- message: a ? "External terminal updated successfully." : "External terminal created successfully."
319
- });
320
- } catch (T) {
321
- e.open({
322
- type: "error",
323
- title: a ? "Error occurs when update external terminal" : "Error occurs when create external terminal",
324
- message: R(T)
325
- });
326
- }
327
- }
328
- async function D(t) {
329
- r.open({
330
- title: "Pair External Terminal",
331
- closeButton: !0,
332
- overlay: !0,
333
- contentComponent: _e,
334
- contentComponentProps: { terminal: t }
335
- }).onPrimary(async (a) => {
336
- var f;
337
- r.close();
338
- try {
339
- await S.pair(t._id, a), (f = o.value) == null || f.reset(), e.open({
340
- type: "success",
341
- message: "External terminal paired successfully."
342
- });
343
- } catch (T) {
344
- e.open({
345
- type: "error",
346
- title: "Error occurs when pair external terminal",
347
- message: R(T)
348
- });
349
- }
350
- });
351
- }
352
- async function I(t) {
353
- le(
354
- r,
355
- "Delete External Terminal",
356
- "Are you sure to delete this external terminal? This action cannot be revert!",
357
- async () => {
358
- var a;
359
- try {
360
- await S.delete(t), (a = o.value) == null || a.reset(), e.open({
361
- type: "success",
362
- message: "External terminal deleted successfully."
363
- });
364
- } catch (f) {
365
- e.open({
366
- type: "error",
367
- title: "Error occurs when delete external terminal",
368
- message: R(f)
369
- });
370
- }
371
- }
372
- );
373
- }
374
- const x = function(t) {
375
- return {
376
- id: t._id,
377
- status: t.status,
378
- name: t.name,
379
- type: t.type,
380
- restaurant: t.restaurantId,
381
- updatedAt: J(t.updatedAt).format("YYYY-MM-DD HH:mm:ss")
382
- };
383
- }, y = [
384
- {
385
- accessorKey: "id",
386
- header: () => "Terminal ID",
387
- meta: {
388
- textAlign: "right"
389
- },
390
- cell: ({ cell: t, row: a }) => K(se, { row: a, data: t.getValue() })
391
- },
392
- {
393
- accessorKey: "name",
394
- header: () => "Name",
395
- meta: {
396
- textAlign: "left"
397
- }
398
- },
399
- {
400
- accessorKey: "type",
401
- header: () => "Provider",
402
- meta: {
403
- textAlign: "left"
404
- }
405
- },
406
- {
407
- accessorKey: "restaurant",
408
- header: () => "Restaurant",
409
- meta: {
410
- textAlign: "left"
411
- }
412
- },
413
- {
414
- accessorKey: "status",
415
- header: () => "Status",
416
- meta: {
417
- textAlign: "left"
418
- }
419
- },
420
- {
421
- accessorKey: "updatedAt",
422
- header: () => "Last Updated",
423
- meta: {
424
- textAlign: "left"
425
- }
426
- },
427
- {
428
- accessorKey: "id",
429
- header: () => "Actions",
430
- meta: {
431
- textAlign: "center"
432
- },
433
- cell: ({ row: t }) => {
434
- var f;
435
- const a = (f = o.value) == null ? void 0 : f.pageData().at(t.index);
436
- return K(ue, {
437
- data: a,
438
- onPair: () => D(a),
439
- onEdit: () => F(a),
440
- onDelete: () => I(a._id)
441
- });
442
- }
443
- }
444
- ];
445
- return (t, a) => {
446
- const f = u("FmSearch"), T = u("FmButton");
447
- return v(), C(ee, {
448
- title: "External Terminals",
449
- loading: !1
450
- }, {
451
- default: h(() => [
452
- b("div", ve, [
453
- b("div", xe, [
454
- c(f, {
455
- "model-value": m(n),
456
- "onUpdate:modelValue": a[0] || (a[0] = (E) => W(n) ? n.value = E : null),
457
- class: "mr-8",
458
- label: "Search",
459
- placeholder: "Search ..."
460
- }, null, 8, ["model-value"])
461
- ]),
462
- b("div", ge, [
463
- c(T, {
464
- label: "Create",
465
- icon: "add",
466
- onClick: a[1] || (a[1] = () => F())
467
- })
468
- ])
469
- ]),
470
- c(Z, {
471
- ref_key: "controller",
472
- ref: o,
473
- "column-defs": y,
474
- "rows-defs": x,
475
- paginate: (E, g) => m(S).read({ searchKey: m(n), limit: E, cursor: g })
476
- }, null, 8, ["paginate"]),
477
- c(ce, {
478
- modelValue: i.value,
479
- "onUpdate:modelValue": a[2] || (a[2] = (E) => i.value = E),
480
- terminal: p.value,
481
- onSubmit: V
482
- }, null, 8, ["modelValue", "terminal"])
483
- ]),
484
- _: 1
485
- });
486
- };
487
- }
488
- });
489
- export {
490
- Ae as default
491
- };