@escapenavigator/types 1.10.130 → 1.10.131
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/dist/certificate-v2/certificate-settings.ro.d.ts +2 -0
- package/dist/certificate-v2/certificate-settings.ro.js +8 -0
- package/dist/certificate-v2/update-certificate-settings.dto.d.ts +2 -0
- package/dist/certificate-v2/update-certificate-settings.dto.js +12 -0
- package/dist/openapi/certificates-v2/openapi-certificates-shop.ro.d.ts +2 -0
- package/dist/openapi/certificates-v2/openapi-certificates-shop.ro.js +8 -0
- package/dist/openapi/shared/openapi-questroom.ro.d.ts +2 -41
- package/dist/openapi/shared/openapi-questroom.ro.js +8 -4
- package/dist/openapi/widget/openapi-resolve-promocode.ro.d.ts +7 -0
- package/dist/openapi/widget/openapi-resolve-promocode.ro.js +5 -0
- package/dist/openapi/widget/openapi-widget-info.ro.js +5 -1
- package/dist/promocode/create-promocode.dto.d.ts +7 -0
- package/dist/promocode/create-promocode.dto.js +8 -0
- package/dist/promocode/emun/promocode-certificate-mode.enum.d.ts +18 -0
- package/dist/promocode/emun/promocode-certificate-mode.enum.js +22 -0
- package/dist/promocode/promocode-nominal-rule.d.ts +14 -5
- package/dist/promocode/promocode.ro.d.ts +2 -0
- package/dist/promocode/promocode.ro.js +5 -0
- package/dist/questroom/create-questroom-admin.dto.js +6 -5
- package/dist/questroom/create-questroom.dto.js +7 -6
- package/dist/questroom/enum/questroom-type.enum.d.ts +2 -1
- package/dist/questroom/enum/questroom-type.enum.js +1 -0
- package/dist/questroom/lounge-questroom.d.ts +11 -0
- package/dist/questroom/lounge-questroom.js +36 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/widget-sessions/widget-session-attach-order.dto.d.ts +11 -0
- package/dist/widget-sessions/widget-session-attach-order.dto.js +42 -0
- package/dist/widget-sessions/widget-session-events.ro.d.ts +8 -0
- package/dist/widget-sessions/widget-session-events.ro.js +2 -0
- package/dist/widget-sessions/widget-session-query.dto.d.ts +15 -0
- package/dist/widget-sessions/widget-session-query.dto.js +63 -0
- package/dist/widget-sessions/widget-session-update.dto.d.ts +6 -0
- package/dist/widget-sessions/widget-session-update.dto.js +27 -0
- package/dist/widget-sessions/widget-session.ro.d.ts +50 -0
- package/dist/widget-sessions/widget-session.ro.js +2 -0
- package/package.json +2 -2
|
@@ -9,6 +9,8 @@ export declare class CertificateSettingsRO extends RO {
|
|
|
9
9
|
pickupAvailable: boolean;
|
|
10
10
|
pickupInfo: string;
|
|
11
11
|
deliveryInfo: string;
|
|
12
|
+
shopTitle: string;
|
|
13
|
+
shopSubtitle: string;
|
|
12
14
|
onlinePaymentsCashbox: number | null;
|
|
13
15
|
squareCashbox: number | null;
|
|
14
16
|
paypalCashbox: number | null;
|
|
@@ -51,6 +51,14 @@ __decorate([
|
|
|
51
51
|
(0, class_transformer_1.Expose)(),
|
|
52
52
|
__metadata("design:type", String)
|
|
53
53
|
], CertificateSettingsRO.prototype, "deliveryInfo", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_transformer_1.Expose)(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], CertificateSettingsRO.prototype, "shopTitle", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_transformer_1.Expose)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], CertificateSettingsRO.prototype, "shopSubtitle", void 0);
|
|
54
62
|
__decorate([
|
|
55
63
|
(0, class_transformer_1.Expose)(),
|
|
56
64
|
__metadata("design:type", Number)
|
|
@@ -7,6 +7,8 @@ export declare class UpdateCertificateSettingsDto {
|
|
|
7
7
|
pickupAvailable?: boolean;
|
|
8
8
|
pickupInfo?: string;
|
|
9
9
|
deliveryInfo?: string;
|
|
10
|
+
shopTitle?: string;
|
|
11
|
+
shopSubtitle?: string;
|
|
10
12
|
onlinePaymentsCashbox?: number | null;
|
|
11
13
|
squareCashbox?: number | null;
|
|
12
14
|
paypalCashbox?: number | null;
|
|
@@ -75,6 +75,18 @@ __decorate([
|
|
|
75
75
|
(0, class_transformer_1.Expose)(),
|
|
76
76
|
__metadata("design:type", String)
|
|
77
77
|
], UpdateCertificateSettingsDto.prototype, "deliveryInfo", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.IsString)(),
|
|
81
|
+
(0, class_transformer_1.Expose)(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], UpdateCertificateSettingsDto.prototype, "shopTitle", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
(0, class_validator_1.IsString)(),
|
|
87
|
+
(0, class_transformer_1.Expose)(),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], UpdateCertificateSettingsDto.prototype, "shopSubtitle", void 0);
|
|
78
90
|
__decorate([
|
|
79
91
|
(0, class_validator_1.IsOptional)(),
|
|
80
92
|
(0, class_transformer_1.Expose)(),
|
|
@@ -9,6 +9,8 @@ export declare class OpenapiCertificateSettingsRO {
|
|
|
9
9
|
pickupAvailable: boolean;
|
|
10
10
|
pickupInfo: string;
|
|
11
11
|
deliveryInfo: string;
|
|
12
|
+
shopTitle: string;
|
|
13
|
+
shopSubtitle: string;
|
|
12
14
|
}
|
|
13
15
|
export declare class OpenapiCertificatesShopRO {
|
|
14
16
|
settings: OpenapiCertificateSettingsRO;
|
|
@@ -48,6 +48,14 @@ __decorate([
|
|
|
48
48
|
(0, class_transformer_1.Expose)(),
|
|
49
49
|
__metadata("design:type", String)
|
|
50
50
|
], OpenapiCertificateSettingsRO.prototype, "deliveryInfo", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_transformer_1.Expose)(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], OpenapiCertificateSettingsRO.prototype, "shopTitle", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_transformer_1.Expose)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], OpenapiCertificateSettingsRO.prototype, "shopSubtitle", void 0);
|
|
51
59
|
class OpenapiCertificatesShopRO {
|
|
52
60
|
}
|
|
53
61
|
exports.OpenapiCertificatesShopRO = OpenapiCertificatesShopRO;
|
|
@@ -3,48 +3,9 @@ import { QuestroomTypeEnum } from '../../questroom/enum/questroom-type.enum';
|
|
|
3
3
|
import { Languages } from '../../shared/enum/languages.enum';
|
|
4
4
|
import { SlotTemplateType } from '../../slot-template/slot-template-type';
|
|
5
5
|
export declare const transformQuestroom: ({ value, language, }: {
|
|
6
|
-
value: OpenapiQuestroomRO;
|
|
6
|
+
value: OpenapiQuestroomRO | undefined | null;
|
|
7
7
|
language: any;
|
|
8
|
-
}) =>
|
|
9
|
-
title: string;
|
|
10
|
-
importantInfo: string;
|
|
11
|
-
location: {
|
|
12
|
-
howToFind: string;
|
|
13
|
-
prepareText: string;
|
|
14
|
-
address: string;
|
|
15
|
-
phone: string;
|
|
16
|
-
sortPosition: number;
|
|
17
|
-
timeZone: string;
|
|
18
|
-
};
|
|
19
|
-
id: number;
|
|
20
|
-
fear: number;
|
|
21
|
-
difficult: number;
|
|
22
|
-
photo: string;
|
|
23
|
-
time: number;
|
|
24
|
-
ticketSystem: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Type of the linked SlotTemplate (`fixed` or `flex`). Denormalized from
|
|
27
|
-
* `SlotTemplate.type` so widgets can branch on the schedule kind without
|
|
28
|
-
* an extra fetch.
|
|
29
|
-
*/
|
|
30
|
-
templateType?: SlotTemplateType;
|
|
31
|
-
type: QuestroomTypeEnum;
|
|
32
|
-
confirmType: QuestroomConfirmTypeEnum;
|
|
33
|
-
playersMax: number;
|
|
34
|
-
disabledLanguages: Languages[];
|
|
35
|
-
playersMin: number;
|
|
36
|
-
sortPosition: number;
|
|
37
|
-
onlinePaymentsCashbox: number;
|
|
38
|
-
squareCashbox: number;
|
|
39
|
-
daysForBooking: number;
|
|
40
|
-
bsCashbox: number;
|
|
41
|
-
paypalCashbox: number;
|
|
42
|
-
modes: Mode[];
|
|
43
|
-
minAge: number;
|
|
44
|
-
flexPlayersSelect: boolean;
|
|
45
|
-
slotStepMinutes: number;
|
|
46
|
-
questOpeningDate?: string;
|
|
47
|
-
};
|
|
8
|
+
}) => any;
|
|
48
9
|
declare class QuestroomLocale {
|
|
49
10
|
title: string;
|
|
50
11
|
legend: string;
|
|
@@ -28,10 +28,14 @@ const questroom_type_enum_1 = require("../../questroom/enum/questroom-type.enum"
|
|
|
28
28
|
const languages_enum_1 = require("../../shared/enum/languages.enum");
|
|
29
29
|
const transformQuestroom = ({ value, language, }) => {
|
|
30
30
|
var _a, _b, _c, _d;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if (!value)
|
|
32
|
+
return value;
|
|
33
|
+
const { locales, location } = value, questroom = __rest(value, ["locales", "location"]);
|
|
34
|
+
const _e = location || {}, { locales: locationLocales } = _e, locationRest = __rest(_e, ["locales"]);
|
|
35
|
+
return Object.assign(Object.assign({}, questroom), { title: ((_a = locales === null || locales === void 0 ? void 0 : locales.find((l) => l.language === language)) === null || _a === void 0 ? void 0 : _a.title) || questroom.title, importantInfo: ((_b = locales === null || locales === void 0 ? void 0 : locales.find((l) => l.language === language)) === null || _b === void 0 ? void 0 : _b.importantInfo) || questroom.importantInfo, location: location
|
|
36
|
+
? Object.assign(Object.assign({}, locationRest), { howToFind: ((_c = locationLocales === null || locationLocales === void 0 ? void 0 : locationLocales.find((l) => l.language === language)) === null || _c === void 0 ? void 0 : _c.howToFind) ||
|
|
37
|
+
locationRest.howToFind, prepareText: ((_d = locationLocales === null || locationLocales === void 0 ? void 0 : locationLocales.find((l) => l.language === language)) === null || _d === void 0 ? void 0 : _d.prepareText) ||
|
|
38
|
+
locationRest.prepareText }) : location });
|
|
35
39
|
};
|
|
36
40
|
exports.transformQuestroom = transformQuestroom;
|
|
37
41
|
class QuestroomLocale {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PromocodeCertificateModeEnum } from '../../promocode/emun/promocode-certificate-mode.enum';
|
|
1
2
|
import { PromocodeTypeEnum } from '../../promocode/emun/promocode-type.enum';
|
|
2
3
|
import { PromocodeNominalRule } from '../../promocode/promocode-nominal-rule';
|
|
3
4
|
/**
|
|
@@ -28,6 +29,12 @@ export declare class OpenapiPromocodeWidgetRO {
|
|
|
28
29
|
minPlayers?: number;
|
|
29
30
|
maxPlayers?: number;
|
|
30
31
|
certificateNominalRules: PromocodeNominalRule[];
|
|
32
|
+
/**
|
|
33
|
+
* Режим действия для сертификатов: 'discount' (скидка на цену) или
|
|
34
|
+
* 'bonus' (бонус к номиналу). Для промокодов «на игры» приходит
|
|
35
|
+
* `null` — поле игнорируется виджетом.
|
|
36
|
+
*/
|
|
37
|
+
certificateMode: PromocodeCertificateModeEnum | null;
|
|
31
38
|
}
|
|
32
39
|
export declare class OpenapiResolvePromocodeRO {
|
|
33
40
|
valid: boolean;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.OpenapiResolvePromocodeRO = exports.OpenapiPromocodeWidgetRO = void 0;
|
|
13
13
|
/* eslint-disable max-classes-per-file */
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const promocode_certificate_mode_enum_1 = require("../../promocode/emun/promocode-certificate-mode.enum");
|
|
15
16
|
const promocode_type_enum_1 = require("../../promocode/emun/promocode-type.enum");
|
|
16
17
|
/**
|
|
17
18
|
* Slim-DTO промокода для виджета. Содержит только поля, нужные для фронтового
|
|
@@ -106,6 +107,10 @@ __decorate([
|
|
|
106
107
|
(0, class_transformer_1.Expose)(),
|
|
107
108
|
__metadata("design:type", Array)
|
|
108
109
|
], OpenapiPromocodeWidgetRO.prototype, "certificateNominalRules", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, class_transformer_1.Expose)(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], OpenapiPromocodeWidgetRO.prototype, "certificateMode", void 0);
|
|
109
114
|
class OpenapiResolvePromocodeRO {
|
|
110
115
|
}
|
|
111
116
|
exports.OpenapiResolvePromocodeRO = OpenapiResolvePromocodeRO;
|
|
@@ -184,7 +184,11 @@ __decorate([
|
|
|
184
184
|
__decorate([
|
|
185
185
|
(0, class_transformer_1.Expose)(),
|
|
186
186
|
(0, class_transformer_1.Type)(() => openapi_questroom_ro_1.OpenapiQuestroomRO),
|
|
187
|
-
(0, class_transformer_1.Transform)(({ value, obj }) =>
|
|
187
|
+
(0, class_transformer_1.Transform)(({ value, obj }) => Array.isArray(value)
|
|
188
|
+
? value
|
|
189
|
+
.filter(Boolean)
|
|
190
|
+
.map((questroom) => (0, openapi_questroom_ro_1.transformQuestroom)({ value: questroom, language: obj === null || obj === void 0 ? void 0 : obj.language }))
|
|
191
|
+
: []),
|
|
188
192
|
__metadata("design:type", Array)
|
|
189
193
|
], OpenapiWidgetInfoRO.prototype, "questrooms", void 0);
|
|
190
194
|
__decorate([
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PromocodeCertificateModeEnum } from './emun/promocode-certificate-mode.enum';
|
|
1
2
|
import { PromocodeKindEnum } from './emun/promocode-kind.enum';
|
|
2
3
|
import { PromocodeTypeEnum } from './emun/promocode-type.enum';
|
|
3
4
|
export declare class PromocodeNominalRuleDto {
|
|
@@ -29,6 +30,12 @@ export declare class CreatePromocodeDto {
|
|
|
29
30
|
minPlayers: number;
|
|
30
31
|
maxPlayers: number;
|
|
31
32
|
certificateNominalRules?: PromocodeNominalRuleDto[];
|
|
33
|
+
/**
|
|
34
|
+
* Режим действия промокода для сертификатов. Используется только при
|
|
35
|
+
* `availableForCertificates === true`. Если не задан — трактуем как
|
|
36
|
+
* `DISCOUNT` (легаси-семантика: скидка на цену сертификата).
|
|
37
|
+
*/
|
|
38
|
+
certificateMode?: PromocodeCertificateModeEnum;
|
|
32
39
|
/**
|
|
33
40
|
* Происхождение промокода. Обычно проставляется сервером:
|
|
34
41
|
* - `MANUAL` (default) — для ручного создания из CRM,
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CreatePromocodeDto = exports.PromocodeNominalRuleDto = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const promocode_certificate_mode_enum_1 = require("./emun/promocode-certificate-mode.enum");
|
|
15
16
|
const promocode_kind_enum_1 = require("./emun/promocode-kind.enum");
|
|
16
17
|
const promocode_type_enum_1 = require("./emun/promocode-type.enum");
|
|
17
18
|
class PromocodeNominalRuleDto {
|
|
@@ -172,6 +173,13 @@ __decorate([
|
|
|
172
173
|
(0, class_transformer_1.Expose)(),
|
|
173
174
|
__metadata("design:type", Array)
|
|
174
175
|
], CreatePromocodeDto.prototype, "certificateNominalRules", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, class_validator_1.IsOptional)(),
|
|
178
|
+
(0, class_validator_1.IsEnum)(promocode_certificate_mode_enum_1.PromocodeCertificateModeEnum),
|
|
179
|
+
(0, class_transformer_1.Transform)(({ value }) => value !== null && value !== void 0 ? value : promocode_certificate_mode_enum_1.PromocodeCertificateModeEnum.DISCOUNT),
|
|
180
|
+
(0, class_transformer_1.Expose)(),
|
|
181
|
+
__metadata("design:type", String)
|
|
182
|
+
], CreatePromocodeDto.prototype, "certificateMode", void 0);
|
|
175
183
|
__decorate([
|
|
176
184
|
(0, class_validator_1.IsOptional)(),
|
|
177
185
|
(0, class_validator_1.IsEnum)(promocode_kind_enum_1.PromocodeKindEnum),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Режим действия промокода в части сертификатов.
|
|
3
|
+
*
|
|
4
|
+
* - `DISCOUNT` — историческое поведение: значение из правила
|
|
5
|
+
* `certificateNominalRules[i].discount` уменьшает цену покупки сертификата
|
|
6
|
+
* (попадает в `payed`/`promocodeTotal`, при этом номинал сертификата
|
|
7
|
+
* остаётся прежним).
|
|
8
|
+
* - `BONUS` — то же значение трактуется как бонус: цена покупки не меняется,
|
|
9
|
+
* но к усваиваемому балансу сертификата прибавляется указанная сумма
|
|
10
|
+
* (клиент платит как обычно, а тратить потом может больше).
|
|
11
|
+
*
|
|
12
|
+
* Поле действует только когда `availableForCertificates === true`.
|
|
13
|
+
* Для промокодов «на игры» (`availableForBookings`) значение игнорируется.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum PromocodeCertificateModeEnum {
|
|
16
|
+
DISCOUNT = "discount",
|
|
17
|
+
BONUS = "bonus"
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PromocodeCertificateModeEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Режим действия промокода в части сертификатов.
|
|
6
|
+
*
|
|
7
|
+
* - `DISCOUNT` — историческое поведение: значение из правила
|
|
8
|
+
* `certificateNominalRules[i].discount` уменьшает цену покупки сертификата
|
|
9
|
+
* (попадает в `payed`/`promocodeTotal`, при этом номинал сертификата
|
|
10
|
+
* остаётся прежним).
|
|
11
|
+
* - `BONUS` — то же значение трактуется как бонус: цена покупки не меняется,
|
|
12
|
+
* но к усваиваемому балансу сертификата прибавляется указанная сумма
|
|
13
|
+
* (клиент платит как обычно, а тратить потом может больше).
|
|
14
|
+
*
|
|
15
|
+
* Поле действует только когда `availableForCertificates === true`.
|
|
16
|
+
* Для промокодов «на игры» (`availableForBookings`) значение игнорируется.
|
|
17
|
+
*/
|
|
18
|
+
var PromocodeCertificateModeEnum;
|
|
19
|
+
(function (PromocodeCertificateModeEnum) {
|
|
20
|
+
PromocodeCertificateModeEnum["DISCOUNT"] = "discount";
|
|
21
|
+
PromocodeCertificateModeEnum["BONUS"] = "bonus";
|
|
22
|
+
})(PromocodeCertificateModeEnum || (exports.PromocodeCertificateModeEnum = PromocodeCertificateModeEnum = {}));
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Правило применения промокода к конкретному номиналу сертификата.
|
|
3
3
|
*
|
|
4
|
-
* Используется только для сертификатной части
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
4
|
+
* Используется только для сертификатной части промокода (`availableForCertificates`).
|
|
5
|
+
* Поле `discount` хранит сумму в минимальных единицах валюты (копейки/центы) и
|
|
6
|
+
* интерпретируется в зависимости от `PromocodeRO.certificateMode`:
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* - `DISCOUNT` (легаси, по умолчанию) — сумма вычитается из цены покупки
|
|
9
|
+
* сертификата вместо базового `nominal.discount`.
|
|
10
|
+
* - `BONUS` — сумма прибавляется к балансу сертификата (цена покупки
|
|
11
|
+
* не меняется, клиент получает «бонус сверху номинала»).
|
|
12
|
+
*
|
|
13
|
+
* Если для номинала правила нет — промокод к этому номиналу **не применим**
|
|
14
|
+
* (магазин показывает базовую скидку номинала, бонус не начисляется).
|
|
15
|
+
*
|
|
16
|
+
* Имя поля `discount` сохранено ради обратной совместимости со старым
|
|
17
|
+
* фронтом, схемой БД и сериализацией. Семантическое значение «скидка/бонус»
|
|
18
|
+
* определяется флагом `certificateMode` родительского промокода.
|
|
10
19
|
*/
|
|
11
20
|
export type PromocodeNominalRule = {
|
|
12
21
|
nominalId: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RO } from '../shared/ro-class';
|
|
2
|
+
import { PromocodeCertificateModeEnum } from './emun/promocode-certificate-mode.enum';
|
|
2
3
|
import { PromocodeKindEnum } from './emun/promocode-kind.enum';
|
|
3
4
|
import { PromocodeTypeEnum } from './emun/promocode-type.enum';
|
|
4
5
|
import { PromocodeNominalRule } from './promocode-nominal-rule';
|
|
@@ -30,5 +31,6 @@ export declare class PromocodeRO extends RO {
|
|
|
30
31
|
maxPlayers: number;
|
|
31
32
|
orderId: number;
|
|
32
33
|
certificateNominalRules: PromocodeNominalRule[];
|
|
34
|
+
certificateMode: PromocodeCertificateModeEnum | null;
|
|
33
35
|
kind: PromocodeKindEnum;
|
|
34
36
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.PromocodeRO = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const ro_class_1 = require("../shared/ro-class");
|
|
15
|
+
const promocode_certificate_mode_enum_1 = require("./emun/promocode-certificate-mode.enum");
|
|
15
16
|
const promocode_kind_enum_1 = require("./emun/promocode-kind.enum");
|
|
16
17
|
const promocode_type_enum_1 = require("./emun/promocode-type.enum");
|
|
17
18
|
class PromocodeRO extends ro_class_1.RO {
|
|
@@ -125,6 +126,10 @@ __decorate([
|
|
|
125
126
|
(0, class_transformer_1.Expose)(),
|
|
126
127
|
__metadata("design:type", Array)
|
|
127
128
|
], PromocodeRO.prototype, "certificateNominalRules", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, class_transformer_1.Expose)(),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], PromocodeRO.prototype, "certificateMode", void 0);
|
|
128
133
|
__decorate([
|
|
129
134
|
(0, class_transformer_1.Expose)(),
|
|
130
135
|
__metadata("design:type", String)
|
|
@@ -16,6 +16,7 @@ const class_validator_1 = require("class-validator");
|
|
|
16
16
|
const tags_enum_1 = require("../shared/enum/tags.enum");
|
|
17
17
|
const is_not_blank_1 = require("../shared/is-not-blank");
|
|
18
18
|
const questroom_type_enum_1 = require("./enum/questroom-type.enum");
|
|
19
|
+
const lounge_questroom_1 = require("./lounge-questroom");
|
|
19
20
|
class CreateQuestroomAdminDto {
|
|
20
21
|
}
|
|
21
22
|
exports.CreateQuestroomAdminDto = CreateQuestroomAdminDto;
|
|
@@ -62,7 +63,7 @@ __decorate([
|
|
|
62
63
|
__metadata("design:type", String)
|
|
63
64
|
], CreateQuestroomAdminDto.prototype, "importantInfo", void 0);
|
|
64
65
|
__decorate([
|
|
65
|
-
(0, class_validator_1.ValidateIf)(
|
|
66
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
66
67
|
(0, class_validator_1.IsArray)(),
|
|
67
68
|
(0, class_validator_1.ArrayMinSize)(1),
|
|
68
69
|
(0, class_validator_1.ArrayMaxSize)(10),
|
|
@@ -82,7 +83,7 @@ __decorate([
|
|
|
82
83
|
__metadata("design:type", String)
|
|
83
84
|
], CreateQuestroomAdminDto.prototype, "type", void 0);
|
|
84
85
|
__decorate([
|
|
85
|
-
(0, class_validator_1.ValidateIf)(
|
|
86
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
86
87
|
(0, class_validator_1.IsPositive)(),
|
|
87
88
|
(0, class_validator_1.Max)(6),
|
|
88
89
|
(0, class_validator_1.Min)(1),
|
|
@@ -91,7 +92,7 @@ __decorate([
|
|
|
91
92
|
__metadata("design:type", Number)
|
|
92
93
|
], CreateQuestroomAdminDto.prototype, "difficult", void 0);
|
|
93
94
|
__decorate([
|
|
94
|
-
(0, class_validator_1.ValidateIf)(
|
|
95
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
95
96
|
(0, class_validator_1.IsPositive)(),
|
|
96
97
|
(0, class_validator_1.Max)(5),
|
|
97
98
|
(0, class_validator_1.Min)(1),
|
|
@@ -100,14 +101,14 @@ __decorate([
|
|
|
100
101
|
__metadata("design:type", Number)
|
|
101
102
|
], CreateQuestroomAdminDto.prototype, "fear", void 0);
|
|
102
103
|
__decorate([
|
|
103
|
-
(0, class_validator_1.ValidateIf)(
|
|
104
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
104
105
|
(0, class_validator_1.IsInt)(),
|
|
105
106
|
(0, class_transformer_1.Transform)(({ value }) => value || 12),
|
|
106
107
|
(0, class_transformer_1.Expose)(),
|
|
107
108
|
__metadata("design:type", Number)
|
|
108
109
|
], CreateQuestroomAdminDto.prototype, "minAge", void 0);
|
|
109
110
|
__decorate([
|
|
110
|
-
(0, class_validator_1.ValidateIf)(
|
|
111
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
111
112
|
(0, class_validator_1.IsPositive)(),
|
|
112
113
|
(0, class_transformer_1.Transform)(({ value }) => value || 60),
|
|
113
114
|
(0, class_transformer_1.Expose)(),
|
|
@@ -19,6 +19,7 @@ const is_not_blank_1 = require("../shared/is-not-blank");
|
|
|
19
19
|
const questroom_actors_enum_1 = require("./enum/questroom-actors.enum");
|
|
20
20
|
const questroom_confirm_type_enum_1 = require("./enum/questroom-confirm-type.enum");
|
|
21
21
|
const questroom_type_enum_1 = require("./enum/questroom-type.enum");
|
|
22
|
+
const lounge_questroom_1 = require("./lounge-questroom");
|
|
22
23
|
class Locale {
|
|
23
24
|
}
|
|
24
25
|
__decorate([
|
|
@@ -109,7 +110,7 @@ __decorate([
|
|
|
109
110
|
__metadata("design:type", String)
|
|
110
111
|
], CreateQuestroomDto.prototype, "actors", void 0);
|
|
111
112
|
__decorate([
|
|
112
|
-
(0, class_validator_1.ValidateIf)(
|
|
113
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
113
114
|
(0, class_validator_1.IsPositive)(),
|
|
114
115
|
(0, class_validator_1.Max)(6),
|
|
115
116
|
(0, class_validator_1.Min)(1),
|
|
@@ -118,7 +119,7 @@ __decorate([
|
|
|
118
119
|
__metadata("design:type", Number)
|
|
119
120
|
], CreateQuestroomDto.prototype, "difficult", void 0);
|
|
120
121
|
__decorate([
|
|
121
|
-
(0, class_validator_1.ValidateIf)(
|
|
122
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
122
123
|
(0, class_validator_1.IsPositive)(),
|
|
123
124
|
(0, class_validator_1.Max)(5),
|
|
124
125
|
(0, class_validator_1.Min)(1),
|
|
@@ -127,7 +128,7 @@ __decorate([
|
|
|
127
128
|
__metadata("design:type", Number)
|
|
128
129
|
], CreateQuestroomDto.prototype, "fear", void 0);
|
|
129
130
|
__decorate([
|
|
130
|
-
(0, class_validator_1.ValidateIf)(
|
|
131
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
131
132
|
(0, class_validator_1.IsInt)(),
|
|
132
133
|
(0, class_transformer_1.Transform)(({ value }) => value || 12),
|
|
133
134
|
(0, class_transformer_1.Expose)(),
|
|
@@ -176,7 +177,7 @@ __decorate([
|
|
|
176
177
|
__metadata("design:type", Boolean)
|
|
177
178
|
], CreateQuestroomDto.prototype, "awailableForNavigator", void 0);
|
|
178
179
|
__decorate([
|
|
179
|
-
(0, class_validator_1.ValidateIf)(
|
|
180
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
180
181
|
(0, class_validator_1.IsPositive)(),
|
|
181
182
|
(0, class_transformer_1.Transform)(({ value }) => value || 60),
|
|
182
183
|
(0, class_transformer_1.Expose)(),
|
|
@@ -234,7 +235,7 @@ __decorate([
|
|
|
234
235
|
__metadata("design:type", Array)
|
|
235
236
|
], CreateQuestroomDto.prototype, "disabledLanguages", void 0);
|
|
236
237
|
__decorate([
|
|
237
|
-
(0, class_validator_1.ValidateIf)(
|
|
238
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
238
239
|
(0, class_validator_1.IsArray)(),
|
|
239
240
|
(0, class_validator_1.ArrayMinSize)(1),
|
|
240
241
|
(0, class_validator_1.ArrayMaxSize)(10),
|
|
@@ -243,7 +244,7 @@ __decorate([
|
|
|
243
244
|
__metadata("design:type", Array)
|
|
244
245
|
], CreateQuestroomDto.prototype, "questroomTags", void 0);
|
|
245
246
|
__decorate([
|
|
246
|
-
(0, class_validator_1.ValidateIf)(
|
|
247
|
+
(0, class_validator_1.ValidateIf)(lounge_questroom_1.isClassicQuestroomFieldsRequired),
|
|
247
248
|
(0, is_not_blank_1.IsNotBlank)(),
|
|
248
249
|
(0, class_transformer_1.Expose)(),
|
|
249
250
|
(0, class_validator_1.MaxLength)(3000),
|
|
@@ -13,4 +13,5 @@ var QuestroomTypeEnum;
|
|
|
13
13
|
QuestroomTypeEnum["ROLE_BASED"] = "role-based";
|
|
14
14
|
QuestroomTypeEnum["QIUZ"] = "quiz";
|
|
15
15
|
QuestroomTypeEnum["ANTISTRESS"] = "antistress";
|
|
16
|
+
QuestroomTypeEnum["LOUNGE"] = "lounge";
|
|
16
17
|
})(QuestroomTypeEnum || (exports.QuestroomTypeEnum = QuestroomTypeEnum = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QuestroomTypeEnum } from './enum/questroom-type.enum';
|
|
2
|
+
import { CreateQuestroomDto } from './create-questroom.dto';
|
|
3
|
+
export declare const isLoungeQuestroomType: (type?: QuestroomTypeEnum | string | null) => boolean;
|
|
4
|
+
/** Поля escape-квеста обязательны только для обычных комнат (не лаунж, не closed). */
|
|
5
|
+
export declare const isClassicQuestroomFieldsRequired: (o: {
|
|
6
|
+
type?: QuestroomTypeEnum;
|
|
7
|
+
closed?: boolean;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
export type SetQuestroomFormField = (field: string, value: unknown) => void;
|
|
10
|
+
export declare const fillLoungeQuestroomFormFields: (setFieldValue: SetQuestroomFormField) => void;
|
|
11
|
+
export declare const applyLoungeQuestroomDefaults: <T extends Partial<CreateQuestroomDto>>(values: T) => T;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyLoungeQuestroomDefaults = exports.fillLoungeQuestroomFormFields = exports.isClassicQuestroomFieldsRequired = exports.isLoungeQuestroomType = void 0;
|
|
4
|
+
const questroom_actors_enum_1 = require("./enum/questroom-actors.enum");
|
|
5
|
+
const questroom_type_enum_1 = require("./enum/questroom-type.enum");
|
|
6
|
+
const isLoungeQuestroomType = (type) => type === questroom_type_enum_1.QuestroomTypeEnum.LOUNGE;
|
|
7
|
+
exports.isLoungeQuestroomType = isLoungeQuestroomType;
|
|
8
|
+
/** Поля escape-квеста обязательны только для обычных комнат (не лаунж, не closed). */
|
|
9
|
+
const isClassicQuestroomFieldsRequired = (o) => !o.closed && !(0, exports.isLoungeQuestroomType)(o.type);
|
|
10
|
+
exports.isClassicQuestroomFieldsRequired = isClassicQuestroomFieldsRequired;
|
|
11
|
+
const fillLoungeQuestroomFormFields = (setFieldValue) => {
|
|
12
|
+
setFieldValue('actors', questroom_actors_enum_1.QuestroomActorsEnum.NO);
|
|
13
|
+
setFieldValue('difficult', 1);
|
|
14
|
+
setFieldValue('fear', 1);
|
|
15
|
+
setFieldValue('minAge', 0);
|
|
16
|
+
setFieldValue('time', 60);
|
|
17
|
+
setFieldValue('legend', '');
|
|
18
|
+
setFieldValue('teaser', '');
|
|
19
|
+
setFieldValue('questroomTags', []);
|
|
20
|
+
setFieldValue('playersMin', 1);
|
|
21
|
+
setFieldValue('playersMax', 20);
|
|
22
|
+
setFieldValue('modes', []);
|
|
23
|
+
setFieldValue('ticketSystem', false);
|
|
24
|
+
setFieldValue('resourceUnitsTotal', null);
|
|
25
|
+
setFieldValue('resourceUnitSize', null);
|
|
26
|
+
};
|
|
27
|
+
exports.fillLoungeQuestroomFormFields = fillLoungeQuestroomFormFields;
|
|
28
|
+
const applyLoungeQuestroomDefaults = (values) => {
|
|
29
|
+
var _a, _b, _c, _d, _e;
|
|
30
|
+
if (!(0, exports.isLoungeQuestroomType)(values.type)) {
|
|
31
|
+
return values;
|
|
32
|
+
}
|
|
33
|
+
const legend = (_a = values.legend) === null || _a === void 0 ? void 0 : _a.trim();
|
|
34
|
+
return Object.assign(Object.assign({}, values), { actors: questroom_actors_enum_1.QuestroomActorsEnum.NO, difficult: values.difficult || 1, fear: values.fear || 1, minAge: (_b = values.minAge) !== null && _b !== void 0 ? _b : 0, time: values.time || 60, legend: legend || '—', teaser: (_c = values.teaser) !== null && _c !== void 0 ? _c : '', questroomTags: (_d = values.questroomTags) !== null && _d !== void 0 ? _d : [], playersMin: values.playersMin || 1, playersMax: values.playersMax || 20, modes: (_e = values.modes) !== null && _e !== void 0 ? _e : [] });
|
|
35
|
+
};
|
|
36
|
+
exports.applyLoungeQuestroomDefaults = applyLoungeQuestroomDefaults;
|