hh-contracts 0.0.108 → 0.0.110
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/build/common/constants/app-statuses.constant.js +6 -0
- package/build/common/constants/icon.constants.js +4 -0
- package/build/index.js +1 -0
- package/build/users/contracts/assign-user-role.contract.js +15 -0
- package/build/users/contracts/create-user.contract.js +14 -0
- package/build/users/contracts/delete-user.contract.js +46 -0
- package/build/users/contracts/find-many-users.contract.js +71 -0
- package/build/users/contracts/find-user.contract.js +13 -0
- package/build/users/contracts/index.js +23 -0
- package/build/users/contracts/replace-user-role-assignments.contract.js +15 -0
- package/build/users/contracts/update-user.contract.js +14 -0
- package/build/users/index.js +20 -0
- package/build/users/user-role-assignments.models.js +107 -0
- package/build/users/user.models.js +80 -0
- package/build/users/users.api.js +17 -0
- package/package.json +15 -3
- package/app-menu/get.query.ts +0 -17
- package/app-menu/index.ts +0 -1
- package/common/constants/app-ability.constant.ts +0 -22
- package/common/constants/app-errors.constant.ts +0 -235
- package/common/constants/app-statuses.constant.ts +0 -26
- package/common/constants/array-splitter.constant.ts +0 -1
- package/common/constants/default-pagination-config.constant.ts +0 -5
- package/common/constants/domain-name.constant.ts +0 -8
- package/common/constants/entity.constant.ts +0 -10
- package/common/constants/http-method.constant.ts +0 -9
- package/common/constants/icon.constants.ts +0 -85
- package/common/constants/index.ts +0 -18
- package/common/constants/kind-of-app.constant.ts +0 -7
- package/common/constants/locales.constant.ts +0 -26
- package/common/constants/navigation-item-type.constant.ts +0 -6
- package/common/constants/order-direction.constant.ts +0 -10
- package/common/constants/role-types.constant.ts +0 -8
- package/common/constants/route-component-key.constants.ts +0 -5
- package/common/constants/slug.constant.ts +0 -8
- package/common/constants/time-zone.constant.ts +0 -4
- package/common/constants/translatable-field.constant.ts +0 -10
- package/common/index.ts +0 -5
- package/common/models/boolean-query-param.schema.ts +0 -8
- package/common/models/common-query-params.schema.ts +0 -10
- package/common/models/domain-name.schema.ts +0 -14
- package/common/models/icon-key.schema.ts +0 -4
- package/common/models/index.ts +0 -15
- package/common/models/info.schema.ts +0 -8
- package/common/models/language-keys.schema.ts +0 -4
- package/common/models/navigation-item.schemas.ts +0 -29
- package/common/models/order.schema.ts +0 -7
- package/common/models/pagination.schema.ts +0 -18
- package/common/models/search.schema.ts +0 -5
- package/common/models/slug.schema.ts +0 -14
- package/common/models/timestamp.schemas.ts +0 -14
- package/common/models/timezone.schema.ts +0 -10
- package/common/models/translations.schemas.ts +0 -14
- package/common/models/uuid.schemas.ts +0 -9
- package/common/types/index.ts +0 -1
- package/common/types/optionalized.type.ts +0 -40
- package/common/utils/create-api/create-api.ts +0 -28
- package/common/utils/create-api/index.ts +0 -2
- package/common/utils/create-api/types.ts +0 -34
- package/common/utils/index.ts +0 -2
- package/common/utils/zod-message-key/index.ts +0 -1
- package/common/utils/zod-message-key/types.ts +0 -7
- package/common/utils/zod-message-key/zod-message-key.util.ts +0 -31
- package/companies/company.models.ts +0 -11
- package/companies/index.ts +0 -1
- package/hotels/amenities/hotel-amenity.model.ts +0 -10
- package/hotels/amenities/index.ts +0 -1
- package/hotels/constants/hotel-amenity.constant.ts +0 -18
- package/hotels/constants/hotel-contact-type.constant.ts +0 -12
- package/hotels/constants/hotel-feature.constant.ts +0 -14
- package/hotels/constants/hotel-integration-connection-state.constant.ts +0 -13
- package/hotels/constants/hotel-integration-credential-status.constant.ts +0 -12
- package/hotels/constants/hotel-integration-provider.constant.ts +0 -11
- package/hotels/constants/hotel-integration-sync-status.constant.ts +0 -13
- package/hotels/constants/hotel-policy-type.constant.ts +0 -15
- package/hotels/constants/hotel-rating-source.constant.ts +0 -12
- package/hotels/constants/index.ts +0 -9
- package/hotels/contacts/hotel-contact.model.ts +0 -15
- package/hotels/contacts/index.ts +0 -1
- package/hotels/contracts/create-hotel.contract.ts +0 -16
- package/hotels/contracts/delete-hotel.contract.ts +0 -12
- package/hotels/contracts/find-hotel.contract.ts +0 -27
- package/hotels/contracts/find-many-hotels.contract.ts +0 -41
- package/hotels/contracts/index.ts +0 -5
- package/hotels/contracts/update-hotel.contract.ts +0 -17
- package/hotels/domains/contracts/find-hotel-domain-settings.contract.ts +0 -13
- package/hotels/domains/contracts/index.ts +0 -2
- package/hotels/domains/contracts/update-hotel-domain-settings.contract.ts +0 -16
- package/hotels/domains/hotel-domains.api.ts +0 -11
- package/hotels/domains/hotel-domains.schema.ts +0 -25
- package/hotels/domains/index.ts +0 -3
- package/hotels/features/hotel-feature.model.ts +0 -14
- package/hotels/features/index.ts +0 -1
- package/hotels/hotel.models.ts +0 -72
- package/hotels/hotels.api.ts +0 -22
- package/hotels/index.ts +0 -14
- package/hotels/integrations/configs/index.ts +0 -1
- package/hotels/integrations/configs/opera-integration-config.model.ts +0 -6
- package/hotels/integrations/contracts/create-hotel-integration.contract.ts +0 -21
- package/hotels/integrations/contracts/delete-hotel-integration.contract.ts +0 -14
- package/hotels/integrations/contracts/find-all-hotel-integrations.contract.ts +0 -18
- package/hotels/integrations/contracts/find-hotel-integration.contract.ts +0 -15
- package/hotels/integrations/contracts/index.ts +0 -5
- package/hotels/integrations/contracts/update-hotel-integration.contract.ts +0 -21
- package/hotels/integrations/hotel-integration.model.ts +0 -80
- package/hotels/integrations/hotel-integrations.api.ts +0 -16
- package/hotels/integrations/index.ts +0 -3
- package/hotels/location/hotel-location.model.ts +0 -17
- package/hotels/location/index.ts +0 -1
- package/hotels/policies/hotel-policy.model.ts +0 -16
- package/hotels/policies/index.ts +0 -1
- package/hotels/ratings/hotel-rating.model.ts +0 -15
- package/hotels/ratings/index.ts +0 -1
- package/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.ts +0 -26
- package/hotels/sites/contracts/index.ts +0 -1
- package/hotels/sites/hotel-pages.api.ts +0 -24
- package/hotels/sites/index.ts +0 -2
- package/hotels/themes/constants/accent-colors.constant.ts +0 -18
- package/hotels/themes/constants/fonts.constant.ts +0 -9
- package/hotels/themes/constants/index.ts +0 -3
- package/hotels/themes/constants/radius.constant.ts +0 -12
- package/hotels/themes/contracts/find-hotel-theme.contract.ts +0 -13
- package/hotels/themes/contracts/index.ts +0 -1
- package/hotels/themes/hotel-themes.api.ts +0 -20
- package/hotels/themes/index.ts +0 -4
- package/hotels/themes/theme.models.ts +0 -13
- package/index.ts +0 -10
- package/pages/constants/block-type.constant.ts +0 -11
- package/pages/constants/cta-actions.constant.ts +0 -5
- package/pages/constants/hero.constants.ts +0 -18
- package/pages/constants/image-loading.constant.ts +0 -8
- package/pages/constants/index.ts +0 -5
- package/pages/constants/media.constants.ts +0 -20
- package/pages/index.ts +0 -2
- package/pages/models/blocks/base-block.schema.ts +0 -11
- package/pages/models/blocks/block.schemas.ts +0 -57
- package/pages/models/blocks/cta.schema.ts +0 -58
- package/pages/models/blocks/hero-block.schema.ts +0 -27
- package/pages/models/blocks/html-block.schema.ts +0 -14
- package/pages/models/blocks/index.ts +0 -6
- package/pages/models/blocks/media.schemas.ts +0 -66
- package/pages/models/index.ts +0 -2
- package/pages/models/page.schema.ts +0 -29
- package/permissions/contracts/create-permission.contract.ts +0 -18
- package/permissions/contracts/delete-permission.contract.ts +0 -12
- package/permissions/contracts/find-all-permission.contract.ts +0 -13
- package/permissions/contracts/find-many-permission.contract.ts +0 -40
- package/permissions/contracts/find-permission.contract.ts +0 -13
- package/permissions/contracts/index.ts +0 -6
- package/permissions/contracts/update-permission.contract.ts +0 -17
- package/permissions/index.ts +0 -3
- package/permissions/permission.models.ts +0 -37
- package/permissions/permissions.api.ts +0 -15
- package/permissions/permisson-conditions.model.ts +0 -7
- package/roles/contracts/create-role.contract.ts +0 -16
- package/roles/contracts/delete-role.contract.ts +0 -12
- package/roles/contracts/find-many-roles.contract.ts +0 -55
- package/roles/contracts/find-role.contract.ts +0 -13
- package/roles/contracts/index.ts +0 -5
- package/roles/contracts/update-role.contract.ts +0 -17
- package/roles/index.ts +0 -3
- package/roles/role.models.ts +0 -52
- package/roles/roles.api.ts +0 -14
- package/tenants/contracts/index.ts +0 -1
- package/tenants/contracts/resolve-tenant.contract.ts +0 -32
- package/tenants/index.ts +0 -3
- package/tenants/tenant.model.ts +0 -19
- package/tenants/tenants.api.ts +0 -10
- package/translate/contracts/index.ts +0 -2
- package/translate/contracts/translate-object.contract.ts +0 -54
- package/translate/contracts/translate-text.contract.ts +0 -24
- package/translate/index.ts +0 -2
- package/translate/translate.api.ts +0 -11
- package/translate/translate.schemas.ts +0 -7
- package/translations/index.ts +0 -4
- package/translations/resolve-translation-value-type.helper.ts +0 -14
- package/translations/translation-value-type-policy.ts +0 -22
- package/translations/translation-value-types.constant.ts +0 -10
- package/translations/translation.models.ts +0 -13
- package/tsconfig.json +0 -112
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
export const APP_ERRORS = {
|
|
2
|
-
common: {
|
|
3
|
-
validation: {
|
|
4
|
-
statusCode: 400, // HttpStatus.BAD_REQUEST,
|
|
5
|
-
code: 'COMMON-01',
|
|
6
|
-
messageKey: 'errors.common.validation',
|
|
7
|
-
},
|
|
8
|
-
unauthorized: {
|
|
9
|
-
statusCode: 401, // HttpStatus.UNAUTHORIZED,
|
|
10
|
-
code: 'COMMON-02',
|
|
11
|
-
messageKey: 'errors.common.unauthorized',
|
|
12
|
-
},
|
|
13
|
-
forbidden: {
|
|
14
|
-
statusCode: 403, // HttpStatus.FORBIDDEN,
|
|
15
|
-
code: 'COMMON-03',
|
|
16
|
-
messageKey: 'errors.common.forbidden',
|
|
17
|
-
},
|
|
18
|
-
requestTimeout: {
|
|
19
|
-
statusCode: 408, // HttpStatus.REQUEST_TIMEOUT,
|
|
20
|
-
code: 'COMMON-04',
|
|
21
|
-
messageKey: 'errors.common.requestTimeout',
|
|
22
|
-
},
|
|
23
|
-
unprocessableEntity: {
|
|
24
|
-
statusCode: 422, // HttpStatus.UNPROCESSABLE_ENTITY,
|
|
25
|
-
code: 'COMMON-05',
|
|
26
|
-
messageKey: 'errors.common.unprocessableEntity',
|
|
27
|
-
},
|
|
28
|
-
internalServer: {
|
|
29
|
-
statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
30
|
-
code: 'COMMON-06',
|
|
31
|
-
messageKey: 'errors.common.internalServer',
|
|
32
|
-
},
|
|
33
|
-
// Перенести в отдельную сущность
|
|
34
|
-
// hotelClientNotConnected: {
|
|
35
|
-
// statusCode: 503, // HttpStatus.SERVICE_UNAVAILABLE,
|
|
36
|
-
// code: 'COMMON-05',
|
|
37
|
-
// message: 'Hotel client is not connected.',
|
|
38
|
-
// },
|
|
39
|
-
// hotelClientInternalError: {
|
|
40
|
-
// statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
41
|
-
// code: 'COMMON-06',
|
|
42
|
-
// message: 'Hotel client internal error.',
|
|
43
|
-
// },
|
|
44
|
-
},
|
|
45
|
-
auth: {
|
|
46
|
-
wrongCredentials: {
|
|
47
|
-
statusCode: 401, // HttpStatus.UNAUTHORIZED,
|
|
48
|
-
code: 'AUTH-01',
|
|
49
|
-
messageKey: 'errors.auth.wrongCredentials',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
translation: {
|
|
53
|
-
alreadyExists: {
|
|
54
|
-
statusCode: 409, // HttpStatus.CONFLICT,
|
|
55
|
-
code: 'TRANSLATION-02',
|
|
56
|
-
messageKey: 'errors.translation.alreadyExists',
|
|
57
|
-
},
|
|
58
|
-
entityFieldExists: {
|
|
59
|
-
statusCode: 409, // HttpStatus.CONFLICT,
|
|
60
|
-
code: 'TRANSLATION-03',
|
|
61
|
-
messageKey: 'errors.translation.entityFieldExists',
|
|
62
|
-
},
|
|
63
|
-
createFailed: {
|
|
64
|
-
statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
65
|
-
code: 'TRANSLATION-04',
|
|
66
|
-
messageKey: 'errors.translation.createFailed',
|
|
67
|
-
},
|
|
68
|
-
updateFailed: {
|
|
69
|
-
statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
70
|
-
code: 'TRANSLATION-05',
|
|
71
|
-
messageKey: 'errors.translation.updateFailed',
|
|
72
|
-
},
|
|
73
|
-
deleteFailed: {
|
|
74
|
-
statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
75
|
-
code: 'TRANSLATION-06',
|
|
76
|
-
messageKey: 'errors.translation.deleteFailed',
|
|
77
|
-
},
|
|
78
|
-
findFailed: {
|
|
79
|
-
statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
80
|
-
code: 'TRANSLATION-07',
|
|
81
|
-
messageKey: 'errors.translation.findFailed',
|
|
82
|
-
},
|
|
83
|
-
required: {
|
|
84
|
-
statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
85
|
-
code: 'TRANSLATION-08',
|
|
86
|
-
messageKey: 'errors.translation.required',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
translate: {
|
|
90
|
-
failed: {
|
|
91
|
-
statusCode: 500, // HttpStatus.INTERNAL_SERVER_ERROR,
|
|
92
|
-
code: 'TRANSLATE-01',
|
|
93
|
-
messageKey: 'errors.translate.failed',
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
user: {
|
|
97
|
-
notFound: {
|
|
98
|
-
statusCode: 404, // HttpStatus.NOT_FOUND,
|
|
99
|
-
code: 'USER-01',
|
|
100
|
-
messageKey: 'errors.user.notFound',
|
|
101
|
-
},
|
|
102
|
-
alreadyExists: {
|
|
103
|
-
statusCode: 409, // HttpStatus.CONFLICT,
|
|
104
|
-
code: 'USER-02',
|
|
105
|
-
messageKey: 'errors.user.alreadyExists',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
role: {
|
|
109
|
-
notFound: {
|
|
110
|
-
statusCode: 404, // HttpStatus.NOT_FOUND,
|
|
111
|
-
code: 'ROLE-01',
|
|
112
|
-
messageKey: 'errors.role.notFound',
|
|
113
|
-
},
|
|
114
|
-
cannotDeleteDefault: {
|
|
115
|
-
statusCode: 400, // HttpStatus.BAD_REQUEST,
|
|
116
|
-
code: 'ROLE-02',
|
|
117
|
-
messageKey: 'errors.role.cannotDeleteDefault',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
permission: {
|
|
121
|
-
notFound: {
|
|
122
|
-
statusCode: 404, // HttpStatus.NOT_FOUND,
|
|
123
|
-
code: 'PERMISSION-01',
|
|
124
|
-
messageKey: 'errors.permission.notFound',
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
hotel: {
|
|
128
|
-
notFound: {
|
|
129
|
-
statusCode: 404, // HttpStatus.NOT_FOUND,
|
|
130
|
-
code: 'HOTEL-01',
|
|
131
|
-
messageKey: 'errors.hotel.notFound',
|
|
132
|
-
},
|
|
133
|
-
alreadyExists: {
|
|
134
|
-
statusCode: 409, // HttpStatus.CONFLICT,
|
|
135
|
-
code: 'HOTEL-02',
|
|
136
|
-
messageKey: 'errors.hotel.alreadyExists',
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
roomCategory: {
|
|
140
|
-
notFound: {
|
|
141
|
-
statusCode: 404, // HttpStatus.NOT_FOUND,
|
|
142
|
-
code: 'ROOM-CATEGORY-01',
|
|
143
|
-
messageKey: 'errors.roomCategory.notFound',
|
|
144
|
-
},
|
|
145
|
-
alreadyExists: {
|
|
146
|
-
statusCode: 409, // HttpStatus.CONFLICT,
|
|
147
|
-
code: 'ROOM-CATEGORY-02',
|
|
148
|
-
messageKey: 'errors.roomCategory.alreadyExists',
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
room: {
|
|
152
|
-
notFound: {
|
|
153
|
-
statusCode: 404, // HttpStatus.NOT_FOUND,
|
|
154
|
-
code: 'ROOM-01',
|
|
155
|
-
messageKey: 'errors.room.notFound',
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
page: {
|
|
160
|
-
notFound: {
|
|
161
|
-
statusCode: 404,
|
|
162
|
-
code: 'PAGE-01',
|
|
163
|
-
messageKey: 'errors.page.notFound',
|
|
164
|
-
},
|
|
165
|
-
draft: {
|
|
166
|
-
statusCode: 404,
|
|
167
|
-
code: 'PAGE-02',
|
|
168
|
-
messageKey: 'errors.page.draft',
|
|
169
|
-
},
|
|
170
|
-
inactive: {
|
|
171
|
-
statusCode: 404,
|
|
172
|
-
code: 'PAGE-03',
|
|
173
|
-
messageKey: 'errors.page.inactive',
|
|
174
|
-
},
|
|
175
|
-
alreadyExists: {
|
|
176
|
-
statusCode: 409,
|
|
177
|
-
code: 'PAGE-04',
|
|
178
|
-
messageKey: 'errors.page.alreadyExists',
|
|
179
|
-
},
|
|
180
|
-
createFailed: {
|
|
181
|
-
statusCode: 500,
|
|
182
|
-
code: 'PAGE-05',
|
|
183
|
-
messageKey: 'errors.page.createFailed',
|
|
184
|
-
},
|
|
185
|
-
updateFailed: {
|
|
186
|
-
statusCode: 500,
|
|
187
|
-
code: 'PAGE-06',
|
|
188
|
-
messageKey: 'errors.page.updateFailed',
|
|
189
|
-
},
|
|
190
|
-
deleteFailed: {
|
|
191
|
-
statusCode: 500,
|
|
192
|
-
code: 'PAGE-07',
|
|
193
|
-
messageKey: 'errors.page.deleteFailed',
|
|
194
|
-
},
|
|
195
|
-
findFailed: {
|
|
196
|
-
statusCode: 500,
|
|
197
|
-
code: 'PAGE-08',
|
|
198
|
-
messageKey: 'errors.page.findFailed',
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
} as const;
|
|
202
|
-
|
|
203
|
-
interface IError {
|
|
204
|
-
statusCode: number;
|
|
205
|
-
code: string;
|
|
206
|
-
messageKey: string;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export type TMappedErrors<T extends Record<string, unknown>> = {
|
|
210
|
-
[k in keyof T]: T[k] extends Record<string, unknown>
|
|
211
|
-
? T[k] extends IError
|
|
212
|
-
? T[k]
|
|
213
|
-
: TMappedErrors<T[k]>
|
|
214
|
-
: never;
|
|
215
|
-
}[keyof T];
|
|
216
|
-
export type TAppError = TMappedErrors<typeof APP_ERRORS>;
|
|
217
|
-
export type TAppErrorCode = TAppError['code'];
|
|
218
|
-
export type TAppErrorMessageKey = TAppError['messageKey'];
|
|
219
|
-
|
|
220
|
-
export interface IBaseErrorDetails {
|
|
221
|
-
type?: string;
|
|
222
|
-
message?: string;
|
|
223
|
-
messageKey?: string;
|
|
224
|
-
params?: Record<string, unknown>;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export interface IErrorDetails extends IBaseErrorDetails {
|
|
228
|
-
[key: string]: string | IErrorDetails | IErrorDetails[] | Record<string, unknown> | undefined;
|
|
229
|
-
}
|
|
230
|
-
export type TAppErrorDetails = Record<string, IErrorDetails | IErrorDetails[]>;
|
|
231
|
-
|
|
232
|
-
export type TAppErrorWithDetails = TAppError & {
|
|
233
|
-
message?: string;
|
|
234
|
-
details?: TAppErrorDetails;
|
|
235
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export namespace AppStatuses {
|
|
2
|
-
export const COMMON = {
|
|
3
|
-
active: 'active',
|
|
4
|
-
disabled: 'disabled',
|
|
5
|
-
} as const;
|
|
6
|
-
export type TCommon = (typeof COMMON)[keyof typeof COMMON];
|
|
7
|
-
export const COMMON_VALUES = Object.values(COMMON) as [TCommon];
|
|
8
|
-
|
|
9
|
-
export const HOTEL = {
|
|
10
|
-
...COMMON,
|
|
11
|
-
pending: 'pending',
|
|
12
|
-
maintenance: 'maintenance',
|
|
13
|
-
archived: 'archived',
|
|
14
|
-
} as const;
|
|
15
|
-
export type THotel = (typeof HOTEL)[keyof typeof HOTEL];
|
|
16
|
-
export const HOTEL_VALUES = Object.values(HOTEL) as [THotel];
|
|
17
|
-
|
|
18
|
-
export const PAGE = {
|
|
19
|
-
...COMMON,
|
|
20
|
-
draft: 'draft',
|
|
21
|
-
scheduled: 'scheduled',
|
|
22
|
-
archived: 'archived',
|
|
23
|
-
} as const;
|
|
24
|
-
export type TPage = (typeof PAGE)[keyof typeof PAGE];
|
|
25
|
-
export const PAGE_VALUES = Object.values(PAGE) as [TPage];
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const ARRAY_SPLITTER = ',';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const ENTITIES = {
|
|
2
|
-
user: 'user',
|
|
3
|
-
role: 'role',
|
|
4
|
-
permission: 'permission',
|
|
5
|
-
hotel: 'hotel',
|
|
6
|
-
room: 'room',
|
|
7
|
-
roomCategory: 'roomCategory',
|
|
8
|
-
} as const;
|
|
9
|
-
export type TEntity = (typeof ENTITIES)[keyof typeof ENTITIES];
|
|
10
|
-
export const ENTITY_VALUES = Object.values(ENTITIES) as [TEntity, ...TEntity[]];
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
export const ICON_KEYS = {
|
|
2
|
-
//interface
|
|
3
|
-
chevronDown: 'chevronDown',
|
|
4
|
-
chevronLeft: 'chevronLeft',
|
|
5
|
-
chevronRight: 'chevronRight',
|
|
6
|
-
arrowDown: 'arrowDown',
|
|
7
|
-
arrowUp: 'arrowUp',
|
|
8
|
-
arrowLeft: 'arrowLeft',
|
|
9
|
-
ellipsis: 'ellipsis',
|
|
10
|
-
plus: 'plus',
|
|
11
|
-
moon: 'moon',
|
|
12
|
-
sun: 'sun',
|
|
13
|
-
menu: 'menu',
|
|
14
|
-
filter: 'filter',
|
|
15
|
-
resetFilter: 'resetFilter',
|
|
16
|
-
sorting: 'sorting',
|
|
17
|
-
circlePlus: 'circlePlus',
|
|
18
|
-
squarePen: 'squarePen',
|
|
19
|
-
trash: 'trash',
|
|
20
|
-
search: 'search',
|
|
21
|
-
language: 'language',
|
|
22
|
-
magic: 'magic',
|
|
23
|
-
play: 'play',
|
|
24
|
-
clock: 'clock',
|
|
25
|
-
// logos
|
|
26
|
-
logo: 'logo',
|
|
27
|
-
accorLogo: 'accorLogo',
|
|
28
|
-
ibisLogo: 'ibisLogo',
|
|
29
|
-
yandexTravelLogo: 'yandexTravelLogo',
|
|
30
|
-
ostrovokLogo: 'ostrovokLogo',
|
|
31
|
-
oneTwoTripLogo: 'oneTwoTripLogo',
|
|
32
|
-
hotel101Logo: 'hotel101Logo',
|
|
33
|
-
twoGisLogo: 'twoGisLogo',
|
|
34
|
-
// advantages
|
|
35
|
-
location: 'location',
|
|
36
|
-
hotel: 'hotel',
|
|
37
|
-
breakfast: 'breakfast',
|
|
38
|
-
pets: 'pets',
|
|
39
|
-
room: 'room',
|
|
40
|
-
sweetBed: 'sweetBed',
|
|
41
|
-
meeting: 'meeting',
|
|
42
|
-
qualityStandards: 'qualityStandards',
|
|
43
|
-
parking: 'parking',
|
|
44
|
-
banqueting: 'banqueting',
|
|
45
|
-
bar: 'bar',
|
|
46
|
-
//room
|
|
47
|
-
guests: 'guests',
|
|
48
|
-
roomSquareMeter: 'roomSquareMeter',
|
|
49
|
-
beds: 'beds',
|
|
50
|
-
//amenities
|
|
51
|
-
wifi: 'wifi',
|
|
52
|
-
tv: 'tv',
|
|
53
|
-
airConditioning: 'airConditioning',
|
|
54
|
-
shower: 'shower',
|
|
55
|
-
toiletries: 'toiletries',
|
|
56
|
-
bathrobe: 'bathrobe',
|
|
57
|
-
slippers: 'slippers',
|
|
58
|
-
safe: 'safe',
|
|
59
|
-
wardrobe: 'wardrobe',
|
|
60
|
-
bed: 'bed',
|
|
61
|
-
sofa: 'sofa',
|
|
62
|
-
hairdryer: 'hairdryer',
|
|
63
|
-
miniFridge: 'miniFridge',
|
|
64
|
-
kettle: 'kettle',
|
|
65
|
-
teaStation: 'teaStation',
|
|
66
|
-
fridge: 'fridge',
|
|
67
|
-
//conference
|
|
68
|
-
conferenceSeatingTheatre: 'conferenceSeatingTheatre',
|
|
69
|
-
conferenceSeatingClass: 'conferenceSeatingClass',
|
|
70
|
-
conferenceSeatingUShape: 'conferenceSeatingUShape',
|
|
71
|
-
conferenceSeatingCircle: 'conferenceSeatingCircle',
|
|
72
|
-
conferenceSeatingBanquet: 'conferenceSeatingBanquet',
|
|
73
|
-
|
|
74
|
-
flagGB: 'flagGB',
|
|
75
|
-
flagRU: 'flagRU',
|
|
76
|
-
} as const;
|
|
77
|
-
export type TIconKey = (typeof ICON_KEYS)[keyof typeof ICON_KEYS];
|
|
78
|
-
export const ICON_KEY_VALUES = Object.values(ICON_KEYS) as [TIconKey];
|
|
79
|
-
|
|
80
|
-
export const ICON_POSITION = {
|
|
81
|
-
start: 'start',
|
|
82
|
-
end: 'end',
|
|
83
|
-
} as const;
|
|
84
|
-
export type TIconPosition = (typeof ICON_POSITION)[keyof typeof ICON_POSITION];
|
|
85
|
-
export const ICON_POSITION_VALUES = Object.values(ICON_POSITION) as [TIconPosition];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from './app-ability.constant';
|
|
2
|
-
export * from './array-splitter.constant';
|
|
3
|
-
export * from './app-errors.constant';
|
|
4
|
-
export * from './app-statuses.constant';
|
|
5
|
-
export * from './default-pagination-config.constant';
|
|
6
|
-
export * from './entity.constant';
|
|
7
|
-
export * from './http-method.constant';
|
|
8
|
-
export * from './icon.constants';
|
|
9
|
-
export * from './kind-of-app.constant';
|
|
10
|
-
export * from './locales.constant';
|
|
11
|
-
export * from './navigation-item-type.constant';
|
|
12
|
-
export * from './order-direction.constant';
|
|
13
|
-
export * from './role-types.constant';
|
|
14
|
-
export * from './route-component-key.constants';
|
|
15
|
-
export * from './slug.constant';
|
|
16
|
-
export * from './time-zone.constant';
|
|
17
|
-
export * from './domain-name.constant';
|
|
18
|
-
export * from './translatable-field.constant';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ICON_KEYS } from './icon.constants';
|
|
2
|
-
|
|
3
|
-
export const LANGUAGES = {
|
|
4
|
-
en: {
|
|
5
|
-
value: 'en',
|
|
6
|
-
label: 'English',
|
|
7
|
-
flag: ICON_KEYS.flagGB,
|
|
8
|
-
locale: 'en-US',
|
|
9
|
-
postgressLocale: 'en_US',
|
|
10
|
-
} as const,
|
|
11
|
-
ru: {
|
|
12
|
-
value: 'ru',
|
|
13
|
-
label: 'Русский',
|
|
14
|
-
flag: ICON_KEYS.flagRU,
|
|
15
|
-
locale: 'ru-RU',
|
|
16
|
-
postgressLocale: 'ru_RU',
|
|
17
|
-
} as const,
|
|
18
|
-
} as const;
|
|
19
|
-
|
|
20
|
-
export type TLanguage = keyof typeof LANGUAGES;
|
|
21
|
-
export type TLanguageValues = (typeof LANGUAGES)[keyof typeof LANGUAGES];
|
|
22
|
-
|
|
23
|
-
export type TLocale = (typeof LANGUAGES)[TLanguage]['locale'];
|
|
24
|
-
export type TPostgresLocale = (typeof LANGUAGES)[TLanguage]['postgressLocale'];
|
|
25
|
-
|
|
26
|
-
export const LANGUAGE_KEYS = Object.keys(LANGUAGES) as [TLanguage, ...TLanguage[]];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const ORDER_DIRECTION = {
|
|
2
|
-
asc: 'asc',
|
|
3
|
-
desc: 'desc',
|
|
4
|
-
} as const;
|
|
5
|
-
|
|
6
|
-
export type TOrderDirection = (typeof ORDER_DIRECTION)[keyof typeof ORDER_DIRECTION];
|
|
7
|
-
export const ORDER_DIRECTION_VALUES = Object.values(ORDER_DIRECTION) as [
|
|
8
|
-
TOrderDirection,
|
|
9
|
-
...TOrderDirection[],
|
|
10
|
-
];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const ROLE_TYPES = {
|
|
2
|
-
superAdmin: 'superAdmin',
|
|
3
|
-
system: 'system',
|
|
4
|
-
hotel: 'hotel',
|
|
5
|
-
guest: 'guest',
|
|
6
|
-
} as const;
|
|
7
|
-
export type TRoleType = (typeof ROLE_TYPES)[keyof typeof ROLE_TYPES];
|
|
8
|
-
export const ROLE_TYPE_VALUES = Object.values(ROLE_TYPES) as [TRoleType];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const TRANSLATABLE_FIELDS = {
|
|
2
|
-
name: 'name',
|
|
3
|
-
description: 'description',
|
|
4
|
-
} as const;
|
|
5
|
-
|
|
6
|
-
export type TTranslatableField = (typeof TRANSLATABLE_FIELDS)[keyof typeof TRANSLATABLE_FIELDS];
|
|
7
|
-
export const TRANSLATABLE_FIELD_VALUES = Object.values(TRANSLATABLE_FIELDS) as [
|
|
8
|
-
TTranslatableField,
|
|
9
|
-
...TTranslatableField[],
|
|
10
|
-
];
|
package/common/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
|
|
3
|
-
export const BooleanQueryParamSchema = z.union([z.boolean(), z.string()]).transform(value => {
|
|
4
|
-
if (typeof value === 'boolean') return value;
|
|
5
|
-
const v = value.trim().toLowerCase();
|
|
6
|
-
if (v === 'true' || v === '1' || v === 'yes') return true;
|
|
7
|
-
if (v === 'false' || v === '0' || v === 'no') return false;
|
|
8
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
import { OrderSchema } from './order.schema';
|
|
3
|
-
import { PaginationRequestSchema } from './pagination.schema';
|
|
4
|
-
import { SearchSchema } from './search.schema';
|
|
5
|
-
|
|
6
|
-
export const CommonQueryParamsSchema = OrderSchema.extend({
|
|
7
|
-
...SearchSchema.shape,
|
|
8
|
-
...PaginationRequestSchema.shape,
|
|
9
|
-
});
|
|
10
|
-
export type TCommonQueryParams = z.infer<typeof CommonQueryParamsSchema>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
import { DOMAIN_NAME_CONFIG } from '../constants';
|
|
3
|
-
|
|
4
|
-
export const DomainNameSchema = z
|
|
5
|
-
.string()
|
|
6
|
-
.min(DOMAIN_NAME_CONFIG.minLength)
|
|
7
|
-
.max(DOMAIN_NAME_CONFIG.maxLength)
|
|
8
|
-
.refine(value => DOMAIN_NAME_CONFIG.regex.test(value), {
|
|
9
|
-
params: {
|
|
10
|
-
messageKey: DOMAIN_NAME_CONFIG.messageKey,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export type TDomainName = z.infer<typeof DomainNameSchema>;
|
package/common/models/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './boolean-query-param.schema';
|
|
2
|
-
export * from './common-query-params.schema';
|
|
3
|
-
export * from './icon-key.schema';
|
|
4
|
-
export * from './info.schema';
|
|
5
|
-
export * from './navigation-item.schemas';
|
|
6
|
-
export * from './order.schema';
|
|
7
|
-
export * from './pagination.schema';
|
|
8
|
-
export * from './search.schema';
|
|
9
|
-
export * from './slug.schema';
|
|
10
|
-
export * from './timestamp.schemas';
|
|
11
|
-
export * from './timezone.schema';
|
|
12
|
-
export * from './language-keys.schema';
|
|
13
|
-
export * from './translations.schemas';
|
|
14
|
-
export * from './uuid.schemas';
|
|
15
|
-
export * from './domain-name.schema';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
import { ROUTE_COMPONENT_KEYS } from '../constants';
|
|
3
|
-
import { NAVIGATION_ITEM_TYPES } from '../constants';
|
|
4
|
-
import { IconKeySchema } from './icon-key.schema';
|
|
5
|
-
import { TimestampSchema } from './timestamp.schemas';
|
|
6
|
-
|
|
7
|
-
export const NavigationItemEntityBaseSchema = z
|
|
8
|
-
.object({
|
|
9
|
-
id: z.number().int().positive(),
|
|
10
|
-
parentId: z.nullable(z.number().int().positive()),
|
|
11
|
-
label: z.string().min(1),
|
|
12
|
-
description: z.nullable(z.string().min(1)),
|
|
13
|
-
iconKey: z.nullable(IconKeySchema),
|
|
14
|
-
link: z.nullable(z.string().min(1)),
|
|
15
|
-
routeComponentKey: z.nullable(z.enum(ROUTE_COMPONENT_KEYS)),
|
|
16
|
-
type: z.enum(NAVIGATION_ITEM_TYPES),
|
|
17
|
-
disabled: z.boolean(),
|
|
18
|
-
order: z.number().int().positive(),
|
|
19
|
-
})
|
|
20
|
-
.extend(TimestampSchema.shape);
|
|
21
|
-
|
|
22
|
-
export type TNavigationItemEntityBase = z.infer<typeof NavigationItemEntityBaseSchema>;
|
|
23
|
-
export type TNavigationItemEntity = TNavigationItemEntityBase & {
|
|
24
|
-
children?: TNavigationItemEntity[];
|
|
25
|
-
};
|
|
26
|
-
export const NavigationItemEntitySchema: z.ZodType<TNavigationItemEntity> =
|
|
27
|
-
NavigationItemEntityBaseSchema.extend({
|
|
28
|
-
children: z.lazy(() => z.array(NavigationItemEntitySchema).optional()),
|
|
29
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
import { DEFAULT_PAGINATION_CONFIG } from '../constants';
|
|
3
|
-
|
|
4
|
-
export const PaginationResponseSchema = z.object({
|
|
5
|
-
page: z.coerce.number().positive(),
|
|
6
|
-
pageSize: z.coerce.number().positive(),
|
|
7
|
-
total: z.coerce.number().nonnegative(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const PaginationRequestSchema = z.object({
|
|
11
|
-
page: z.coerce.number().positive().optional().default(DEFAULT_PAGINATION_CONFIG.page),
|
|
12
|
-
pageSize: z.coerce
|
|
13
|
-
.number()
|
|
14
|
-
.positive()
|
|
15
|
-
.optional()
|
|
16
|
-
.default(DEFAULT_PAGINATION_CONFIG.pageSize)
|
|
17
|
-
.transform(val => Math.min(val, DEFAULT_PAGINATION_CONFIG.maxPageSize)),
|
|
18
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
import { SLUG_CONFIG } from '../constants';
|
|
3
|
-
|
|
4
|
-
export const SlugSchema = z
|
|
5
|
-
.string()
|
|
6
|
-
.trim()
|
|
7
|
-
.min(SLUG_CONFIG.minLength)
|
|
8
|
-
.max(SLUG_CONFIG.maxLength)
|
|
9
|
-
.refine(value => SLUG_CONFIG.regex.test(value), {
|
|
10
|
-
params: {
|
|
11
|
-
messageKey: SLUG_CONFIG.messageKey,
|
|
12
|
-
},
|
|
13
|
-
})
|
|
14
|
-
.toLowerCase();
|