hh-contracts 0.0.95 → 0.0.97
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/CHANGELOG.md +5 -0
- package/app-menu/get.query.ts +2 -2
- package/build/app-menu/get.query.js +1 -1
- package/build/common/constants/domain-name.constant.js +9 -0
- package/build/common/constants/index.js +2 -0
- package/build/common/constants/slug.constant.js +1 -0
- package/build/common/constants/time-zone.constant.js +7 -0
- package/build/common/models/domain-name.schema.js +47 -0
- package/build/common/models/index.js +3 -1
- package/build/common/models/slug.schema.js +5 -1
- package/build/common/models/timestamp.schemas.js +4 -1
- package/build/common/models/timezone.schema.js +43 -0
- package/build/common/models/{uuid-array.schema.js → uuid.schemas.js} +3 -2
- package/build/companies/company.models.js +1 -1
- package/build/hotels/amenities/hotel-amenity.model.js +44 -0
- package/build/hotels/amenities/index.js +17 -0
- package/build/hotels/constants/hotel-amenity.constant.js +15 -0
- package/build/hotels/constants/hotel-contact-type.constant.js +9 -0
- package/build/hotels/constants/hotel-feature.constant.js +11 -0
- package/build/hotels/constants/hotel-integration-connection-state.constant.js +10 -0
- package/build/hotels/constants/hotel-integration-credential-status.constant.js +9 -0
- package/build/hotels/constants/hotel-integration-provider.constant.js +7 -0
- package/build/hotels/constants/hotel-integration-sync-status.constant.js +10 -0
- package/build/hotels/constants/hotel-policy-type.constant.js +11 -0
- package/build/hotels/constants/hotel-rating-source.constant.js +9 -0
- package/build/hotels/constants/index.js +25 -0
- package/build/hotels/contacts/hotel-contact.model.js +48 -0
- package/build/hotels/contacts/index.js +17 -0
- package/build/hotels/contracts/create-hotel.contract.js +14 -0
- package/build/hotels/contracts/delete-hotel.contract.js +46 -0
- package/build/hotels/contracts/find-hotel.contract.js +18 -0
- package/build/hotels/contracts/find-many-hotels.contract.js +67 -0
- package/build/hotels/contracts/index.js +4 -0
- package/build/hotels/contracts/update-hotel.contract.js +15 -0
- package/build/hotels/domains/contracts/find-hotel-domain-settings.contract.js +13 -0
- package/build/hotels/domains/contracts/index.js +18 -0
- package/build/hotels/domains/contracts/update-hotel-domain-settings.contract.js +14 -0
- package/build/hotels/domains/hotel-domains.api.js +12 -0
- package/build/hotels/domains/hotel-domains.schema.js +49 -0
- package/build/hotels/domains/index.js +19 -0
- package/build/hotels/{hotel.model.js → features/hotel-feature.model.js} +8 -9
- package/build/hotels/features/index.js +17 -0
- package/build/hotels/hotel.models.js +83 -0
- package/build/hotels/hotels.api.js +14 -5
- package/build/hotels/index.js +10 -1
- package/build/hotels/integrations/configs/index.js +17 -0
- package/build/hotels/integrations/configs/opera-integration-config.model.js +41 -0
- package/build/hotels/integrations/contracts/create-hotel-integration.contract.js +14 -0
- package/build/hotels/integrations/contracts/delete-hotel-integration.contract.js +46 -0
- package/build/hotels/integrations/contracts/find-all-hotel-integrations.contract.js +47 -0
- package/build/hotels/integrations/contracts/find-hotel-integration.contract.js +13 -0
- package/build/hotels/integrations/contracts/index.js +21 -0
- package/build/hotels/integrations/contracts/update-hotel-integration.contract.js +14 -0
- package/build/hotels/integrations/hotel-integration.model.js +97 -0
- package/build/hotels/integrations/hotel-integrations.api.js +17 -0
- package/build/hotels/integrations/index.js +19 -0
- package/build/hotels/location/hotel-location.model.js +51 -0
- package/build/hotels/location/index.js +17 -0
- package/build/hotels/policies/hotel-policy.model.js +49 -0
- package/build/hotels/policies/index.js +17 -0
- package/build/hotels/ratings/hotel-rating.model.js +48 -0
- package/build/hotels/ratings/index.js +17 -0
- package/build/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.js +3 -3
- package/build/hotels/sites/hotel-pages.api.js +24 -0
- package/build/hotels/sites/index.js +1 -0
- package/build/hotels/themes/contracts/find-hotel-theme.contract.js +3 -3
- package/build/hotels/themes/hotel-themes.api.js +20 -0
- package/build/hotels/themes/index.js +1 -0
- package/build/permissions/contracts/create-permission.contract.js +2 -6
- package/build/permissions/contracts/delete-permission.contract.js +35 -2
- package/build/permissions/contracts/find-permission.contract.js +1 -8
- package/build/permissions/contracts/update-permission.contract.js +1 -1
- package/build/permissions/permission.models.js +12 -25
- package/build/roles/contracts/create-role.contract.js +2 -6
- package/build/roles/contracts/delete-role.contract.js +35 -2
- package/build/roles/contracts/find-role.contract.js +1 -1
- package/build/roles/contracts/update-role.contract.js +1 -1
- package/build/roles/role.models.js +14 -11
- package/build/translate/contracts/translate-object.contract.js +3 -0
- package/common/constants/domain-name.constant.ts +8 -0
- package/common/constants/index.ts +2 -0
- package/common/constants/slug.constant.ts +2 -1
- package/common/constants/time-zone.constant.ts +4 -0
- package/common/models/domain-name.schema.ts +14 -0
- package/common/models/index.ts +3 -1
- package/common/models/slug.schema.ts +5 -1
- package/common/models/timestamp.schemas.ts +4 -0
- package/common/models/timezone.schema.ts +10 -0
- package/common/models/uuid.schemas.ts +4 -0
- package/companies/company.models.ts +2 -2
- package/hotels/amenities/hotel-amenity.model.ts +10 -0
- package/hotels/amenities/index.ts +1 -0
- package/hotels/constants/hotel-amenity.constant.ts +18 -0
- package/hotels/constants/hotel-contact-type.constant.ts +12 -0
- package/hotels/constants/hotel-feature.constant.ts +14 -0
- package/hotels/constants/hotel-integration-connection-state.constant.ts +13 -0
- package/hotels/constants/hotel-integration-credential-status.constant.ts +12 -0
- package/hotels/constants/hotel-integration-provider.constant.ts +11 -0
- package/hotels/constants/hotel-integration-sync-status.constant.ts +13 -0
- package/hotels/constants/hotel-policy-type.constant.ts +15 -0
- package/hotels/constants/hotel-rating-source.constant.ts +12 -0
- package/hotels/constants/index.ts +9 -0
- package/hotels/contacts/hotel-contact.model.ts +15 -0
- package/hotels/contacts/index.ts +1 -0
- package/hotels/contracts/create-hotel.contract.ts +16 -0
- package/hotels/contracts/delete-hotel.contract.ts +12 -0
- package/hotels/contracts/find-hotel.contract.ts +27 -1
- package/hotels/contracts/find-many-hotels.contract.ts +43 -0
- package/hotels/contracts/index.ts +4 -0
- package/hotels/contracts/update-hotel.contract.ts +17 -0
- package/hotels/domains/contracts/find-hotel-domain-settings.contract.ts +13 -0
- package/hotels/domains/contracts/index.ts +2 -0
- package/hotels/domains/contracts/update-hotel-domain-settings.contract.ts +16 -0
- package/hotels/domains/hotel-domains.api.ts +11 -0
- package/hotels/domains/hotel-domains.schema.ts +25 -0
- package/hotels/domains/index.ts +3 -0
- package/hotels/features/hotel-feature.model.ts +14 -0
- package/hotels/features/index.ts +1 -0
- package/hotels/hotel.models.ts +70 -0
- package/hotels/hotels.api.ts +14 -4
- package/hotels/index.ts +10 -1
- package/hotels/integrations/configs/index.ts +1 -0
- package/hotels/integrations/configs/opera-integration-config.model.ts +6 -0
- package/hotels/integrations/contracts/create-hotel-integration.contract.ts +21 -0
- package/hotels/integrations/contracts/delete-hotel-integration.contract.ts +14 -0
- package/hotels/integrations/contracts/find-all-hotel-integrations.contract.ts +15 -0
- package/hotels/integrations/contracts/find-hotel-integration.contract.ts +15 -0
- package/hotels/integrations/contracts/index.ts +5 -0
- package/hotels/integrations/contracts/update-hotel-integration.contract.ts +21 -0
- package/hotels/integrations/hotel-integration.model.ts +80 -0
- package/hotels/integrations/hotel-integrations.api.ts +16 -0
- package/hotels/integrations/index.ts +3 -0
- package/hotels/location/hotel-location.model.ts +17 -0
- package/hotels/location/index.ts +1 -0
- package/hotels/policies/hotel-policy.model.ts +16 -0
- package/hotels/policies/index.ts +1 -0
- package/hotels/ratings/hotel-rating.model.ts +15 -0
- package/hotels/ratings/index.ts +1 -0
- package/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.ts +3 -3
- package/hotels/sites/hotel-pages.api.ts +24 -0
- package/hotels/sites/index.ts +1 -0
- package/hotels/themes/contracts/find-hotel-theme.contract.ts +3 -3
- package/hotels/themes/hotel-themes.api.ts +20 -0
- package/hotels/themes/index.ts +1 -0
- package/package.json +1 -1
- package/permissions/contracts/create-permission.contract.ts +3 -7
- package/permissions/contracts/delete-permission.contract.ts +1 -2
- package/permissions/contracts/find-permission.contract.ts +2 -10
- package/permissions/contracts/update-permission.contract.ts +2 -2
- package/permissions/permission.models.ts +18 -31
- package/roles/contracts/create-role.contract.ts +3 -7
- package/roles/contracts/delete-role.contract.ts +1 -2
- package/roles/contracts/find-role.contract.ts +2 -2
- package/roles/contracts/update-role.contract.ts +2 -2
- package/roles/role.models.ts +26 -15
- package/translate/contracts/translate-object.contract.ts +3 -0
- package/build/permissions/permission.response.schema.js +0 -8
- package/common/models/uuid-array.schema.ts +0 -3
- package/hotels/hotel.model.ts +0 -14
- package/permissions/permission.response.schema.ts +0 -8
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
- Расширены модели интеграций отелей: добавлены схемы маршрутизации, состояния подключений и статусы учётных данных для поддержки брокерного обмена.
|
|
5
|
+
- Контракт поиска интеграций переименован в `findAll`, запрос теперь поддерживает только фильтр по `alias` без пагинации.
|
package/app-menu/get.query.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { NavigationItemEntitySchema } from '../common';
|
|
2
|
+
import { NavigationItemEntitySchema, UuidSchema } from '../common';
|
|
3
3
|
|
|
4
4
|
const GetAppMenuQueryRequestSchema = z.object({
|
|
5
|
-
userUuid:
|
|
5
|
+
userUuid: UuidSchema,
|
|
6
6
|
});
|
|
7
7
|
const GetAppMenuQueryResponseSchema = z.object({
|
|
8
8
|
appMenu: z.array(NavigationItemEntitySchema),
|
|
@@ -37,7 +37,7 @@ exports.GetAppMenuQuery = void 0;
|
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
const common_1 = require("../common");
|
|
39
39
|
const GetAppMenuQueryRequestSchema = z.object({
|
|
40
|
-
userUuid:
|
|
40
|
+
userUuid: common_1.UuidSchema,
|
|
41
41
|
});
|
|
42
42
|
const GetAppMenuQueryResponseSchema = z.object({
|
|
43
43
|
appMenu: z.array(common_1.NavigationItemEntitySchema),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DOMAIN_NAME_CONFIG = void 0;
|
|
4
|
+
exports.DOMAIN_NAME_CONFIG = {
|
|
5
|
+
minLength: 1,
|
|
6
|
+
maxLength: 253,
|
|
7
|
+
regex: /^(?!-)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/i,
|
|
8
|
+
messageKey: 'zod.domainName.invalidFormat',
|
|
9
|
+
};
|
|
@@ -28,4 +28,6 @@ __exportStar(require("./order-direction.constant"), exports);
|
|
|
28
28
|
__exportStar(require("./role-types.constant"), exports);
|
|
29
29
|
__exportStar(require("./route-component-key.constants"), exports);
|
|
30
30
|
__exportStar(require("./slug.constant"), exports);
|
|
31
|
+
__exportStar(require("./time-zone.constant"), exports);
|
|
32
|
+
__exportStar(require("./domain-name.constant"), exports);
|
|
31
33
|
__exportStar(require("./translatable-field.constant"), exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DomainNameSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../constants");
|
|
39
|
+
exports.DomainNameSchema = z
|
|
40
|
+
.string()
|
|
41
|
+
.min(constants_1.DOMAIN_NAME_CONFIG.minLength)
|
|
42
|
+
.max(constants_1.DOMAIN_NAME_CONFIG.maxLength)
|
|
43
|
+
.refine(value => constants_1.DOMAIN_NAME_CONFIG.regex.test(value), {
|
|
44
|
+
params: {
|
|
45
|
+
messageKey: constants_1.DOMAIN_NAME_CONFIG.messageKey,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -23,6 +23,8 @@ __exportStar(require("./pagination.schema"), exports);
|
|
|
23
23
|
__exportStar(require("./search.schema"), exports);
|
|
24
24
|
__exportStar(require("./slug.schema"), exports);
|
|
25
25
|
__exportStar(require("./timestamp.schemas"), exports);
|
|
26
|
+
__exportStar(require("./timezone.schema"), exports);
|
|
26
27
|
__exportStar(require("./language-keys.schema"), exports);
|
|
27
28
|
__exportStar(require("./translations.schemas"), exports);
|
|
28
|
-
__exportStar(require("./uuid
|
|
29
|
+
__exportStar(require("./uuid.schemas"), exports);
|
|
30
|
+
__exportStar(require("./domain-name.schema"), exports);
|
|
@@ -41,5 +41,9 @@ exports.SlugSchema = z
|
|
|
41
41
|
.trim()
|
|
42
42
|
.min(constants_1.SLUG_CONFIG.minLength)
|
|
43
43
|
.max(constants_1.SLUG_CONFIG.maxLength)
|
|
44
|
-
.
|
|
44
|
+
.refine(value => constants_1.SLUG_CONFIG.regex.test(value), {
|
|
45
|
+
params: {
|
|
46
|
+
messageKey: constants_1.SLUG_CONFIG.messageKey,
|
|
47
|
+
},
|
|
48
|
+
})
|
|
45
49
|
.toLowerCase();
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.TimestampWithDeletedSchema = exports.TimestampSchema = void 0;
|
|
36
|
+
exports.IsoTimeSchema = exports.IsoDateSchema = exports.IsoDatetimeSchema = exports.TimestampWithDeletedSchema = exports.TimestampSchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
exports.TimestampSchema = z.object({
|
|
39
39
|
createdAt: z.date(),
|
|
@@ -42,3 +42,6 @@ exports.TimestampSchema = z.object({
|
|
|
42
42
|
exports.TimestampWithDeletedSchema = exports.TimestampSchema.extend({
|
|
43
43
|
deletedAt: z.date().nullable(),
|
|
44
44
|
});
|
|
45
|
+
exports.IsoDatetimeSchema = z.iso.datetime();
|
|
46
|
+
exports.IsoDateSchema = z.iso.date();
|
|
47
|
+
exports.IsoTimeSchema = z.iso.time();
|
|
@@ -0,0 +1,43 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TimezoneSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../constants");
|
|
39
|
+
exports.TimezoneSchema = z.string().refine(value => constants_1.TIME_ZONE_CONFIG.regex.test(value), {
|
|
40
|
+
params: {
|
|
41
|
+
messageKey: constants_1.TIME_ZONE_CONFIG.messageKey,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.UuidArraySchema = void 0;
|
|
36
|
+
exports.UuidArraySchema = exports.UuidSchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
|
-
exports.
|
|
38
|
+
exports.UuidSchema = z.uuid();
|
|
39
|
+
exports.UuidArraySchema = z.array(exports.UuidSchema);
|
|
@@ -0,0 +1,44 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HotelAmenitySchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../constants");
|
|
39
|
+
const common_1 = require("../../common");
|
|
40
|
+
exports.HotelAmenitySchema = z.object({
|
|
41
|
+
hotelId: common_1.UuidSchema,
|
|
42
|
+
amenityCode: z.enum(constants_1.HOTEL_AMENITY_VALUES),
|
|
43
|
+
isPrimary: z.boolean().default(false),
|
|
44
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hotel-amenity.model"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_AMENITY_VALUES = exports.HOTEL_AMENITIES = void 0;
|
|
4
|
+
exports.HOTEL_AMENITIES = {
|
|
5
|
+
wifi: 'wifi',
|
|
6
|
+
parking: 'parking',
|
|
7
|
+
pool: 'pool',
|
|
8
|
+
spa: 'spa',
|
|
9
|
+
gym: 'gym',
|
|
10
|
+
restaurant: 'restaurant',
|
|
11
|
+
bar: 'bar',
|
|
12
|
+
conferenceRoom: 'conferenceRoom',
|
|
13
|
+
businessCenter: 'businessCenter',
|
|
14
|
+
};
|
|
15
|
+
exports.HOTEL_AMENITY_VALUES = Object.values(exports.HOTEL_AMENITIES);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_CONTACT_TYPE_VALUES = exports.HOTEL_CONTACT_TYPES = void 0;
|
|
4
|
+
exports.HOTEL_CONTACT_TYPES = {
|
|
5
|
+
mainPhone: 'mainPhone',
|
|
6
|
+
reservations: 'reservations',
|
|
7
|
+
sales: 'sales',
|
|
8
|
+
};
|
|
9
|
+
exports.HOTEL_CONTACT_TYPE_VALUES = Object.values(exports.HOTEL_CONTACT_TYPES);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_FEATURE_VALUES = exports.HOTEL_FEATURES = void 0;
|
|
4
|
+
exports.HOTEL_FEATURES = {
|
|
5
|
+
site: 'site',
|
|
6
|
+
services: 'services',
|
|
7
|
+
digitalSignage: 'digitalSignage',
|
|
8
|
+
hskRoomStatus: 'hskRoomStatus',
|
|
9
|
+
fbBreakfastCheckin: 'fbBreakfastCheckin',
|
|
10
|
+
};
|
|
11
|
+
exports.HOTEL_FEATURE_VALUES = Object.values(exports.HOTEL_FEATURES);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_INTEGRATION_CONNECTION_STATE_VALUES = exports.HOTEL_INTEGRATION_CONNECTION_STATES = void 0;
|
|
4
|
+
exports.HOTEL_INTEGRATION_CONNECTION_STATES = {
|
|
5
|
+
offline: 'offline',
|
|
6
|
+
connecting: 'connecting',
|
|
7
|
+
online: 'online',
|
|
8
|
+
degraded: 'degraded',
|
|
9
|
+
};
|
|
10
|
+
exports.HOTEL_INTEGRATION_CONNECTION_STATE_VALUES = Object.values(exports.HOTEL_INTEGRATION_CONNECTION_STATES);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_INTEGRATION_CREDENTIAL_STATUS_VALUES = exports.HOTEL_INTEGRATION_CREDENTIAL_STATUSES = void 0;
|
|
4
|
+
exports.HOTEL_INTEGRATION_CREDENTIAL_STATUSES = {
|
|
5
|
+
active: 'active',
|
|
6
|
+
rotating: 'rotating',
|
|
7
|
+
revoked: 'revoked',
|
|
8
|
+
};
|
|
9
|
+
exports.HOTEL_INTEGRATION_CREDENTIAL_STATUS_VALUES = Object.values(exports.HOTEL_INTEGRATION_CREDENTIAL_STATUSES);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_INTEGRATION_PROVIDER_VALUES = exports.HOTEL_INTEGRATION_PROVIDERS = void 0;
|
|
4
|
+
exports.HOTEL_INTEGRATION_PROVIDERS = {
|
|
5
|
+
opera: 'opera',
|
|
6
|
+
};
|
|
7
|
+
exports.HOTEL_INTEGRATION_PROVIDER_VALUES = Object.values(exports.HOTEL_INTEGRATION_PROVIDERS);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_INTEGRATION_SYNC_STATUS_VALUES = exports.HOTEL_INTEGRATION_SYNC_STATUSES = void 0;
|
|
4
|
+
exports.HOTEL_INTEGRATION_SYNC_STATUSES = {
|
|
5
|
+
idle: 'idle',
|
|
6
|
+
running: 'running',
|
|
7
|
+
success: 'success',
|
|
8
|
+
failed: 'failed',
|
|
9
|
+
};
|
|
10
|
+
exports.HOTEL_INTEGRATION_SYNC_STATUS_VALUES = Object.values(exports.HOTEL_INTEGRATION_SYNC_STATUSES);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_POLICY_TYPE_VALUES = exports.HOTEL_POLICY_TYPES = void 0;
|
|
4
|
+
exports.HOTEL_POLICY_TYPES = {
|
|
5
|
+
cancellation: 'cancellation',
|
|
6
|
+
deposit: 'deposit',
|
|
7
|
+
meal: 'meal',
|
|
8
|
+
pet: 'pet',
|
|
9
|
+
smoking: 'smoking',
|
|
10
|
+
};
|
|
11
|
+
exports.HOTEL_POLICY_TYPE_VALUES = Object.values(exports.HOTEL_POLICY_TYPES);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_RATING_SOURCE_VALUES = exports.HOTEL_RATING_SOURCES = void 0;
|
|
4
|
+
exports.HOTEL_RATING_SOURCES = {
|
|
5
|
+
google: 'google',
|
|
6
|
+
yandexMaps: 'yandexMaps',
|
|
7
|
+
ostrovok: 'ostrovok',
|
|
8
|
+
};
|
|
9
|
+
exports.HOTEL_RATING_SOURCE_VALUES = Object.values(exports.HOTEL_RATING_SOURCES);
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hotel-amenity.constant"), exports);
|
|
18
|
+
__exportStar(require("./hotel-contact-type.constant"), exports);
|
|
19
|
+
__exportStar(require("./hotel-feature.constant"), exports);
|
|
20
|
+
__exportStar(require("./hotel-integration-connection-state.constant"), exports);
|
|
21
|
+
__exportStar(require("./hotel-integration-credential-status.constant"), exports);
|
|
22
|
+
__exportStar(require("./hotel-integration-provider.constant"), exports);
|
|
23
|
+
__exportStar(require("./hotel-integration-sync-status.constant"), exports);
|
|
24
|
+
__exportStar(require("./hotel-policy-type.constant"), exports);
|
|
25
|
+
__exportStar(require("./hotel-rating-source.constant"), exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HotelContactSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../constants");
|
|
39
|
+
const common_1 = require("../../common");
|
|
40
|
+
exports.HotelContactSchema = z
|
|
41
|
+
.object({
|
|
42
|
+
hotelId: common_1.UuidSchema,
|
|
43
|
+
contactType: z.enum(constants_1.HOTEL_CONTACT_TYPE_VALUES),
|
|
44
|
+
value: z.string().min(1),
|
|
45
|
+
isPublic: z.boolean().default(true),
|
|
46
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
47
|
+
})
|
|
48
|
+
.extend(common_1.TimestampSchema.shape);
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hotel-contact.model"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateHotelContract = void 0;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
const hotels_api_1 = require("../hotels.api");
|
|
6
|
+
const hotel_models_1 = require("../hotel.models");
|
|
7
|
+
var CreateHotelContract;
|
|
8
|
+
(function (CreateHotelContract) {
|
|
9
|
+
CreateHotelContract.getUrl = hotels_api_1.HOTELS_API.create;
|
|
10
|
+
CreateHotelContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.create;
|
|
11
|
+
CreateHotelContract.httpMethod = common_1.HTTP_METHODS.post;
|
|
12
|
+
CreateHotelContract.RequestSchema = hotel_models_1.HotelWriteSchema;
|
|
13
|
+
CreateHotelContract.ResponseSchema = hotel_models_1.HotelDetailSchema;
|
|
14
|
+
})(CreateHotelContract || (exports.CreateHotelContract = CreateHotelContract = {}));
|
|
@@ -0,0 +1,46 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DeleteHotelContract = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
const hotels_api_1 = require("../hotels.api");
|
|
40
|
+
var DeleteHotelContract;
|
|
41
|
+
(function (DeleteHotelContract) {
|
|
42
|
+
DeleteHotelContract.getUrl = hotels_api_1.HOTELS_API.deleteById;
|
|
43
|
+
DeleteHotelContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.deleteById;
|
|
44
|
+
DeleteHotelContract.httpMethod = common_1.HTTP_METHODS.delete;
|
|
45
|
+
DeleteHotelContract.ResponseSchema = z.void();
|
|
46
|
+
})(DeleteHotelContract || (exports.DeleteHotelContract = DeleteHotelContract = {}));
|
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindHotelBySlugContract = exports.FindHotelByIdContract = void 0;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
const hotel_models_1 = require("../hotel.models");
|
|
6
|
+
const hotels_api_1 = require("../hotels.api");
|
|
7
|
+
var FindHotelByIdContract;
|
|
8
|
+
(function (FindHotelByIdContract) {
|
|
9
|
+
FindHotelByIdContract.getUrl = hotels_api_1.HOTELS_API.findById;
|
|
10
|
+
FindHotelByIdContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.findById;
|
|
11
|
+
FindHotelByIdContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
12
|
+
FindHotelByIdContract.ResponseSchema = hotel_models_1.HotelDetailSchema;
|
|
13
|
+
})(FindHotelByIdContract || (exports.FindHotelByIdContract = FindHotelByIdContract = {}));
|
|
14
|
+
var FindHotelBySlugContract;
|
|
15
|
+
(function (FindHotelBySlugContract) {
|
|
16
|
+
FindHotelBySlugContract.getUrl = hotels_api_1.HOTELS_BY_SLUG_API.find;
|
|
17
|
+
FindHotelBySlugContract.endpoint = hotels_api_1.HOTELS_BY_SLUG_CONTROLLER.endpoints.find;
|
|
18
|
+
FindHotelBySlugContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
19
|
+
FindHotelBySlugContract.ResponseSchema = hotel_models_1.HotelDetailSchema;
|
|
20
|
+
})(FindHotelBySlugContract || (exports.FindHotelBySlugContract = FindHotelBySlugContract = {}));
|
|
@@ -0,0 +1,67 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.FindManyHotelsContract = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
const hotel_models_1 = require("../hotel.models");
|
|
40
|
+
const hotels_api_1 = require("../hotels.api");
|
|
41
|
+
const BaseQuerySchema = hotel_models_1.HotelListItemSchema.pick({
|
|
42
|
+
status: true,
|
|
43
|
+
category: true,
|
|
44
|
+
stars: true,
|
|
45
|
+
}).partial();
|
|
46
|
+
const OrderBySchema = hotel_models_1.HotelListItemSchema.omit({
|
|
47
|
+
id: true,
|
|
48
|
+
}).keyof();
|
|
49
|
+
const FindManyHotelsContractRequestSchema = BaseQuerySchema.extend({
|
|
50
|
+
...common_1.CommonQueryParamsSchema.shape,
|
|
51
|
+
orderBy: OrderBySchema.optional(),
|
|
52
|
+
});
|
|
53
|
+
const FindManyHotelsContractResponseSchema = z
|
|
54
|
+
.object({
|
|
55
|
+
hotels: z.array(hotel_models_1.HotelListItemSchema),
|
|
56
|
+
})
|
|
57
|
+
.extend(common_1.PaginationResponseSchema.shape);
|
|
58
|
+
var FindManyHotelsContract;
|
|
59
|
+
(function (FindManyHotelsContract) {
|
|
60
|
+
FindManyHotelsContract.getUrl = hotels_api_1.HOTELS_API.findMany;
|
|
61
|
+
FindManyHotelsContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.findMany;
|
|
62
|
+
FindManyHotelsContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
63
|
+
FindManyHotelsContract.BaseFilterSchema = BaseQuerySchema;
|
|
64
|
+
FindManyHotelsContract.SORTING_KEYS = OrderBySchema.options;
|
|
65
|
+
FindManyHotelsContract.RequestSchema = FindManyHotelsContractRequestSchema;
|
|
66
|
+
FindManyHotelsContract.ResponseSchema = FindManyHotelsContractResponseSchema;
|
|
67
|
+
})(FindManyHotelsContract || (exports.FindManyHotelsContract = FindManyHotelsContract = {}));
|
|
@@ -15,3 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./find-hotel.contract"), exports);
|
|
18
|
+
__exportStar(require("./find-many-hotels.contract"), exports);
|
|
19
|
+
__exportStar(require("./update-hotel.contract"), exports);
|
|
20
|
+
__exportStar(require("./delete-hotel.contract"), exports);
|
|
21
|
+
__exportStar(require("./create-hotel.contract"), exports);
|