@escapenavigator/types 2.0.34 → 2.0.37
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/admin/aggregator-order/create-aggregator-order.dto.d.ts +1 -0
- package/dist/agregator/agregator-questroom.ro.d.ts +2 -0
- package/dist/agregator/agregator-questroom.ro.js +5 -0
- package/dist/certificate-sale/certificate-sale.ro.d.ts +6 -0
- package/dist/certificate-sale/certificate-sale.ro.js +4 -0
- package/dist/certificate-uploaded/certificate-uploaded.ro.d.ts +1 -1
- package/dist/client/client.ro.d.ts +13 -0
- package/dist/client/client.ro.js +21 -0
- package/dist/constants/uploading/upload-bookeo-certificate-rows.js +2 -2
- package/dist/constants/uploading/upload-certificate-rows.js +1 -1
- package/dist/location/create-location.dto.d.ts +2 -0
- package/dist/location/create-location.dto.js +7 -0
- package/dist/location/location-light.ro.d.ts +3 -1
- package/dist/location/location-light.ro.js +6 -1
- package/dist/location/update-location-for-admin.dto.d.ts +2 -0
- package/dist/location/update-location-for-admin.dto.js +7 -0
- package/dist/log/log-title.enum.d.ts +3 -0
- package/dist/log/log-title.enum.js +3 -0
- package/dist/loyalty/adjust-bonus.dto.d.ts +14 -0
- package/dist/loyalty/adjust-bonus.dto.js +35 -0
- package/dist/loyalty/assign-client-tier.dto.d.ts +9 -0
- package/dist/loyalty/assign-client-tier.dto.js +29 -0
- package/dist/loyalty/client-loyalty.ro.d.ts +30 -0
- package/dist/loyalty/client-loyalty.ro.js +71 -0
- package/dist/loyalty/enum/loyalty-bonus-type.enum.d.ts +13 -0
- package/dist/loyalty/enum/loyalty-bonus-type.enum.js +17 -0
- package/dist/loyalty/enum/loyalty-history-mode.enum.d.ts +18 -0
- package/dist/loyalty/enum/loyalty-history-mode.enum.js +22 -0
- package/dist/loyalty/enum/loyalty-metric.enum.d.ts +12 -0
- package/dist/loyalty/enum/loyalty-metric.enum.js +16 -0
- package/dist/loyalty/enum/loyalty-program-type.enum.d.ts +12 -0
- package/dist/loyalty/enum/loyalty-program-type.enum.js +16 -0
- package/dist/loyalty/enum/loyalty-stacking.enum.d.ts +14 -0
- package/dist/loyalty/enum/loyalty-stacking.enum.js +18 -0
- package/dist/loyalty/enum/loyalty-tier-color.enum.d.ts +16 -0
- package/dist/loyalty/enum/loyalty-tier-color.enum.js +20 -0
- package/dist/loyalty/enum/loyalty-tier-source.enum.d.ts +13 -0
- package/dist/loyalty/enum/loyalty-tier-source.enum.js +17 -0
- package/dist/loyalty/loyalty-bonus.ro.d.ts +20 -0
- package/dist/loyalty/loyalty-bonus.ro.js +55 -0
- package/dist/loyalty/loyalty-presets.d.ts +45 -0
- package/dist/loyalty/loyalty-presets.js +30 -0
- package/dist/loyalty/loyalty-preview.dto.d.ts +19 -0
- package/dist/loyalty/loyalty-preview.dto.js +64 -0
- package/dist/loyalty/loyalty-preview.ro.d.ts +20 -0
- package/dist/loyalty/loyalty-preview.ro.js +53 -0
- package/dist/loyalty/loyalty-settings.dto.d.ts +51 -0
- package/dist/loyalty/loyalty-settings.dto.js +103 -0
- package/dist/loyalty/loyalty-settings.ro.d.ts +33 -0
- package/dist/loyalty/loyalty-settings.ro.js +67 -0
- package/dist/loyalty/loyalty-tier.dto.d.ts +33 -0
- package/dist/loyalty/loyalty-tier.dto.js +69 -0
- package/dist/loyalty/loyalty-tier.ro.d.ts +12 -0
- package/dist/loyalty/loyalty-tier.ro.js +42 -0
- package/dist/loyalty/pay-with-bonus.dto.d.ts +10 -0
- package/dist/loyalty/pay-with-bonus.dto.js +36 -0
- package/dist/openapi/order-groups/openapi-batch-create-preorder.dto.d.ts +3 -3
- package/dist/openapi/orders/openapi-order.ro.d.ts +12 -0
- package/dist/openapi/orders/openapi-order.ro.js +8 -0
- package/dist/openapi/profiles/enum/openapi-certificate-status.enum.d.ts +29 -0
- package/dist/openapi/profiles/enum/openapi-certificate-status.enum.js +38 -0
- package/dist/openapi/profiles/openapi-annul-certificate.dto.d.ts +3 -0
- package/dist/openapi/profiles/openapi-annul-certificate.dto.js +29 -0
- package/dist/openapi/profiles/openapi-certificate.ro.d.ts +33 -0
- package/dist/openapi/profiles/openapi-certificate.ro.js +195 -0
- package/dist/openapi/profiles/openapi-create-certificate.dto.d.ts +24 -0
- package/dist/openapi/profiles/openapi-create-certificate.dto.js +208 -0
- package/dist/openapi/slots/openapi-widget-slot.ro.d.ts +3 -0
- package/dist/openapi/slots/openapi-widget-slot.ro.js +24 -2
- package/dist/order/order.ro.d.ts +23 -1
- package/dist/order/order.ro.js +19 -0
- package/dist/order-discount/enum/order-discount-source.enum.d.ts +10 -0
- package/dist/order-discount/enum/order-discount-source.enum.js +14 -0
- package/dist/packages/book-package.dto.d.ts +3 -0
- package/dist/packages/book-package.dto.js +9 -0
- package/dist/packages/create-package.dto.d.ts +23 -0
- package/dist/packages/create-package.dto.js +81 -1
- package/dist/packages/package-addon.dto.d.ts +5 -0
- package/dist/packages/package-addon.dto.js +31 -0
- package/dist/packages/package-audience.enum.d.ts +6 -0
- package/dist/packages/package-audience.enum.js +10 -0
- package/dist/packages/package-feature.dto.d.ts +12 -0
- package/dist/packages/package-feature.dto.js +41 -0
- package/dist/packages/package-pricing-mode.enum.d.ts +14 -0
- package/dist/packages/package-pricing-mode.enum.js +18 -0
- package/dist/packages/package.ro.d.ts +14 -0
- package/dist/packages/package.ro.js +48 -0
- package/dist/profile/company-ai-context.d.ts +2 -0
- package/dist/profile/notification-chanel/notification-chanel-action.enum.d.ts +16 -1
- package/dist/profile/notification-chanel/notification-chanel-action.enum.js +21 -1
- package/dist/profile/notification-chanel/notification-chanel.ro.d.ts +5 -0
- package/dist/profile/notification-chanel/notification-chanel.ro.js +4 -0
- package/dist/profile/notification-chanel/test-notification-chanel.dto.d.ts +7 -2
- package/dist/profile/notification-chanel/test-notification-chanel.dto.js +7 -0
- package/dist/questroom/questroom-ai-context.d.ts +5 -0
- package/dist/shared/enum/availability.enum.d.ts +11 -0
- package/dist/shared/enum/availability.enum.js +15 -0
- package/dist/slot/bulk-update-slots.dto.d.ts +2 -0
- package/dist/slot/bulk-update-slots.dto.js +7 -0
- package/dist/slot/change-template-slots-form.dto.d.ts +3 -0
- package/dist/slot/change-template-slots-form.dto.js +13 -0
- package/dist/slot/create-slot-form.dto.d.ts +2 -0
- package/dist/slot/create-slot-form.dto.js +7 -0
- package/dist/slot/create-slot.dto.d.ts +2 -0
- package/dist/slot/create-slot.dto.js +7 -0
- package/dist/slot/daily-window-range.validator.d.ts +15 -0
- package/dist/slot/daily-window-range.validator.js +46 -0
- package/dist/slot/enum/slot-discount-type.enum.d.ts +15 -0
- package/dist/slot/enum/slot-discount-type.enum.js +19 -0
- package/dist/slot/slot-autocomplite-form.dto.d.ts +2 -0
- package/dist/slot/slot-autocomplite-form.dto.js +7 -0
- package/dist/slot/slot-discount-range.validator.d.ts +10 -0
- package/dist/slot/slot-discount-range.validator.js +36 -0
- package/dist/slot/slot.ro.d.ts +10 -0
- package/dist/slot/update-slot-upsellings-range.dto.d.ts +17 -0
- package/dist/slot/update-slot-upsellings-range.dto.js +68 -0
- package/dist/slot/update-slot.dto.d.ts +4 -0
- package/dist/slot/update-slot.dto.js +14 -0
- package/dist/slot-template/slot-template-element.d.ts +4 -0
- package/dist/slot-template/slot-template-element.js +9 -0
- package/dist/slot-template/slot-template-flex-rule.d.ts +8 -0
- package/dist/slot-template/slot-template-flex-rule.js +15 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/user/crud/user.ro.d.ts +3 -0
- package/dist/user/crud/user.ro.js +11 -0
- package/dist/user/current/update-current-user-notifications.dto.d.ts +7 -0
- package/dist/user/current/update-current-user-notifications.dto.js +13 -0
- package/dist/user/enum/push-order-scope.enum.d.ts +15 -0
- package/dist/user/enum/push-order-scope.enum.js +19 -0
- package/dist/widget/enum/widget-type.enum.d.ts +3 -1
- package/dist/widget/enum/widget-type.enum.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class OpenapiCertificateClientDto {
|
|
2
|
+
name?: string;
|
|
3
|
+
surname?: string;
|
|
4
|
+
phone?: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class OpenapiCertificateRecipientDto {
|
|
8
|
+
name?: string;
|
|
9
|
+
surname?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
phone?: string;
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class OpenapiCreateCertificateDto {
|
|
15
|
+
code: string;
|
|
16
|
+
nominal: number;
|
|
17
|
+
expireDate?: string;
|
|
18
|
+
maxUsages?: number;
|
|
19
|
+
designId?: number;
|
|
20
|
+
comment?: string;
|
|
21
|
+
externalId?: string;
|
|
22
|
+
client?: OpenapiCertificateClientDto;
|
|
23
|
+
recipient?: OpenapiCertificateRecipientDto;
|
|
24
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OpenapiCreateCertificateDto = exports.OpenapiCertificateRecipientDto = exports.OpenapiCertificateClientDto = void 0;
|
|
13
|
+
/* eslint-disable max-classes-per-file */
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
const class_validator_1 = require("class-validator");
|
|
17
|
+
class OpenapiCertificateClientDto {
|
|
18
|
+
}
|
|
19
|
+
exports.OpenapiCertificateClientDto = OpenapiCertificateClientDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({
|
|
22
|
+
required: false,
|
|
23
|
+
example: 'John',
|
|
24
|
+
description: "Buyer's first name.",
|
|
25
|
+
}),
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], OpenapiCertificateClientDto.prototype, "name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({
|
|
32
|
+
required: false,
|
|
33
|
+
example: 'Doe',
|
|
34
|
+
description: "Buyer's last name.",
|
|
35
|
+
}),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], OpenapiCertificateClientDto.prototype, "surname", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiProperty)({
|
|
42
|
+
required: false,
|
|
43
|
+
example: '+49 151 23456789',
|
|
44
|
+
description: 'Buyer phone number. Used to match an existing client (dedup) before creating a new one.',
|
|
45
|
+
}),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], OpenapiCertificateClientDto.prototype, "phone", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiProperty)({
|
|
52
|
+
required: false,
|
|
53
|
+
example: 'john.doe@example.com',
|
|
54
|
+
description: 'Buyer email. Used to match an existing client (dedup) before creating a new one.',
|
|
55
|
+
}),
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, class_validator_1.IsEmail)(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], OpenapiCertificateClientDto.prototype, "email", void 0);
|
|
60
|
+
class OpenapiCertificateRecipientDto {
|
|
61
|
+
}
|
|
62
|
+
exports.OpenapiCertificateRecipientDto = OpenapiCertificateRecipientDto;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, swagger_1.ApiProperty)({ required: false, example: 'Anna' }),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], OpenapiCertificateRecipientDto.prototype, "name", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiProperty)({ required: false, example: 'Smith' }),
|
|
71
|
+
(0, class_validator_1.IsOptional)(),
|
|
72
|
+
(0, class_validator_1.IsString)(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], OpenapiCertificateRecipientDto.prototype, "surname", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, swagger_1.ApiProperty)({ required: false, example: 'anna@example.com' }),
|
|
77
|
+
(0, class_validator_1.IsOptional)(),
|
|
78
|
+
(0, class_validator_1.IsEmail)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], OpenapiCertificateRecipientDto.prototype, "email", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, swagger_1.ApiProperty)({ required: false, example: '+49 151 98765432' }),
|
|
83
|
+
(0, class_validator_1.IsOptional)(),
|
|
84
|
+
(0, class_validator_1.IsString)(),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], OpenapiCertificateRecipientDto.prototype, "phone", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, swagger_1.ApiProperty)({
|
|
89
|
+
required: false,
|
|
90
|
+
example: 'Happy birthday!',
|
|
91
|
+
description: 'Gift message shown to the recipient in the company CRM.',
|
|
92
|
+
}),
|
|
93
|
+
(0, class_validator_1.IsOptional)(),
|
|
94
|
+
(0, class_validator_1.IsString)(),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], OpenapiCertificateRecipientDto.prototype, "message", void 0);
|
|
97
|
+
class OpenapiCreateCertificateDto {
|
|
98
|
+
}
|
|
99
|
+
exports.OpenapiCreateCertificateDto = OpenapiCreateCertificateDto;
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, swagger_1.ApiProperty)({
|
|
102
|
+
example: 'GIFT-2026-000145',
|
|
103
|
+
minLength: 3,
|
|
104
|
+
maxLength: 64,
|
|
105
|
+
description: `The certificate code your customer will present at the venue. You own this value — Escape Navigator does not generate one.
|
|
106
|
+
|
|
107
|
+
Must be unique within your company: the request fails with \`409\` if the code is already taken by another certificate (including codes issued by the widget or the CRM).
|
|
108
|
+
|
|
109
|
+
Spaces are stripped before the code is stored, so \`1111 2222 3333 4444\` and \`1111222233334444\` are the same certificate. Staff and customers may type the code either way when redeeming it.`,
|
|
110
|
+
}),
|
|
111
|
+
(0, class_validator_1.IsString)(),
|
|
112
|
+
(0, class_validator_1.Length)(3, 64),
|
|
113
|
+
(0, class_validator_1.Matches)(/^[A-Za-z0-9][A-Za-z0-9 _.-]*$/, {
|
|
114
|
+
message: 'code may contain letters, digits, spaces, dot, dash and underscore only',
|
|
115
|
+
}),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], OpenapiCreateCertificateDto.prototype, "code", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, swagger_1.ApiProperty)({
|
|
120
|
+
example: 5000,
|
|
121
|
+
minimum: 1,
|
|
122
|
+
description: "Certificate face value in minor currency units of the company's currency (e.g. 5000 = 50.00 EUR). This is the amount the holder can spend on bookings.",
|
|
123
|
+
}),
|
|
124
|
+
(0, class_validator_1.IsInt)(),
|
|
125
|
+
(0, class_validator_1.Min)(1),
|
|
126
|
+
__metadata("design:type", Number)
|
|
127
|
+
], OpenapiCreateCertificateDto.prototype, "nominal", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, swagger_1.ApiProperty)({
|
|
130
|
+
required: false,
|
|
131
|
+
example: '2027-08-18',
|
|
132
|
+
description: 'Expiry date (`YYYY-MM-DD`). Defaults to the validity period configured in the company certificate settings.',
|
|
133
|
+
}),
|
|
134
|
+
(0, class_validator_1.IsOptional)(),
|
|
135
|
+
(0, class_validator_1.IsISO8601)(),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], OpenapiCreateCertificateDto.prototype, "expireDate", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, swagger_1.ApiProperty)({
|
|
140
|
+
required: false,
|
|
141
|
+
default: 100,
|
|
142
|
+
example: 100,
|
|
143
|
+
minimum: 1,
|
|
144
|
+
description: `How many bookings the certificate may be spread across. Each booking spends part of the balance until the balance runs out or this limit is reached.
|
|
145
|
+
|
|
146
|
+
Defaults to \`100\`, which effectively means "until the balance is empty" — the usual behaviour for a gift card. Pass \`1\` for a single-use certificate that is written off in full on its first booking, even when the booking is cheaper than the face value.`,
|
|
147
|
+
}),
|
|
148
|
+
(0, class_validator_1.IsOptional)(),
|
|
149
|
+
(0, class_validator_1.IsInt)(),
|
|
150
|
+
(0, class_validator_1.Min)(1),
|
|
151
|
+
__metadata("design:type", Number)
|
|
152
|
+
], OpenapiCreateCertificateDto.prototype, "maxUsages", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, swagger_1.ApiProperty)({
|
|
155
|
+
required: false,
|
|
156
|
+
example: 12,
|
|
157
|
+
description: 'Design from the company certificate catalogue (`GET /v2/certificate-designs` in the CRM). Only affects how the certificate is presented to staff — omit it for a plain external certificate.',
|
|
158
|
+
}),
|
|
159
|
+
(0, class_validator_1.IsOptional)(),
|
|
160
|
+
(0, class_validator_1.IsInt)(),
|
|
161
|
+
__metadata("design:type", Number)
|
|
162
|
+
], OpenapiCreateCertificateDto.prototype, "designId", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, swagger_1.ApiProperty)({
|
|
165
|
+
required: false,
|
|
166
|
+
example: 'Sold in the shopping mall kiosk',
|
|
167
|
+
description: 'Free-text note attached to the certificate and visible to the venue staff.',
|
|
168
|
+
}),
|
|
169
|
+
(0, class_validator_1.IsOptional)(),
|
|
170
|
+
(0, class_validator_1.IsString)(),
|
|
171
|
+
__metadata("design:type", String)
|
|
172
|
+
], OpenapiCreateCertificateDto.prototype, "comment", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, swagger_1.ApiProperty)({
|
|
175
|
+
required: false,
|
|
176
|
+
example: 'partner-sale-98211',
|
|
177
|
+
maxLength: 128,
|
|
178
|
+
description: `Your own identifier for this sale. Stored as-is and returned in every response and webhook.
|
|
179
|
+
|
|
180
|
+
Doubles as an idempotency key: repeating the request with the same \`externalId\` returns the already created certificate instead of creating a second one.`,
|
|
181
|
+
}),
|
|
182
|
+
(0, class_validator_1.IsOptional)(),
|
|
183
|
+
(0, class_validator_1.IsString)(),
|
|
184
|
+
(0, class_validator_1.Length)(1, 128),
|
|
185
|
+
__metadata("design:type", String)
|
|
186
|
+
], OpenapiCreateCertificateDto.prototype, "externalId", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
(0, swagger_1.ApiProperty)({
|
|
189
|
+
required: false,
|
|
190
|
+
type: OpenapiCertificateClientDto,
|
|
191
|
+
description: 'Buyer details. An existing client is reused when matched by phone/email; otherwise a new one is created. Omit it and the certificate is attached to the company API client.',
|
|
192
|
+
}),
|
|
193
|
+
(0, class_validator_1.IsOptional)(),
|
|
194
|
+
(0, class_validator_1.ValidateNested)(),
|
|
195
|
+
(0, class_transformer_1.Type)(() => OpenapiCertificateClientDto),
|
|
196
|
+
__metadata("design:type", OpenapiCertificateClientDto)
|
|
197
|
+
], OpenapiCreateCertificateDto.prototype, "client", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
(0, swagger_1.ApiProperty)({
|
|
200
|
+
required: false,
|
|
201
|
+
type: OpenapiCertificateRecipientDto,
|
|
202
|
+
description: 'Gift recipient details, when the certificate was bought as a present.',
|
|
203
|
+
}),
|
|
204
|
+
(0, class_validator_1.IsOptional)(),
|
|
205
|
+
(0, class_validator_1.ValidateNested)(),
|
|
206
|
+
(0, class_transformer_1.Type)(() => OpenapiCertificateRecipientDto),
|
|
207
|
+
__metadata("design:type", OpenapiCertificateRecipientDto)
|
|
208
|
+
], OpenapiCreateCertificateDto.prototype, "recipient", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SlotDiscountTypeEnum } from '../../slot/enum/slot-discount-type.enum';
|
|
1
2
|
import { OpenapiBokingRuleRO } from '../shared/openapi-booking-rule.ro';
|
|
2
3
|
import { OpenapiSlotTariffRO } from './openapi-slot-tariff.ro';
|
|
3
4
|
export type SlotType = 'bookeo' | 'crm' | 'myerp' | 'kvestadmin' | 'partner';
|
|
@@ -14,9 +15,11 @@ export declare class OpenapiSlotRO {
|
|
|
14
15
|
end?: string;
|
|
15
16
|
numSeatsAvailable?: number;
|
|
16
17
|
discount?: number;
|
|
18
|
+
discountType?: SlotDiscountTypeEnum;
|
|
17
19
|
onlyPhone?: boolean;
|
|
18
20
|
tariff?: OpenapiSlotTariffRO;
|
|
19
21
|
status?: 'bussy' | 'call' | 'free' | 'hold' | 'selected' | 'done' | 'no-resources';
|
|
20
22
|
rule?: OpenapiBokingRuleRO;
|
|
21
23
|
privateEvent?: boolean;
|
|
24
|
+
excludedUpsellingIds?: number[];
|
|
22
25
|
}
|
|
@@ -14,6 +14,7 @@ exports.OpenapiSlotRO = void 0;
|
|
|
14
14
|
/* eslint-disable max-classes-per-file */
|
|
15
15
|
const swagger_1 = require("@nestjs/swagger");
|
|
16
16
|
const class_transformer_1 = require("class-transformer");
|
|
17
|
+
const slot_discount_type_enum_1 = require("../../slot/enum/slot-discount-type.enum");
|
|
17
18
|
const openapi_booking_rule_ro_1 = require("../shared/openapi-booking-rule.ro");
|
|
18
19
|
const openapi_slot_tariff_ro_1 = require("./openapi-slot-tariff.ro");
|
|
19
20
|
var SType;
|
|
@@ -126,13 +127,23 @@ __decorate([
|
|
|
126
127
|
], OpenapiSlotRO.prototype, "numSeatsAvailable", void 0);
|
|
127
128
|
__decorate([
|
|
128
129
|
(0, swagger_1.ApiProperty)({
|
|
129
|
-
description: 'Discount applied to the slot
|
|
130
|
+
description: 'Discount applied to the slot. With `discountType: percent` the value is in basis points (1500 = 15%); with `discountType: fixed` it is an amount in minor currency units subtracted once per booking.',
|
|
130
131
|
required: false,
|
|
131
|
-
example:
|
|
132
|
+
example: 1500,
|
|
132
133
|
}),
|
|
133
134
|
(0, class_transformer_1.Expose)(),
|
|
134
135
|
__metadata("design:type", Number)
|
|
135
136
|
], OpenapiSlotRO.prototype, "discount", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, swagger_1.ApiProperty)({
|
|
139
|
+
description: 'How to read `discount`. Omitted for slots created before fixed discounts existed, which means `percent`.',
|
|
140
|
+
required: false,
|
|
141
|
+
enum: slot_discount_type_enum_1.SlotDiscountTypeEnum,
|
|
142
|
+
example: slot_discount_type_enum_1.SlotDiscountTypeEnum.PERCENT,
|
|
143
|
+
}),
|
|
144
|
+
(0, class_transformer_1.Expose)(),
|
|
145
|
+
__metadata("design:type", String)
|
|
146
|
+
], OpenapiSlotRO.prototype, "discountType", void 0);
|
|
136
147
|
__decorate([
|
|
137
148
|
(0, swagger_1.ApiProperty)({
|
|
138
149
|
description: 'When true, the slot can only be booked by phone (no online booking).',
|
|
@@ -182,3 +193,14 @@ __decorate([
|
|
|
182
193
|
(0, class_transformer_1.Transform)(({ value }) => (value === undefined ? true : value)),
|
|
183
194
|
__metadata("design:type", Boolean)
|
|
184
195
|
], OpenapiSlotRO.prototype, "privateEvent", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, swagger_1.ApiProperty)({
|
|
198
|
+
description: 'Upselling ids that must not be offered for this slot. Omitted when nothing is restricted.',
|
|
199
|
+
required: false,
|
|
200
|
+
isArray: true,
|
|
201
|
+
type: Number,
|
|
202
|
+
example: [42],
|
|
203
|
+
}),
|
|
204
|
+
(0, class_transformer_1.Expose)(),
|
|
205
|
+
__metadata("design:type", Array)
|
|
206
|
+
], OpenapiSlotRO.prototype, "excludedUpsellingIds", void 0);
|
package/dist/order/order.ro.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ClientRO } from '../client/client.ro';
|
|
2
|
+
import { LoyaltyBonusRO } from '../loyalty/loyalty-bonus.ro';
|
|
3
|
+
import { OrderDiscountSourceEnum } from '../order-discount/enum/order-discount-source.enum';
|
|
2
4
|
import { OrderPenaltyTypeEnum } from '../order-penalty/enum/order-penalty-type.enum';
|
|
3
5
|
import { OrderProductRO } from '../order-product/order-product.ro';
|
|
4
6
|
import { PromocodeKindEnum } from '../promocode/emun/promocode-kind.enum';
|
|
@@ -66,6 +68,12 @@ export declare class Discounts extends RO {
|
|
|
66
68
|
reason: string;
|
|
67
69
|
amount: number;
|
|
68
70
|
userId: number;
|
|
71
|
+
/**
|
|
72
|
+
* Ручная скидка администратора или автоматическая по статусу клиента.
|
|
73
|
+
* Необязательное: этот же класс описывает скидки на продаже
|
|
74
|
+
* сертификата, где источник один и колонки под него нет.
|
|
75
|
+
*/
|
|
76
|
+
source?: OrderDiscountSourceEnum;
|
|
69
77
|
}
|
|
70
78
|
export declare class PromocodeIssuer {
|
|
71
79
|
id: number;
|
|
@@ -205,12 +213,20 @@ export declare class OrderRO extends RO {
|
|
|
205
213
|
toPay: number;
|
|
206
214
|
/** Реально полученные деньги. v2: payed = cashReceived. */
|
|
207
215
|
cashReceived: number;
|
|
208
|
-
/** Сумма скидок (slotDiscount + ручные). v2: уже вычтено из total. */
|
|
216
|
+
/** Сумма скидок (slotDiscount + ручные + по лояльности). v2: уже вычтено из total. */
|
|
209
217
|
discountTotal: number;
|
|
218
|
+
/** Часть `discountTotal`, пришедшая от статуса клиента в программе лояльности. */
|
|
219
|
+
loyaltyDiscount: number;
|
|
210
220
|
/** Сумма промокодов − returnedPromocode.discount. v2: уже вычтено из total. */
|
|
211
221
|
promocodeTotal: number;
|
|
212
222
|
/** Сумма сертификатов. v2: уже вычтено из total. */
|
|
213
223
|
certificateTotal: number;
|
|
224
|
+
/**
|
|
225
|
+
* Сумма бонусов, которыми закрыта игра. v2: уже вычтено из total и,
|
|
226
|
+
* как сертификат, НЕ входит в `payed` — живых денег бонусы не
|
|
227
|
+
* приносят.
|
|
228
|
+
*/
|
|
229
|
+
bonusTotal: number;
|
|
214
230
|
/** Сумма допуслуг (Σ amount × count). Денорм для бейджа на слоте. */
|
|
215
231
|
upsellingsTotal: number;
|
|
216
232
|
/**
|
|
@@ -253,6 +269,12 @@ export declare class OrderRO extends RO {
|
|
|
253
269
|
questroomId: number;
|
|
254
270
|
certificates: Certificates[];
|
|
255
271
|
uploadedCertificates: Certificates[];
|
|
272
|
+
/**
|
|
273
|
+
* Списания бонусов по этой игре. Отдельными строками, а не одной
|
|
274
|
+
* суммой: администратору нужно видеть, кто и когда списал, и иметь
|
|
275
|
+
* возможность снять конкретную операцию.
|
|
276
|
+
*/
|
|
277
|
+
bonuses: LoyaltyBonusRO[];
|
|
256
278
|
upsellings: Upsellings[];
|
|
257
279
|
discounts: Discounts[];
|
|
258
280
|
promocodes: Promocodes[];
|
package/dist/order/order.ro.js
CHANGED
|
@@ -14,6 +14,8 @@ exports.OrderRO = exports.Transactions = exports.Promocodes = exports.PromocodeI
|
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
16
16
|
const client_ro_1 = require("../client/client.ro");
|
|
17
|
+
const loyalty_bonus_ro_1 = require("../loyalty/loyalty-bonus.ro");
|
|
18
|
+
const order_discount_source_enum_1 = require("../order-discount/enum/order-discount-source.enum");
|
|
17
19
|
const order_penalty_type_enum_1 = require("../order-penalty/enum/order-penalty-type.enum");
|
|
18
20
|
const order_product_ro_1 = require("../order-product/order-product.ro");
|
|
19
21
|
const promocode_kind_enum_1 = require("../promocode/emun/promocode-kind.enum");
|
|
@@ -173,6 +175,10 @@ __decorate([
|
|
|
173
175
|
(0, class_transformer_1.Expose)(),
|
|
174
176
|
__metadata("design:type", Number)
|
|
175
177
|
], Discounts.prototype, "userId", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, class_transformer_1.Expose)(),
|
|
180
|
+
__metadata("design:type", String)
|
|
181
|
+
], Discounts.prototype, "source", void 0);
|
|
176
182
|
class PromocodeIssuer {
|
|
177
183
|
}
|
|
178
184
|
exports.PromocodeIssuer = PromocodeIssuer;
|
|
@@ -498,6 +504,10 @@ __decorate([
|
|
|
498
504
|
(0, class_transformer_1.Expose)(),
|
|
499
505
|
__metadata("design:type", Number)
|
|
500
506
|
], OrderRO.prototype, "discountTotal", void 0);
|
|
507
|
+
__decorate([
|
|
508
|
+
(0, class_transformer_1.Expose)(),
|
|
509
|
+
__metadata("design:type", Number)
|
|
510
|
+
], OrderRO.prototype, "loyaltyDiscount", void 0);
|
|
501
511
|
__decorate([
|
|
502
512
|
(0, class_transformer_1.Expose)(),
|
|
503
513
|
__metadata("design:type", Number)
|
|
@@ -506,6 +516,10 @@ __decorate([
|
|
|
506
516
|
(0, class_transformer_1.Expose)(),
|
|
507
517
|
__metadata("design:type", Number)
|
|
508
518
|
], OrderRO.prototype, "certificateTotal", void 0);
|
|
519
|
+
__decorate([
|
|
520
|
+
(0, class_transformer_1.Expose)(),
|
|
521
|
+
__metadata("design:type", Number)
|
|
522
|
+
], OrderRO.prototype, "bonusTotal", void 0);
|
|
509
523
|
__decorate([
|
|
510
524
|
(0, class_transformer_1.Expose)(),
|
|
511
525
|
__metadata("design:type", Number)
|
|
@@ -610,6 +624,11 @@ __decorate([
|
|
|
610
624
|
(0, class_transformer_1.Type)(() => Certificates),
|
|
611
625
|
__metadata("design:type", Array)
|
|
612
626
|
], OrderRO.prototype, "uploadedCertificates", void 0);
|
|
627
|
+
__decorate([
|
|
628
|
+
(0, class_transformer_1.Expose)(),
|
|
629
|
+
(0, class_transformer_1.Type)(() => loyalty_bonus_ro_1.LoyaltyBonusRO),
|
|
630
|
+
__metadata("design:type", Array)
|
|
631
|
+
], OrderRO.prototype, "bonuses", void 0);
|
|
613
632
|
__decorate([
|
|
614
633
|
(0, class_transformer_1.Expose)(),
|
|
615
634
|
(0, class_transformer_1.Type)(() => Upsellings),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Кто поставил скидку на игру. Строка с `LOYALTY` принадлежит программе
|
|
3
|
+
* лояльности: её пересобирает система при каждом пересчёте чека, и
|
|
4
|
+
* администратор не должен править её руками — правка всё равно
|
|
5
|
+
* потеряется на следующем пересчёте.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum OrderDiscountSourceEnum {
|
|
8
|
+
MANUAL = "manual",
|
|
9
|
+
LOYALTY = "loyalty"
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderDiscountSourceEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Кто поставил скидку на игру. Строка с `LOYALTY` принадлежит программе
|
|
6
|
+
* лояльности: её пересобирает система при каждом пересчёте чека, и
|
|
7
|
+
* администратор не должен править её руками — правка всё равно
|
|
8
|
+
* потеряется на следующем пересчёте.
|
|
9
|
+
*/
|
|
10
|
+
var OrderDiscountSourceEnum;
|
|
11
|
+
(function (OrderDiscountSourceEnum) {
|
|
12
|
+
OrderDiscountSourceEnum["MANUAL"] = "manual";
|
|
13
|
+
OrderDiscountSourceEnum["LOYALTY"] = "loyalty";
|
|
14
|
+
})(OrderDiscountSourceEnum || (exports.OrderDiscountSourceEnum = OrderDiscountSourceEnum = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PackageAddonSelectionDto } from './package-addon.dto';
|
|
1
2
|
/** Выбранный клиентом слот под конкретную позицию пакета. */
|
|
2
3
|
export declare class BookPackageSelectionDto {
|
|
3
4
|
positionId: string;
|
|
@@ -16,6 +17,8 @@ export declare class BookPackageDto {
|
|
|
16
17
|
selections: BookPackageSelectionDto[];
|
|
17
18
|
/** Апселлы пакета, которые клиент оставил (positionId → добавить к 1-му заказу). */
|
|
18
19
|
keptUpsellingPositionIds?: string[];
|
|
20
|
+
/** Платные допы сверх пакета («добавьте к празднику»). */
|
|
21
|
+
addons?: PackageAddonSelectionDto[];
|
|
19
22
|
language?: string;
|
|
20
23
|
comment?: string;
|
|
21
24
|
/** hold текущей widget-сессии (для идемпотентности preorder). */
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BookPackageDto = exports.BookPackageSelectionDto = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const package_addon_dto_1 = require("./package-addon.dto");
|
|
15
16
|
/** Выбранный клиентом слот под конкретную позицию пакета. */
|
|
16
17
|
class BookPackageSelectionDto {
|
|
17
18
|
}
|
|
@@ -90,6 +91,14 @@ __decorate([
|
|
|
90
91
|
(0, class_transformer_1.Expose)(),
|
|
91
92
|
__metadata("design:type", Array)
|
|
92
93
|
], BookPackageDto.prototype, "keptUpsellingPositionIds", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, class_validator_1.IsOptional)(),
|
|
96
|
+
(0, class_validator_1.IsArray)(),
|
|
97
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
98
|
+
(0, class_transformer_1.Type)(() => package_addon_dto_1.PackageAddonSelectionDto),
|
|
99
|
+
(0, class_transformer_1.Expose)(),
|
|
100
|
+
__metadata("design:type", Array)
|
|
101
|
+
], BookPackageDto.prototype, "addons", void 0);
|
|
93
102
|
__decorate([
|
|
94
103
|
(0, class_validator_1.IsOptional)(),
|
|
95
104
|
(0, class_validator_1.IsString)(),
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { PackageAudienceEnum } from './package-audience.enum';
|
|
1
2
|
import { PackageCancelScopeEnum } from './package-cancel-scope.enum';
|
|
2
3
|
import { PackageCapacityModelEnum } from './package-capacity-model.enum';
|
|
3
4
|
import { PackageDiscountTypeEnum } from './package-discount-type.enum';
|
|
5
|
+
import { PackageFeatureDto } from './package-feature.dto';
|
|
4
6
|
import { PackagePositionDto } from './package-position.dto';
|
|
7
|
+
import { PackagePricingModeEnum } from './package-pricing-mode.enum';
|
|
5
8
|
import { PackageSplitModeEnum } from './package-split-mode.enum';
|
|
6
9
|
import { PackageTimingModeEnum } from './package-timing-mode.enum';
|
|
7
10
|
export declare class CreatePackageDto {
|
|
@@ -11,6 +14,11 @@ export declare class CreatePackageDto {
|
|
|
11
14
|
photo?: string;
|
|
12
15
|
color?: string;
|
|
13
16
|
sortPosition: number;
|
|
17
|
+
/** Плашка на карточке («популярный», «выгодно»). */
|
|
18
|
+
badge?: string | null;
|
|
19
|
+
audience: PackageAudienceEnum;
|
|
20
|
+
/** Чек-лист «что входит в тариф» на витрине. */
|
|
21
|
+
features: PackageFeatureDto[];
|
|
14
22
|
availableInWidget: boolean;
|
|
15
23
|
saved: boolean;
|
|
16
24
|
/** Диапазон действия акции (ISO date), null — бессрочно. */
|
|
@@ -34,6 +42,21 @@ export declare class CreatePackageDto {
|
|
|
34
42
|
/** Общий мин./макс. игроков на пакет (для capacityModel=shared). */
|
|
35
43
|
playersMin?: number | null;
|
|
36
44
|
playersMax?: number | null;
|
|
45
|
+
pricingMode: PackagePricingModeEnum;
|
|
46
|
+
/** Цена пакета за будний день (pricingMode=fixed). */
|
|
47
|
+
price: number;
|
|
48
|
+
/** Цена за выходной/праздничный день. null — та же, что и в будни. */
|
|
49
|
+
weekendPrice?: number | null;
|
|
50
|
+
/** Какие дни недели считать «выходными» для цены (0 — Пн … 6 — Вс). */
|
|
51
|
+
weekendDays: number[];
|
|
52
|
+
/** Сколько игроков уже включено в цену пакета. */
|
|
53
|
+
includedPlayers: number;
|
|
54
|
+
/** Доплата за каждого игрока сверх `includedPlayers`. */
|
|
55
|
+
extraPlayerPrice: number;
|
|
56
|
+
/** Предоплата для брони пакета (0 — бронь без предоплаты). */
|
|
57
|
+
prepayment: number;
|
|
58
|
+
/** Платные допуслуги, предлагаемые к пакету («добавьте к празднику»). */
|
|
59
|
+
addonUpsellingIds: number[];
|
|
37
60
|
discountType: PackageDiscountTypeEnum;
|
|
38
61
|
discountAmount: number;
|
|
39
62
|
/** Тираж пакета (null — без лимита). */
|
|
@@ -13,10 +13,13 @@ exports.CreatePackageDto = void 0;
|
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const is_not_blank_1 = require("../shared/is-not-blank");
|
|
16
|
+
const package_audience_enum_1 = require("./package-audience.enum");
|
|
16
17
|
const package_cancel_scope_enum_1 = require("./package-cancel-scope.enum");
|
|
17
18
|
const package_capacity_model_enum_1 = require("./package-capacity-model.enum");
|
|
18
19
|
const package_discount_type_enum_1 = require("./package-discount-type.enum");
|
|
20
|
+
const package_feature_dto_1 = require("./package-feature.dto");
|
|
19
21
|
const package_position_dto_1 = require("./package-position.dto");
|
|
22
|
+
const package_pricing_mode_enum_1 = require("./package-pricing-mode.enum");
|
|
20
23
|
const package_split_mode_enum_1 = require("./package-split-mode.enum");
|
|
21
24
|
const package_timing_mode_enum_1 = require("./package-timing-mode.enum");
|
|
22
25
|
class CreatePackageDto {
|
|
@@ -57,6 +60,26 @@ __decorate([
|
|
|
57
60
|
(0, class_transformer_1.Expose)(),
|
|
58
61
|
__metadata("design:type", Number)
|
|
59
62
|
], CreatePackageDto.prototype, "sortPosition", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
(0, class_transformer_1.Expose)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], CreatePackageDto.prototype, "badge", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsEnum)(package_audience_enum_1.PackageAudienceEnum),
|
|
71
|
+
(0, class_transformer_1.Transform)(({ value }) => value !== null && value !== void 0 ? value : package_audience_enum_1.PackageAudienceEnum.ANY),
|
|
72
|
+
(0, class_transformer_1.Expose)(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], CreatePackageDto.prototype, "audience", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, class_validator_1.IsArray)(),
|
|
77
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
78
|
+
(0, class_transformer_1.Type)(() => package_feature_dto_1.PackageFeatureDto),
|
|
79
|
+
(0, class_transformer_1.Transform)(({ value }) => (Array.isArray(value) ? value : [])),
|
|
80
|
+
(0, class_transformer_1.Expose)(),
|
|
81
|
+
__metadata("design:type", Array)
|
|
82
|
+
], CreatePackageDto.prototype, "features", void 0);
|
|
60
83
|
__decorate([
|
|
61
84
|
(0, class_validator_1.IsBoolean)(),
|
|
62
85
|
(0, class_transformer_1.Transform)(({ value }) => value !== null && value !== void 0 ? value : false),
|
|
@@ -170,6 +193,62 @@ __decorate([
|
|
|
170
193
|
(0, class_transformer_1.Expose)(),
|
|
171
194
|
__metadata("design:type", Number)
|
|
172
195
|
], CreatePackageDto.prototype, "playersMax", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, class_validator_1.IsEnum)(package_pricing_mode_enum_1.PackagePricingModeEnum),
|
|
198
|
+
(0, class_transformer_1.Transform)(({ value }) => value !== null && value !== void 0 ? value : package_pricing_mode_enum_1.PackagePricingModeEnum.DISCOUNT),
|
|
199
|
+
(0, class_transformer_1.Expose)(),
|
|
200
|
+
__metadata("design:type", String)
|
|
201
|
+
], CreatePackageDto.prototype, "pricingMode", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
(0, class_validator_1.ValidateIf)((o) => o.pricingMode === package_pricing_mode_enum_1.PackagePricingModeEnum.FIXED),
|
|
204
|
+
(0, class_validator_1.IsNumber)(),
|
|
205
|
+
(0, class_validator_1.Min)(0),
|
|
206
|
+
(0, class_transformer_1.Transform)(({ value }) => (value === undefined || value === null ? 0 : Number(value))),
|
|
207
|
+
(0, class_transformer_1.Expose)(),
|
|
208
|
+
__metadata("design:type", Number)
|
|
209
|
+
], CreatePackageDto.prototype, "price", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
(0, class_validator_1.IsOptional)(),
|
|
212
|
+
(0, class_validator_1.IsNumber)(),
|
|
213
|
+
(0, class_validator_1.Min)(0),
|
|
214
|
+
(0, class_transformer_1.Expose)(),
|
|
215
|
+
__metadata("design:type", Number)
|
|
216
|
+
], CreatePackageDto.prototype, "weekendPrice", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
(0, class_validator_1.IsArray)(),
|
|
219
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
220
|
+
(0, class_transformer_1.Transform)(({ value }) => (Array.isArray(value) ? value.map((v) => +v) : [5, 6])),
|
|
221
|
+
(0, class_transformer_1.Expose)(),
|
|
222
|
+
__metadata("design:type", Array)
|
|
223
|
+
], CreatePackageDto.prototype, "weekendDays", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
(0, class_validator_1.IsInt)(),
|
|
226
|
+
(0, class_validator_1.Min)(0),
|
|
227
|
+
(0, class_transformer_1.Transform)(({ value }) => (value === undefined || value === null ? 0 : +value)),
|
|
228
|
+
(0, class_transformer_1.Expose)(),
|
|
229
|
+
__metadata("design:type", Number)
|
|
230
|
+
], CreatePackageDto.prototype, "includedPlayers", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
(0, class_validator_1.IsNumber)(),
|
|
233
|
+
(0, class_validator_1.Min)(0),
|
|
234
|
+
(0, class_transformer_1.Transform)(({ value }) => (value === undefined || value === null ? 0 : Number(value))),
|
|
235
|
+
(0, class_transformer_1.Expose)(),
|
|
236
|
+
__metadata("design:type", Number)
|
|
237
|
+
], CreatePackageDto.prototype, "extraPlayerPrice", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
(0, class_validator_1.IsNumber)(),
|
|
240
|
+
(0, class_validator_1.Min)(0),
|
|
241
|
+
(0, class_transformer_1.Transform)(({ value }) => (value === undefined || value === null ? 0 : Number(value))),
|
|
242
|
+
(0, class_transformer_1.Expose)(),
|
|
243
|
+
__metadata("design:type", Number)
|
|
244
|
+
], CreatePackageDto.prototype, "prepayment", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
(0, class_validator_1.IsArray)(),
|
|
247
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
248
|
+
(0, class_transformer_1.Transform)(({ value }) => (Array.isArray(value) ? value.map((v) => +v) : [])),
|
|
249
|
+
(0, class_transformer_1.Expose)(),
|
|
250
|
+
__metadata("design:type", Array)
|
|
251
|
+
], CreatePackageDto.prototype, "addonUpsellingIds", void 0);
|
|
173
252
|
__decorate([
|
|
174
253
|
(0, class_validator_1.IsEnum)(package_discount_type_enum_1.PackageDiscountTypeEnum),
|
|
175
254
|
(0, class_transformer_1.Transform)(({ value }) => value !== null && value !== void 0 ? value : package_discount_type_enum_1.PackageDiscountTypeEnum.PERCENT),
|
|
@@ -177,7 +256,8 @@ __decorate([
|
|
|
177
256
|
__metadata("design:type", String)
|
|
178
257
|
], CreatePackageDto.prototype, "discountType", void 0);
|
|
179
258
|
__decorate([
|
|
180
|
-
(0, class_validator_1.ValidateIf)((o) => o.
|
|
259
|
+
(0, class_validator_1.ValidateIf)((o) => o.pricingMode !== package_pricing_mode_enum_1.PackagePricingModeEnum.FIXED &&
|
|
260
|
+
o.discountType !== package_discount_type_enum_1.PackageDiscountTypeEnum.FULL),
|
|
181
261
|
(0, class_validator_1.IsNumber)(),
|
|
182
262
|
(0, class_validator_1.Min)(0),
|
|
183
263
|
(0, class_transformer_1.Transform)(({ value }) => (value === undefined || value === null ? 0 : Number(value))),
|