@escapenavigator/types 2.0.34 → 2.0.38
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/email-builder/email-content.dto.d.ts +26 -0
- package/dist/email-builder/email-content.dto.js +62 -0
- package/dist/email-builder/index.d.ts +81 -0
- package/dist/email-builder/index.js +89 -1
- package/dist/emails/index.d.ts +25 -2
- 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/openapi/upsellings/openapi-upselling.ro.d.ts +1 -0
- package/dist/openapi/upsellings/openapi-upselling.ro.js +4 -0
- 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/birthday-marketing/birthday-marketing.dto.d.ts +2 -2
- package/dist/profile/birthday-marketing/birthday-marketing.dto.js +3 -1
- package/dist/profile/company-ai-context.d.ts +2 -0
- package/dist/profile/cross-sale/cross-sale.dto.d.ts +2 -2
- package/dist/profile/cross-sale/cross-sale.dto.js +3 -1
- package/dist/profile/cross-sale/cross-sale.ro.d.ts +2 -2
- package/dist/profile/custom-client-booking-email/custom-client-booking-email.dto.d.ts +2 -2
- package/dist/profile/custom-client-booking-email/custom-client-booking-email.dto.js +3 -1
- package/dist/profile/custom-client-booking-email/custom-client-booking-email.ro.d.ts +2 -2
- package/dist/profile/marketing-automation/marketing-automation.dto.d.ts +2 -2
- package/dist/profile/marketing-automation/marketing-automation.dto.js +3 -1
- package/dist/profile/marketing-automation/marketing-automation.ro.d.ts +2 -2
- package/dist/profile/marketing-email/create-profile-marketing-email-campaign.dto.d.ts +14 -13
- package/dist/profile/marketing-email/create-profile-marketing-email-campaign.dto.js +19 -28
- package/dist/profile/marketing-email/preflight-issue.ro.d.ts +31 -1
- package/dist/profile/marketing-email/preflight-issue.ro.js +30 -0
- package/dist/profile/marketing-email/preview-campaign-v2.dto.d.ts +2 -2
- package/dist/profile/marketing-email/preview-campaign-v2.dto.js +2 -2
- package/dist/profile/marketing-email/preview-profile-marketing-segment.dto.d.ts +6 -0
- package/dist/profile/marketing-email/preview-profile-marketing-segment.dto.js +8 -0
- package/dist/profile/marketing-email/preview-profile-marketing-segment.ro.d.ts +6 -1
- package/dist/profile/marketing-email/preview-profile-marketing-segment.ro.js +9 -1
- package/dist/profile/marketing-email/profile-marketing-email-campaign.ro.d.ts +11 -2
- package/dist/profile/marketing-email/profile-marketing-email-campaign.ro.js +12 -0
- package/dist/profile/marketing-email/profile-marketing-email-recipient-status.enum.d.ts +6 -0
- package/dist/profile/marketing-email/profile-marketing-email-recipient-status.enum.js +6 -0
- package/dist/profile/marketing-email/test-send-email-v2.dto.d.ts +2 -2
- package/dist/profile/marketing-email/test-send-email-v2.dto.js +2 -2
- 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/questroom-scenario-email/create-questroom-scenario-email.dto.d.ts +2 -2
- package/dist/questroom-scenario-email/create-questroom-scenario-email.dto.js +3 -1
- package/dist/questroom-scenario-email/questroom-scenario-email.ro.d.ts +2 -2
- 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/upselling/create-upselling.dto.d.ts +5 -0
- package/dist/upselling/create-upselling.dto.js +8 -0
- package/dist/upselling/upselling.ro.d.ts +1 -0
- package/dist/upselling/upselling.ro.js +4 -0
- 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
|
@@ -218,6 +218,14 @@ __decorate([
|
|
|
218
218
|
(0, class_transformer_1.Expose)(),
|
|
219
219
|
__metadata("design:type", Number)
|
|
220
220
|
], OpenapiOrderRO.prototype, "slotDiscount", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
(0, class_transformer_1.Expose)(),
|
|
223
|
+
__metadata("design:type", Number)
|
|
224
|
+
], OpenapiOrderRO.prototype, "loyaltyDiscount", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
(0, class_transformer_1.Expose)(),
|
|
227
|
+
__metadata("design:type", Number)
|
|
228
|
+
], OpenapiOrderRO.prototype, "bonusTotal", void 0);
|
|
221
229
|
__decorate([
|
|
222
230
|
(0, class_transformer_1.Expose)(),
|
|
223
231
|
(0, class_transformer_1.Type)(() => openapi_order_upselling_ro_1.OpenapiOrderUpsellingRO),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Статус сертификата в публичном API. Внутри системы отдельной колонки
|
|
3
|
+
* статуса нет — он выводится из флагов продажи (`annul` / `used` / `toPay` /
|
|
4
|
+
* `balance` / `expireDate`), поэтому наружу отдаём короткий стабильный
|
|
5
|
+
* словарь вместо CRM-ного `CertificatesaleStatusEnum`, где половина значений
|
|
6
|
+
* описывает стадию доставки, а не право на погашение.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum OpenapiCertificateStatusEnum {
|
|
9
|
+
ACTIVE = "active",
|
|
10
|
+
PARTLY_USED = "partly_used",
|
|
11
|
+
USED = "used",
|
|
12
|
+
ANNULLED = "annulled",
|
|
13
|
+
EXPIRED = "expired",
|
|
14
|
+
NOT_PAID = "not_paid"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Порядок проверок повторяет приоритет CRM-статусов (`get-certificate-data`):
|
|
18
|
+
* аннулирование перекрывает всё, затем полное погашение, затем срок, затем
|
|
19
|
+
* неоплата. Частичное погашение показываем только пока остаток можно потратить.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveOpenapiCertificateStatus({ annul, used, usedAmount, balance, toPay, expireDate, now, }: {
|
|
22
|
+
annul: boolean;
|
|
23
|
+
used: boolean;
|
|
24
|
+
usedAmount: number;
|
|
25
|
+
balance: number;
|
|
26
|
+
toPay: number;
|
|
27
|
+
expireDate: string;
|
|
28
|
+
now?: Date;
|
|
29
|
+
}): OpenapiCertificateStatusEnum;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenapiCertificateStatusEnum = void 0;
|
|
4
|
+
exports.resolveOpenapiCertificateStatus = resolveOpenapiCertificateStatus;
|
|
5
|
+
/**
|
|
6
|
+
* Статус сертификата в публичном API. Внутри системы отдельной колонки
|
|
7
|
+
* статуса нет — он выводится из флагов продажи (`annul` / `used` / `toPay` /
|
|
8
|
+
* `balance` / `expireDate`), поэтому наружу отдаём короткий стабильный
|
|
9
|
+
* словарь вместо CRM-ного `CertificatesaleStatusEnum`, где половина значений
|
|
10
|
+
* описывает стадию доставки, а не право на погашение.
|
|
11
|
+
*/
|
|
12
|
+
var OpenapiCertificateStatusEnum;
|
|
13
|
+
(function (OpenapiCertificateStatusEnum) {
|
|
14
|
+
OpenapiCertificateStatusEnum["ACTIVE"] = "active";
|
|
15
|
+
OpenapiCertificateStatusEnum["PARTLY_USED"] = "partly_used";
|
|
16
|
+
OpenapiCertificateStatusEnum["USED"] = "used";
|
|
17
|
+
OpenapiCertificateStatusEnum["ANNULLED"] = "annulled";
|
|
18
|
+
OpenapiCertificateStatusEnum["EXPIRED"] = "expired";
|
|
19
|
+
OpenapiCertificateStatusEnum["NOT_PAID"] = "not_paid";
|
|
20
|
+
})(OpenapiCertificateStatusEnum || (exports.OpenapiCertificateStatusEnum = OpenapiCertificateStatusEnum = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Порядок проверок повторяет приоритет CRM-статусов (`get-certificate-data`):
|
|
23
|
+
* аннулирование перекрывает всё, затем полное погашение, затем срок, затем
|
|
24
|
+
* неоплата. Частичное погашение показываем только пока остаток можно потратить.
|
|
25
|
+
*/
|
|
26
|
+
function resolveOpenapiCertificateStatus({ annul, used, usedAmount, balance, toPay, expireDate, now = new Date(), }) {
|
|
27
|
+
if (annul)
|
|
28
|
+
return OpenapiCertificateStatusEnum.ANNULLED;
|
|
29
|
+
if (used || balance <= 0)
|
|
30
|
+
return OpenapiCertificateStatusEnum.USED;
|
|
31
|
+
if (expireDate && new Date(expireDate) < now)
|
|
32
|
+
return OpenapiCertificateStatusEnum.EXPIRED;
|
|
33
|
+
if (toPay > 0)
|
|
34
|
+
return OpenapiCertificateStatusEnum.NOT_PAID;
|
|
35
|
+
if (usedAmount > 0)
|
|
36
|
+
return OpenapiCertificateStatusEnum.PARTLY_USED;
|
|
37
|
+
return OpenapiCertificateStatusEnum.ACTIVE;
|
|
38
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.OpenapiAnnulCertificateDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class OpenapiAnnulCertificateDto {
|
|
16
|
+
}
|
|
17
|
+
exports.OpenapiAnnulCertificateDto = OpenapiAnnulCertificateDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
required: false,
|
|
21
|
+
example: 'Refunded to the customer',
|
|
22
|
+
maxLength: 500,
|
|
23
|
+
description: 'Why the certificate is being voided. Stored on the certificate and shown to the venue staff.',
|
|
24
|
+
}),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.Length)(1, 500),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], OpenapiAnnulCertificateDto.prototype, "reason", void 0);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ProfileCurrencyEnum } from '../../profile/enum/profile-currency';
|
|
2
|
+
import { SourceEnum } from '../../shared/source.enum';
|
|
3
|
+
import { OpenapiCertificateStatusEnum } from './enum/openapi-certificate-status.enum';
|
|
4
|
+
export declare class OpenapiCertificateClientRO {
|
|
5
|
+
name: string | null;
|
|
6
|
+
surname: string | null;
|
|
7
|
+
phone: string | null;
|
|
8
|
+
email: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare class OpenapiCertificateUsageRO {
|
|
11
|
+
orderId: number;
|
|
12
|
+
amount: number;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare class OpenapiCertificateRO {
|
|
16
|
+
certificateId: number;
|
|
17
|
+
code: string;
|
|
18
|
+
externalId: string | null;
|
|
19
|
+
status: OpenapiCertificateStatusEnum;
|
|
20
|
+
nominal: number;
|
|
21
|
+
usedAmount: number;
|
|
22
|
+
balance: number;
|
|
23
|
+
currency: ProfileCurrencyEnum;
|
|
24
|
+
expireDate: string;
|
|
25
|
+
maxUsages: number;
|
|
26
|
+
annulled: boolean;
|
|
27
|
+
annulledAt: Date | null;
|
|
28
|
+
annulReason: string | null;
|
|
29
|
+
source: SourceEnum;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
client: OpenapiCertificateClientRO | null;
|
|
32
|
+
usages: OpenapiCertificateUsageRO[];
|
|
33
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
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.OpenapiCertificateRO = exports.OpenapiCertificateUsageRO = exports.OpenapiCertificateClientRO = 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 profile_currency_1 = require("../../profile/enum/profile-currency");
|
|
17
|
+
const source_enum_1 = require("../../shared/source.enum");
|
|
18
|
+
const openapi_certificate_status_enum_1 = require("./enum/openapi-certificate-status.enum");
|
|
19
|
+
class OpenapiCertificateClientRO {
|
|
20
|
+
}
|
|
21
|
+
exports.OpenapiCertificateClientRO = OpenapiCertificateClientRO;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Expose)(),
|
|
24
|
+
(0, swagger_1.ApiProperty)({ example: 'John', nullable: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], OpenapiCertificateClientRO.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_transformer_1.Expose)(),
|
|
29
|
+
(0, swagger_1.ApiProperty)({ example: 'Doe', nullable: true }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], OpenapiCertificateClientRO.prototype, "surname", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_transformer_1.Expose)(),
|
|
34
|
+
(0, swagger_1.ApiProperty)({ example: '+491701234567', nullable: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], OpenapiCertificateClientRO.prototype, "phone", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Expose)(),
|
|
39
|
+
(0, swagger_1.ApiProperty)({ example: 'john@example.com', nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], OpenapiCertificateClientRO.prototype, "email", void 0);
|
|
42
|
+
class OpenapiCertificateUsageRO {
|
|
43
|
+
}
|
|
44
|
+
exports.OpenapiCertificateUsageRO = OpenapiCertificateUsageRO;
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_transformer_1.Expose)(),
|
|
47
|
+
(0, swagger_1.ApiProperty)({ example: 12345, description: 'Booking the certificate was redeemed against.' }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], OpenapiCertificateUsageRO.prototype, "orderId", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_transformer_1.Expose)(),
|
|
52
|
+
(0, swagger_1.ApiProperty)({
|
|
53
|
+
example: 3000,
|
|
54
|
+
description: 'Amount spent on that booking, in minor currency units.',
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], OpenapiCertificateUsageRO.prototype, "amount", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_transformer_1.Expose)(),
|
|
60
|
+
(0, swagger_1.ApiProperty)({ example: '2026-04-02T10:15:00.000Z' }),
|
|
61
|
+
__metadata("design:type", Date)
|
|
62
|
+
], OpenapiCertificateUsageRO.prototype, "createdAt", void 0);
|
|
63
|
+
class OpenapiCertificateRO {
|
|
64
|
+
}
|
|
65
|
+
exports.OpenapiCertificateRO = OpenapiCertificateRO;
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_transformer_1.Expose)(),
|
|
68
|
+
(0, swagger_1.ApiProperty)({ example: 987, description: 'Escape Navigator internal certificate id.' }),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], OpenapiCertificateRO.prototype, "certificateId", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_transformer_1.Expose)(),
|
|
73
|
+
(0, swagger_1.ApiProperty)({ example: 'GIFT-2026-000145', description: 'Certificate code.' }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], OpenapiCertificateRO.prototype, "code", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_transformer_1.Expose)(),
|
|
78
|
+
(0, swagger_1.ApiProperty)({
|
|
79
|
+
example: 'partner-sale-98211',
|
|
80
|
+
nullable: true,
|
|
81
|
+
description: 'Your own identifier, passed when the certificate was created.',
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], OpenapiCertificateRO.prototype, "externalId", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, class_transformer_1.Expose)(),
|
|
87
|
+
(0, swagger_1.ApiProperty)({
|
|
88
|
+
enum: openapi_certificate_status_enum_1.OpenapiCertificateStatusEnum,
|
|
89
|
+
example: openapi_certificate_status_enum_1.OpenapiCertificateStatusEnum.ACTIVE,
|
|
90
|
+
description: `Redemption status:
|
|
91
|
+
- \`active\` — can be redeemed;
|
|
92
|
+
- \`partly_used\` — redeemed at least once, balance left;
|
|
93
|
+
- \`used\` — fully redeemed or usage limit reached;
|
|
94
|
+
- \`annulled\` — voided, can no longer be redeemed;
|
|
95
|
+
- \`expired\` — past its expiry date;
|
|
96
|
+
- \`not_paid\` — issued but not settled yet (never happens for certificates created through this API).`,
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], OpenapiCertificateRO.prototype, "status", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, class_transformer_1.Expose)(),
|
|
102
|
+
(0, swagger_1.ApiProperty)({
|
|
103
|
+
example: 5000,
|
|
104
|
+
description: 'Face value in minor currency units.',
|
|
105
|
+
}),
|
|
106
|
+
__metadata("design:type", Number)
|
|
107
|
+
], OpenapiCertificateRO.prototype, "nominal", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, class_transformer_1.Expose)(),
|
|
110
|
+
(0, swagger_1.ApiProperty)({
|
|
111
|
+
example: 2000,
|
|
112
|
+
description: 'Amount already spent on bookings, in minor currency units.',
|
|
113
|
+
}),
|
|
114
|
+
__metadata("design:type", Number)
|
|
115
|
+
], OpenapiCertificateRO.prototype, "usedAmount", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, class_transformer_1.Expose)(),
|
|
118
|
+
(0, swagger_1.ApiProperty)({
|
|
119
|
+
example: 3000,
|
|
120
|
+
description: 'Remaining spendable amount, in minor currency units.',
|
|
121
|
+
}),
|
|
122
|
+
__metadata("design:type", Number)
|
|
123
|
+
], OpenapiCertificateRO.prototype, "balance", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, class_transformer_1.Expose)(),
|
|
126
|
+
(0, swagger_1.ApiProperty)({
|
|
127
|
+
enum: profile_currency_1.ProfileCurrencyEnum,
|
|
128
|
+
example: profile_currency_1.ProfileCurrencyEnum.EUR,
|
|
129
|
+
description: 'Currency of all monetary fields.',
|
|
130
|
+
}),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], OpenapiCertificateRO.prototype, "currency", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, class_transformer_1.Expose)(),
|
|
135
|
+
(0, swagger_1.ApiProperty)({ example: '2027-08-18', description: 'Expiry date (`YYYY-MM-DD`).' }),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], OpenapiCertificateRO.prototype, "expireDate", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, class_transformer_1.Expose)(),
|
|
140
|
+
(0, swagger_1.ApiProperty)({ example: 1, description: 'How many redemptions the certificate allows.' }),
|
|
141
|
+
__metadata("design:type", Number)
|
|
142
|
+
], OpenapiCertificateRO.prototype, "maxUsages", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, class_transformer_1.Expose)(),
|
|
145
|
+
(0, swagger_1.ApiProperty)({ example: false, description: 'Whether the certificate has been voided.' }),
|
|
146
|
+
__metadata("design:type", Boolean)
|
|
147
|
+
], OpenapiCertificateRO.prototype, "annulled", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, class_transformer_1.Expose)(),
|
|
150
|
+
(0, swagger_1.ApiProperty)({
|
|
151
|
+
example: null,
|
|
152
|
+
nullable: true,
|
|
153
|
+
description: 'When the certificate was voided (UTC).',
|
|
154
|
+
}),
|
|
155
|
+
__metadata("design:type", Date)
|
|
156
|
+
], OpenapiCertificateRO.prototype, "annulledAt", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, class_transformer_1.Expose)(),
|
|
159
|
+
(0, swagger_1.ApiProperty)({
|
|
160
|
+
example: null,
|
|
161
|
+
nullable: true,
|
|
162
|
+
description: 'Reason supplied when the certificate was voided.',
|
|
163
|
+
}),
|
|
164
|
+
__metadata("design:type", String)
|
|
165
|
+
], OpenapiCertificateRO.prototype, "annulReason", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, class_transformer_1.Expose)(),
|
|
168
|
+
(0, swagger_1.ApiProperty)({
|
|
169
|
+
enum: source_enum_1.SourceEnum,
|
|
170
|
+
example: source_enum_1.SourceEnum.API,
|
|
171
|
+
description: 'Where the certificate originated from.',
|
|
172
|
+
}),
|
|
173
|
+
__metadata("design:type", String)
|
|
174
|
+
], OpenapiCertificateRO.prototype, "source", void 0);
|
|
175
|
+
__decorate([
|
|
176
|
+
(0, class_transformer_1.Expose)(),
|
|
177
|
+
(0, swagger_1.ApiProperty)({ example: '2026-08-18T14:05:00.000Z' }),
|
|
178
|
+
__metadata("design:type", Date)
|
|
179
|
+
], OpenapiCertificateRO.prototype, "createdAt", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, class_transformer_1.Expose)(),
|
|
182
|
+
(0, class_transformer_1.Type)(() => OpenapiCertificateClientRO),
|
|
183
|
+
(0, swagger_1.ApiProperty)({ type: () => OpenapiCertificateClientRO, nullable: true }),
|
|
184
|
+
__metadata("design:type", OpenapiCertificateClientRO)
|
|
185
|
+
], OpenapiCertificateRO.prototype, "client", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
(0, class_transformer_1.Expose)(),
|
|
188
|
+
(0, class_transformer_1.Type)(() => OpenapiCertificateUsageRO),
|
|
189
|
+
(0, swagger_1.ApiProperty)({
|
|
190
|
+
type: () => OpenapiCertificateUsageRO,
|
|
191
|
+
isArray: true,
|
|
192
|
+
description: 'Bookings the certificate has been redeemed against.',
|
|
193
|
+
}),
|
|
194
|
+
__metadata("design:type", Array)
|
|
195
|
+
], OpenapiCertificateRO.prototype, "usages", void 0);
|
|
@@ -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);
|
|
@@ -62,6 +62,10 @@ __decorate([
|
|
|
62
62
|
(0, class_transformer_1.Expose)(),
|
|
63
63
|
__metadata("design:type", Array)
|
|
64
64
|
], OpenapiUpsellingRO.prototype, "availableDays", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_transformer_1.Expose)(),
|
|
67
|
+
__metadata("design:type", Number)
|
|
68
|
+
], OpenapiUpsellingRO.prototype, "minMinutesBeforeStart", void 0);
|
|
65
69
|
__decorate([
|
|
66
70
|
(0, class_transformer_1.Expose)(),
|
|
67
71
|
__metadata("design:type", Boolean)
|