tychat-contracts 1.3.18 → 1.3.19

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.
@@ -12,5 +12,10 @@ export declare class LegalTermSendDto {
12
12
  whatsappMessage: string;
13
13
  signerEmail?: string;
14
14
  instanceKey?: string;
15
+ tenantAutoSign?: boolean;
16
+ tenantSignerName?: string;
17
+ tenantSignerEmail?: string;
18
+ tenantSignerBirthday?: string;
19
+ tenantSignerDocumentation?: string;
15
20
  }
16
21
  //# sourceMappingURL=legal-term-preview.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,qBAAa,0BAA0B;IAQrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAU9B,+BAA+B,CAAC,EAAE,MAAM,EAAE,CAAC;IAM3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,gBAAgB;IAI3B,YAAY,EAAE,MAAM,EAAE,CAAC;IASvB,eAAe,EAAE,MAAM,CAAC;IAMxB,WAAW,CAAC,EAAE,MAAM,CAAC;IASrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"AAcA,4FAA4F;AAC5F,qBAAa,0BAA0B;IAQrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAU9B,+BAA+B,CAAC,EAAE,MAAM,EAAE,CAAC;IAM3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,gBAAgB;IAI3B,YAAY,EAAE,MAAM,EAAE,CAAC;IASvB,eAAe,EAAE,MAAM,CAAC;IAMxB,WAAW,CAAC,EAAE,MAAM,CAAC;IASrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,cAAc,CAAC,EAAE,OAAO,CAAC;IAMzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAK1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAM9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC"}
@@ -75,6 +75,11 @@ class LegalTermSendDto {
75
75
  whatsappMessage;
76
76
  signerEmail;
77
77
  instanceKey;
78
+ tenantAutoSign;
79
+ tenantSignerName;
80
+ tenantSignerEmail;
81
+ tenantSignerBirthday;
82
+ tenantSignerDocumentation;
78
83
  }
79
84
  exports.LegalTermSendDto = LegalTermSendDto;
80
85
  __decorate([
@@ -109,3 +114,39 @@ __decorate([
109
114
  (0, class_validator_1.MaxLength)(128),
110
115
  __metadata("design:type", String)
111
116
  ], LegalTermSendDto.prototype, "instanceKey", void 0);
117
+ __decorate([
118
+ (0, swagger_1.ApiPropertyOptional)({
119
+ description: 'Assinatura automática do representante da clínica (Clicksign) antes do paciente. Exige tenantSignerName, tenantSignerEmail, tenantSignerBirthday (YYYY-MM-DD) e tenantSignerDocumentation (CPF).',
120
+ }),
121
+ (0, class_validator_1.IsOptional)(),
122
+ (0, class_validator_1.IsBoolean)(),
123
+ __metadata("design:type", Boolean)
124
+ ], LegalTermSendDto.prototype, "tenantAutoSign", void 0);
125
+ __decorate([
126
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
127
+ (0, class_validator_1.IsString)(),
128
+ (0, class_validator_1.MinLength)(1),
129
+ (0, class_validator_1.MaxLength)(500),
130
+ __metadata("design:type", String)
131
+ ], LegalTermSendDto.prototype, "tenantSignerName", void 0);
132
+ __decorate([
133
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
134
+ (0, class_validator_1.IsEmail)(),
135
+ (0, class_validator_1.MaxLength)(320),
136
+ __metadata("design:type", String)
137
+ ], LegalTermSendDto.prototype, "tenantSignerEmail", void 0);
138
+ __decorate([
139
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
140
+ (0, class_validator_1.IsString)(),
141
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
142
+ message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
143
+ }),
144
+ __metadata("design:type", String)
145
+ ], LegalTermSendDto.prototype, "tenantSignerBirthday", void 0);
146
+ __decorate([
147
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
148
+ (0, class_validator_1.IsString)(),
149
+ (0, class_validator_1.MinLength)(11),
150
+ (0, class_validator_1.MaxLength)(14),
151
+ __metadata("design:type", String)
152
+ ], LegalTermSendDto.prototype, "tenantSignerDocumentation", void 0);
@@ -9,6 +9,11 @@ export declare class CreateLegalSigningEnvelopeRpcDto {
9
9
  renderedHtml?: string;
10
10
  documentFilename: string;
11
11
  envelopeName?: string;
12
+ tenantAutoSign?: boolean;
13
+ tenantSignerName?: string;
14
+ tenantSignerEmail?: string;
15
+ tenantSignerBirthday?: string;
16
+ tenantSignerDocumentation?: string;
12
17
  }
13
18
  export declare class CreateLegalSigningEnvelopeRpcResultDto {
14
19
  signatureDocumentId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"legal-term-signature-rpc.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-signature-rpc.dto.ts"],"names":[],"mappings":"AAWA,wFAAwF;AACxF,qBAAa,gCAAgC;IAK3C,MAAM,EAAE,MAAM,CAAC;IAIf,SAAS,EAAE,MAAM,CAAC;IAKlB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAM7B,UAAU,E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AAoB,CAAC,EAAE,MAAM,CAAC;IAM9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,qBAAa,sCAAsC;IAEjD,mBAAmB,EAAE,MAAM,CAAC;IAG5B,UAAU,EAAE,MAAM,CAAC;IAGnB,mBAAmB,EAAE,MAAM,CAAC;IAG5B,mBAAmB,EAAE,MAAM,CAAC;IAG5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8EAA8E;AAC9E,MAAM,MAAM,+BAA+B,GAAG;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EACZ,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,SAAS,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC"}
@@ -23,6 +23,11 @@ class CreateLegalSigningEnvelopeRpcDto {
23
23
  renderedHtml;
24
24
  documentFilename;
25
25
  envelopeName;
26
+ tenantAutoSign;
27
+ tenantSignerName;
28
+ tenantSignerEmail;
29
+ tenantSignerBirthday;
30
+ tenantSignerDocumentation;
26
31
  }
27
32
  exports.CreateLegalSigningEnvelopeRpcDto = CreateLegalSigningEnvelopeRpcDto;
28
33
  __decorate([
@@ -73,7 +78,10 @@ __decorate([
73
78
  __metadata("design:type", String)
74
79
  ], CreateLegalSigningEnvelopeRpcDto.prototype, "renderedHtml", void 0);
75
80
  __decorate([
76
- (0, swagger_1.ApiProperty)({ example: 'termo-juridico.pdf' }),
81
+ (0, swagger_1.ApiProperty)({
82
+ example: 'termo-juridico.pdf',
83
+ description: 'Nome do arquivo no envelope. Com renderedHtml o PDF é gerado no signature-service (html-to-pdfmake + pdfmake); com pdfBase64, o binário enviado já é PDF.',
84
+ }),
77
85
  (0, class_validator_1.IsString)(),
78
86
  (0, class_validator_1.MinLength)(1),
79
87
  (0, class_validator_1.MaxLength)(255),
@@ -86,6 +94,42 @@ __decorate([
86
94
  (0, class_validator_1.MaxLength)(500),
87
95
  __metadata("design:type", String)
88
96
  ], CreateLegalSigningEnvelopeRpcDto.prototype, "envelopeName", void 0);
97
+ __decorate([
98
+ (0, swagger_1.ApiPropertyOptional)({
99
+ description: 'Incluir signatário da clínica (PJ) com assinatura automática na Clicksign antes do paciente. Exige conta com termo de assinatura automática válido.',
100
+ }),
101
+ (0, class_validator_1.IsOptional)(),
102
+ (0, class_validator_1.IsBoolean)(),
103
+ __metadata("design:type", Boolean)
104
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantAutoSign", void 0);
105
+ __decorate([
106
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
107
+ (0, class_validator_1.IsString)(),
108
+ (0, class_validator_1.MinLength)(1),
109
+ (0, class_validator_1.MaxLength)(500),
110
+ __metadata("design:type", String)
111
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerName", void 0);
112
+ __decorate([
113
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
114
+ (0, class_validator_1.IsEmail)(),
115
+ (0, class_validator_1.MaxLength)(320),
116
+ __metadata("design:type", String)
117
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerEmail", void 0);
118
+ __decorate([
119
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
120
+ (0, class_validator_1.IsString)(),
121
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
122
+ message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
123
+ }),
124
+ __metadata("design:type", String)
125
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerBirthday", void 0);
126
+ __decorate([
127
+ (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
128
+ (0, class_validator_1.IsString)(),
129
+ (0, class_validator_1.MinLength)(11),
130
+ (0, class_validator_1.MaxLength)(14),
131
+ __metadata("design:type", String)
132
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerDocumentation", void 0);
89
133
  class CreateLegalSigningEnvelopeRpcResultDto {
90
134
  signatureDocumentId;
91
135
  signingUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,16 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
- import { IsArray, IsOptional, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
2
+ import {
3
+ IsArray,
4
+ IsBoolean,
5
+ IsEmail,
6
+ IsOptional,
7
+ IsString,
8
+ IsUUID,
9
+ Matches,
10
+ MaxLength,
11
+ MinLength,
12
+ ValidateIf,
13
+ } from 'class-validator';
3
14
 
4
15
  /** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
5
16
  export class LegalTermPreviewRequestDto {
@@ -76,4 +87,36 @@ export class LegalTermSendDto {
76
87
  @IsString()
77
88
  @MaxLength(128)
78
89
  instanceKey?: string;
90
+
91
+ @ApiPropertyOptional({
92
+ description:
93
+ 'Assinatura automática do representante da clínica (Clicksign) antes do paciente. Exige tenantSignerName, tenantSignerEmail, tenantSignerBirthday (YYYY-MM-DD) e tenantSignerDocumentation (CPF).',
94
+ })
95
+ @IsOptional()
96
+ @IsBoolean()
97
+ tenantAutoSign?: boolean;
98
+
99
+ @ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
100
+ @IsString()
101
+ @MinLength(1)
102
+ @MaxLength(500)
103
+ tenantSignerName?: string;
104
+
105
+ @ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
106
+ @IsEmail()
107
+ @MaxLength(320)
108
+ tenantSignerEmail?: string;
109
+
110
+ @ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
111
+ @IsString()
112
+ @Matches(/^\d{4}-\d{2}-\d{2}$/, {
113
+ message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
114
+ })
115
+ tenantSignerBirthday?: string;
116
+
117
+ @ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
118
+ @IsString()
119
+ @MinLength(11)
120
+ @MaxLength(14)
121
+ tenantSignerDocumentation?: string;
79
122
  }
@@ -1,9 +1,11 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
2
  import {
3
+ IsBoolean,
3
4
  IsEmail,
4
5
  IsOptional,
5
6
  IsString,
6
7
  IsUUID,
8
+ Matches,
7
9
  MaxLength,
8
10
  MinLength,
9
11
  ValidateIf,
@@ -51,7 +53,11 @@ export class CreateLegalSigningEnvelopeRpcDto {
51
53
  @MinLength(1)
52
54
  renderedHtml?: string;
53
55
 
54
- @ApiProperty({ example: 'termo-juridico.pdf' })
56
+ @ApiProperty({
57
+ example: 'termo-juridico.pdf',
58
+ description:
59
+ 'Nome do arquivo no envelope. Com renderedHtml o PDF é gerado no signature-service (html-to-pdfmake + pdfmake); com pdfBase64, o binário enviado já é PDF.',
60
+ })
55
61
  @IsString()
56
62
  @MinLength(1)
57
63
  @MaxLength(255)
@@ -62,6 +68,38 @@ export class CreateLegalSigningEnvelopeRpcDto {
62
68
  @IsString()
63
69
  @MaxLength(500)
64
70
  envelopeName?: string;
71
+
72
+ @ApiPropertyOptional({
73
+ description:
74
+ 'Incluir signatário da clínica (PJ) com assinatura automática na Clicksign antes do paciente. Exige conta com termo de assinatura automática válido.',
75
+ })
76
+ @IsOptional()
77
+ @IsBoolean()
78
+ tenantAutoSign?: boolean;
79
+
80
+ @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
81
+ @IsString()
82
+ @MinLength(1)
83
+ @MaxLength(500)
84
+ tenantSignerName?: string;
85
+
86
+ @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
87
+ @IsEmail()
88
+ @MaxLength(320)
89
+ tenantSignerEmail?: string;
90
+
91
+ @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
92
+ @IsString()
93
+ @Matches(/^\d{4}-\d{2}-\d{2}$/, {
94
+ message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
95
+ })
96
+ tenantSignerBirthday?: string;
97
+
98
+ @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
99
+ @IsString()
100
+ @MinLength(11)
101
+ @MaxLength(14)
102
+ tenantSignerDocumentation?: string;
65
103
  }
66
104
 
67
105
  export class CreateLegalSigningEnvelopeRpcResultDto {