@escapenavigator/types 2.1.22 → 2.1.24

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.
@@ -13,8 +13,21 @@ exports.UpdateCertificateSettingsDto = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const certificate_shop_flow_order_enum_1 = require("./enum/certificate-shop-flow-order.enum");
16
- function checkBoolean({ value }, defaultValue) {
17
- return value === undefined ? (defaultValue !== null && defaultValue !== void 0 ? defaultValue : false) : value;
16
+ /**
17
+ * Нет ключа в патче — не подставляем дефолт. Иначе ValidationPipe
18
+ * дописывает `false`/`true` на все `@Expose`-поля, и сохранение одной
19
+ * формы магазина затирает поля другой (кастомный номинал, самовывоз).
20
+ */
21
+ function optionalBoolean({ value }) {
22
+ if (value === undefined || value === null)
23
+ return undefined;
24
+ return value;
25
+ }
26
+ function optionalNumber({ value }) {
27
+ if (value === undefined || value === null)
28
+ return undefined;
29
+ const numeric = +value;
30
+ return numeric ? numeric : 0;
18
31
  }
19
32
  class UpdateCertificateSettingsDto {
20
33
  }
@@ -27,7 +40,7 @@ __decorate([
27
40
  ], UpdateCertificateSettingsDto.prototype, "validity", void 0);
28
41
  __decorate([
29
42
  (0, class_validator_1.IsOptional)(),
30
- (0, class_transformer_1.Transform)(({ value }) => (+value ? +value : 0)),
43
+ (0, class_transformer_1.Transform)(optionalNumber),
31
44
  (0, class_validator_1.Min)(0),
32
45
  (0, class_validator_1.IsInt)(),
33
46
  (0, class_transformer_1.Expose)(),
@@ -36,13 +49,13 @@ __decorate([
36
49
  __decorate([
37
50
  (0, class_validator_1.IsOptional)(),
38
51
  (0, class_validator_1.IsBoolean)(),
39
- (0, class_transformer_1.Transform)(({ value }) => checkBoolean({ value }, false)),
52
+ (0, class_transformer_1.Transform)(optionalBoolean),
40
53
  (0, class_transformer_1.Expose)(),
41
54
  __metadata("design:type", Boolean)
42
55
  ], UpdateCertificateSettingsDto.prototype, "allowFreeNominal", void 0);
43
56
  __decorate([
44
57
  (0, class_validator_1.ValidateIf)((o) => o.allowFreeNominal),
45
- (0, class_transformer_1.Transform)(({ value }) => (+value ? +value : 0)),
58
+ (0, class_transformer_1.Transform)(optionalNumber),
46
59
  (0, class_validator_1.Min)(0),
47
60
  (0, class_validator_1.IsInt)(),
48
61
  (0, class_transformer_1.Expose)(),
@@ -50,7 +63,7 @@ __decorate([
50
63
  ], UpdateCertificateSettingsDto.prototype, "freeNominalMin", void 0);
51
64
  __decorate([
52
65
  (0, class_validator_1.ValidateIf)((o) => o.allowFreeNominal),
53
- (0, class_transformer_1.Transform)(({ value }) => (+value ? +value : 0)),
66
+ (0, class_transformer_1.Transform)(optionalNumber),
54
67
  (0, class_validator_1.Min)(0),
55
68
  (0, class_validator_1.IsInt)(),
56
69
  (0, class_transformer_1.Expose)(),
@@ -58,7 +71,7 @@ __decorate([
58
71
  ], UpdateCertificateSettingsDto.prototype, "freeNominalMax", void 0);
59
72
  __decorate([
60
73
  (0, class_validator_1.IsOptional)(),
61
- (0, class_transformer_1.Transform)(({ value }) => (+value ? +value : 0)),
74
+ (0, class_transformer_1.Transform)(optionalNumber),
62
75
  (0, class_validator_1.Min)(0),
63
76
  (0, class_validator_1.Max)(100),
64
77
  (0, class_validator_1.IsNumber)(),
@@ -68,7 +81,7 @@ __decorate([
68
81
  __decorate([
69
82
  (0, class_validator_1.IsOptional)(),
70
83
  (0, class_validator_1.IsBoolean)(),
71
- (0, class_transformer_1.Transform)(({ value }) => checkBoolean({ value }, true)),
84
+ (0, class_transformer_1.Transform)(optionalBoolean),
72
85
  (0, class_transformer_1.Expose)(),
73
86
  __metadata("design:type", Boolean)
74
87
  ], UpdateCertificateSettingsDto.prototype, "pickupAvailable", void 0);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * UI-only answer meaning that the client wants a callback without committing
3
+ * to a preferred time. The submission service keeps the answer for managers,
4
+ * but does not write it into `preferredTime`.
5
+ */
6
+ export declare const LEAD_TIME_UNDECIDED_VALUE = "__time_undecided__";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LEAD_TIME_UNDECIDED_VALUE = void 0;
4
+ /**
5
+ * UI-only answer meaning that the client wants a callback without committing
6
+ * to a preferred time. The submission service keeps the answer for managers,
7
+ * but does not write it into `preferredTime`.
8
+ */
9
+ exports.LEAD_TIME_UNDECIDED_VALUE = '__time_undecided__';
@@ -15,6 +15,8 @@ export declare class PublicLeadFormReferenceRO {
15
15
  */
16
16
  export declare class PublicLeadFormProfileRO {
17
17
  title: string;
18
+ /** Для ссылок на политику и согласие площадки (`/company/:slug/...`). */
19
+ slug: string;
18
20
  logo?: string;
19
21
  country: CountriesEnum;
20
22
  language: Languages;
@@ -14,6 +14,8 @@ export declare class SubmitLeadDto {
14
14
  answers: SubmitLeadAnswerDto[];
15
15
  source?: LeadSourceEnum;
16
16
  meta?: LeadMeta;
17
+ /** Галочка согласия на обработку ПДн. У площадок из РФ без неё заявка не принимается. */
18
+ pdConsent?: boolean;
17
19
  /**
18
20
  * Honeypot: скрытое поле, которое не видит человек. Любое непустое
19
21
  * значение — бот, заявка молча отбрасывается с успешным ответом.
@@ -53,6 +53,12 @@ __decorate([
53
53
  (0, class_transformer_1.Expose)(),
54
54
  __metadata("design:type", Object)
55
55
  ], SubmitLeadDto.prototype, "meta", void 0);
56
+ __decorate([
57
+ (0, class_validator_1.IsOptional)(),
58
+ (0, class_validator_1.IsBoolean)(),
59
+ (0, class_transformer_1.Expose)(),
60
+ __metadata("design:type", Boolean)
61
+ ], SubmitLeadDto.prototype, "pdConsent", void 0);
56
62
  __decorate([
57
63
  (0, class_validator_1.IsOptional)(),
58
64
  (0, class_validator_1.IsString)(),
@@ -65,4 +65,6 @@ export declare class OpenapiCreateCertificateShopSaleDto {
65
65
  billingOrganizationName?: string;
66
66
  billingTaxId?: string;
67
67
  billingAddress?: string;
68
+ /** Галочка согласия на обработку ПДн. У площадок из РФ без неё продажа не создаётся. */
69
+ pdConsent?: boolean;
68
70
  }
@@ -241,3 +241,9 @@ __decorate([
241
241
  (0, class_transformer_1.Expose)(),
242
242
  __metadata("design:type", String)
243
243
  ], OpenapiCreateCertificateShopSaleDto.prototype, "billingAddress", void 0);
244
+ __decorate([
245
+ (0, class_validator_1.IsOptional)(),
246
+ (0, class_validator_1.IsBoolean)(),
247
+ (0, class_transformer_1.Expose)(),
248
+ __metadata("design:type", Boolean)
249
+ ], OpenapiCreateCertificateShopSaleDto.prototype, "pdConsent", void 0);
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Документы площадки для её клиентов. Площадка — оператор персональных данных
3
+ * своих клиентов, мы обрабатываем их по её поручению, поэтому политика и
4
+ * согласие должны быть от её имени, а не от имени Escape Navigator.
5
+ */
6
+ export declare enum ProfileDocumentTypeEnum {
7
+ /** Клиентское соглашение (оферта) — `/company/:slug/terms-of-services`. */
8
+ AGREEMENT = "agreement",
9
+ /** Политика обработки ПДн — `/company/:slug/privacy-policy`. */
10
+ PRIVACY_POLICY = "privacy_policy",
11
+ /**
12
+ * Согласие на обработку ПДн — `/company/:slug/personal-data-consent`.
13
+ * Только РФ: 152-ФЗ требует оформлять согласие отдельно от других
14
+ * документов. В ЕС основание — договор (GDPR 6(1)(b)), согласие не нужно.
15
+ */
16
+ PD_CONSENT = "pd_consent"
17
+ }
18
+ /** Страница `/company/:slug/<path>` в orders для каждого документа площадки. */
19
+ export declare const PROFILE_DOCUMENT_PATH: Record<ProfileDocumentTypeEnum, string>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROFILE_DOCUMENT_PATH = exports.ProfileDocumentTypeEnum = void 0;
4
+ /**
5
+ * Документы площадки для её клиентов. Площадка — оператор персональных данных
6
+ * своих клиентов, мы обрабатываем их по её поручению, поэтому политика и
7
+ * согласие должны быть от её имени, а не от имени Escape Navigator.
8
+ */
9
+ var ProfileDocumentTypeEnum;
10
+ (function (ProfileDocumentTypeEnum) {
11
+ /** Клиентское соглашение (оферта) — `/company/:slug/terms-of-services`. */
12
+ ProfileDocumentTypeEnum["AGREEMENT"] = "agreement";
13
+ /** Политика обработки ПДн — `/company/:slug/privacy-policy`. */
14
+ ProfileDocumentTypeEnum["PRIVACY_POLICY"] = "privacy_policy";
15
+ /**
16
+ * Согласие на обработку ПДн — `/company/:slug/personal-data-consent`.
17
+ * Только РФ: 152-ФЗ требует оформлять согласие отдельно от других
18
+ * документов. В ЕС основание — договор (GDPR 6(1)(b)), согласие не нужно.
19
+ */
20
+ ProfileDocumentTypeEnum["PD_CONSENT"] = "pd_consent";
21
+ })(ProfileDocumentTypeEnum || (exports.ProfileDocumentTypeEnum = ProfileDocumentTypeEnum = {}));
22
+ /** Страница `/company/:slug/<path>` в orders для каждого документа площадки. */
23
+ exports.PROFILE_DOCUMENT_PATH = {
24
+ [ProfileDocumentTypeEnum.AGREEMENT]: 'terms-of-services',
25
+ [ProfileDocumentTypeEnum.PRIVACY_POLICY]: 'privacy-policy',
26
+ [ProfileDocumentTypeEnum.PD_CONSENT]: 'personal-data-consent',
27
+ };
@@ -0,0 +1,35 @@
1
+ import { ProfileDocumentTypeEnum } from './profile-document-type.enum';
2
+ /**
3
+ * Как документ площадки попадает к клиенту:
4
+ * - `custom` — площадка написала свой текст;
5
+ * - `url` — ведём на документ на сайте площадки;
6
+ * - `standard` — стандартный текст из шаблона с реквизитами площадки
7
+ * (есть только там, где у нас есть шаблон — сейчас РФ);
8
+ * - `none` — ничего нет, публичная страница показывает политику
9
+ * Escape Navigator как запасной вариант.
10
+ */
11
+ export type ProfileDocumentMode = 'custom' | 'url' | 'standard' | 'none';
12
+ /** Документ площадки в CRM: что сохранено и что увидит клиент. */
13
+ export type ProfileDocumentRO = {
14
+ type: ProfileDocumentTypeEnum;
15
+ text: string;
16
+ url: string;
17
+ mode: ProfileDocumentMode;
18
+ /** Для `standard` — готовый текст шаблона, чтобы показать его в CRM. */
19
+ standardText?: string;
20
+ /** Каких реквизитов не хватает стандартному тексту (legalTitle, legalTaxId…). */
21
+ missingRequisites?: string[];
22
+ updatedAt?: Date | string;
23
+ };
24
+ /** Публичный документ площадки для страницы в orders. */
25
+ export type PublicProfileDocumentRO = {
26
+ type: ProfileDocumentTypeEnum;
27
+ mode: ProfileDocumentMode;
28
+ text: string;
29
+ url: string;
30
+ updatedAt?: Date | string;
31
+ profile: {
32
+ title?: string;
33
+ logo?: string;
34
+ };
35
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Пустые `text` и `url` — вернуться к стандартному документу. Заполнен `url` —
3
+ * ведём клиента на сайт площадки, `text` игнорируется.
4
+ */
5
+ export declare class UpdateProfileDocumentDto {
6
+ text?: string;
7
+ url?: string;
8
+ }
@@ -0,0 +1,35 @@
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.UpdateProfileDocumentDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Пустые `text` и `url` — вернуться к стандартному документу. Заполнен `url` —
17
+ * ведём клиента на сайт площадки, `text` игнорируется.
18
+ */
19
+ class UpdateProfileDocumentDto {
20
+ }
21
+ exports.UpdateProfileDocumentDto = UpdateProfileDocumentDto;
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_transformer_1.Expose)(),
26
+ __metadata("design:type", String)
27
+ ], UpdateProfileDocumentDto.prototype, "text", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.ValidateIf)((dto) => !!dto.url),
31
+ (0, class_validator_1.IsUrl)({ require_protocol: true, protocols: ['http', 'https'] }),
32
+ (0, class_validator_1.MaxLength)(1000),
33
+ (0, class_transformer_1.Expose)(),
34
+ __metadata("design:type", String)
35
+ ], UpdateProfileDocumentDto.prototype, "url", void 0);
@@ -32,6 +32,7 @@ export declare class CreateRoleDto {
32
32
  canEditSchedule: boolean;
33
33
  canExportData: boolean;
34
34
  canRevealClientContacts: boolean;
35
+ canDeleteClients: boolean;
35
36
  canDeletePayments: boolean;
36
37
  canSeeEmployeeReport: boolean;
37
38
  }
@@ -189,6 +189,12 @@ __decorate([
189
189
  (0, class_transformer_1.Expose)(),
190
190
  __metadata("design:type", Boolean)
191
191
  ], CreateRoleDto.prototype, "canRevealClientContacts", void 0);
192
+ __decorate([
193
+ (0, class_validator_1.IsBoolean)(),
194
+ (0, class_transformer_1.Transform)(({ value }) => (value !== undefined ? value : false)),
195
+ (0, class_transformer_1.Expose)(),
196
+ __metadata("design:type", Boolean)
197
+ ], CreateRoleDto.prototype, "canDeleteClients", void 0);
192
198
  __decorate([
193
199
  (0, class_validator_1.IsBoolean)(),
194
200
  (0, class_transformer_1.Transform)(({ value }) => (value !== undefined ? value : false)),
@@ -35,6 +35,7 @@ export declare class RoleRO extends RoleLightRO {
35
35
  canEditSchedule: boolean;
36
36
  canExportData: boolean;
37
37
  canRevealClientContacts: boolean;
38
+ canDeleteClients: boolean;
38
39
  canDeletePayments: boolean;
39
40
  canSeeEmployeeReport: boolean;
40
41
  }
@@ -123,6 +123,10 @@ __decorate([
123
123
  (0, class_transformer_1.Expose)(),
124
124
  __metadata("design:type", Boolean)
125
125
  ], RoleRO.prototype, "canRevealClientContacts", void 0);
126
+ __decorate([
127
+ (0, class_transformer_1.Expose)(),
128
+ __metadata("design:type", Boolean)
129
+ ], RoleRO.prototype, "canDeleteClients", void 0);
126
130
  __decorate([
127
131
  (0, class_transformer_1.Expose)(),
128
132
  __metadata("design:type", Boolean)