@escapenavigator/types 1.6.92 → 1.6.94

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.
@@ -0,0 +1,6 @@
1
+ import { Participant } from '../../order/waivers/order-to-sign.ro';
2
+ import { OpenapiOrderRO } from './openapi-order.ro';
3
+ export declare class OpenapiOrderForOrderServiceRO extends OpenapiOrderRO {
4
+ participants: Participant[];
5
+ needWaiver: boolean;
6
+ }
@@ -9,22 +9,20 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SignOrderFormDTO = void 0;
12
+ exports.OpenapiOrderForOrderServiceRO = void 0;
13
13
  /* eslint-disable max-classes-per-file */
14
14
  const class_transformer_1 = require("class-transformer");
15
- const class_validator_1 = require("class-validator");
16
- const is_not_blank_1 = require("../../shared/is-not-blank");
17
- const sign_order_dto_1 = require("./sign-order.dto");
18
- class SignOrderFormDTO extends sign_order_dto_1.SignOrderDTO {
15
+ const order_to_sign_ro_1 = require("../../order/waivers/order-to-sign.ro");
16
+ const openapi_order_ro_1 = require("./openapi-order.ro");
17
+ class OpenapiOrderForOrderServiceRO extends openapi_order_ro_1.OpenapiOrderRO {
19
18
  }
20
19
  __decorate([
21
- (0, class_validator_1.IsBoolean)(),
22
20
  (0, class_transformer_1.Expose)(),
23
- __metadata("design:type", Boolean)
24
- ], SignOrderFormDTO.prototype, "agree", void 0);
21
+ (0, class_transformer_1.Type)(() => order_to_sign_ro_1.Participant),
22
+ __metadata("design:type", Array)
23
+ ], OpenapiOrderForOrderServiceRO.prototype, "participants", void 0);
25
24
  __decorate([
26
- (0, is_not_blank_1.IsNotBlank)(),
27
25
  (0, class_transformer_1.Expose)(),
28
- __metadata("design:type", String)
29
- ], SignOrderFormDTO.prototype, "step", void 0);
30
- exports.SignOrderFormDTO = SignOrderFormDTO;
26
+ __metadata("design:type", Boolean)
27
+ ], OpenapiOrderForOrderServiceRO.prototype, "needWaiver", void 0);
28
+ exports.OpenapiOrderForOrderServiceRO = OpenapiOrderForOrderServiceRO;
@@ -36,6 +36,7 @@ declare class Profile {
36
36
  export declare class OpenapiWidgetInfoRO {
37
37
  uuid: string;
38
38
  testMode: boolean;
39
+ withWaiver: boolean;
39
40
  upsellings: OpenapiUpsellingRO[];
40
41
  language: Languages;
41
42
  type: WidgetTypeEnum;
@@ -113,6 +113,10 @@ __decorate([
113
113
  (0, class_transformer_1.Expose)(),
114
114
  __metadata("design:type", Boolean)
115
115
  ], OpenapiWidgetInfoRO.prototype, "testMode", void 0);
116
+ __decorate([
117
+ (0, class_transformer_1.Expose)(),
118
+ __metadata("design:type", Boolean)
119
+ ], OpenapiWidgetInfoRO.prototype, "withWaiver", void 0);
116
120
  __decorate([
117
121
  (0, class_transformer_1.Expose)(),
118
122
  (0, class_transformer_1.Type)(() => openapi_upselling_ro_1.OpenapiUpsellingRO),
@@ -1,16 +1,26 @@
1
1
  import { QuestroomRow } from '../../openapi/shared/openapi-questroom.ro';
2
2
  import { Languages } from '../../shared/enum/languages.enum';
3
- declare class Participant {
3
+ declare class Client {
4
4
  name: string;
5
5
  surname: string;
6
+ email: string;
7
+ phone: string;
8
+ }
9
+ export declare class Participant {
10
+ id: number;
11
+ name: string;
12
+ surname: string;
13
+ email: string;
6
14
  }
7
15
  export declare class OrderForSignRO extends QuestroomRow {
8
16
  code: string;
9
17
  profileId: number;
10
18
  language?: Languages;
11
19
  canceledWithFine: boolean;
20
+ needWaiver: boolean;
12
21
  players: number;
13
22
  utcDate: string;
14
23
  participants: Participant[];
24
+ client: Client;
15
25
  }
16
26
  export {};
@@ -9,23 +9,49 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OrderForSignRO = void 0;
12
+ exports.OrderForSignRO = exports.Participant = void 0;
13
13
  /* eslint-disable max-classes-per-file */
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const openapi_questroom_ro_1 = require("../../openapi/shared/openapi-questroom.ro");
16
16
  const languages_enum_1 = require("../../shared/enum/languages.enum");
17
+ class Client {
18
+ }
19
+ __decorate([
20
+ (0, class_transformer_1.Expose)(),
21
+ __metadata("design:type", String)
22
+ ], Client.prototype, "name", void 0);
23
+ __decorate([
24
+ (0, class_transformer_1.Expose)(),
25
+ __metadata("design:type", String)
26
+ ], Client.prototype, "surname", void 0);
27
+ __decorate([
28
+ (0, class_transformer_1.Expose)(),
29
+ __metadata("design:type", String)
30
+ ], Client.prototype, "email", void 0);
31
+ __decorate([
32
+ (0, class_transformer_1.Expose)(),
33
+ __metadata("design:type", String)
34
+ ], Client.prototype, "phone", void 0);
17
35
  class Participant {
18
36
  }
19
37
  __decorate([
20
38
  (0, class_transformer_1.Expose)(),
21
- (0, class_transformer_1.Transform)(({ value }) => value.slice(0, 2) + '*'.repeat(value.length - 2)),
39
+ __metadata("design:type", Number)
40
+ ], Participant.prototype, "id", void 0);
41
+ __decorate([
42
+ (0, class_transformer_1.Expose)(),
22
43
  __metadata("design:type", String)
23
44
  ], Participant.prototype, "name", void 0);
24
45
  __decorate([
25
46
  (0, class_transformer_1.Expose)(),
26
- (0, class_transformer_1.Transform)(({ value }) => value.slice(0, 2) + '*'.repeat(value.length - 2)),
47
+ (0, class_transformer_1.Transform)(({ value }) => `${value.slice(0, 1)}.`),
27
48
  __metadata("design:type", String)
28
49
  ], Participant.prototype, "surname", void 0);
50
+ __decorate([
51
+ (0, class_transformer_1.Expose)(),
52
+ __metadata("design:type", String)
53
+ ], Participant.prototype, "email", void 0);
54
+ exports.Participant = Participant;
29
55
  class OrderForSignRO extends openapi_questroom_ro_1.QuestroomRow {
30
56
  }
31
57
  __decorate([
@@ -44,6 +70,10 @@ __decorate([
44
70
  (0, class_transformer_1.Expose)(),
45
71
  __metadata("design:type", Boolean)
46
72
  ], OrderForSignRO.prototype, "canceledWithFine", void 0);
73
+ __decorate([
74
+ (0, class_transformer_1.Expose)(),
75
+ __metadata("design:type", Boolean)
76
+ ], OrderForSignRO.prototype, "needWaiver", void 0);
47
77
  __decorate([
48
78
  (0, class_transformer_1.Expose)(),
49
79
  __metadata("design:type", Number)
@@ -57,4 +87,9 @@ __decorate([
57
87
  (0, class_transformer_1.Type)(() => Participant),
58
88
  __metadata("design:type", Array)
59
89
  ], OrderForSignRO.prototype, "participants", void 0);
90
+ __decorate([
91
+ (0, class_transformer_1.Expose)(),
92
+ (0, class_transformer_1.Type)(() => Client),
93
+ __metadata("design:type", Client)
94
+ ], OrderForSignRO.prototype, "client", void 0);
60
95
  exports.OrderForSignRO = OrderForSignRO;
@@ -1,18 +1,19 @@
1
- declare class Signee {
2
- name: string;
3
- surname: string;
4
- email: string;
5
- phone: string;
6
- }
7
- declare class Child {
1
+ declare class Minor {
8
2
  name: string;
9
3
  surname: string;
4
+ birthday: string;
10
5
  }
11
6
  export declare class SignOrderDTO {
7
+ agree: boolean;
8
+ step: 'form' | 'sign';
12
9
  orderToken: string;
10
+ emails: string[];
13
11
  signBase64: string;
14
12
  isParticipant: boolean;
15
- signee: Signee;
16
- chilren: Child[];
13
+ name: string;
14
+ surname: string;
15
+ email: string;
16
+ phone: string;
17
+ childs: Minor[];
17
18
  }
18
19
  export {};
@@ -13,43 +13,52 @@ exports.SignOrderDTO = void 0;
13
13
  /* eslint-disable max-classes-per-file */
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const class_validator_1 = require("class-validator");
16
+ const ins_minor_1 = require("../../shared/ins-minor");
16
17
  const is_not_blank_1 = require("../../shared/is-not-blank");
17
- class Signee {
18
+ const is_uniq_email_1 = require("../../shared/is-uniq-email");
19
+ class Minor {
18
20
  }
19
21
  __decorate([
22
+ (0, is_not_blank_1.IsNotBlank)(),
20
23
  (0, class_transformer_1.Expose)(),
21
24
  __metadata("design:type", String)
22
- ], Signee.prototype, "name", void 0);
23
- __decorate([
24
- (0, class_transformer_1.Expose)(),
25
- __metadata("design:type", String)
26
- ], Signee.prototype, "surname", void 0);
25
+ ], Minor.prototype, "name", void 0);
27
26
  __decorate([
27
+ (0, is_not_blank_1.IsNotBlank)(),
28
28
  (0, class_transformer_1.Expose)(),
29
29
  __metadata("design:type", String)
30
- ], Signee.prototype, "email", void 0);
30
+ ], Minor.prototype, "surname", void 0);
31
31
  __decorate([
32
+ (0, is_not_blank_1.IsNotBlank)(),
33
+ (0, ins_minor_1.IsMinor)(),
32
34
  (0, class_transformer_1.Expose)(),
33
35
  __metadata("design:type", String)
34
- ], Signee.prototype, "phone", void 0);
35
- class Child {
36
+ ], Minor.prototype, "birthday", void 0);
37
+ class SignOrderDTO {
36
38
  }
37
39
  __decorate([
40
+ (0, class_validator_1.ValidateIf)(({ step }) => step === 'sign'),
41
+ (0, class_validator_1.IsBoolean)(),
38
42
  (0, class_transformer_1.Expose)(),
39
- __metadata("design:type", String)
40
- ], Child.prototype, "name", void 0);
43
+ __metadata("design:type", Boolean)
44
+ ], SignOrderDTO.prototype, "agree", void 0);
41
45
  __decorate([
46
+ (0, is_not_blank_1.IsNotBlank)(),
42
47
  (0, class_transformer_1.Expose)(),
43
48
  __metadata("design:type", String)
44
- ], Child.prototype, "surname", void 0);
45
- class SignOrderDTO {
46
- }
49
+ ], SignOrderDTO.prototype, "step", void 0);
47
50
  __decorate([
48
51
  (0, is_not_blank_1.IsNotBlank)(),
49
52
  (0, class_transformer_1.Expose)(),
50
53
  __metadata("design:type", String)
51
54
  ], SignOrderDTO.prototype, "orderToken", void 0);
52
55
  __decorate([
56
+ (0, class_transformer_1.Expose)(),
57
+ (0, class_validator_1.IsArray)(),
58
+ __metadata("design:type", Array)
59
+ ], SignOrderDTO.prototype, "emails", void 0);
60
+ __decorate([
61
+ (0, class_validator_1.ValidateIf)(({ step }) => step === 'sign'),
53
62
  (0, is_not_blank_1.IsNotBlank)(),
54
63
  (0, class_transformer_1.Expose)(),
55
64
  __metadata("design:type", String)
@@ -60,15 +69,31 @@ __decorate([
60
69
  __metadata("design:type", Boolean)
61
70
  ], SignOrderDTO.prototype, "isParticipant", void 0);
62
71
  __decorate([
63
- (0, class_transformer_1.Type)(() => Signee),
64
- (0, class_validator_1.ValidateNested)({ each: true }),
72
+ (0, is_not_blank_1.IsNotBlank)(),
73
+ (0, class_transformer_1.Expose)(),
74
+ __metadata("design:type", String)
75
+ ], SignOrderDTO.prototype, "name", void 0);
76
+ __decorate([
77
+ (0, is_not_blank_1.IsNotBlank)(),
78
+ (0, class_transformer_1.Expose)(),
79
+ __metadata("design:type", String)
80
+ ], SignOrderDTO.prototype, "surname", void 0);
81
+ __decorate([
82
+ (0, class_validator_1.IsEmail)(),
83
+ (0, is_uniq_email_1.IsEmailUnique)(),
65
84
  (0, class_transformer_1.Expose)(),
66
- __metadata("design:type", Signee)
67
- ], SignOrderDTO.prototype, "signee", void 0);
85
+ __metadata("design:type", String)
86
+ ], SignOrderDTO.prototype, "email", void 0);
87
+ __decorate([
88
+ (0, is_not_blank_1.IsNotBlank)(),
89
+ (0, class_transformer_1.Expose)(),
90
+ __metadata("design:type", String)
91
+ ], SignOrderDTO.prototype, "phone", void 0);
68
92
  __decorate([
69
- (0, class_transformer_1.Type)(() => Child),
70
- (0, class_validator_1.ValidateNested)({ each: true }),
93
+ (0, class_validator_1.IsArray)(),
71
94
  (0, class_transformer_1.Expose)(),
95
+ (0, class_validator_1.ValidateNested)(),
96
+ (0, class_transformer_1.Type)(() => Minor),
72
97
  __metadata("design:type", Array)
73
- ], SignOrderDTO.prototype, "chilren", void 0);
98
+ ], SignOrderDTO.prototype, "childs", void 0);
74
99
  exports.SignOrderDTO = SignOrderDTO;
@@ -1,10 +1,4 @@
1
- import { EmailStatusEnum } from '../emails/enum/email.status-enum';
2
- declare class ProfileEmail {
3
- createdAt: Date;
4
- id: number;
5
- to: string;
6
- status: EmailStatusEnum;
7
- }
1
+ import { ProfileEmailCardRO } from '../profile/email/profile-email-card.ro';
8
2
  declare class Scenario {
9
3
  title: string;
10
4
  }
@@ -12,7 +6,7 @@ export declare class OrderEmailRO {
12
6
  id: number;
13
7
  type: 'crossSale' | 'upSale' | 'retargeting' | 'earlyBooking' | 'scenario';
14
8
  disabled: boolean;
15
- profileEmails: ProfileEmail[];
9
+ profileEmails: ProfileEmailCardRO[];
16
10
  sendAt: string;
17
11
  scenario: Scenario;
18
12
  }
@@ -12,25 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OrderEmailRO = void 0;
13
13
  /* eslint-disable max-classes-per-file */
14
14
  const class_transformer_1 = require("class-transformer");
15
- const email_status_enum_1 = require("../emails/enum/email.status-enum");
16
- class ProfileEmail {
17
- }
18
- __decorate([
19
- (0, class_transformer_1.Expose)(),
20
- __metadata("design:type", Date)
21
- ], ProfileEmail.prototype, "createdAt", void 0);
22
- __decorate([
23
- (0, class_transformer_1.Expose)(),
24
- __metadata("design:type", Number)
25
- ], ProfileEmail.prototype, "id", void 0);
26
- __decorate([
27
- (0, class_transformer_1.Expose)(),
28
- __metadata("design:type", String)
29
- ], ProfileEmail.prototype, "to", void 0);
30
- __decorate([
31
- (0, class_transformer_1.Expose)(),
32
- __metadata("design:type", String)
33
- ], ProfileEmail.prototype, "status", void 0);
15
+ const profile_email_card_ro_1 = require("../profile/email/profile-email-card.ro");
34
16
  class Scenario {
35
17
  }
36
18
  __decorate([
@@ -53,7 +35,7 @@ __decorate([
53
35
  ], OrderEmailRO.prototype, "disabled", void 0);
54
36
  __decorate([
55
37
  (0, class_transformer_1.Expose)(),
56
- (0, class_transformer_1.Type)(() => ProfileEmail),
38
+ (0, class_transformer_1.Type)(() => profile_email_card_ro_1.ProfileEmailCardRO),
57
39
  __metadata("design:type", Array)
58
40
  ], OrderEmailRO.prototype, "profileEmails", void 0);
59
41
  __decorate([
@@ -1,6 +1,10 @@
1
+ import { EmailStatusEnum } from '../../emails/enum/email.status-enum';
1
2
  export declare class ProfileEmailCardRO {
3
+ id: number;
4
+ createdAt: Date;
2
5
  to: string;
3
6
  subject: string;
7
+ status: EmailStatusEnum;
4
8
  opens: number[];
5
9
  clicks: string[];
6
10
  tags: string[];
@@ -11,8 +11,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProfileEmailCardRO = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
+ const email_status_enum_1 = require("../../emails/enum/email.status-enum");
14
15
  class ProfileEmailCardRO {
15
16
  }
17
+ __decorate([
18
+ (0, class_transformer_1.Expose)(),
19
+ __metadata("design:type", Number)
20
+ ], ProfileEmailCardRO.prototype, "id", void 0);
21
+ __decorate([
22
+ (0, class_transformer_1.Expose)(),
23
+ __metadata("design:type", Date)
24
+ ], ProfileEmailCardRO.prototype, "createdAt", void 0);
16
25
  __decorate([
17
26
  (0, class_transformer_1.Expose)(),
18
27
  __metadata("design:type", String)
@@ -21,6 +30,10 @@ __decorate([
21
30
  (0, class_transformer_1.Expose)(),
22
31
  __metadata("design:type", String)
23
32
  ], ProfileEmailCardRO.prototype, "subject", void 0);
33
+ __decorate([
34
+ (0, class_transformer_1.Expose)(),
35
+ __metadata("design:type", String)
36
+ ], ProfileEmailCardRO.prototype, "status", void 0);
24
37
  __decorate([
25
38
  (0, class_transformer_1.Expose)(),
26
39
  __metadata("design:type", Array)
@@ -0,0 +1,2 @@
1
+ import { ValidationOptions } from 'class-validator';
2
+ export declare function IsMinor(validationOptions?: ValidationOptions): (object: any, propertyName: string) => void;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IsMinor = void 0;
4
+ const class_validator_1 = require("class-validator");
5
+ function IsMinor(validationOptions) {
6
+ return function (object, propertyName) {
7
+ (0, class_validator_1.registerDecorator)({
8
+ name: 'isMinor',
9
+ target: object.constructor,
10
+ propertyName,
11
+ options: validationOptions,
12
+ validator: {
13
+ validate(value) {
14
+ if (typeof value !== 'string') {
15
+ return false;
16
+ }
17
+ const birthday = new Date(value);
18
+ if (Number.isNaN(birthday.getTime())) {
19
+ return false;
20
+ }
21
+ const today = new Date();
22
+ const age = today.getFullYear() - birthday.getFullYear();
23
+ const monthDifference = today.getMonth() - birthday.getMonth();
24
+ const dayDifference = today.getDate() - birthday.getDate();
25
+ if (monthDifference < 0 || (monthDifference === 0 && dayDifference < 0)) {
26
+ return age - 1 >= 18;
27
+ }
28
+ return age < 18;
29
+ },
30
+ defaultMessage() {
31
+ return 'Age should be less than 18';
32
+ },
33
+ },
34
+ });
35
+ };
36
+ }
37
+ exports.IsMinor = IsMinor;
@@ -0,0 +1,2 @@
1
+ import { ValidationOptions } from 'class-validator';
2
+ export declare function IsEmailUnique(validationOptions?: ValidationOptions): (object: any, propertyName: string) => void;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IsEmailUnique = void 0;
4
+ const class_validator_1 = require("class-validator");
5
+ function IsEmailUnique(validationOptions) {
6
+ return function (object, propertyName) {
7
+ (0, class_validator_1.registerDecorator)({
8
+ name: 'isEmailUnique',
9
+ target: object.constructor,
10
+ propertyName,
11
+ options: validationOptions,
12
+ validator: {
13
+ validate(value, args) {
14
+ var _a;
15
+ const emails = (_a = args.object) === null || _a === void 0 ? void 0 : _a.emails;
16
+ if (!Array.isArray(emails)) {
17
+ return false;
18
+ }
19
+ return !emails.includes(value);
20
+ },
21
+ defaultMessage() {
22
+ return 'This email already signed waiver!';
23
+ },
24
+ },
25
+ });
26
+ };
27
+ }
28
+ exports.IsEmailUnique = IsEmailUnique;