@hyper.software/common-helpers 1.0.29 → 1.0.30
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.
- package/README.md +0 -0
- package/lib/errors/CriticalError.d.ts +0 -0
- package/lib/errors/CriticalError.js +0 -0
- package/lib/errors/CriticalError.js.map +0 -0
- package/lib/errors/ValidationError.d.ts +0 -0
- package/lib/errors/ValidationError.js +0 -0
- package/lib/errors/ValidationError.js.map +0 -0
- package/lib/errors/ValidationErrorSilent.d.ts +0 -0
- package/lib/errors/ValidationErrorSilent.js +0 -0
- package/lib/errors/ValidationErrorSilent.js.map +0 -0
- package/lib/errors/ValidationErrorWithStatus.d.ts +0 -0
- package/lib/errors/ValidationErrorWithStatus.js +0 -0
- package/lib/errors/ValidationErrorWithStatus.js.map +0 -0
- package/lib/errors/ValidationErrorWithStatusSilent.d.ts +0 -0
- package/lib/errors/ValidationErrorWithStatusSilent.js +0 -0
- package/lib/errors/ValidationErrorWithStatusSilent.js.map +0 -0
- package/lib/errors/__mocks__/errors.mock.d.ts +0 -0
- package/lib/errors/__mocks__/errors.mock.js +0 -0
- package/lib/errors/__mocks__/errors.mock.js.map +0 -0
- package/lib/errors/__tests__/errorMappers.test.d.ts +0 -0
- package/lib/errors/__tests__/errorMappers.test.js +0 -0
- package/lib/errors/__tests__/errorMappers.test.js.map +0 -0
- package/lib/errors/__tests__/errors.test.d.ts +0 -0
- package/lib/errors/__tests__/errors.test.js +0 -0
- package/lib/errors/__tests__/errors.test.js.map +0 -0
- package/lib/errors/errorMappers.d.ts +0 -0
- package/lib/errors/errorMappers.js +0 -0
- package/lib/errors/errorMappers.js.map +0 -0
- package/lib/errors/errors.types.d.ts +0 -0
- package/lib/errors/errors.types.js +0 -0
- package/lib/errors/errors.types.js.map +0 -0
- package/lib/errors/index.d.ts +0 -0
- package/lib/errors/index.js +0 -0
- package/lib/errors/index.js.map +0 -0
- package/lib/express/__tests__/swaggerHelpers.test.d.ts +0 -0
- package/lib/express/__tests__/swaggerHelpers.test.js +0 -0
- package/lib/express/__tests__/swaggerHelpers.test.js.map +0 -0
- package/lib/express/middleware/aliveMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/aliveMiddleware/index.js +0 -0
- package/lib/express/middleware/aliveMiddleware/index.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/company.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/company.js +0 -0
- package/lib/express/middleware/companyMiddleware/company.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/companyApiRequest.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/companyApiRequest.js +0 -0
- package/lib/express/middleware/companyMiddleware/companyApiRequest.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/index.js +0 -0
- package/lib/express/middleware/companyMiddleware/index.js.map +0 -0
- package/lib/express/middleware/companyMiddleware/index.types.d.ts +0 -0
- package/lib/express/middleware/companyMiddleware/index.types.js +0 -0
- package/lib/express/middleware/companyMiddleware/index.types.js.map +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/__tests__/expressErrorHandlerMiddleware.test.d.ts +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/__tests__/expressErrorHandlerMiddleware.test.js +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/__tests__/expressErrorHandlerMiddleware.test.js.map +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/index.js +0 -0
- package/lib/express/middleware/expressErrorHandlerMiddleware/index.js.map +0 -0
- package/lib/express/middleware/index.d.ts +0 -0
- package/lib/express/middleware/index.js +0 -0
- package/lib/express/middleware/index.js.map +0 -0
- package/lib/express/middleware/languageMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/languageMiddleware/index.js +0 -0
- package/lib/express/middleware/languageMiddleware/index.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/index.js +0 -0
- package/lib/express/middleware/partnerMiddleware/index.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/index.types.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/index.types.js +0 -0
- package/lib/express/middleware/partnerMiddleware/index.types.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/partner.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/partner.js +0 -0
- package/lib/express/middleware/partnerMiddleware/partner.js.map +0 -0
- package/lib/express/middleware/partnerMiddleware/partnerServiceRequest.d.ts +0 -0
- package/lib/express/middleware/partnerMiddleware/partnerServiceRequest.js +0 -0
- package/lib/express/middleware/partnerMiddleware/partnerServiceRequest.js.map +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/index.js +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/index.js.map +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/types.d.ts +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/types.js +0 -0
- package/lib/express/middleware/responseHelpersMiddleware/types.js.map +0 -0
- package/lib/express/middleware/translationsMiddleware/index.d.ts +0 -0
- package/lib/express/middleware/translationsMiddleware/index.js +0 -0
- package/lib/express/middleware/translationsMiddleware/index.js.map +0 -0
- package/lib/express/swaggerControllersConfig.d.ts +0 -0
- package/lib/express/swaggerControllersConfig.js +0 -0
- package/lib/express/swaggerControllersConfig.js.map +0 -0
- package/lib/express/swaggerHelpers.d.ts +0 -0
- package/lib/express/swaggerHelpers.js +0 -0
- package/lib/express/swaggerHelpers.js.map +0 -0
- package/lib/express/swaggerUiController.d.ts +0 -0
- package/lib/express/swaggerUiController.js +0 -0
- package/lib/express/swaggerUiController.js.map +0 -0
- package/lib/express/swaggerUiTemplate.d.ts +0 -0
- package/lib/express/swaggerUiTemplate.js +0 -0
- package/lib/express/swaggerUiTemplate.js.map +0 -0
- package/lib/helpers/ExecuteOnce.d.ts +0 -0
- package/lib/helpers/ExecuteOnce.js +0 -0
- package/lib/helpers/ExecuteOnce.js.map +0 -0
- package/lib/helpers/UniversalConfig.d.ts +0 -0
- package/lib/helpers/UniversalConfig.js +0 -0
- package/lib/helpers/UniversalConfig.js.map +0 -0
- package/lib/helpers/__tests__/arrays.test.d.ts +0 -0
- package/lib/helpers/__tests__/arrays.test.js +0 -0
- package/lib/helpers/__tests__/arrays.test.js.map +0 -0
- package/lib/helpers/__tests__/emptyValues.test.d.ts +0 -0
- package/lib/helpers/__tests__/emptyValues.test.js +0 -0
- package/lib/helpers/__tests__/emptyValues.test.js.map +0 -0
- package/lib/helpers/__tests__/formatters.formatCurrency.test.d.ts +0 -0
- package/lib/helpers/__tests__/formatters.formatCurrency.test.js +0 -0
- package/lib/helpers/__tests__/formatters.formatCurrency.test.js.map +0 -0
- package/lib/helpers/__tests__/formatters.formatDate.test.d.ts +0 -0
- package/lib/helpers/__tests__/formatters.formatDate.test.js +0 -0
- package/lib/helpers/__tests__/formatters.formatDate.test.js.map +0 -0
- package/lib/helpers/__tests__/formatters.formatDouble.test.d.ts +0 -0
- package/lib/helpers/__tests__/formatters.formatDouble.test.js +0 -0
- package/lib/helpers/__tests__/formatters.formatDouble.test.js.map +0 -0
- package/lib/helpers/__tests__/navigation.test.d.ts +0 -0
- package/lib/helpers/__tests__/navigation.test.js +0 -0
- package/lib/helpers/__tests__/navigation.test.js.map +0 -0
- package/lib/helpers/__tests__/strings.test.d.ts +0 -0
- package/lib/helpers/__tests__/strings.test.js +0 -0
- package/lib/helpers/__tests__/strings.test.js.map +0 -0
- package/lib/helpers/__tests__/validation.test.d.ts +0 -0
- package/lib/helpers/__tests__/validation.test.js +0 -0
- package/lib/helpers/__tests__/validation.test.js.map +0 -0
- package/lib/helpers/arrays.d.ts +0 -0
- package/lib/helpers/arrays.js +0 -0
- package/lib/helpers/arrays.js.map +0 -0
- package/lib/helpers/clientLogger.d.ts +0 -0
- package/lib/helpers/clientLogger.js +0 -0
- package/lib/helpers/clientLogger.js.map +0 -0
- package/lib/helpers/constants/common.d.ts +0 -0
- package/lib/helpers/constants/common.js +0 -0
- package/lib/helpers/constants/common.js.map +0 -0
- package/lib/helpers/constants/fileUploads.d.ts +0 -0
- package/lib/helpers/constants/fileUploads.js +0 -0
- package/lib/helpers/constants/fileUploads.js.map +0 -0
- package/lib/helpers/constants/index.d.ts +0 -0
- package/lib/helpers/constants/index.js +0 -0
- package/lib/helpers/constants/index.js.map +0 -0
- package/lib/helpers/constants/integrations.d.ts +0 -0
- package/lib/helpers/constants/integrations.js +0 -0
- package/lib/helpers/constants/integrations.js.map +0 -0
- package/lib/helpers/constants/language.d.ts +0 -0
- package/lib/helpers/constants/language.js +0 -0
- package/lib/helpers/constants/language.js.map +0 -0
- package/lib/helpers/constants/swagger.d.ts +0 -0
- package/lib/helpers/constants/swagger.js +0 -0
- package/lib/helpers/constants/swagger.js.map +0 -0
- package/lib/helpers/constants/urls.d.ts +0 -0
- package/lib/helpers/constants/urls.js +0 -0
- package/lib/helpers/constants/urls.js.map +0 -0
- package/lib/helpers/constants/user.d.ts +0 -0
- package/lib/helpers/constants/user.js +0 -0
- package/lib/helpers/constants/user.js.map +0 -0
- package/lib/helpers/constants/validators.d.ts +0 -0
- package/lib/helpers/constants/validators.js +0 -0
- package/lib/helpers/constants/validators.js.map +0 -0
- package/lib/helpers/emptyValues.d.ts +0 -0
- package/lib/helpers/emptyValues.js +0 -0
- package/lib/helpers/emptyValues.js.map +0 -0
- package/lib/helpers/formatters.d.ts +0 -0
- package/lib/helpers/formatters.js +0 -0
- package/lib/helpers/formatters.js.map +0 -0
- package/lib/helpers/guards.d.ts +0 -0
- package/lib/helpers/guards.js +0 -0
- package/lib/helpers/guards.js.map +0 -0
- package/lib/helpers/index.d.ts +0 -0
- package/lib/helpers/index.js +0 -0
- package/lib/helpers/index.js.map +0 -0
- package/lib/helpers/isBrowser.d.ts +0 -0
- package/lib/helpers/isBrowser.js +0 -0
- package/lib/helpers/isBrowser.js.map +0 -0
- package/lib/helpers/math.d.ts +0 -0
- package/lib/helpers/math.js +0 -0
- package/lib/helpers/math.js.map +0 -0
- package/lib/helpers/moment.d.ts +0 -0
- package/lib/helpers/moment.js +0 -0
- package/lib/helpers/moment.js.map +0 -0
- package/lib/helpers/navigation.d.ts +0 -0
- package/lib/helpers/navigation.js +0 -0
- package/lib/helpers/navigation.js.map +0 -0
- package/lib/helpers/stringifySafe.d.ts +0 -0
- package/lib/helpers/stringifySafe.js +0 -0
- package/lib/helpers/stringifySafe.js.map +0 -0
- package/lib/helpers/strings.d.ts +0 -0
- package/lib/helpers/strings.js +0 -0
- package/lib/helpers/strings.js.map +0 -0
- package/lib/helpers/validation.d.ts +0 -0
- package/lib/helpers/validation.js +0 -0
- package/lib/helpers/validation.js.map +0 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/lib/interfaces.d.ts +1 -0
- package/lib/interfaces.js +15 -0
- package/lib/interfaces.js.map +1 -1
- package/lib/redux/analyticsMiddleware.d.ts +0 -0
- package/lib/redux/analyticsMiddleware.js +0 -0
- package/lib/redux/analyticsMiddleware.js.map +0 -0
- package/lib/redux/clientMiddleware.d.ts +0 -0
- package/lib/redux/clientMiddleware.js +0 -0
- package/lib/redux/clientMiddleware.js.map +0 -0
- package/lib/redux/emptyMiddleware.d.ts +0 -0
- package/lib/redux/emptyMiddleware.js +0 -0
- package/lib/redux/emptyMiddleware.js.map +0 -0
- package/lib/redux/index.d.ts +0 -0
- package/lib/redux/index.js +0 -0
- package/lib/redux/index.js.map +0 -0
- package/lib/services/bookingService/bookingsServices.d.ts +17 -0
- package/lib/services/bookingService/bookingsServices.js +100 -0
- package/lib/services/bookingService/bookingsServices.js.map +1 -0
- package/lib/services/cookieService/cookieService.d.ts +0 -0
- package/lib/services/cookieService/cookieService.js +0 -0
- package/lib/services/cookieService/cookieService.js.map +0 -0
- package/lib/services/googleAnalyticsService/googleAnalyticsService.d.ts +0 -0
- package/lib/services/googleAnalyticsService/googleAnalyticsService.js +0 -0
- package/lib/services/googleAnalyticsService/googleAnalyticsService.js.map +0 -0
- package/lib/services/imageService/imageService.d.ts +0 -0
- package/lib/services/imageService/imageService.js +0 -0
- package/lib/services/imageService/imageService.js.map +0 -0
- package/lib/services/index.d.ts +0 -0
- package/lib/services/index.js +0 -0
- package/lib/services/index.js.map +0 -0
- package/lib/services/languageService/languageService.d.ts +0 -0
- package/lib/services/languageService/languageService.js +0 -0
- package/lib/services/languageService/languageService.js.map +0 -0
- package/lib/services/localstorageService/localstorageService.d.ts +0 -0
- package/lib/services/localstorageService/localstorageService.js +0 -0
- package/lib/services/localstorageService/localstorageService.js.map +0 -0
- package/lib/services/sessionStorageService/index.d.ts +0 -0
- package/lib/services/sessionStorageService/index.js +0 -0
- package/lib/services/sessionStorageService/index.js.map +0 -0
- package/lib/translations/getAllTranslations.d.ts +0 -0
- package/lib/translations/getAllTranslations.js +0 -0
- package/lib/translations/getAllTranslations.js.map +0 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/errors/index.d.ts
CHANGED
|
File without changes
|
package/lib/errors/index.js
CHANGED
|
File without changes
|
package/lib/errors/index.js.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/helpers/arrays.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/arrays.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/helpers/guards.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/guards.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/helpers/index.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/index.js
CHANGED
|
File without changes
|
package/lib/helpers/index.js.map
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/helpers/isBrowser.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/helpers/math.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/math.js
CHANGED
|
File without changes
|
package/lib/helpers/math.js.map
CHANGED
|
File without changes
|
package/lib/helpers/moment.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/moment.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/helpers/strings.d.ts
CHANGED
|
File without changes
|
package/lib/helpers/strings.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/index.d.ts
CHANGED
|
File without changes
|
package/lib/index.js
CHANGED
|
File without changes
|
package/lib/index.js.map
CHANGED
|
File without changes
|
package/lib/interfaces.d.ts
CHANGED
package/lib/interfaces.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.ALL_CURRENCY = exports.CURRENCY = exports.LANGUAGE = void 0;
|
|
4
18
|
var getAllEnumStatuses = function (value) { return Object.keys(value).map(function (key) { return value[key]; }); };
|
|
@@ -20,4 +34,5 @@ var CURRENCY;
|
|
|
20
34
|
CURRENCY["CHF"] = "CHF";
|
|
21
35
|
})(CURRENCY || (exports.CURRENCY = CURRENCY = {}));
|
|
22
36
|
exports.ALL_CURRENCY = getAllEnumStatuses(CURRENCY);
|
|
37
|
+
__exportStar(require("@hyper.software/common-models/lib/interfaces"), exports);
|
|
23
38
|
//# sourceMappingURL=interfaces.js.map
|
package/lib/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAM,kBAAkB,GAAG,UAAU,KAAU,IAAU,OAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,KAAK,CAAC,GAAG,CAAC,EAAV,CAAU,CAAC,EAA3C,CAA2C,CAAA;AAEpG,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;AACjB,CAAC,EARW,QAAQ,wBAAR,QAAQ,QAQnB;AAED,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;AACb,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB;AACY,QAAA,YAAY,GAAG,kBAAkB,CAAW,QAAQ,CAAC,CAAA;AAClE,+EAA4D"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/redux/index.d.ts
CHANGED
|
File without changes
|
package/lib/redux/index.js
CHANGED
|
File without changes
|
package/lib/redux/index.js.map
CHANGED
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import moment, { Moment } from 'moment';
|
|
2
|
+
import { IRoom, IRoomBooking, IRoomTypePricePlanPricingInformation, IRoomTypePricePlanPricingRules } from '../../interfaces';
|
|
3
|
+
export declare const getTotalCostForRoomBooking: (roomBooking: IRoomBooking & {
|
|
4
|
+
pricingRules?: IRoomTypePricePlanPricingRules;
|
|
5
|
+
pricingInformation?: Partial<IRoomTypePricePlanPricingInformation>;
|
|
6
|
+
}, checkinDate: moment.Moment, checkoutDate: moment.Moment, numberOfAdults: any) => number;
|
|
7
|
+
export declare const getTotalCost: (roomBookings: Array<{
|
|
8
|
+
roomId?: string;
|
|
9
|
+
breakfastIncluded?: boolean;
|
|
10
|
+
pricingInformation?: Partial<IRoomTypePricePlanPricingInformation>;
|
|
11
|
+
pricingRules?: IRoomTypePricePlanPricingRules;
|
|
12
|
+
personsPayingBreakfast?: number;
|
|
13
|
+
room?: IRoom;
|
|
14
|
+
}>, _checkinDate: moment.Moment, _checkoutDate: moment.Moment, numberOfAdults: number) => number;
|
|
15
|
+
export declare const ensureValueIsNumber: (value: string | number, isDouble?: boolean) => number | null;
|
|
16
|
+
export declare const removeInvalidCharacters: (value: string, isDouble: boolean) => string;
|
|
17
|
+
export declare const normalizeDate: (date: Date | Moment | string | null) => Moment | null;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.normalizeDate = exports.removeInvalidCharacters = exports.ensureValueIsNumber = exports.getTotalCost = exports.getTotalCostForRoomBooking = void 0;
|
|
7
|
+
var moment_1 = __importDefault(require("moment"));
|
|
8
|
+
var helpers_1 = require("../../helpers");
|
|
9
|
+
var interfaces_1 = require("../../interfaces");
|
|
10
|
+
var getTotalCostForRoomBooking = function (roomBooking, checkinDate, checkoutDate, numberOfAdults) {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
if (!roomBooking) {
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
var totalCost = 0;
|
|
16
|
+
var maxNumberOfAdults = ((_b = (_a = roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.room) === null || _a === void 0 ? void 0 : _a.roomType) === null || _b === void 0 ? void 0 : _b.maxNumberOfAdults) || ((_c = roomBooking === null || roomBooking === void 0 ? void 0 : roomBooking.roomType) === null || _c === void 0 ? void 0 : _c.maxNumberOfAdults);
|
|
17
|
+
var actualNumberOfAdults = roomBooking.personsPayingBreakfast || numberOfAdults;
|
|
18
|
+
var shouldIncreasePrice = actualNumberOfAdults > maxNumberOfAdults;
|
|
19
|
+
var adjustmentFactor = shouldIncreasePrice ? 1 : -1;
|
|
20
|
+
var applicablePricingRules = (roomBooking.pricingRules || []).filter(function (pricingRule) { return pricingRule.active; });
|
|
21
|
+
var discountOrIncrease = (roomBooking.pricingRules || [])
|
|
22
|
+
.filter(function (pricingRule) { return pricingRule.active && !!pricingRule.value && !!pricingRule.type; })
|
|
23
|
+
.find(function (pricingRule) { return pricingRule.numberOfAdults === actualNumberOfAdults; });
|
|
24
|
+
if (!discountOrIncrease) {
|
|
25
|
+
discountOrIncrease =
|
|
26
|
+
applicablePricingRules.length > 0
|
|
27
|
+
? applicablePricingRules.reduce(function (lastRule, currentRule) {
|
|
28
|
+
return currentRule.numberOfAdults > lastRule.numberOfAdults ? currentRule : lastRule;
|
|
29
|
+
})
|
|
30
|
+
: null;
|
|
31
|
+
}
|
|
32
|
+
var cost = roomBooking.pricePerNight ||
|
|
33
|
+
(0, exports.ensureValueIsNumber)(roomBooking.pricingInformation[checkinDate.format(helpers_1.DATE_FORMATS.YYYY_MM_DD)]);
|
|
34
|
+
var calculation = actualNumberOfAdults === maxNumberOfAdults || !(discountOrIncrease === null || discountOrIncrease === void 0 ? void 0 : discountOrIncrease.value)
|
|
35
|
+
? cost
|
|
36
|
+
: (discountOrIncrease === null || discountOrIncrease === void 0 ? void 0 : discountOrIncrease.type) === interfaces_1.DISCOUNT_TYPE.PERCENTAGE
|
|
37
|
+
? ((100 + (discountOrIncrease === null || discountOrIncrease === void 0 ? void 0 : discountOrIncrease.value) * adjustmentFactor) / 100) * cost || 0
|
|
38
|
+
: cost + (discountOrIncrease === null || discountOrIncrease === void 0 ? void 0 : discountOrIncrease.value) * adjustmentFactor;
|
|
39
|
+
while (checkoutDate.diff(checkinDate, 'days') > 0) {
|
|
40
|
+
totalCost += calculation;
|
|
41
|
+
checkinDate.add(1, 'days');
|
|
42
|
+
}
|
|
43
|
+
return totalCost;
|
|
44
|
+
};
|
|
45
|
+
exports.getTotalCostForRoomBooking = getTotalCostForRoomBooking;
|
|
46
|
+
var getTotalCost = function (roomBookings, _checkinDate, _checkoutDate, numberOfAdults) {
|
|
47
|
+
if (!_checkinDate || !_checkoutDate) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
var checkinDate = (0, moment_1.default)((0, exports.normalizeDate)(_checkinDate));
|
|
51
|
+
var checkoutDate = (0, moment_1.default)((0, exports.normalizeDate)(_checkoutDate));
|
|
52
|
+
var totalCost = 0;
|
|
53
|
+
for (var _i = 0, roomBookings_1 = roomBookings; _i < roomBookings_1.length; _i++) {
|
|
54
|
+
var roomBooking = roomBookings_1[_i];
|
|
55
|
+
var costForRoomBooking = (0, exports.getTotalCostForRoomBooking)(roomBooking, (0, moment_1.default)(checkinDate.toISOString()), (0, moment_1.default)(checkoutDate.toISOString()), roomBooking.personsPayingBreakfast || numberOfAdults);
|
|
56
|
+
totalCost += costForRoomBooking;
|
|
57
|
+
}
|
|
58
|
+
return totalCost;
|
|
59
|
+
};
|
|
60
|
+
exports.getTotalCost = getTotalCost;
|
|
61
|
+
var ensureValueIsNumber = function (value, isDouble) {
|
|
62
|
+
if (isDouble === void 0) { isDouble = true; }
|
|
63
|
+
if ((0, helpers_1.isEmpty)(value)) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (typeof value === 'number') {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
if (value === '-') {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
if (!isNaN(parseFloat((0, exports.removeInvalidCharacters)(value, isDouble)))) {
|
|
73
|
+
return parseFloat((0, exports.removeInvalidCharacters)(value, isDouble));
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
};
|
|
77
|
+
exports.ensureValueIsNumber = ensureValueIsNumber;
|
|
78
|
+
var removeInvalidCharacters = function (value, isDouble) {
|
|
79
|
+
var valWithNoInvalidChars = (value || '')
|
|
80
|
+
.replace(/[^0-9,.-]/g, '')
|
|
81
|
+
.replace(/(?!^)-/g, '')
|
|
82
|
+
.replace(/\./g, '');
|
|
83
|
+
if (isDouble) {
|
|
84
|
+
return valWithNoInvalidChars.replace(/,/g, '.');
|
|
85
|
+
}
|
|
86
|
+
return valWithNoInvalidChars.replace(/,/g, '');
|
|
87
|
+
};
|
|
88
|
+
exports.removeInvalidCharacters = removeInvalidCharacters;
|
|
89
|
+
var normalizeDate = function (date) {
|
|
90
|
+
if (!date) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return (0, moment_1.default)(date).set({
|
|
94
|
+
hour: 18,
|
|
95
|
+
minute: 0,
|
|
96
|
+
second: 0,
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
exports.normalizeDate = normalizeDate;
|
|
100
|
+
//# sourceMappingURL=bookingsServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingsServices.js","sourceRoot":"","sources":["../../../src/services/bookingService/bookingsServices.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuC;AACvC,yCAAqD;AACrD,+CAMyB;AAElB,IAAM,0BAA0B,GAAG,UACxC,WAGC,EACD,WAA0B,EAC1B,YAA2B,EAC3B,cAAc;;IAEd,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,CAAC,CAAA;KACT;IAED,IAAI,SAAS,GAAG,CAAC,CAAA;IAEjB,IAAM,iBAAiB,GACrB,CAAA,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,0CAAE,QAAQ,0CAAE,iBAAiB,MAAI,MAAC,WAAmB,aAAnB,WAAW,uBAAX,WAAW,CAAU,QAAQ,0CAAE,iBAAiB,CAAA,CAAA;IACrG,IAAM,oBAAoB,GAAG,WAAW,CAAC,sBAAsB,IAAI,cAAc,CAAA;IAEjF,IAAM,mBAAmB,GAAG,oBAAoB,GAAG,iBAAiB,CAAA;IACpE,IAAM,gBAAgB,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAErD,IAAM,sBAAsB,GAAG,CAAC,WAAW,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,UAAC,WAAW,IAAK,OAAA,WAAW,CAAC,MAAM,EAAlB,CAAkB,CAAC,CAAA;IAE3G,IAAI,kBAAkB,GAAG,CAAC,WAAW,CAAC,YAAY,IAAI,EAAE,CAAC;SACtD,MAAM,CAAC,UAAC,WAA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C7B,OAAO,KAAK,CAAA;KACb;IAED,IAAI,KAAK,KAAK,GAAG,EAAE;QACjB,OAAO,IAAI,CAAA;KACZ;IAED,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAA,+BAAuB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;QAChE,OAAO,UAAU,CAAC,IAAA,+BAAuB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAA;KAC5D;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAlBY,QAAA,mBAAmB,uBAkB/B;AAEM,IAAM,uBAAuB,GAAG,UAAC,KAAa,EAAE,QAAiB;IACtE,IAAM,qBAAqB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACxC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAErB,IAAI,QAAQ,EAAE;QACZ,OAAO,qBAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;KAChD;IAED,OAAO,qBAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AAChD,CAAC,CAAA;AAXY,QAAA,uBAAuB,2BAWnC;AAEM,IAAM,aAAa,GAAG,UAAC,IAAmC;IAC/D,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,IAAA,gBAAM,EAAC,IAAI,CAAC,CAAC,GAAG,CAAC;QACtB,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;KACV,CAAC,CAAA;AACJ,CAAC,CAAA;AAVY,QAAA,aAAa,iBAUzB"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/services/index.d.ts
CHANGED
|
File without changes
|
package/lib/services/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyper.software/common-helpers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"author": "Raul Tomescu <tomescu.raul+hyper@gmail.com>",
|
|
5
5
|
"description": "Hyper Software Common Javascript Helpers",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/preset-env": "^7.23.3",
|
|
38
|
+
"@hyper.software/common-models": "^2.0.17",
|
|
38
39
|
"@hyper.software/tslint-config": "^1.0.1",
|
|
39
40
|
"@sentry/types": "^7.77.0",
|
|
40
41
|
"@types/cookie": "^0.5.3",
|