@syzy/apphost 1.0.1 → 1.0.3

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 (213) hide show
  1. package/dist/App.d.ts +4 -0
  2. package/dist/App.js +83 -0
  3. package/dist/AppHostProvider.d.ts +6 -0
  4. package/dist/AppHostProvider.js +4 -0
  5. package/dist/AppHostRoutes.d.ts +1 -0
  6. package/dist/AppHostRoutes.js +7 -0
  7. package/dist/api/image-api.d.ts +8 -0
  8. package/dist/api/image-api.js +45 -0
  9. package/dist/api/mapping-api.d.ts +80 -0
  10. package/dist/api/mapping-api.js +427 -0
  11. package/dist/bookingModule/components/AmenityForm.d.ts +3 -0
  12. package/dist/bookingModule/components/AmenityForm.js +19 -0
  13. package/dist/bookingModule/components/BillingManagement.d.ts +3 -0
  14. package/dist/bookingModule/components/BillingManagement.js +17 -0
  15. package/dist/bookingModule/components/CreateRoomForm.d.ts +3 -0
  16. package/dist/bookingModule/components/CreateRoomForm.js +19 -0
  17. package/dist/bookingModule/components/ExtraRequirementForm.d.ts +3 -0
  18. package/dist/bookingModule/components/ExtraRequirementForm.js +19 -0
  19. package/dist/bookingModule/components/ReservationForm.d.ts +3 -0
  20. package/dist/bookingModule/components/ReservationForm.js +18 -0
  21. package/dist/bookingModule/components/RoomCategoryForm.d.ts +3 -0
  22. package/dist/bookingModule/components/RoomCategoryForm.js +19 -0
  23. package/dist/bookingModule/components/RoomCategoryPriceForm.d.ts +3 -0
  24. package/dist/bookingModule/components/RoomCategoryPriceForm.js +20 -0
  25. package/dist/bookingModule/components/RoomExtraRequirementCapture.d.ts +3 -0
  26. package/dist/bookingModule/components/RoomExtraRequirementCapture.js +18 -0
  27. package/dist/bookingModule/components/RoomFacilityForm.d.ts +3 -0
  28. package/dist/bookingModule/components/RoomFacilityForm.js +19 -0
  29. package/dist/bookingModule/components/RoomReservationAction.d.ts +3 -0
  30. package/dist/bookingModule/components/RoomReservationAction.js +18 -0
  31. package/dist/components/Home/Home.d.ts +3 -0
  32. package/dist/components/Home/Home.js +14 -0
  33. package/dist/components/Loader/Loader.d.ts +2 -0
  34. package/dist/components/Loader/Loader.js +5 -0
  35. package/dist/components/Login/Login.d.ts +7 -0
  36. package/dist/components/Login/Login.js +149 -0
  37. package/dist/components/Login/loginSchema.d.ts +27 -0
  38. package/dist/components/Login/loginSchema.js +41 -0
  39. package/dist/components/Mappings/BranchMapping/Branch.d.ts +5 -0
  40. package/dist/components/Mappings/BranchMapping/Branch.js +135 -0
  41. package/dist/components/Mappings/BranchMapping/BranchTableColumns.d.ts +10 -0
  42. package/dist/components/Mappings/BranchMapping/BranchTableColumns.js +21 -0
  43. package/dist/components/Mappings/BranchMapping/MappingFormBranchUser.d.ts +3 -0
  44. package/dist/components/Mappings/BranchMapping/MappingFormBranchUser.js +150 -0
  45. package/dist/components/Mappings/BranchMapping/MappingTableColumns.d.ts +14 -0
  46. package/dist/components/Mappings/BranchMapping/MappingTableColumns.js +29 -0
  47. package/dist/components/Mappings/BranchMapping/branchSchema.d.ts +37 -0
  48. package/dist/components/Mappings/BranchMapping/branchSchema.js +34 -0
  49. package/dist/components/Mappings/ComponentMapping/ComponentRoleMapping.d.ts +3 -0
  50. package/dist/components/Mappings/ComponentMapping/ComponentRoleMapping.js +98 -0
  51. package/dist/components/Mappings/ComponentMapping/componentRoleColumns.d.ts +3 -0
  52. package/dist/components/Mappings/ComponentMapping/componentRoleColumns.js +29 -0
  53. package/dist/components/Mappings/MappingForm/MappingForm.d.ts +35 -0
  54. package/dist/components/Mappings/MappingForm/MappingForm.js +142 -0
  55. package/dist/components/Mappings/MappingForm/mappingSchema.d.ts +23 -0
  56. package/dist/components/Mappings/MappingForm/mappingSchema.js +32 -0
  57. package/dist/components/Mappings/RoleMapping/MappingFormUserRole.d.ts +5 -0
  58. package/dist/components/Mappings/RoleMapping/MappingFormUserRole.js +194 -0
  59. package/dist/components/Mappings/RoleMapping/UserRoleTableColumns.d.ts +3 -0
  60. package/dist/components/Mappings/RoleMapping/UserRoleTableColumns.js +33 -0
  61. package/dist/components/NavBar/Sidebar.d.ts +4 -0
  62. package/dist/components/NavBar/Sidebar.js +56 -0
  63. package/dist/components/ProfileForm/ProfileForm.d.ts +3 -0
  64. package/dist/components/ProfileForm/ProfileForm.js +190 -0
  65. package/dist/components/ProfileForm/ProfileList.d.ts +3 -0
  66. package/dist/components/ProfileForm/ProfileList.js +33 -0
  67. package/dist/components/ProfileForm/profileColumns.d.ts +3 -0
  68. package/dist/components/ProfileForm/profileColumns.js +67 -0
  69. package/dist/components/ProfileForm/profileSchema.d.ts +52 -0
  70. package/dist/components/ProfileForm/profileSchema.js +50 -0
  71. package/dist/components/SettingsPage/SettingsPage.d.ts +3 -0
  72. package/dist/components/SettingsPage/SettingsPage.js +240 -0
  73. package/dist/components/api/settings-api.d.ts +26 -0
  74. package/dist/components/api/settings-api.js +131 -0
  75. package/dist/components/common/Form/FormActionButtons.d.ts +11 -0
  76. package/dist/components/common/Form/FormActionButtons.js +6 -0
  77. package/dist/components/common/Form/FormLabel.d.ts +8 -0
  78. package/dist/components/common/Form/FormLabel.js +6 -0
  79. package/dist/components/common/ListTable/ListHeader.d.ts +8 -0
  80. package/dist/components/common/ListTable/ListHeader.js +5 -0
  81. package/dist/components/common/ListTable/ListTable.d.ts +17 -0
  82. package/dist/components/common/ListTable/ListTable.js +31 -0
  83. package/dist/components/common/Modal/Modal.d.ts +11 -0
  84. package/dist/components/common/Modal/Modal.js +6 -0
  85. package/dist/config/EnvConfig.d.ts +13 -0
  86. package/dist/config/EnvConfig.js +13 -0
  87. package/dist/config/amplifyConfig.d.ts +1 -0
  88. package/dist/config/amplifyConfig.js +45 -0
  89. package/dist/configureAppHost.d.ts +6 -0
  90. package/dist/configureAppHost.js +5 -0
  91. package/dist/customGraphQL/customMutations.d.ts +3 -0
  92. package/dist/customGraphQL/customMutations.js +53 -0
  93. package/dist/customGraphQL/customQueries.d.ts +7 -0
  94. package/dist/customGraphQL/customQueries.js +104 -0
  95. package/dist/domain/input/input-types.d.ts +47 -0
  96. package/dist/domain/input/input-types.js +1 -0
  97. package/dist/domain/model/BranchDto.d.ts +9 -0
  98. package/dist/domain/model/BranchDto.js +8 -0
  99. package/dist/domain/model/ComponentMappingDto.d.ts +24 -0
  100. package/dist/domain/model/ComponentMappingDto.js +19 -0
  101. package/dist/domain/model/MappingDto.d.ts +30 -0
  102. package/dist/domain/model/MappingDto.js +16 -0
  103. package/dist/domain/model/PrefixDescriptionDto.d.ts +16 -0
  104. package/dist/domain/model/PrefixDescriptionDto.js +13 -0
  105. package/dist/domain/model/ProfileDto.d.ts +21 -0
  106. package/dist/domain/model/ProfileDto.js +20 -0
  107. package/dist/domain/model/RoleMappingDto.d.ts +14 -0
  108. package/dist/domain/model/RoleMappingDto.js +19 -0
  109. package/dist/domain/model/SettingsDto.d.ts +8 -0
  110. package/dist/domain/model/SettingsDto.js +7 -0
  111. package/dist/domain/model/UserMappingDto.d.ts +14 -0
  112. package/dist/domain/model/UserMappingDto.js +28 -0
  113. package/dist/domain/model/imageDto.d.ts +4 -0
  114. package/dist/domain/model/imageDto.js +1 -0
  115. package/dist/domain/type/EntityTypes.d.ts +5 -0
  116. package/dist/domain/type/EntityTypes.js +6 -0
  117. package/dist/domain/type/MappingOptions.d.ts +5 -0
  118. package/dist/domain/type/MappingOptions.js +1 -0
  119. package/dist/domain/type/MappingTypes.d.ts +6 -0
  120. package/dist/domain/type/MappingTypes.js +7 -0
  121. package/dist/domain/type/Nullable.d.ts +13 -0
  122. package/dist/domain/type/Nullable.js +1 -0
  123. package/dist/domain/type/ResettingPeriodOptions.d.ts +2 -0
  124. package/dist/domain/type/ResettingPeriodOptions.js +8 -0
  125. package/dist/domain/type/RolesEnum.d.ts +6 -0
  126. package/dist/domain/type/RolesEnum.js +7 -0
  127. package/dist/domain/type/SelectType.d.ts +16 -0
  128. package/dist/domain/type/SelectType.js +1 -0
  129. package/dist/domain/type/StatusEnum.d.ts +5 -0
  130. package/dist/domain/type/StatusEnum.js +6 -0
  131. package/dist/domain/type/signUpOptions.d.ts +2 -0
  132. package/dist/domain/type/signUpOptions.js +4 -0
  133. package/dist/domain/type/statusOptions.d.ts +2 -0
  134. package/dist/domain/type/statusOptions.js +4 -0
  135. package/dist/graphql/profileQueries.d.ts +4 -0
  136. package/dist/graphql/profileQueries.js +89 -0
  137. package/dist/hoc/withSyzyAuth.d.ts +2 -0
  138. package/dist/hoc/withSyzyAuth.js +87 -0
  139. package/dist/hooks/useCurrentUser.d.ts +3 -0
  140. package/dist/hooks/useCurrentUser.js +6 -0
  141. package/dist/hooks/useDispatch.d.ts +3 -0
  142. package/dist/hooks/useDispatch.js +7 -0
  143. package/dist/hooks/usePermission.d.ts +1 -0
  144. package/dist/hooks/usePermission.js +7 -0
  145. package/dist/index.d.ts +3 -0
  146. package/dist/index.js +3 -15
  147. package/dist/main.d.ts +4 -0
  148. package/dist/main.js +60 -0
  149. package/dist/services/Client.Service.d.ts +12 -0
  150. package/dist/services/Client.Service.js +96 -0
  151. package/dist/services/Storage-service.d.ts +2 -0
  152. package/dist/services/Storage-service.js +26 -0
  153. package/dist/services/navigationMenu.d.ts +1 -0
  154. package/dist/services/navigationMenu.js +9 -0
  155. package/dist/static/constants.d.ts +34 -0
  156. package/dist/static/constants.js +34 -0
  157. package/dist/store/AppAction.d.ts +11 -0
  158. package/dist/store/AppAction.js +5 -0
  159. package/dist/store/AppContext.d.ts +3 -0
  160. package/dist/store/AppContext.js +3 -0
  161. package/dist/store/AppContextType.d.ts +12 -0
  162. package/dist/store/AppContextType.js +6 -0
  163. package/dist/store/AppProvider.d.ts +7 -0
  164. package/dist/store/AppProvider.js +32 -0
  165. package/dist/store/HostedInContainerContext.d.ts +5 -0
  166. package/dist/store/HostedInContainerContext.js +11 -0
  167. package/dist/store/SesssionReducer.d.ts +4 -0
  168. package/dist/store/SesssionReducer.js +16 -0
  169. package/dist/types.d.ts +26 -0
  170. package/dist/types.js +14 -0
  171. package/dist/util/AuthUtils.d.ts +1 -0
  172. package/dist/util/AuthUtils.js +10 -0
  173. package/dist/util/LogEnum.d.ts +6 -0
  174. package/dist/util/LogEnum.js +7 -0
  175. package/dist/util/Logger.d.ts +6 -0
  176. package/dist/util/Logger.js +18 -0
  177. package/dist/util/SyzyDate.d.ts +69 -0
  178. package/dist/util/SyzyDate.js +265 -0
  179. package/dist/util/dateUtils.d.ts +10 -0
  180. package/dist/util/dateUtils.js +24 -0
  181. package/dist/util/hostedinContainer.d.ts +1 -0
  182. package/dist/util/hostedinContainer.js +9 -0
  183. package/dist/util/model-types.d.ts +96 -0
  184. package/dist/util/model-types.js +18 -0
  185. package/dist/util/prefixAndResettingValidation.d.ts +9 -0
  186. package/dist/util/prefixAndResettingValidation.js +54 -0
  187. package/dist/util/transformToData.d.ts +1 -0
  188. package/dist/util/transformToData.js +9 -0
  189. package/package.json +14 -9
  190. package/dist/__federation_shared_@tanstack/react-query-DHuUsaNz.js +0 -2517
  191. package/dist/__federation_shared_react-CikWE6qG.js +0 -7
  192. package/dist/__federation_shared_react-bootstrap-BKlZRvMR.js +0 -7516
  193. package/dist/__federation_shared_react-dom-vrQ70Ay8.js +0 -372
  194. package/dist/__federation_shared_react-router-dom-BKminmS4.js +0 -10448
  195. package/dist/__federation_shared_react-select-B6kehBDI.js +0 -4056
  196. package/dist/__federation_shared_react-toastify-B0S0UGr3.js +0 -412
  197. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  198. package/dist/_virtual___federation_fn_import-XZCKozko.js +0 -217
  199. package/dist/favicon.ico +0 -0
  200. package/dist/index-DgtWMtjZ.js +0 -184
  201. package/dist/index-eZknuYwc.js +0 -1219
  202. package/dist/jsx-runtime-D_t4bG-_.js +0 -264
  203. package/dist/manifest.webmanifest +0 -1
  204. package/dist/pwa/Hotel-icon.jpg +0 -0
  205. package/dist/pwa/apple-touch-icon-180x180.png +0 -0
  206. package/dist/pwa/favicon.ico +0 -0
  207. package/dist/pwa/maskable-icon-512x512.png +0 -0
  208. package/dist/pwa/pwa-192x192.png +0 -0
  209. package/dist/pwa/pwa-512x512.png +0 -0
  210. package/dist/pwa/pwa-64x64.png +0 -0
  211. package/dist/registerSW.js +0 -1
  212. package/dist/sw.js +0 -1
  213. package/dist/workbox-1ef09536.js +0 -1
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const AmenityForm: React.FC;
3
+ export default AmenityForm;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteAmenityForm = React.lazy(() => import("bookingUIApp/AmenityForm"));
5
+ const AmenityForm = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
11
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteAmenityForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
12
+ fontTitle: "font-title",
13
+ fontLabel: "font-label",
14
+ formGroup: "form-group",
15
+ buttonPrimary: "btn-primary-global",
16
+ buttonSecondary: "btn-secondary-global"
17
+ } }) }) }));
18
+ };
19
+ export default AmenityForm;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const BillingManagement: React.FC;
3
+ export default BillingManagement;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from "react";
3
+ import AppContext from "../../store/AppContext";
4
+ import logo from "../../../src/assets/images/Hotel-Logo.jpg";
5
+ const RemoteBillingManagement = React.lazy(() => import("bookingUIApp/BillingManagement"));
6
+ const BillingManagement = () => {
7
+ const { user } = useContext(AppContext) ?? { user: undefined };
8
+ const rawBranch = user?.branchId ?? "";
9
+ const parts = rawBranch.split("#");
10
+ const branchId = parts[1] ?? "";
11
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteBillingManagement, { branchId: branchId, logoUrl: logo, classNames: {
12
+ fontTitle: "font-title",
13
+ buttonPrimary: "btn-primary-global",
14
+ card: "card shadow-lg border-0",
15
+ } }) }) }));
16
+ };
17
+ export default BillingManagement;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CreateRoomForm: React.FC;
3
+ export default CreateRoomForm;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteCreateRoomForm = React.lazy(() => import("bookingUIApp/CreateRoomForm"));
5
+ const CreateRoomForm = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
11
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteCreateRoomForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
12
+ fontTitle: "font-title",
13
+ fontLabel: "font-label",
14
+ formGroup: "form-group",
15
+ buttonPrimary: "btn-primary-global",
16
+ buttonSecondary: "btn-secondary-global"
17
+ } }) }) }));
18
+ };
19
+ export default CreateRoomForm;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ExtraRequirementForm: React.FC;
3
+ export default ExtraRequirementForm;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteExtraRequirementForm = React.lazy(() => import("bookingUIApp/ExtraRequirementForm"));
5
+ const ExtraRequirementForm = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
11
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteExtraRequirementForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
12
+ fontTitle: "font-title",
13
+ fontLabel: "font-label",
14
+ formGroup: "form-group",
15
+ buttonPrimary: "btn-primary-global",
16
+ buttonSecondary: "btn-secondary-global"
17
+ } }) }) }));
18
+ };
19
+ export default ExtraRequirementForm;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ReservationForm: React.FC;
3
+ export default ReservationForm;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteReservationForm = React.lazy(() => import("bookingUIApp/ReservationForm"));
5
+ const ReservationForm = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteReservationForm, { branchId: branchId, classNames: {
11
+ fontTitle: "font-title",
12
+ fontLabel: "font-label",
13
+ formGroup: "form-group",
14
+ buttonPrimary: "btn-primary-global",
15
+ buttonSecondary: "btn-secondary-global"
16
+ } }) }) }));
17
+ };
18
+ export default ReservationForm;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const RoomCategoryForm: React.FC;
3
+ export default RoomCategoryForm;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteRoomCategoryForm = React.lazy(() => import("bookingUIApp/RoomCategoryForm"));
5
+ const RoomCategoryForm = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
11
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteRoomCategoryForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
12
+ fontTitle: "font-title",
13
+ fontLabel: "font-label",
14
+ formGroup: "form-group",
15
+ buttonPrimary: "btn-primary-global",
16
+ buttonSecondary: "btn-secondary-global"
17
+ } }) }) }));
18
+ };
19
+ export default RoomCategoryForm;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const RoomCategoryPriceForm: React.FC;
3
+ export default RoomCategoryPriceForm;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteRoomCategoryPriceForm = React.lazy(() => import("bookingUIApp/RoomCategoryPriceForm"));
5
+ const RoomCategoryPriceForm = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ const userId = `${parts[3]}#${parts[4]}`;
11
+ const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
12
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteRoomCategoryPriceForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, userId: userId, classNames: {
13
+ fontTitle: "font-title",
14
+ fontLabel: "font-label",
15
+ formGroup: "form-group",
16
+ buttonPrimary: "btn-primary-global",
17
+ buttonSecondary: "btn-secondary-global"
18
+ } }) }) }));
19
+ };
20
+ export default RoomCategoryPriceForm;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const RoomExtraRequirementCapture: React.FC;
3
+ export default RoomExtraRequirementCapture;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteRoomList = React.lazy(() => import("bookingUIApp/RoomList"));
5
+ const RoomExtraRequirementCapture = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ return (_jsx("div", { children: _jsxs(Suspense, { children: [_jsx("h3", { className: 'text-center mt-4', children: "Guest Requirement" }), _jsx(RemoteRoomList, { branchId: branchId, forExtraRequirementCapture: true, classNames: {
11
+ fontTitle: "font-title",
12
+ fontLabel: "font-label",
13
+ formGroup: "form-group",
14
+ buttonPrimary: "btn-primary-global",
15
+ buttonSecondary: "btn-secondary-global"
16
+ } })] }) }));
17
+ };
18
+ export default RoomExtraRequirementCapture;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const RoomFacilityForm: React.FC;
3
+ export default RoomFacilityForm;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteRoomFacilityForm = React.lazy(() => import("bookingUIApp/RoomFacilityForm"));
5
+ const RoomFacilityForm = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ const isSuperAdmin = user?.roles?.includes("SUPERADMIN") ?? false;
11
+ return (_jsx("div", { children: _jsx(Suspense, { children: _jsx(RemoteRoomFacilityForm, { branchId: branchId, isSuperAdmin: isSuperAdmin, classNames: {
12
+ fontTitle: "font-title",
13
+ fontLabel: "font-label",
14
+ formGroup: "form-group",
15
+ buttonPrimary: "btn-primary-global",
16
+ buttonSecondary: "btn-secondary-global"
17
+ } }) }) }));
18
+ };
19
+ export default RoomFacilityForm;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const RoomReservationAction: React.FC;
3
+ export default RoomReservationAction;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { Suspense, useContext } from 'react';
3
+ import AppContext from '../../store/AppContext';
4
+ const RemoteRoomList = React.lazy(() => import("bookingUIApp/RoomList"));
5
+ const RoomReservationAction = () => {
6
+ const { user } = useContext(AppContext) ?? { user: undefined };
7
+ const rawBranch = user?.branchId ?? "";
8
+ const parts = rawBranch.split("#");
9
+ const branchId = parts[1];
10
+ return (_jsx("div", { children: _jsxs(Suspense, { children: [_jsx("h3", { className: 'text-center mt-4', children: "Reservation Action" }), _jsx(RemoteRoomList, { branchId: branchId, forRoomReservationAction: true, classNames: {
11
+ fontTitle: "font-title",
12
+ fontLabel: "font-label",
13
+ formGroup: "form-group",
14
+ buttonPrimary: "btn-primary-global",
15
+ buttonSecondary: "btn-secondary-global"
16
+ } })] }) }));
17
+ };
18
+ export default RoomReservationAction;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Home: React.FC;
3
+ export default Home;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useContext } from "react";
3
+ import { EnvConfig } from "../../config/EnvConfig";
4
+ import AppContext from "../../store/AppContext";
5
+ const appName = EnvConfig.applicationName || "Application";
6
+ const ReservationCount = React.lazy(() => import("bookingUIApp/ReservationCount"));
7
+ const Home = () => {
8
+ const { user } = useContext(AppContext) ?? { user: undefined };
9
+ const rawBranch = user?.branchId ?? "";
10
+ const parts = rawBranch.split("#");
11
+ const branchId = parts[1];
12
+ return (_jsxs("div", { className: "d-fle justify-content-center align-items-center h-100 flex-wrap", children: [_jsx("div", { className: "px-3 w-100 col-12", children: _jsx(ReservationCount, { branchId: branchId }) }), _jsx("div", { className: "h-75 d-flex justify-content-center align-items-center", children: _jsxs("div", { className: "text-center", children: [_jsxs("h2", { className: "fw-bold", children: [appName, " Dash Board"] }), _jsx("br", {}), _jsxs("h5", { children: ["\uD83D\uDC4B Welcome To ", appName, "! \uD83D\uDE42"] })] }) })] }));
13
+ };
14
+ export default Home;
@@ -0,0 +1,2 @@
1
+ declare const LoadingSpinner: () => import("react/jsx-runtime").JSX.Element;
2
+ export default LoadingSpinner;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const LoadingSpinner = () => {
3
+ return (_jsx("div", { className: "d-flex justify-content-center align-items-center h-100", children: _jsxs("div", { className: "text-center", children: [_jsx("div", { className: "spinner-border text-primary p-4", role: "status", children: _jsx("span", { className: "visually-hidden", children: "Loading..." }) }), _jsx("h5", { className: "mt-3", children: "Loading..." })] }) }));
4
+ };
5
+ export default LoadingSpinner;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "react-toastify/dist/ReactToastify.css";
3
+ interface LoginProps {
4
+ login: (isLoggedIn: boolean) => void;
5
+ }
6
+ declare const LoginForm: React.FC<LoginProps>;
7
+ export default LoginForm;
@@ -0,0 +1,149 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { useForm } from "react-hook-form";
4
+ import { zodResolver } from "@hookform/resolvers/zod";
5
+ import { toast } from "react-toastify";
6
+ import "react-toastify/dist/ReactToastify.css";
7
+ import { useNavigate } from "react-router-dom";
8
+ import { FaEye, FaEyeSlash } from "react-icons/fa";
9
+ import logo from "../../../src/assets/images/Hotel-Logo.jpg";
10
+ import { signIn, signUp, confirmSignUp, confirmResetPassword, getCurrentUser, confirmSignIn, resetPassword } from "aws-amplify/auth";
11
+ import { signInSchema, registerSchema, confirmSignUpSchema, resetPasswordSchema, forceResetSchema, forgotPasswordSchema, } from "./loginSchema";
12
+ import { ALL, HIDE_SIGN_UP, HIDE_SIGN_UP_IS_NO } from "../../static/constants";
13
+ import { useGetSettingsByPkAndSk } from "../api/settings-api";
14
+ const LoginForm = ({ login }) => {
15
+ const [authMode, setAuthMode] = useState("signin");
16
+ const navigate = useNavigate();
17
+ const [tempUsername, setTempUsername] = useState("");
18
+ const [showPassword, setShowPassword] = useState(false);
19
+ const { settingsByPkAndSk } = useGetSettingsByPkAndSk(ALL, HIDE_SIGN_UP);
20
+ const getSchema = () => {
21
+ switch (authMode) {
22
+ case "signin":
23
+ return signInSchema;
24
+ case "register":
25
+ return registerSchema;
26
+ case "confirm":
27
+ return confirmSignUpSchema;
28
+ case "forgot":
29
+ return forgotPasswordSchema;
30
+ case "reset":
31
+ return resetPasswordSchema;
32
+ case "forceReset":
33
+ return forceResetSchema;
34
+ default:
35
+ return signInSchema;
36
+ }
37
+ };
38
+ const { register, handleSubmit, formState: { errors }, reset, } = useForm({
39
+ resolver: zodResolver(getSchema()),
40
+ defaultValues: {
41
+ username: "",
42
+ email: "",
43
+ password: "",
44
+ confirmPassword: "",
45
+ confirmationCode: "",
46
+ },
47
+ });
48
+ useEffect(() => {
49
+ reset({}, { keepValues: false });
50
+ }, [authMode, reset]);
51
+ const onSubmit = async (data) => {
52
+ try {
53
+ if (authMode === "signin") {
54
+ const res = await signIn({
55
+ username: data.username,
56
+ password: data.password,
57
+ });
58
+ if (res.nextStep?.signInStep === "CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED") {
59
+ reset({
60
+ password: "",
61
+ confirmPassword: "",
62
+ });
63
+ setAuthMode("forceReset");
64
+ return;
65
+ }
66
+ if (res.isSignedIn) {
67
+ const user = await getCurrentUser();
68
+ localStorage.setItem("lastUser", user.username);
69
+ login(true);
70
+ navigate("/");
71
+ reset();
72
+ }
73
+ }
74
+ if (authMode === "register") {
75
+ const { nextStep } = await signUp({
76
+ username: data.username,
77
+ password: data.password,
78
+ options: { userAttributes: { email: data.email } },
79
+ });
80
+ if (nextStep?.signUpStep === "CONFIRM_SIGN_UP")
81
+ setAuthMode("confirm");
82
+ reset();
83
+ }
84
+ if (authMode === "confirm") {
85
+ await confirmSignUp({
86
+ username: data.username,
87
+ confirmationCode: data.confirmationCode,
88
+ });
89
+ setAuthMode("signin");
90
+ reset();
91
+ }
92
+ if (authMode === "forgot") {
93
+ try {
94
+ await resetPassword({ username: data.username });
95
+ toast.success("Verification code sent to your email!");
96
+ setTempUsername(data.username); // store username for next step
97
+ setAuthMode("reset");
98
+ reset({}, { keepValues: false });
99
+ }
100
+ catch (err) {
101
+ toast.error(err.message || "Failed to send reset code");
102
+ }
103
+ }
104
+ if (authMode === "reset") {
105
+ try {
106
+ await confirmResetPassword({
107
+ username: tempUsername,
108
+ confirmationCode: data.confirmationCode,
109
+ newPassword: data.password
110
+ });
111
+ toast.success("Password reset successfully!");
112
+ setAuthMode("signin");
113
+ reset();
114
+ }
115
+ catch (error) {
116
+ if (error.name === "ExpiredCodeException") {
117
+ toast.error("Code expired. Request a new one.");
118
+ setAuthMode("forgot");
119
+ return;
120
+ }
121
+ if (error.name === "CodeMismatchException" || error.name === "InvalidParameterException") {
122
+ toast.error("Invalid verification code. Please request a new one.");
123
+ setAuthMode("forgot");
124
+ setTempUsername("");
125
+ reset();
126
+ return;
127
+ }
128
+ toast.error(error.message || "Failed to reset password");
129
+ }
130
+ }
131
+ if (authMode === "forceReset") {
132
+ await confirmSignIn({ challengeResponse: data.password });
133
+ login(true);
134
+ navigate("/");
135
+ reset();
136
+ }
137
+ }
138
+ catch (err) {
139
+ toast.error(err.message || "Something went wrong");
140
+ }
141
+ };
142
+ const renderInput = (label, type, name) => {
143
+ const isPassword = type === "password";
144
+ return (_jsxs("div", { className: "mb-3 position-relative", children: [_jsxs("div", { className: "input-group", children: [_jsx("input", { type: isPassword ? (showPassword ? "text" : "password") : type, placeholder: label, ...register(name), className: `form-control ${errors[name] ? "is-invalid" : ""}` }), isPassword && (_jsx("span", { className: "input-group-text bg-white", style: { cursor: "pointer" }, onClick: () => setShowPassword((prev) => !prev), children: showPassword ? _jsx(FaEye, { size: 18 }) : _jsx(FaEyeSlash, { size: 18 }) }))] }), errors[name] && (_jsx("div", { className: "invalid-feedback d-block", children: errors[name]?.message }))] }));
145
+ };
146
+ return (_jsx("div", { className: "d-flex justify-content-center align-items-center vh-100 bg-light", children: _jsx("div", { className: "card shadow-sm p-4 p-md-5 w-100", style: { maxWidth: "420px" }, children: _jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx("div", { className: "d-flex justify-content-center", children: _jsx("img", { className: "w-75 mx-auto mb-4", src: logo }) }), _jsxs("h4", { className: "text-center mb-4 fw-bold", children: [authMode === "signin" && "Sign in to your account", authMode === "register" && "Create a new account", authMode === "confirm" && "Verify your email", authMode === "forgot" && "Forgot Password?", authMode === "reset" && "Reset Password", authMode === "forceReset" && "Set New Password"] }), authMode === "signin" && (_jsxs(_Fragment, { children: [renderInput("Username", "text", "username"), renderInput("Password", "password", "password"), _jsx("button", { type: "submit", className: "btn btn-primary w-100 mb-2", children: "Sign In" }), _jsxs("div", { className: "d-flex justify-content-between", children: [(settingsByPkAndSk && settingsByPkAndSk?.value === HIDE_SIGN_UP_IS_NO) &&
147
+ _jsx("button", { type: "button", className: "btn btn-link p-0", onClick: () => setAuthMode("register"), children: "Create Account" }), _jsx("button", { type: "button", className: "btn btn-link p-0", onClick: () => setAuthMode("forgot"), children: "Forgot Password?" })] })] })), authMode === "register" && (_jsxs(_Fragment, { children: [renderInput("Username", "text", "username"), renderInput("Email", "email", "email"), renderInput("Password", "password", "password"), renderInput("Confirm Password", "password", "confirmPassword"), _jsx("button", { type: "submit", className: "btn btn-success w-100 mb-2", children: "Register" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "confirm" && (_jsxs(_Fragment, { children: [renderInput("Verification Code", "text", "confirmationCode"), _jsx("button", { type: "submit", className: "btn btn-primary w-100 mb-2", children: "Confirm" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "forgot" && (_jsxs(_Fragment, { children: [renderInput("Username", "text", "username"), _jsx("button", { type: "submit", className: "btn btn-warning w-100 mb-2", children: "Send Reset Code" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "reset" && (_jsxs(_Fragment, { children: [renderInput("Verification Code", "text", "confirmationCode"), renderInput("New Password", "password", "password"), renderInput("Confirm New Password", "password", "confirmPassword"), _jsx("button", { type: "submit", className: "btn btn-success w-100 mb-2", children: "Reset Password" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] })), authMode === "forceReset" && (_jsxs(_Fragment, { children: [renderInput("New Password", "password", "password"), renderInput("Confirm New Password", "password", "confirmPassword"), _jsx("button", { type: "submit", className: "btn btn-success w-100 mb-2", children: "Update Password" }), _jsx("button", { type: "button", className: "btn btn-link w-100", onClick: () => setAuthMode("signin"), children: "Back to Sign In" })] }))] }) }) }));
148
+ };
149
+ export default LoginForm;
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ export declare const signInSchema: z.ZodObject<{
3
+ username: z.ZodString;
4
+ password: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const registerSchema: z.ZodObject<{
7
+ username: z.ZodString;
8
+ email: z.ZodString;
9
+ password: z.ZodString;
10
+ confirmPassword: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export declare const resetPasswordSchema: z.ZodObject<{
13
+ confirmationCode: z.ZodString;
14
+ password: z.ZodString;
15
+ confirmPassword: z.ZodString;
16
+ }, z.core.$strip>;
17
+ export declare const forgotPasswordSchema: z.ZodObject<{
18
+ username: z.ZodString;
19
+ }, z.core.$strip>;
20
+ export declare const confirmSignUpSchema: z.ZodObject<{
21
+ username: z.ZodString;
22
+ confirmationCode: z.ZodString;
23
+ }, z.core.$strip>;
24
+ export declare const forceResetSchema: z.ZodObject<{
25
+ password: z.ZodString;
26
+ confirmPassword: z.ZodString;
27
+ }, z.core.$strip>;
@@ -0,0 +1,41 @@
1
+ import { z } from "zod";
2
+ // Schema for Sign In
3
+ export const signInSchema = z.object({
4
+ username: z.string().min(1, "Username is required"),
5
+ password: z.string().min(1, "Password is required"),
6
+ });
7
+ // Schema for Register
8
+ export const registerSchema = z.object({
9
+ username: z.string().min(1, "Username is required"),
10
+ email: z.string().email("Invalid email"),
11
+ password: z.string().min(6, "Password must be at least 6 characters"),
12
+ confirmPassword: z.string().min(1, "Confirm Password is required"),
13
+ }).refine((data) => data.password === data.confirmPassword, {
14
+ message: "Passwords do not match",
15
+ path: ["confirmPassword"],
16
+ });
17
+ // Schema for Forgot/Reset Password
18
+ export const resetPasswordSchema = z.object({
19
+ confirmationCode: z.string().min(6, "Code is required"),
20
+ password: z.string().min(8, "Password must be at least 8 chars"),
21
+ confirmPassword: z.string().min(8, "Confirm your password"),
22
+ }).refine((data) => data.password === data.confirmPassword, {
23
+ message: "Passwords do not match",
24
+ path: ["confirmPassword"],
25
+ });
26
+ export const forgotPasswordSchema = z.object({
27
+ username: z.string().min(1, "Username is required"),
28
+ });
29
+ // Schema for Confirm Sign Up
30
+ export const confirmSignUpSchema = z.object({
31
+ username: z.string().min(1, "Username is required"),
32
+ confirmationCode: z.string().min(1, "Verification code is required"),
33
+ });
34
+ // Schema for Force Reset
35
+ export const forceResetSchema = z.object({
36
+ password: z.string().min(8, "Password must be at least 8 characters"),
37
+ confirmPassword: z.string().min(8, "Confirm Password is required"),
38
+ }).refine((data) => data.password === data.confirmPassword, {
39
+ message: "Passwords do not match",
40
+ path: ["confirmPassword"],
41
+ });
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import "../../../styles/button.css";
3
+ import "../../Mappings/MappingForm/MappingForm.css";
4
+ declare const BranchMapping: React.FC;
5
+ export default BranchMapping;