tychat-contracts 1.6.61 → 1.6.63
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/configurations/app-module-policy.enums.d.ts +1 -1
- package/dist/configurations/app-module-policy.enums.d.ts.map +1 -1
- package/dist/configurations/app-module-policy.enums.js +0 -1
- package/dist/legal-terms/legal-term-dispatch.dto.d.ts +15 -11
- package/dist/legal-terms/legal-term-dispatch.dto.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-preview.dto.d.ts +7 -13
- package/dist/legal-terms/legal-term-preview.dto.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-preview.dto.js +19 -85
- package/dist/legal-terms/legal-term-rmq-patterns.d.ts +10 -1
- package/dist/legal-terms/legal-term-rmq-patterns.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-rmq-patterns.js +11 -2
- package/dist/legal-terms/legal-term-signature-rpc.dto.d.ts +36 -29
- package/dist/legal-terms/legal-term-signature-rpc.dto.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-signature-rpc.dto.js +77 -132
- package/package.json +1 -1
- package/src/configurations/app-module-policy.enums.ts +0 -1
- package/src/legal-terms/legal-term-dispatch.dto.ts +22 -17
- package/src/legal-terms/legal-term-preview.dto.ts +12 -81
- package/src/legal-terms/legal-term-rmq-patterns.ts +13 -1
- package/src/legal-terms/legal-term-signature-rpc.dto.ts +74 -131
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Módulos da aplicação web do tenant (Tychat-v2), controlados por plano e override por tenant.
|
|
3
3
|
* Valores estáveis para API e persistência.
|
|
4
4
|
*/
|
|
5
|
-
export declare const TYCHAT_APP_MODULE_KEYS: readonly ["dashboard", "check_in", "check_out", "doctor_platform", "schedule", "conversations", "patients", "patients_documents", "patients_legal_terms", "clinic_legal_terms", "
|
|
5
|
+
export declare const TYCHAT_APP_MODULE_KEYS: readonly ["dashboard", "check_in", "check_out", "doctor_platform", "schedule", "conversations", "patients", "patients_documents", "patients_legal_terms", "clinic_legal_terms", "patients_anamneses", "clinic_anamneses", "ai_conversation", "follow_up", "funnel", "satisfaction", "clinic", "billings", "connections", "settings", "campaigns"];
|
|
6
6
|
export type TychatAppModuleKey = (typeof TYCHAT_APP_MODULE_KEYS)[number];
|
|
7
7
|
export declare const TYCHAT_APP_MODULE_POLICY_LEVELS: readonly ["default", "plan", "tenant"];
|
|
8
8
|
export type TychatAppModulePolicyLevel = (typeof TYCHAT_APP_MODULE_POLICY_LEVELS)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-module-policy.enums.d.ts","sourceRoot":"","sources":["../../src/configurations/app-module-policy.enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"app-module-policy.enums.d.ts","sourceRoot":"","sources":["../../src/configurations/app-module-policy.enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,mVAuBzB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,eAAO,MAAM,+BAA+B,wCAAyC,CAAC;AACtF,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
/** Status do registro de envio na clínica
|
|
2
|
-
export type LegalTermDispatchStatusValue = 'created' | 'sent' | 'failed';
|
|
3
|
-
/** Status
|
|
4
|
-
export type SignatureDocumentStatusValue = '
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
/** Método de assinatura escolhido no envio do termo. */
|
|
8
|
-
export type LegalTermSignatureMethodValue = 'digital' | 'printed';
|
|
9
|
-
/** Política por tenant (admin): quais métodos o produto oferece. */
|
|
10
|
-
export type LegalTermSignaturePolicyValue = 'printed_only' | 'printed_and_integrations';
|
|
1
|
+
/** Status do registro de envio na clínica. */
|
|
2
|
+
export type LegalTermDispatchStatusValue = 'created' | 'sent' | 'failed' | 'cancelled';
|
|
3
|
+
/** Status da assinatura impressa (signature-service). */
|
|
4
|
+
export type SignatureDocumentStatusValue = 'upload_required' | 'signed' | 'cancelled';
|
|
5
|
+
/** Método de assinatura no envio do termo. */
|
|
6
|
+
export type LegalTermSignatureMethodValue = 'printed';
|
|
11
7
|
/** Item agregado para a ficha do paciente (API: clinic + signature). */
|
|
12
8
|
export type PatientLegalTermDispatchItemDto = {
|
|
13
9
|
id: string;
|
|
@@ -21,9 +17,17 @@ export type PatientLegalTermDispatchItemDto = {
|
|
|
21
17
|
signature_document_id: string | null;
|
|
22
18
|
signature_status: SignatureDocumentStatusValue | null;
|
|
23
19
|
signed_at: string | null;
|
|
24
|
-
patient_signed: boolean | null;
|
|
25
20
|
};
|
|
26
21
|
export type PatientLegalTermDispatchesResponseDto = {
|
|
27
22
|
items: PatientLegalTermDispatchItemDto[];
|
|
23
|
+
total?: number;
|
|
24
|
+
};
|
|
25
|
+
export type LegalTermDispatchCancelResponseDto = {
|
|
26
|
+
dispatchId: string;
|
|
27
|
+
appointmentCanceled: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type LegalTermDispatchReprintResponseDto = {
|
|
30
|
+
printPdfBase64: string;
|
|
31
|
+
printFilename: string;
|
|
28
32
|
};
|
|
29
33
|
//# sourceMappingURL=legal-term-dispatch.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal-term-dispatch.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-dispatch.dto.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"legal-term-dispatch.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-dispatch.dto.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,MAAM,4BAA4B,GACpC,SAAS,GACT,MAAM,GACN,QAAQ,GACR,WAAW,CAAC;AAEhB,yDAAyD;AACzD,MAAM,MAAM,4BAA4B,GACpC,iBAAiB,GACjB,QAAQ,GACR,WAAW,CAAC;AAEhB,8CAA8C;AAC9C,MAAM,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAEtD,wEAAwE;AACxE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,4BAA4B,CAAC;IAC9C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gBAAgB,EAAE,4BAA4B,GAAG,IAAI,CAAC;IACtD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,KAAK,EAAE,+BAA+B,EAAE,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type LegalTermBodyFormat } from './legal-term-body-format';
|
|
2
2
|
import { LegalTermDocumentDto } from './legal-term-document.dto';
|
|
3
|
-
declare const LEGAL_TERM_SIGNATURE_METHODS: readonly ["digital", "printed"];
|
|
4
|
-
export type LegalTermSignatureMethodDto = (typeof LEGAL_TERM_SIGNATURE_METHODS)[number];
|
|
5
3
|
/** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
|
|
6
4
|
export declare class LegalTermPreviewRequestDto {
|
|
7
5
|
body_document?: LegalTermDocumentDto;
|
|
@@ -14,18 +12,14 @@ export declare class LegalTermPreviewRequestDto {
|
|
|
14
12
|
data_hora_iso?: string;
|
|
15
13
|
}
|
|
16
14
|
export declare class LegalTermSendDto {
|
|
17
|
-
signatureMethod?: LegalTermSignatureMethodDto;
|
|
18
15
|
procedureIds: string[];
|
|
19
|
-
whatsappMessage?: string;
|
|
20
|
-
signerEmail?: string;
|
|
21
|
-
instanceKey?: string;
|
|
22
16
|
appointmentId?: string;
|
|
23
|
-
tenantAutoSign?: boolean;
|
|
24
|
-
tenantSignerName?: string;
|
|
25
|
-
tenantSignerEmail?: string;
|
|
26
|
-
tenantSignerBirthday?: string;
|
|
27
|
-
tenantSignerDocumentation?: string;
|
|
28
|
-
tenantSignerPhone?: string;
|
|
29
17
|
}
|
|
30
|
-
export {
|
|
18
|
+
export declare class LegalTermSendResponseDto {
|
|
19
|
+
signatureMethod: 'printed';
|
|
20
|
+
printPdfBase64: string;
|
|
21
|
+
printFilename: string;
|
|
22
|
+
signatureId: string;
|
|
23
|
+
dispatchId: string;
|
|
24
|
+
}
|
|
31
25
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"AAWA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,4FAA4F;AAC5F,qBAAa,0BAA0B;IAQrC,aAAa,CAAC,EAAE,oBAAoB,CAAC;IASrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAMlC,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;IAQvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,wBAAwB;IAEnC,eAAe,EAAE,SAAS,CAAC;IAG3B,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,MAAM,CAAC;IAGtB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -9,13 +9,12 @@ 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.LegalTermSendDto = exports.LegalTermPreviewRequestDto = void 0;
|
|
12
|
+
exports.LegalTermSendResponseDto = exports.LegalTermSendDto = exports.LegalTermPreviewRequestDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const class_transformer_1 = require("class-transformer");
|
|
16
16
|
const legal_term_body_format_1 = require("./legal-term-body-format");
|
|
17
17
|
const legal_term_document_dto_1 = require("./legal-term-document.dto");
|
|
18
|
-
const LEGAL_TERM_SIGNATURE_METHODS = ['digital', 'printed'];
|
|
19
18
|
/** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
|
|
20
19
|
class LegalTermPreviewRequestDto {
|
|
21
20
|
body_document;
|
|
@@ -96,62 +95,16 @@ __decorate([
|
|
|
96
95
|
__metadata("design:type", String)
|
|
97
96
|
], LegalTermPreviewRequestDto.prototype, "data_hora_iso", void 0);
|
|
98
97
|
class LegalTermSendDto {
|
|
99
|
-
signatureMethod;
|
|
100
98
|
procedureIds;
|
|
101
|
-
whatsappMessage;
|
|
102
|
-
signerEmail;
|
|
103
|
-
instanceKey;
|
|
104
99
|
appointmentId;
|
|
105
|
-
tenantAutoSign;
|
|
106
|
-
tenantSignerName;
|
|
107
|
-
tenantSignerEmail;
|
|
108
|
-
tenantSignerBirthday;
|
|
109
|
-
tenantSignerDocumentation;
|
|
110
|
-
tenantSignerPhone;
|
|
111
100
|
}
|
|
112
101
|
exports.LegalTermSendDto = LegalTermSendDto;
|
|
113
|
-
__decorate([
|
|
114
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
115
|
-
enum: LEGAL_TERM_SIGNATURE_METHODS,
|
|
116
|
-
description: 'Método de assinatura: digital ou printed (PDF para impressão, ou digital para Assinatura Digital). Padrão: printed.',
|
|
117
|
-
default: 'printed',
|
|
118
|
-
}),
|
|
119
|
-
(0, class_validator_1.IsOptional)(),
|
|
120
|
-
(0, class_validator_1.IsIn)(LEGAL_TERM_SIGNATURE_METHODS),
|
|
121
|
-
__metadata("design:type", String)
|
|
122
|
-
], LegalTermSendDto.prototype, "signatureMethod", void 0);
|
|
123
102
|
__decorate([
|
|
124
103
|
(0, swagger_1.ApiProperty)({ type: [String], format: 'uuid' }),
|
|
125
104
|
(0, class_validator_1.IsArray)(),
|
|
126
105
|
(0, class_validator_1.IsUUID)('4', { each: true }),
|
|
127
106
|
__metadata("design:type", Array)
|
|
128
107
|
], LegalTermSendDto.prototype, "procedureIds", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
131
|
-
description: 'Mensagem WhatsApp. Obrigatória no modo digital (deve conter {{ link_termo_juridico }}). No modo impressão, omita ou deixe em branco para não enviar WhatsApp.',
|
|
132
|
-
example: 'Olá, assine seu termo: {{ link_termo_juridico }}',
|
|
133
|
-
}),
|
|
134
|
-
(0, class_validator_1.IsOptional)(),
|
|
135
|
-
(0, class_validator_1.IsString)(),
|
|
136
|
-
(0, class_validator_1.MaxLength)(4000),
|
|
137
|
-
__metadata("design:type", String)
|
|
138
|
-
], LegalTermSendDto.prototype, "whatsappMessage", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
(0, swagger_1.ApiPropertyOptional)({ description: 'E-mail do signatário se o paciente não tiver e-mail cadastrado' }),
|
|
141
|
-
(0, class_validator_1.IsOptional)(),
|
|
142
|
-
(0, class_validator_1.IsString)(),
|
|
143
|
-
(0, class_validator_1.MaxLength)(320),
|
|
144
|
-
__metadata("design:type", String)
|
|
145
|
-
], LegalTermSendDto.prototype, "signerEmail", void 0);
|
|
146
|
-
__decorate([
|
|
147
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
148
|
-
description: 'UUID da linha WhatsApp Official (whatsapp_official_configs). Se omitido, usa-se o da sessão ativa do paciente.',
|
|
149
|
-
}),
|
|
150
|
-
(0, class_validator_1.IsOptional)(),
|
|
151
|
-
(0, class_validator_1.IsString)(),
|
|
152
|
-
(0, class_validator_1.MaxLength)(128),
|
|
153
|
-
__metadata("design:type", String)
|
|
154
|
-
], LegalTermSendDto.prototype, "instanceKey", void 0);
|
|
155
108
|
__decorate([
|
|
156
109
|
(0, swagger_1.ApiPropertyOptional)({
|
|
157
110
|
description: 'ID do agendamento relacionado ao envio do termo jurídico',
|
|
@@ -161,50 +114,31 @@ __decorate([
|
|
|
161
114
|
(0, class_validator_1.IsUUID)('4'),
|
|
162
115
|
__metadata("design:type", String)
|
|
163
116
|
], LegalTermSendDto.prototype, "appointmentId", void 0);
|
|
117
|
+
class LegalTermSendResponseDto {
|
|
118
|
+
signatureMethod;
|
|
119
|
+
printPdfBase64;
|
|
120
|
+
printFilename;
|
|
121
|
+
signatureId;
|
|
122
|
+
dispatchId;
|
|
123
|
+
}
|
|
124
|
+
exports.LegalTermSendResponseDto = LegalTermSendResponseDto;
|
|
164
125
|
__decorate([
|
|
165
|
-
(0, swagger_1.
|
|
166
|
-
description: 'Assinatura automática do representante da clínica antes do paciente. Exige tenantSignerName, tenantSignerEmail, tenantSignerBirthday (YYYY-MM-DD) e tenantSignerDocumentation (CPF).',
|
|
167
|
-
}),
|
|
168
|
-
(0, class_validator_1.IsOptional)(),
|
|
169
|
-
(0, class_validator_1.IsBoolean)(),
|
|
170
|
-
__metadata("design:type", Boolean)
|
|
171
|
-
], LegalTermSendDto.prototype, "tenantAutoSign", void 0);
|
|
172
|
-
__decorate([
|
|
173
|
-
(0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
|
|
174
|
-
(0, class_validator_1.IsString)(),
|
|
175
|
-
(0, class_validator_1.MinLength)(1),
|
|
176
|
-
(0, class_validator_1.MaxLength)(500),
|
|
126
|
+
(0, swagger_1.ApiProperty)(),
|
|
177
127
|
__metadata("design:type", String)
|
|
178
|
-
],
|
|
128
|
+
], LegalTermSendResponseDto.prototype, "signatureMethod", void 0);
|
|
179
129
|
__decorate([
|
|
180
|
-
(0,
|
|
181
|
-
(0, class_validator_1.IsEmail)(),
|
|
182
|
-
(0, class_validator_1.MaxLength)(320),
|
|
130
|
+
(0, swagger_1.ApiProperty)(),
|
|
183
131
|
__metadata("design:type", String)
|
|
184
|
-
],
|
|
132
|
+
], LegalTermSendResponseDto.prototype, "printPdfBase64", void 0);
|
|
185
133
|
__decorate([
|
|
186
|
-
(0,
|
|
187
|
-
(0, class_validator_1.IsString)(),
|
|
188
|
-
(0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
189
|
-
message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
|
|
190
|
-
}),
|
|
134
|
+
(0, swagger_1.ApiProperty)(),
|
|
191
135
|
__metadata("design:type", String)
|
|
192
|
-
],
|
|
136
|
+
], LegalTermSendResponseDto.prototype, "printFilename", void 0);
|
|
193
137
|
__decorate([
|
|
194
|
-
(0,
|
|
195
|
-
(0, class_validator_1.IsString)(),
|
|
196
|
-
(0, class_validator_1.MinLength)(11),
|
|
197
|
-
(0, class_validator_1.MaxLength)(14),
|
|
138
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
198
139
|
__metadata("design:type", String)
|
|
199
|
-
],
|
|
140
|
+
], LegalTermSendResponseDto.prototype, "signatureId", void 0);
|
|
200
141
|
__decorate([
|
|
201
|
-
(0, swagger_1.
|
|
202
|
-
description: 'Celular do representante (BR) para notificação via WhatsApp; opcional (sem isso usa e-mail).',
|
|
203
|
-
}),
|
|
204
|
-
(0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
|
|
205
|
-
(0, class_validator_1.IsOptional)(),
|
|
206
|
-
(0, class_validator_1.IsString)(),
|
|
207
|
-
(0, class_validator_1.MinLength)(8),
|
|
208
|
-
(0, class_validator_1.MaxLength)(32),
|
|
142
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
209
143
|
__metadata("design:type", String)
|
|
210
|
-
],
|
|
144
|
+
], LegalTermSendResponseDto.prototype, "dispatchId", void 0);
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
export declare const LEGAL_TERM_TEMPLATE_GET = "legalTerm.template.get";
|
|
2
2
|
export declare const LEGAL_TERM_TEMPLATE_UPSERT = "legalTerm.template.upsert";
|
|
3
3
|
export declare const LEGAL_TERM_DISPATCH_CREATE = "legalTerm.dispatch.create";
|
|
4
|
+
export declare const LEGAL_TERM_DISPATCH_UPDATE = "legalTerm.dispatch.update";
|
|
5
|
+
export declare const LEGAL_TERM_DISPATCH_GET = "legalTerm.dispatch.get";
|
|
4
6
|
export declare const LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = "legalTerm.dispatch.listByPatient";
|
|
5
7
|
/** Conta dispatches no mês civil UTC (status sent/created); usado para cota mensal. */
|
|
6
8
|
export declare const LEGAL_TERM_DISPATCH_COUNT_MONTHLY = "legalTerm.dispatch.countMonthly";
|
|
9
|
+
export declare const SIGNATURE_PRINTED_EMIT = "signature.printed.emit";
|
|
10
|
+
export declare const SIGNATURE_PRINTED_CONFIRM_UPLOAD = "signature.printed.confirmUpload";
|
|
11
|
+
export declare const SIGNATURE_PRINTED_CANCEL = "signature.printed.cancel";
|
|
12
|
+
export declare const SIGNATURE_PRINTED_SUMMARY_BY_IDS = "signature.printed.summaryByIds";
|
|
13
|
+
/** RPC: objectKey do scan assinado (status signed) para presign de download. */
|
|
14
|
+
export declare const SIGNATURE_PRINTED_SIGNED_SCAN_OBJECT_KEY = "signature.printed.signedScanObjectKey";
|
|
15
|
+
/** @deprecated Use SIGNATURE_PRINTED_EMIT */
|
|
7
16
|
export declare const SIGNATURE_LEGAL_ENVELOPE_CREATE = "signature.legalEnvelope.create";
|
|
8
|
-
/**
|
|
17
|
+
/** @deprecated Use SIGNATURE_PRINTED_SUMMARY_BY_IDS */
|
|
9
18
|
export declare const SIGNATURE_DOCUMENTS_SUMMARY_BY_IDS = "signature.documents.summaryByIds";
|
|
10
19
|
//# sourceMappingURL=legal-term-rmq-patterns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal-term-rmq-patterns.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-rmq-patterns.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;AACtF,uFAAuF;AACvF,eAAO,MAAM,iCAAiC,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"legal-term-rmq-patterns.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-rmq-patterns.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;AACtF,uFAAuF;AACvF,eAAO,MAAM,iCAAiC,oCAAoC,CAAC;AAEnF,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,gCAAgC,oCAAoC,CAAC;AAClF,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AACnE,eAAO,MAAM,gCAAgC,mCAAmC,CAAC;AACjF,gFAAgF;AAChF,eAAO,MAAM,wCAAwC,0CACZ,CAAC;AAE1C,6CAA6C;AAC7C,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAChF,uDAAuD;AACvD,eAAO,MAAM,kCAAkC,qCAAqC,CAAC"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SIGNATURE_DOCUMENTS_SUMMARY_BY_IDS = exports.SIGNATURE_LEGAL_ENVELOPE_CREATE = exports.LEGAL_TERM_DISPATCH_COUNT_MONTHLY = exports.LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = exports.LEGAL_TERM_DISPATCH_CREATE = exports.LEGAL_TERM_TEMPLATE_UPSERT = exports.LEGAL_TERM_TEMPLATE_GET = void 0;
|
|
3
|
+
exports.SIGNATURE_DOCUMENTS_SUMMARY_BY_IDS = exports.SIGNATURE_LEGAL_ENVELOPE_CREATE = exports.SIGNATURE_PRINTED_SIGNED_SCAN_OBJECT_KEY = exports.SIGNATURE_PRINTED_SUMMARY_BY_IDS = exports.SIGNATURE_PRINTED_CANCEL = exports.SIGNATURE_PRINTED_CONFIRM_UPLOAD = exports.SIGNATURE_PRINTED_EMIT = exports.LEGAL_TERM_DISPATCH_COUNT_MONTHLY = exports.LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = exports.LEGAL_TERM_DISPATCH_GET = exports.LEGAL_TERM_DISPATCH_UPDATE = exports.LEGAL_TERM_DISPATCH_CREATE = exports.LEGAL_TERM_TEMPLATE_UPSERT = exports.LEGAL_TERM_TEMPLATE_GET = void 0;
|
|
4
4
|
exports.LEGAL_TERM_TEMPLATE_GET = 'legalTerm.template.get';
|
|
5
5
|
exports.LEGAL_TERM_TEMPLATE_UPSERT = 'legalTerm.template.upsert';
|
|
6
6
|
exports.LEGAL_TERM_DISPATCH_CREATE = 'legalTerm.dispatch.create';
|
|
7
|
+
exports.LEGAL_TERM_DISPATCH_UPDATE = 'legalTerm.dispatch.update';
|
|
8
|
+
exports.LEGAL_TERM_DISPATCH_GET = 'legalTerm.dispatch.get';
|
|
7
9
|
exports.LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = 'legalTerm.dispatch.listByPatient';
|
|
8
10
|
/** Conta dispatches no mês civil UTC (status sent/created); usado para cota mensal. */
|
|
9
11
|
exports.LEGAL_TERM_DISPATCH_COUNT_MONTHLY = 'legalTerm.dispatch.countMonthly';
|
|
12
|
+
exports.SIGNATURE_PRINTED_EMIT = 'signature.printed.emit';
|
|
13
|
+
exports.SIGNATURE_PRINTED_CONFIRM_UPLOAD = 'signature.printed.confirmUpload';
|
|
14
|
+
exports.SIGNATURE_PRINTED_CANCEL = 'signature.printed.cancel';
|
|
15
|
+
exports.SIGNATURE_PRINTED_SUMMARY_BY_IDS = 'signature.printed.summaryByIds';
|
|
16
|
+
/** RPC: objectKey do scan assinado (status signed) para presign de download. */
|
|
17
|
+
exports.SIGNATURE_PRINTED_SIGNED_SCAN_OBJECT_KEY = 'signature.printed.signedScanObjectKey';
|
|
18
|
+
/** @deprecated Use SIGNATURE_PRINTED_EMIT */
|
|
10
19
|
exports.SIGNATURE_LEGAL_ENVELOPE_CREATE = 'signature.legalEnvelope.create';
|
|
11
|
-
/**
|
|
20
|
+
/** @deprecated Use SIGNATURE_PRINTED_SUMMARY_BY_IDS */
|
|
12
21
|
exports.SIGNATURE_DOCUMENTS_SUMMARY_BY_IDS = 'signature.documents.summaryByIds';
|
|
@@ -1,37 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare
|
|
1
|
+
export declare const SIGNATURE_METHODS: readonly ["printed"];
|
|
2
|
+
export type SignatureMethodValue = (typeof SIGNATURE_METHODS)[number];
|
|
3
|
+
export declare const PRINTED_SIGNATURE_STATUSES: readonly ["pending_upload", "signed", "cancelled"];
|
|
4
|
+
export type PrintedSignatureStatusValue = (typeof PRINTED_SIGNATURE_STATUSES)[number];
|
|
5
|
+
/** RPC: cadastrar assinatura impressa após criar dispatch. */
|
|
6
|
+
export declare class PrintedSignatureEmitRpcDto {
|
|
4
7
|
tenant: string;
|
|
5
8
|
patientId: string;
|
|
6
|
-
legalTermDispatchId
|
|
7
|
-
|
|
8
|
-
signerEmail: string;
|
|
9
|
-
signerPhone?: string;
|
|
10
|
-
pdfBase64?: string;
|
|
11
|
-
renderedHtml?: string;
|
|
12
|
-
bodyFormat?: LegalTermBodyFormat;
|
|
13
|
-
documentFilename: string;
|
|
14
|
-
envelopeName?: string;
|
|
15
|
-
tenantAutoSign?: boolean;
|
|
16
|
-
tenantSignerName?: string;
|
|
17
|
-
tenantSignerEmail?: string;
|
|
18
|
-
tenantSignerBirthday?: string;
|
|
19
|
-
tenantSignerDocumentation?: string;
|
|
20
|
-
tenantSignerPhone?: string;
|
|
9
|
+
legalTermDispatchId: string;
|
|
10
|
+
method: SignatureMethodValue;
|
|
21
11
|
}
|
|
22
|
-
export declare class
|
|
23
|
-
|
|
24
|
-
signingUrl: string;
|
|
25
|
-
clicksignEnvelopeId: string;
|
|
26
|
-
clicksignDocumentId: string;
|
|
27
|
-
clicksignSignerId?: string;
|
|
12
|
+
export declare class PrintedSignatureEmitRpcResultDto {
|
|
13
|
+
signatureId: string;
|
|
28
14
|
}
|
|
29
|
-
/**
|
|
30
|
-
export
|
|
15
|
+
/** RPC: confirmar upload da digitalização assinada. */
|
|
16
|
+
export declare class PrintedSignatureConfirmUploadRpcDto {
|
|
17
|
+
tenant: string;
|
|
18
|
+
signatureId: string;
|
|
19
|
+
signedScanStorageId: string;
|
|
20
|
+
signedScanKey: string;
|
|
21
|
+
signedByUserId?: string;
|
|
22
|
+
}
|
|
23
|
+
/** RPC: cancelar assinatura impressa pendente. */
|
|
24
|
+
export declare class PrintedSignatureCancelRpcDto {
|
|
25
|
+
tenant: string;
|
|
26
|
+
signatureId: string;
|
|
27
|
+
}
|
|
28
|
+
/** Resumo por ID (listagem na ficha do paciente). */
|
|
29
|
+
export type PrintedSignatureSummaryItemDto = {
|
|
31
30
|
id: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/** ISO-8601 UTC ou null */
|
|
31
|
+
method: SignatureMethodValue;
|
|
32
|
+
signature_status: PrintedSignatureStatusValue;
|
|
35
33
|
signed_at: string | null;
|
|
36
34
|
};
|
|
35
|
+
/** RPC: obter chave S3 do scan assinado para download. */
|
|
36
|
+
export declare class PrintedSignatureSignedScanObjectKeyRpcDto {
|
|
37
|
+
tenant: string;
|
|
38
|
+
signatureId: string;
|
|
39
|
+
patientId: string;
|
|
40
|
+
}
|
|
41
|
+
export type PrintedSignatureSignedScanObjectKeyRpcResultDto = {
|
|
42
|
+
objectKey: string;
|
|
43
|
+
};
|
|
37
44
|
//# sourceMappingURL=legal-term-signature-rpc.dto.d.ts.map
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"legal-term-signature-rpc.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-signature-rpc.dto.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,sBAAuB,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B,oDAI7B,CAAC;AACX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,8DAA8D;AAC9D,qBAAa,0BAA0B;IAKrC,MAAM,EAAE,MAAM,CAAC;IAIf,SAAS,EAAE,MAAM,CAAC;IAIlB,mBAAmB,EAAE,MAAM,CAAC;IAI5B,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,qBAAa,gCAAgC;IAE3C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,uDAAuD;AACvD,qBAAa,mCAAmC;IAK9C,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;IAIpB,mBAAmB,EAAE,MAAM,CAAC;IAM5B,aAAa,EAAE,MAAM,CAAC;IAKtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,kDAAkD;AAClD,qBAAa,4BAA4B;IAKvC,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qDAAqD;AACrD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,oBAAoB,CAAC;IAC7B,gBAAgB,EAAE,2BAA2B,CAAC;IAC9C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,0DAA0D;AAC1D,qBAAa,yCAAyC;IAKpD,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;IAIpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,+CAA+C,GAAG;IAC5D,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -9,186 +9,131 @@ 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.
|
|
12
|
+
exports.PrintedSignatureSignedScanObjectKeyRpcDto = exports.PrintedSignatureCancelRpcDto = exports.PrintedSignatureConfirmUploadRpcDto = exports.PrintedSignatureEmitRpcResultDto = exports.PrintedSignatureEmitRpcDto = exports.PRINTED_SIGNATURE_STATUSES = exports.SIGNATURE_METHODS = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
exports.SIGNATURE_METHODS = ['printed'];
|
|
16
|
+
exports.PRINTED_SIGNATURE_STATUSES = [
|
|
17
|
+
'pending_upload',
|
|
18
|
+
'signed',
|
|
19
|
+
'cancelled',
|
|
20
|
+
];
|
|
21
|
+
/** RPC: cadastrar assinatura impressa após criar dispatch. */
|
|
22
|
+
class PrintedSignatureEmitRpcDto {
|
|
18
23
|
tenant;
|
|
19
24
|
patientId;
|
|
20
25
|
legalTermDispatchId;
|
|
21
|
-
|
|
22
|
-
signerEmail;
|
|
23
|
-
signerPhone;
|
|
24
|
-
pdfBase64;
|
|
25
|
-
renderedHtml;
|
|
26
|
-
bodyFormat;
|
|
27
|
-
documentFilename;
|
|
28
|
-
envelopeName;
|
|
29
|
-
tenantAutoSign;
|
|
30
|
-
tenantSignerName;
|
|
31
|
-
tenantSignerEmail;
|
|
32
|
-
tenantSignerBirthday;
|
|
33
|
-
tenantSignerDocumentation;
|
|
34
|
-
tenantSignerPhone;
|
|
26
|
+
method;
|
|
35
27
|
}
|
|
36
|
-
exports.
|
|
28
|
+
exports.PrintedSignatureEmitRpcDto = PrintedSignatureEmitRpcDto;
|
|
37
29
|
__decorate([
|
|
38
|
-
(0, swagger_1.ApiProperty)(
|
|
30
|
+
(0, swagger_1.ApiProperty)(),
|
|
39
31
|
(0, class_validator_1.IsString)(),
|
|
40
32
|
(0, class_validator_1.MinLength)(1),
|
|
41
33
|
(0, class_validator_1.MaxLength)(128),
|
|
42
34
|
__metadata("design:type", String)
|
|
43
|
-
],
|
|
35
|
+
], PrintedSignatureEmitRpcDto.prototype, "tenant", void 0);
|
|
44
36
|
__decorate([
|
|
45
37
|
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
46
38
|
(0, class_validator_1.IsUUID)('4'),
|
|
47
39
|
__metadata("design:type", String)
|
|
48
|
-
],
|
|
40
|
+
], PrintedSignatureEmitRpcDto.prototype, "patientId", void 0);
|
|
49
41
|
__decorate([
|
|
50
|
-
(0, swagger_1.
|
|
51
|
-
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
52
43
|
(0, class_validator_1.IsUUID)('4'),
|
|
53
44
|
__metadata("design:type", String)
|
|
54
|
-
],
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, swagger_1.ApiProperty)(),
|
|
57
|
-
(0, class_validator_1.IsString)(),
|
|
58
|
-
(0, class_validator_1.MinLength)(1),
|
|
59
|
-
(0, class_validator_1.MaxLength)(500),
|
|
60
|
-
__metadata("design:type", String)
|
|
61
|
-
], CreateLegalSigningEnvelopeRpcDto.prototype, "signerName", void 0);
|
|
45
|
+
], PrintedSignatureEmitRpcDto.prototype, "legalTermDispatchId", void 0);
|
|
62
46
|
__decorate([
|
|
63
|
-
(0, swagger_1.ApiProperty)(),
|
|
64
|
-
(0, class_validator_1.
|
|
65
|
-
(0, class_validator_1.MaxLength)(320),
|
|
47
|
+
(0, swagger_1.ApiProperty)({ enum: exports.SIGNATURE_METHODS, default: 'printed' }),
|
|
48
|
+
(0, class_validator_1.IsIn)(exports.SIGNATURE_METHODS),
|
|
66
49
|
__metadata("design:type", String)
|
|
67
|
-
],
|
|
50
|
+
], PrintedSignatureEmitRpcDto.prototype, "method", void 0);
|
|
51
|
+
class PrintedSignatureEmitRpcResultDto {
|
|
52
|
+
signatureId;
|
|
53
|
+
}
|
|
54
|
+
exports.PrintedSignatureEmitRpcResultDto = PrintedSignatureEmitRpcResultDto;
|
|
68
55
|
__decorate([
|
|
69
|
-
(0, swagger_1.
|
|
70
|
-
description: 'Telefone do paciente (BR) para assinatura digital: com WhatsApp em `document_signed` exige 10–11 dígitos nacionais; normalizado no signature-service.',
|
|
71
|
-
}),
|
|
72
|
-
(0, class_validator_1.IsOptional)(),
|
|
73
|
-
(0, class_validator_1.IsString)(),
|
|
74
|
-
(0, class_validator_1.MinLength)(8),
|
|
75
|
-
(0, class_validator_1.MaxLength)(32),
|
|
56
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
76
57
|
__metadata("design:type", String)
|
|
77
|
-
],
|
|
58
|
+
], PrintedSignatureEmitRpcResultDto.prototype, "signatureId", void 0);
|
|
59
|
+
/** RPC: confirmar upload da digitalização assinada. */
|
|
60
|
+
class PrintedSignatureConfirmUploadRpcDto {
|
|
61
|
+
tenant;
|
|
62
|
+
signatureId;
|
|
63
|
+
signedScanStorageId;
|
|
64
|
+
signedScanKey;
|
|
65
|
+
signedByUserId;
|
|
66
|
+
}
|
|
67
|
+
exports.PrintedSignatureConfirmUploadRpcDto = PrintedSignatureConfirmUploadRpcDto;
|
|
78
68
|
__decorate([
|
|
79
|
-
(0, swagger_1.
|
|
80
|
-
(0, class_validator_1.ValidateIf)((o) => !o.renderedHtml?.trim()),
|
|
69
|
+
(0, swagger_1.ApiProperty)(),
|
|
81
70
|
(0, class_validator_1.IsString)(),
|
|
82
71
|
(0, class_validator_1.MinLength)(1),
|
|
72
|
+
(0, class_validator_1.MaxLength)(128),
|
|
83
73
|
__metadata("design:type", String)
|
|
84
|
-
],
|
|
74
|
+
], PrintedSignatureConfirmUploadRpcDto.prototype, "tenant", void 0);
|
|
85
75
|
__decorate([
|
|
86
|
-
(0, swagger_1.
|
|
87
|
-
|
|
88
|
-
}),
|
|
89
|
-
(0, class_validator_1.ValidateIf)((o) => !o.pdfBase64?.trim()),
|
|
90
|
-
(0, class_validator_1.IsString)(),
|
|
91
|
-
(0, class_validator_1.MinLength)(1),
|
|
76
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
77
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
92
78
|
__metadata("design:type", String)
|
|
93
|
-
],
|
|
79
|
+
], PrintedSignatureConfirmUploadRpcDto.prototype, "signatureId", void 0);
|
|
94
80
|
__decorate([
|
|
95
|
-
(0, swagger_1.
|
|
96
|
-
|
|
97
|
-
description: 'Interpretação de renderedHtml antes do PDF; padrão html',
|
|
98
|
-
}),
|
|
99
|
-
(0, class_validator_1.IsOptional)(),
|
|
100
|
-
(0, class_validator_1.IsIn)(legal_term_body_format_1.LEGAL_TERM_BODY_FORMATS),
|
|
81
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
82
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
101
83
|
__metadata("design:type", String)
|
|
102
|
-
],
|
|
84
|
+
], PrintedSignatureConfirmUploadRpcDto.prototype, "signedScanStorageId", void 0);
|
|
103
85
|
__decorate([
|
|
104
|
-
(0, swagger_1.ApiProperty)(
|
|
105
|
-
example: 'termo-juridico.pdf',
|
|
106
|
-
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.',
|
|
107
|
-
}),
|
|
86
|
+
(0, swagger_1.ApiProperty)(),
|
|
108
87
|
(0, class_validator_1.IsString)(),
|
|
109
88
|
(0, class_validator_1.MinLength)(1),
|
|
110
|
-
(0, class_validator_1.MaxLength)(
|
|
89
|
+
(0, class_validator_1.MaxLength)(2048),
|
|
111
90
|
__metadata("design:type", String)
|
|
112
|
-
],
|
|
91
|
+
], PrintedSignatureConfirmUploadRpcDto.prototype, "signedScanKey", void 0);
|
|
113
92
|
__decorate([
|
|
114
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
93
|
+
(0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
|
|
115
94
|
(0, class_validator_1.IsOptional)(),
|
|
116
|
-
(0, class_validator_1.
|
|
117
|
-
(0, class_validator_1.MaxLength)(500),
|
|
95
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
118
96
|
__metadata("design:type", String)
|
|
119
|
-
],
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
__metadata("design:type", Boolean)
|
|
127
|
-
], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantAutoSign", void 0);
|
|
97
|
+
], PrintedSignatureConfirmUploadRpcDto.prototype, "signedByUserId", void 0);
|
|
98
|
+
/** RPC: cancelar assinatura impressa pendente. */
|
|
99
|
+
class PrintedSignatureCancelRpcDto {
|
|
100
|
+
tenant;
|
|
101
|
+
signatureId;
|
|
102
|
+
}
|
|
103
|
+
exports.PrintedSignatureCancelRpcDto = PrintedSignatureCancelRpcDto;
|
|
128
104
|
__decorate([
|
|
129
|
-
(0,
|
|
105
|
+
(0, swagger_1.ApiProperty)(),
|
|
130
106
|
(0, class_validator_1.IsString)(),
|
|
131
107
|
(0, class_validator_1.MinLength)(1),
|
|
132
|
-
(0, class_validator_1.MaxLength)(
|
|
133
|
-
__metadata("design:type", String)
|
|
134
|
-
], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerName", void 0);
|
|
135
|
-
__decorate([
|
|
136
|
-
(0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
|
|
137
|
-
(0, class_validator_1.IsEmail)(),
|
|
138
|
-
(0, class_validator_1.MaxLength)(320),
|
|
139
|
-
__metadata("design:type", String)
|
|
140
|
-
], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerEmail", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
(0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
|
|
143
|
-
(0, class_validator_1.IsString)(),
|
|
144
|
-
(0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/, {
|
|
145
|
-
message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
|
|
146
|
-
}),
|
|
147
|
-
__metadata("design:type", String)
|
|
148
|
-
], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerBirthday", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
(0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
|
|
151
|
-
(0, class_validator_1.IsString)(),
|
|
152
|
-
(0, class_validator_1.MinLength)(11),
|
|
153
|
-
(0, class_validator_1.MaxLength)(14),
|
|
154
|
-
__metadata("design:type", String)
|
|
155
|
-
], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerDocumentation", void 0);
|
|
156
|
-
__decorate([
|
|
157
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
158
|
-
description: 'Celular do representante (BR) para notificação via WhatsApp após assinatura; se omitido, usa-se e-mail.',
|
|
159
|
-
}),
|
|
160
|
-
(0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
|
|
161
|
-
(0, class_validator_1.IsOptional)(),
|
|
162
|
-
(0, class_validator_1.IsString)(),
|
|
163
|
-
(0, class_validator_1.MinLength)(8),
|
|
164
|
-
(0, class_validator_1.MaxLength)(32),
|
|
108
|
+
(0, class_validator_1.MaxLength)(128),
|
|
165
109
|
__metadata("design:type", String)
|
|
166
|
-
],
|
|
167
|
-
class CreateLegalSigningEnvelopeRpcResultDto {
|
|
168
|
-
signatureDocumentId;
|
|
169
|
-
signingUrl;
|
|
170
|
-
clicksignEnvelopeId;
|
|
171
|
-
clicksignDocumentId;
|
|
172
|
-
clicksignSignerId;
|
|
173
|
-
}
|
|
174
|
-
exports.CreateLegalSigningEnvelopeRpcResultDto = CreateLegalSigningEnvelopeRpcResultDto;
|
|
110
|
+
], PrintedSignatureCancelRpcDto.prototype, "tenant", void 0);
|
|
175
111
|
__decorate([
|
|
176
112
|
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
113
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
177
114
|
__metadata("design:type", String)
|
|
178
|
-
],
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
115
|
+
], PrintedSignatureCancelRpcDto.prototype, "signatureId", void 0);
|
|
116
|
+
/** RPC: obter chave S3 do scan assinado para download. */
|
|
117
|
+
class PrintedSignatureSignedScanObjectKeyRpcDto {
|
|
118
|
+
tenant;
|
|
119
|
+
signatureId;
|
|
120
|
+
patientId;
|
|
121
|
+
}
|
|
122
|
+
exports.PrintedSignatureSignedScanObjectKeyRpcDto = PrintedSignatureSignedScanObjectKeyRpcDto;
|
|
183
123
|
__decorate([
|
|
184
124
|
(0, swagger_1.ApiProperty)(),
|
|
125
|
+
(0, class_validator_1.IsString)(),
|
|
126
|
+
(0, class_validator_1.MinLength)(1),
|
|
127
|
+
(0, class_validator_1.MaxLength)(128),
|
|
185
128
|
__metadata("design:type", String)
|
|
186
|
-
],
|
|
129
|
+
], PrintedSignatureSignedScanObjectKeyRpcDto.prototype, "tenant", void 0);
|
|
187
130
|
__decorate([
|
|
188
|
-
(0, swagger_1.ApiProperty)(),
|
|
131
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
132
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
189
133
|
__metadata("design:type", String)
|
|
190
|
-
],
|
|
134
|
+
], PrintedSignatureSignedScanObjectKeyRpcDto.prototype, "signatureId", void 0);
|
|
191
135
|
__decorate([
|
|
192
|
-
(0, swagger_1.
|
|
136
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
137
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
193
138
|
__metadata("design:type", String)
|
|
194
|
-
],
|
|
139
|
+
], PrintedSignatureSignedScanObjectKeyRpcDto.prototype, "patientId", void 0);
|
package/package.json
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
/** Status do registro de envio na clínica
|
|
2
|
-
export type LegalTermDispatchStatusValue =
|
|
1
|
+
/** Status do registro de envio na clínica. */
|
|
2
|
+
export type LegalTermDispatchStatusValue =
|
|
3
|
+
| 'created'
|
|
4
|
+
| 'sent'
|
|
5
|
+
| 'failed'
|
|
6
|
+
| 'cancelled';
|
|
3
7
|
|
|
4
|
-
/** Status
|
|
8
|
+
/** Status da assinatura impressa (signature-service). */
|
|
5
9
|
export type SignatureDocumentStatusValue =
|
|
6
|
-
| '
|
|
10
|
+
| 'upload_required'
|
|
7
11
|
| 'signed'
|
|
8
|
-
| '
|
|
9
|
-
| 'cancelled'
|
|
10
|
-
| 'expired'
|
|
11
|
-
/** Fluxo impresso: aguardando upload da digitalização assinada (sem registro em signature-service). */
|
|
12
|
-
| 'upload_required';
|
|
12
|
+
| 'cancelled';
|
|
13
13
|
|
|
14
|
-
/** Método de assinatura
|
|
15
|
-
export type LegalTermSignatureMethodValue = '
|
|
16
|
-
|
|
17
|
-
/** Política por tenant (admin): quais métodos o produto oferece. */
|
|
18
|
-
export type LegalTermSignaturePolicyValue =
|
|
19
|
-
| 'printed_only'
|
|
20
|
-
| 'printed_and_integrations';
|
|
14
|
+
/** Método de assinatura no envio do termo. */
|
|
15
|
+
export type LegalTermSignatureMethodValue = 'printed';
|
|
21
16
|
|
|
22
17
|
/** Item agregado para a ficha do paciente (API: clinic + signature). */
|
|
23
18
|
export type PatientLegalTermDispatchItemDto = {
|
|
@@ -32,9 +27,19 @@ export type PatientLegalTermDispatchItemDto = {
|
|
|
32
27
|
signature_document_id: string | null;
|
|
33
28
|
signature_status: SignatureDocumentStatusValue | null;
|
|
34
29
|
signed_at: string | null;
|
|
35
|
-
patient_signed: boolean | null;
|
|
36
30
|
};
|
|
37
31
|
|
|
38
32
|
export type PatientLegalTermDispatchesResponseDto = {
|
|
39
33
|
items: PatientLegalTermDispatchItemDto[];
|
|
34
|
+
total?: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type LegalTermDispatchCancelResponseDto = {
|
|
38
|
+
dispatchId: string;
|
|
39
|
+
appointmentCanceled: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type LegalTermDispatchReprintResponseDto = {
|
|
43
|
+
printPdfBase64: string;
|
|
44
|
+
printFilename: string;
|
|
40
45
|
};
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
2
|
import {
|
|
3
3
|
IsArray,
|
|
4
|
-
IsBoolean,
|
|
5
|
-
IsEmail,
|
|
6
4
|
IsIn,
|
|
7
5
|
IsOptional,
|
|
8
6
|
IsString,
|
|
9
7
|
IsUUID,
|
|
10
|
-
Matches,
|
|
11
8
|
MaxLength,
|
|
12
|
-
MinLength,
|
|
13
|
-
ValidateIf,
|
|
14
9
|
ValidateNested,
|
|
15
10
|
} from 'class-validator';
|
|
16
11
|
import { Type } from 'class-transformer';
|
|
17
12
|
import { LEGAL_TERM_BODY_FORMATS, type LegalTermBodyFormat } from './legal-term-body-format';
|
|
18
13
|
import { LegalTermDocumentDto } from './legal-term-document.dto';
|
|
19
14
|
|
|
20
|
-
const LEGAL_TERM_SIGNATURE_METHODS = ['digital', 'printed'] as const;
|
|
21
|
-
export type LegalTermSignatureMethodDto = (typeof LEGAL_TERM_SIGNATURE_METHODS)[number];
|
|
22
|
-
|
|
23
15
|
/** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
|
|
24
16
|
export class LegalTermPreviewRequestDto {
|
|
25
17
|
@ApiPropertyOptional({
|
|
@@ -84,46 +76,11 @@ export class LegalTermPreviewRequestDto {
|
|
|
84
76
|
}
|
|
85
77
|
|
|
86
78
|
export class LegalTermSendDto {
|
|
87
|
-
@ApiPropertyOptional({
|
|
88
|
-
enum: LEGAL_TERM_SIGNATURE_METHODS,
|
|
89
|
-
description:
|
|
90
|
-
'Método de assinatura: digital ou printed (PDF para impressão, ou digital para Assinatura Digital). Padrão: printed.',
|
|
91
|
-
default: 'printed',
|
|
92
|
-
})
|
|
93
|
-
@IsOptional()
|
|
94
|
-
@IsIn(LEGAL_TERM_SIGNATURE_METHODS)
|
|
95
|
-
signatureMethod?: LegalTermSignatureMethodDto;
|
|
96
|
-
|
|
97
79
|
@ApiProperty({ type: [String], format: 'uuid' })
|
|
98
80
|
@IsArray()
|
|
99
81
|
@IsUUID('4', { each: true })
|
|
100
82
|
procedureIds: string[];
|
|
101
83
|
|
|
102
|
-
@ApiPropertyOptional({
|
|
103
|
-
description:
|
|
104
|
-
'Mensagem WhatsApp. Obrigatória no modo digital (deve conter {{ link_termo_juridico }}). No modo impressão, omita ou deixe em branco para não enviar WhatsApp.',
|
|
105
|
-
example: 'Olá, assine seu termo: {{ link_termo_juridico }}',
|
|
106
|
-
})
|
|
107
|
-
@IsOptional()
|
|
108
|
-
@IsString()
|
|
109
|
-
@MaxLength(4000)
|
|
110
|
-
whatsappMessage?: string;
|
|
111
|
-
|
|
112
|
-
@ApiPropertyOptional({ description: 'E-mail do signatário se o paciente não tiver e-mail cadastrado' })
|
|
113
|
-
@IsOptional()
|
|
114
|
-
@IsString()
|
|
115
|
-
@MaxLength(320)
|
|
116
|
-
signerEmail?: string;
|
|
117
|
-
|
|
118
|
-
@ApiPropertyOptional({
|
|
119
|
-
description:
|
|
120
|
-
'UUID da linha WhatsApp Official (whatsapp_official_configs). Se omitido, usa-se o da sessão ativa do paciente.',
|
|
121
|
-
})
|
|
122
|
-
@IsOptional()
|
|
123
|
-
@IsString()
|
|
124
|
-
@MaxLength(128)
|
|
125
|
-
instanceKey?: string;
|
|
126
|
-
|
|
127
84
|
@ApiPropertyOptional({
|
|
128
85
|
description: 'ID do agendamento relacionado ao envio do termo jurídico',
|
|
129
86
|
format: 'uuid',
|
|
@@ -131,47 +88,21 @@ export class LegalTermSendDto {
|
|
|
131
88
|
@IsOptional()
|
|
132
89
|
@IsUUID('4')
|
|
133
90
|
appointmentId?: string;
|
|
91
|
+
}
|
|
134
92
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
})
|
|
139
|
-
@IsOptional()
|
|
140
|
-
@IsBoolean()
|
|
141
|
-
tenantAutoSign?: boolean;
|
|
142
|
-
|
|
143
|
-
@ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
|
|
144
|
-
@IsString()
|
|
145
|
-
@MinLength(1)
|
|
146
|
-
@MaxLength(500)
|
|
147
|
-
tenantSignerName?: string;
|
|
93
|
+
export class LegalTermSendResponseDto {
|
|
94
|
+
@ApiProperty()
|
|
95
|
+
signatureMethod: 'printed';
|
|
148
96
|
|
|
149
|
-
@
|
|
150
|
-
|
|
151
|
-
@MaxLength(320)
|
|
152
|
-
tenantSignerEmail?: string;
|
|
97
|
+
@ApiProperty()
|
|
98
|
+
printPdfBase64: string;
|
|
153
99
|
|
|
154
|
-
@
|
|
155
|
-
|
|
156
|
-
@Matches(/^\d{4}-\d{2}-\d{2}$/, {
|
|
157
|
-
message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
|
|
158
|
-
})
|
|
159
|
-
tenantSignerBirthday?: string;
|
|
100
|
+
@ApiProperty()
|
|
101
|
+
printFilename: string;
|
|
160
102
|
|
|
161
|
-
@
|
|
162
|
-
|
|
163
|
-
@MinLength(11)
|
|
164
|
-
@MaxLength(14)
|
|
165
|
-
tenantSignerDocumentation?: string;
|
|
103
|
+
@ApiProperty({ format: 'uuid' })
|
|
104
|
+
signatureId: string;
|
|
166
105
|
|
|
167
|
-
@
|
|
168
|
-
|
|
169
|
-
'Celular do representante (BR) para notificação via WhatsApp; opcional (sem isso usa e-mail).',
|
|
170
|
-
})
|
|
171
|
-
@ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
|
|
172
|
-
@IsOptional()
|
|
173
|
-
@IsString()
|
|
174
|
-
@MinLength(8)
|
|
175
|
-
@MaxLength(32)
|
|
176
|
-
tenantSignerPhone?: string;
|
|
106
|
+
@ApiProperty({ format: 'uuid' })
|
|
107
|
+
dispatchId: string;
|
|
177
108
|
}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
export const LEGAL_TERM_TEMPLATE_GET = 'legalTerm.template.get';
|
|
2
2
|
export const LEGAL_TERM_TEMPLATE_UPSERT = 'legalTerm.template.upsert';
|
|
3
3
|
export const LEGAL_TERM_DISPATCH_CREATE = 'legalTerm.dispatch.create';
|
|
4
|
+
export const LEGAL_TERM_DISPATCH_UPDATE = 'legalTerm.dispatch.update';
|
|
5
|
+
export const LEGAL_TERM_DISPATCH_GET = 'legalTerm.dispatch.get';
|
|
4
6
|
export const LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = 'legalTerm.dispatch.listByPatient';
|
|
5
7
|
/** Conta dispatches no mês civil UTC (status sent/created); usado para cota mensal. */
|
|
6
8
|
export const LEGAL_TERM_DISPATCH_COUNT_MONTHLY = 'legalTerm.dispatch.countMonthly';
|
|
9
|
+
|
|
10
|
+
export const SIGNATURE_PRINTED_EMIT = 'signature.printed.emit';
|
|
11
|
+
export const SIGNATURE_PRINTED_CONFIRM_UPLOAD = 'signature.printed.confirmUpload';
|
|
12
|
+
export const SIGNATURE_PRINTED_CANCEL = 'signature.printed.cancel';
|
|
13
|
+
export const SIGNATURE_PRINTED_SUMMARY_BY_IDS = 'signature.printed.summaryByIds';
|
|
14
|
+
/** RPC: objectKey do scan assinado (status signed) para presign de download. */
|
|
15
|
+
export const SIGNATURE_PRINTED_SIGNED_SCAN_OBJECT_KEY =
|
|
16
|
+
'signature.printed.signedScanObjectKey';
|
|
17
|
+
|
|
18
|
+
/** @deprecated Use SIGNATURE_PRINTED_EMIT */
|
|
7
19
|
export const SIGNATURE_LEGAL_ENVELOPE_CREATE = 'signature.legalEnvelope.create';
|
|
8
|
-
/**
|
|
20
|
+
/** @deprecated Use SIGNATURE_PRINTED_SUMMARY_BY_IDS */
|
|
9
21
|
export const SIGNATURE_DOCUMENTS_SUMMARY_BY_IDS = 'signature.documents.summaryByIds';
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@ApiProperty({ description: 'Slug do tenant' })
|
|
2
|
+
import { IsIn, IsOptional, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
export const SIGNATURE_METHODS = ['printed'] as const;
|
|
5
|
+
export type SignatureMethodValue = (typeof SIGNATURE_METHODS)[number];
|
|
6
|
+
|
|
7
|
+
export const PRINTED_SIGNATURE_STATUSES = [
|
|
8
|
+
'pending_upload',
|
|
9
|
+
'signed',
|
|
10
|
+
'cancelled',
|
|
11
|
+
] as const;
|
|
12
|
+
export type PrintedSignatureStatusValue =
|
|
13
|
+
(typeof PRINTED_SIGNATURE_STATUSES)[number];
|
|
14
|
+
|
|
15
|
+
/** RPC: cadastrar assinatura impressa após criar dispatch. */
|
|
16
|
+
export class PrintedSignatureEmitRpcDto {
|
|
17
|
+
@ApiProperty()
|
|
19
18
|
@IsString()
|
|
20
19
|
@MinLength(1)
|
|
21
20
|
@MaxLength(128)
|
|
@@ -25,142 +24,86 @@ export class CreateLegalSigningEnvelopeRpcDto {
|
|
|
25
24
|
@IsUUID('4')
|
|
26
25
|
patientId: string;
|
|
27
26
|
|
|
28
|
-
@
|
|
29
|
-
@IsOptional()
|
|
27
|
+
@ApiProperty({ format: 'uuid' })
|
|
30
28
|
@IsUUID('4')
|
|
31
|
-
legalTermDispatchId
|
|
29
|
+
legalTermDispatchId: string;
|
|
32
30
|
|
|
33
|
-
@ApiProperty()
|
|
34
|
-
@
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
signerName: string;
|
|
31
|
+
@ApiProperty({ enum: SIGNATURE_METHODS, default: 'printed' })
|
|
32
|
+
@IsIn(SIGNATURE_METHODS)
|
|
33
|
+
method: SignatureMethodValue;
|
|
34
|
+
}
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
@
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@ApiPropertyOptional({
|
|
45
|
-
description:
|
|
46
|
-
'Telefone do paciente (BR) para assinatura digital: com WhatsApp em `document_signed` exige 10–11 dígitos nacionais; normalizado no signature-service.',
|
|
47
|
-
})
|
|
48
|
-
@IsOptional()
|
|
49
|
-
@IsString()
|
|
50
|
-
@MinLength(8)
|
|
51
|
-
@MaxLength(32)
|
|
52
|
-
signerPhone?: string;
|
|
36
|
+
export class PrintedSignatureEmitRpcResultDto {
|
|
37
|
+
@ApiProperty({ format: 'uuid' })
|
|
38
|
+
signatureId: string;
|
|
39
|
+
}
|
|
53
40
|
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
/** RPC: confirmar upload da digitalização assinada. */
|
|
42
|
+
export class PrintedSignatureConfirmUploadRpcDto {
|
|
43
|
+
@ApiProperty()
|
|
56
44
|
@IsString()
|
|
57
45
|
@MinLength(1)
|
|
58
|
-
|
|
46
|
+
@MaxLength(128)
|
|
47
|
+
tenant: string;
|
|
59
48
|
|
|
60
|
-
@
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
@ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => !o.pdfBase64?.trim())
|
|
65
|
-
@IsString()
|
|
66
|
-
@MinLength(1)
|
|
67
|
-
renderedHtml?: string;
|
|
49
|
+
@ApiProperty({ format: 'uuid' })
|
|
50
|
+
@IsUUID('4')
|
|
51
|
+
signatureId: string;
|
|
68
52
|
|
|
69
|
-
@
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})
|
|
73
|
-
@IsOptional()
|
|
74
|
-
@IsIn(LEGAL_TERM_BODY_FORMATS)
|
|
75
|
-
bodyFormat?: LegalTermBodyFormat;
|
|
76
|
-
|
|
77
|
-
@ApiProperty({
|
|
78
|
-
example: 'termo-juridico.pdf',
|
|
79
|
-
description:
|
|
80
|
-
'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.',
|
|
81
|
-
})
|
|
82
|
-
@IsString()
|
|
83
|
-
@MinLength(1)
|
|
84
|
-
@MaxLength(255)
|
|
85
|
-
documentFilename: string;
|
|
53
|
+
@ApiProperty({ format: 'uuid' })
|
|
54
|
+
@IsUUID('4')
|
|
55
|
+
signedScanStorageId: string;
|
|
86
56
|
|
|
87
|
-
@
|
|
88
|
-
@IsOptional()
|
|
57
|
+
@ApiProperty()
|
|
89
58
|
@IsString()
|
|
90
|
-
@
|
|
91
|
-
|
|
59
|
+
@MinLength(1)
|
|
60
|
+
@MaxLength(2048)
|
|
61
|
+
signedScanKey: string;
|
|
92
62
|
|
|
93
|
-
@ApiPropertyOptional({
|
|
94
|
-
description:
|
|
95
|
-
'Incluir signatário da clínica (PJ) com assinatura automática antes do paciente. Exige conta com termo de assinatura automática válido.',
|
|
96
|
-
})
|
|
63
|
+
@ApiPropertyOptional({ format: 'uuid' })
|
|
97
64
|
@IsOptional()
|
|
98
|
-
@
|
|
99
|
-
|
|
65
|
+
@IsUUID('4')
|
|
66
|
+
signedByUserId?: string;
|
|
67
|
+
}
|
|
100
68
|
|
|
101
|
-
|
|
69
|
+
/** RPC: cancelar assinatura impressa pendente. */
|
|
70
|
+
export class PrintedSignatureCancelRpcDto {
|
|
71
|
+
@ApiProperty()
|
|
102
72
|
@IsString()
|
|
103
73
|
@MinLength(1)
|
|
104
|
-
@MaxLength(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
@ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
|
|
108
|
-
@IsEmail()
|
|
109
|
-
@MaxLength(320)
|
|
110
|
-
tenantSignerEmail?: string;
|
|
111
|
-
|
|
112
|
-
@ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
|
|
113
|
-
@IsString()
|
|
114
|
-
@Matches(/^\d{4}-\d{2}-\d{2}$/, {
|
|
115
|
-
message: 'tenantSignerBirthday deve ser ISO (YYYY-MM-DD)',
|
|
116
|
-
})
|
|
117
|
-
tenantSignerBirthday?: string;
|
|
118
|
-
|
|
119
|
-
@ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
|
|
120
|
-
@IsString()
|
|
121
|
-
@MinLength(11)
|
|
122
|
-
@MaxLength(14)
|
|
123
|
-
tenantSignerDocumentation?: string;
|
|
124
|
-
|
|
125
|
-
@ApiPropertyOptional({
|
|
126
|
-
description:
|
|
127
|
-
'Celular do representante (BR) para notificação via WhatsApp após assinatura; se omitido, usa-se e-mail.',
|
|
128
|
-
})
|
|
129
|
-
@ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
|
|
130
|
-
@IsOptional()
|
|
131
|
-
@IsString()
|
|
132
|
-
@MinLength(8)
|
|
133
|
-
@MaxLength(32)
|
|
134
|
-
tenantSignerPhone?: string;
|
|
135
|
-
}
|
|
74
|
+
@MaxLength(128)
|
|
75
|
+
tenant: string;
|
|
136
76
|
|
|
137
|
-
export class CreateLegalSigningEnvelopeRpcResultDto {
|
|
138
77
|
@ApiProperty({ format: 'uuid' })
|
|
139
|
-
|
|
78
|
+
@IsUUID('4')
|
|
79
|
+
signatureId: string;
|
|
80
|
+
}
|
|
140
81
|
|
|
141
|
-
|
|
142
|
-
|
|
82
|
+
/** Resumo por ID (listagem na ficha do paciente). */
|
|
83
|
+
export type PrintedSignatureSummaryItemDto = {
|
|
84
|
+
id: string;
|
|
85
|
+
method: SignatureMethodValue;
|
|
86
|
+
signature_status: PrintedSignatureStatusValue;
|
|
87
|
+
signed_at: string | null;
|
|
88
|
+
};
|
|
143
89
|
|
|
90
|
+
/** RPC: obter chave S3 do scan assinado para download. */
|
|
91
|
+
export class PrintedSignatureSignedScanObjectKeyRpcDto {
|
|
144
92
|
@ApiProperty()
|
|
145
|
-
|
|
93
|
+
@IsString()
|
|
94
|
+
@MinLength(1)
|
|
95
|
+
@MaxLength(128)
|
|
96
|
+
tenant: string;
|
|
146
97
|
|
|
147
|
-
@ApiProperty()
|
|
148
|
-
|
|
98
|
+
@ApiProperty({ format: 'uuid' })
|
|
99
|
+
@IsUUID('4')
|
|
100
|
+
signatureId: string;
|
|
149
101
|
|
|
150
|
-
@
|
|
151
|
-
|
|
102
|
+
@ApiProperty({ format: 'uuid' })
|
|
103
|
+
@IsUUID('4')
|
|
104
|
+
patientId: string;
|
|
152
105
|
}
|
|
153
106
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
id: string;
|
|
157
|
-
signature_status:
|
|
158
|
-
| 'pending'
|
|
159
|
-
| 'signed'
|
|
160
|
-
| 'refused'
|
|
161
|
-
| 'cancelled'
|
|
162
|
-
| 'expired';
|
|
163
|
-
patient_signed: boolean;
|
|
164
|
-
/** ISO-8601 UTC ou null */
|
|
165
|
-
signed_at: string | null;
|
|
107
|
+
export type PrintedSignatureSignedScanObjectKeyRpcResultDto = {
|
|
108
|
+
objectKey: string;
|
|
166
109
|
};
|