tychat-contracts 1.6.61 → 1.6.62

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.
@@ -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", "legal_terms_digital_signature", "patients_anamneses", "clinic_anamneses", "ai_conversation", "follow_up", "funnel", "satisfaction", "clinic", "billings", "connections", "settings", "campaigns"];
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,oXAwBzB,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
+ {"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"}
@@ -17,7 +17,6 @@ exports.TYCHAT_APP_MODULE_KEYS = [
17
17
  'patients_documents',
18
18
  'patients_legal_terms',
19
19
  'clinic_legal_terms',
20
- 'legal_terms_digital_signature',
21
20
  'patients_anamneses',
22
21
  'clinic_anamneses',
23
22
  'ai_conversation',
@@ -1,13 +1,9 @@
1
- /** Status do registro de envio na clínica (WhatsApp / fluxo). */
2
- export type LegalTermDispatchStatusValue = 'created' | 'sent' | 'failed';
3
- /** Status do documento no provedor de assinatura (signature-service). */
4
- export type SignatureDocumentStatusValue = 'pending' | 'signed' | 'refused' | 'cancelled' | 'expired'
5
- /** Fluxo impresso: aguardando upload da digitalização assinada (sem registro em signature-service). */
6
- | 'upload_required';
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,iEAAiE;AACjE,MAAM,MAAM,4BAA4B,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzE,yEAAyE;AACzE,MAAM,MAAM,4BAA4B,GACpC,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,SAAS;AACX,uGAAuG;GACrG,iBAAiB,CAAC;AAEtB,wDAAwD;AACxD,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,CAAC;AAElE,oEAAoE;AACpE,MAAM,MAAM,6BAA6B,GACrC,cAAc,GACd,0BAA0B,CAAC;AAE/B,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;IACzB,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,KAAK,EAAE,+BAA+B,EAAE,CAAC;CAC1C,CAAC"}
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":"AAgBA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,QAAA,MAAM,4BAA4B,iCAAkC,CAAC;AACrE,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,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;IAS3B,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAK9C,YAAY,EAAE,MAAM,EAAE,CAAC;IAUvB,eAAe,CAAC,EAAE,MAAM,CAAC;IAMzB,WAAW,CAAC,EAAE,MAAM,CAAC;IASrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,aAAa,CAAC,EAAE,MAAM,CAAC;IAQvB,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;IAWnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
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.ApiPropertyOptional)({
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
- ], LegalTermSendDto.prototype, "tenantSignerName", void 0);
128
+ ], LegalTermSendResponseDto.prototype, "signatureMethod", void 0);
179
129
  __decorate([
180
- (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
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
- ], LegalTermSendDto.prototype, "tenantSignerEmail", void 0);
132
+ ], LegalTermSendResponseDto.prototype, "printPdfBase64", void 0);
185
133
  __decorate([
186
- (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
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
- ], LegalTermSendDto.prototype, "tenantSignerBirthday", void 0);
136
+ ], LegalTermSendResponseDto.prototype, "printFilename", void 0);
193
137
  __decorate([
194
- (0, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
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
- ], LegalTermSendDto.prototype, "tenantSignerDocumentation", void 0);
140
+ ], LegalTermSendResponseDto.prototype, "signatureId", void 0);
200
141
  __decorate([
201
- (0, swagger_1.ApiPropertyOptional)({
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
- ], LegalTermSendDto.prototype, "tenantSignerPhone", void 0);
144
+ ], LegalTermSendResponseDto.prototype, "dispatchId", void 0);
@@ -1,10 +1,17 @@
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
+ /** @deprecated Use SIGNATURE_PRINTED_EMIT */
7
14
  export declare const SIGNATURE_LEGAL_ENVELOPE_CREATE = "signature.legalEnvelope.create";
8
- /** Resumo de documentos por IDs (tenant + escopo); usado pela API para enriquecer dispatches. */
15
+ /** @deprecated Use SIGNATURE_PRINTED_SUMMARY_BY_IDS */
9
16
  export declare const SIGNATURE_DOCUMENTS_SUMMARY_BY_IDS = "signature.documents.summaryByIds";
10
17
  //# 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;AACnF,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAChF,iGAAiG;AACjG,eAAO,MAAM,kCAAkC,qCAAqC,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;AAEjF,6CAA6C;AAC7C,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAChF,uDAAuD;AACvD,eAAO,MAAM,kCAAkC,qCAAqC,CAAC"}
@@ -1,12 +1,19 @@
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_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
+ /** @deprecated Use SIGNATURE_PRINTED_EMIT */
10
17
  exports.SIGNATURE_LEGAL_ENVELOPE_CREATE = 'signature.legalEnvelope.create';
11
- /** Resumo de documentos por IDs (tenant + escopo); usado pela API para enriquecer dispatches. */
18
+ /** @deprecated Use SIGNATURE_PRINTED_SUMMARY_BY_IDS */
12
19
  exports.SIGNATURE_DOCUMENTS_SUMMARY_BY_IDS = 'signature.documents.summaryByIds';
@@ -1,37 +1,35 @@
1
- import { type LegalTermBodyFormat } from './legal-term-body-format';
2
- /** Payload RPC: tychat-api → tychat-signature-service (criar envelope de assinatura digital). */
3
- export declare class CreateLegalSigningEnvelopeRpcDto {
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?: string;
7
- signerName: string;
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 CreateLegalSigningEnvelopeRpcResultDto {
23
- signatureDocumentId: string;
24
- signingUrl: string;
25
- clicksignEnvelopeId: string;
26
- clicksignDocumentId: string;
27
- clicksignSignerId?: string;
12
+ export declare class PrintedSignatureEmitRpcResultDto {
13
+ signatureId: string;
28
14
  }
29
- /** Resposta RPC: um documento por ID solicitado (apenas linhas do tenant). */
30
- export type SignatureDocumentSummaryItemDto = {
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
- signature_status: 'pending' | 'signed' | 'refused' | 'cancelled' | 'expired';
33
- patient_signed: boolean;
34
- /** ISO-8601 UTC ou null */
31
+ method: SignatureMethodValue;
32
+ signature_status: PrintedSignatureStatusValue;
35
33
  signed_at: string | null;
36
34
  };
37
35
  //# 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":"AAaA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE7F,iGAAiG;AACjG,qBAAa,gCAAgC;IAK3C,MAAM,EAAE,MAAM,CAAC;IAIf,SAAS,EAAE,MAAM,CAAC;IAKlB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAM7B,UAAU,EAAE,MAAM,CAAC;IAKnB,WAAW,EAAE,MAAM,CAAC;IAUpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,SAAS,CAAC,EAAE,MAAM,CAAC;IASnB,YAAY,CAAC,EAAE,MAAM,CAAC;IAQtB,UAAU,CAAC,EAAE,mBAAmB,CAAC;IAUjC,gBAAgB,EAAE,MAAM,CAAC;IAMzB,YAAY,CAAC,EAAE,MAAM,CAAC;IAQtB,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;IAWnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;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"}
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"}
@@ -9,186 +9,107 @@ 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.CreateLegalSigningEnvelopeRpcResultDto = exports.CreateLegalSigningEnvelopeRpcDto = void 0;
12
+ 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
- const legal_term_body_format_1 = require("./legal-term-body-format");
16
- /** Payload RPC: tychat-api → tychat-signature-service (criar envelope de assinatura digital). */
17
- class CreateLegalSigningEnvelopeRpcDto {
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
- signerName;
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.CreateLegalSigningEnvelopeRpcDto = CreateLegalSigningEnvelopeRpcDto;
28
+ exports.PrintedSignatureEmitRpcDto = PrintedSignatureEmitRpcDto;
37
29
  __decorate([
38
- (0, swagger_1.ApiProperty)({ description: 'Slug do tenant' }),
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenant", void 0);
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "patientId", void 0);
40
+ ], PrintedSignatureEmitRpcDto.prototype, "patientId", void 0);
49
41
  __decorate([
50
- (0, swagger_1.ApiPropertyOptional)({ format: 'uuid', description: 'ID do dispatch na clínica (preenchido após create se fluxo inverter)' }),
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "legalTermDispatchId", void 0);
45
+ ], PrintedSignatureEmitRpcDto.prototype, "legalTermDispatchId", void 0);
55
46
  __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),
47
+ (0, swagger_1.ApiProperty)({ enum: exports.SIGNATURE_METHODS, default: 'printed' }),
48
+ (0, class_validator_1.IsIn)(exports.SIGNATURE_METHODS),
60
49
  __metadata("design:type", String)
61
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "signerName", void 0);
62
- __decorate([
63
- (0, swagger_1.ApiProperty)(),
64
- (0, class_validator_1.IsEmail)(),
65
- (0, class_validator_1.MaxLength)(320),
66
- __metadata("design:type", String)
67
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "signerEmail", void 0);
50
+ ], PrintedSignatureEmitRpcDto.prototype, "method", void 0);
51
+ class PrintedSignatureEmitRpcResultDto {
52
+ signatureId;
53
+ }
54
+ exports.PrintedSignatureEmitRpcResultDto = PrintedSignatureEmitRpcResultDto;
68
55
  __decorate([
69
- (0, swagger_1.ApiPropertyOptional)({
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "signerPhone", void 0);
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.ApiPropertyOptional)({ description: 'PDF em base64 (sem prefixo data:); omitir se enviar renderedHtml' }),
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "pdfBase64", void 0);
74
+ ], PrintedSignatureConfirmUploadRpcDto.prototype, "tenant", void 0);
85
75
  __decorate([
86
- (0, swagger_1.ApiPropertyOptional)({
87
- description: 'Conteúdo já com placeholders substituídos; convertido para HTML→PDF no signature-service conforme bodyFormat',
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "renderedHtml", void 0);
79
+ ], PrintedSignatureConfirmUploadRpcDto.prototype, "signatureId", void 0);
94
80
  __decorate([
95
- (0, swagger_1.ApiPropertyOptional)({
96
- enum: legal_term_body_format_1.LEGAL_TERM_BODY_FORMATS,
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "bodyFormat", void 0);
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)(255),
89
+ (0, class_validator_1.MaxLength)(2048),
111
90
  __metadata("design:type", String)
112
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "documentFilename", void 0);
91
+ ], PrintedSignatureConfirmUploadRpcDto.prototype, "signedScanKey", void 0);
113
92
  __decorate([
114
- (0, swagger_1.ApiPropertyOptional)({ description: 'Nome exibido do envelope de assinatura' }),
93
+ (0, swagger_1.ApiPropertyOptional)({ format: 'uuid' }),
115
94
  (0, class_validator_1.IsOptional)(),
116
- (0, class_validator_1.IsString)(),
117
- (0, class_validator_1.MaxLength)(500),
95
+ (0, class_validator_1.IsUUID)('4'),
118
96
  __metadata("design:type", String)
119
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "envelopeName", void 0);
120
- __decorate([
121
- (0, swagger_1.ApiPropertyOptional)({
122
- description: 'Incluir signatário da clínica (PJ) com assinatura automática antes do paciente. Exige conta com termo de assinatura automática válido.',
123
- }),
124
- (0, class_validator_1.IsOptional)(),
125
- (0, class_validator_1.IsBoolean)(),
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, class_validator_1.ValidateIf)((o) => o.tenantAutoSign === true),
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)(500),
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
- ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenantSignerPhone", void 0);
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
- ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "signatureDocumentId", void 0);
179
- __decorate([
180
- (0, swagger_1.ApiProperty)(),
181
- __metadata("design:type", String)
182
- ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "signingUrl", void 0);
183
- __decorate([
184
- (0, swagger_1.ApiProperty)(),
185
- __metadata("design:type", String)
186
- ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "clicksignEnvelopeId", void 0);
187
- __decorate([
188
- (0, swagger_1.ApiProperty)(),
189
- __metadata("design:type", String)
190
- ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "clicksignDocumentId", void 0);
191
- __decorate([
192
- (0, swagger_1.ApiPropertyOptional)(),
193
- __metadata("design:type", String)
194
- ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "clicksignSignerId", void 0);
115
+ ], PrintedSignatureCancelRpcDto.prototype, "signatureId", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.6.61",
3
+ "version": "1.6.62",
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",
@@ -14,7 +14,6 @@ export const TYCHAT_APP_MODULE_KEYS = [
14
14
  'patients_documents',
15
15
  'patients_legal_terms',
16
16
  'clinic_legal_terms',
17
- 'legal_terms_digital_signature',
18
17
  'patients_anamneses',
19
18
  'clinic_anamneses',
20
19
  'ai_conversation',
@@ -1,23 +1,18 @@
1
- /** Status do registro de envio na clínica (WhatsApp / fluxo). */
2
- export type LegalTermDispatchStatusValue = 'created' | 'sent' | 'failed';
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 do documento no provedor de assinatura (signature-service). */
8
+ /** Status da assinatura impressa (signature-service). */
5
9
  export type SignatureDocumentStatusValue =
6
- | 'pending'
10
+ | 'upload_required'
7
11
  | 'signed'
8
- | 'refused'
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 escolhido no envio do termo. */
15
- export type LegalTermSignatureMethodValue = 'digital' | 'printed';
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
- @ApiPropertyOptional({
136
- description:
137
- 'Assinatura automática do representante da clínica antes do paciente. Exige tenantSignerName, tenantSignerEmail, tenantSignerBirthday (YYYY-MM-DD) e tenantSignerDocumentation (CPF).',
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
- @ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
150
- @IsEmail()
151
- @MaxLength(320)
152
- tenantSignerEmail?: string;
97
+ @ApiProperty()
98
+ printPdfBase64: string;
153
99
 
154
- @ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
155
- @IsString()
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
- @ValidateIf((o: LegalTermSendDto) => o.tenantAutoSign === true)
162
- @IsString()
163
- @MinLength(11)
164
- @MaxLength(14)
165
- tenantSignerDocumentation?: string;
103
+ @ApiProperty({ format: 'uuid' })
104
+ signatureId: string;
166
105
 
167
- @ApiPropertyOptional({
168
- description:
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,18 @@
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
+
15
+ /** @deprecated Use SIGNATURE_PRINTED_EMIT */
7
16
  export const SIGNATURE_LEGAL_ENVELOPE_CREATE = 'signature.legalEnvelope.create';
8
- /** Resumo de documentos por IDs (tenant + escopo); usado pela API para enriquecer dispatches. */
17
+ /** @deprecated Use SIGNATURE_PRINTED_SUMMARY_BY_IDS */
9
18
  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
- IsBoolean,
4
- IsEmail,
5
- IsIn,
6
- IsOptional,
7
- IsString,
8
- IsUUID,
9
- Matches,
10
- MaxLength,
11
- MinLength,
12
- ValidateIf,
13
- } from 'class-validator';
14
- import { LEGAL_TERM_BODY_FORMATS, type LegalTermBodyFormat } from './legal-term-body-format';
2
+ import { IsIn, IsOptional, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
15
3
 
16
- /** Payload RPC: tychat-api tychat-signature-service (criar envelope de assinatura digital). */
17
- export class CreateLegalSigningEnvelopeRpcDto {
18
- @ApiProperty({ description: 'Slug do tenant' })
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,65 @@ export class CreateLegalSigningEnvelopeRpcDto {
25
24
  @IsUUID('4')
26
25
  patientId: string;
27
26
 
28
- @ApiPropertyOptional({ format: 'uuid', description: 'ID do dispatch na clínica (preenchido após create se fluxo inverter)' })
29
- @IsOptional()
27
+ @ApiProperty({ format: 'uuid' })
30
28
  @IsUUID('4')
31
- legalTermDispatchId?: string;
29
+ legalTermDispatchId: string;
32
30
 
33
- @ApiProperty()
34
- @IsString()
35
- @MinLength(1)
36
- @MaxLength(500)
37
- signerName: string;
38
-
39
- @ApiProperty()
40
- @IsEmail()
41
- @MaxLength(320)
42
- signerEmail: string;
31
+ @ApiProperty({ enum: SIGNATURE_METHODS, default: 'printed' })
32
+ @IsIn(SIGNATURE_METHODS)
33
+ method: SignatureMethodValue;
34
+ }
43
35
 
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
- @ApiPropertyOptional({ description: 'PDF em base64 (sem prefixo data:); omitir se enviar renderedHtml' })
55
- @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => !o.renderedHtml?.trim())
41
+ /** RPC: confirmar upload da digitalização assinada. */
42
+ export class PrintedSignatureConfirmUploadRpcDto {
43
+ @ApiProperty()
56
44
  @IsString()
57
45
  @MinLength(1)
58
- pdfBase64?: string;
46
+ @MaxLength(128)
47
+ tenant: string;
59
48
 
60
- @ApiPropertyOptional({
61
- description:
62
- 'Conteúdo já com placeholders substituídos; convertido para HTML→PDF no signature-service conforme bodyFormat',
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
- @ApiPropertyOptional({
70
- enum: LEGAL_TERM_BODY_FORMATS,
71
- description: 'Interpretação de renderedHtml antes do PDF; padrão html',
72
- })
73
- @IsOptional()
74
- @IsIn(LEGAL_TERM_BODY_FORMATS)
75
- bodyFormat?: LegalTermBodyFormat;
53
+ @ApiProperty({ format: 'uuid' })
54
+ @IsUUID('4')
55
+ signedScanStorageId: string;
76
56
 
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
- })
57
+ @ApiProperty()
82
58
  @IsString()
83
59
  @MinLength(1)
84
- @MaxLength(255)
85
- documentFilename: string;
60
+ @MaxLength(2048)
61
+ signedScanKey: string;
86
62
 
87
- @ApiPropertyOptional({ description: 'Nome exibido do envelope de assinatura' })
63
+ @ApiPropertyOptional({ format: 'uuid' })
88
64
  @IsOptional()
89
- @IsString()
90
- @MaxLength(500)
91
- envelopeName?: string;
92
-
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
- })
97
- @IsOptional()
98
- @IsBoolean()
99
- tenantAutoSign?: boolean;
65
+ @IsUUID('4')
66
+ signedByUserId?: string;
67
+ }
100
68
 
101
- @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => o.tenantAutoSign === true)
69
+ /** RPC: cancelar assinatura impressa pendente. */
70
+ export class PrintedSignatureCancelRpcDto {
71
+ @ApiProperty()
102
72
  @IsString()
103
73
  @MinLength(1)
104
- @MaxLength(500)
105
- tenantSignerName?: string;
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
- signatureDocumentId: string;
140
-
141
- @ApiProperty()
142
- signingUrl: string;
143
-
144
- @ApiProperty()
145
- clicksignEnvelopeId: string;
146
-
147
- @ApiProperty()
148
- clicksignDocumentId: string;
149
-
150
- @ApiPropertyOptional()
151
- clicksignSignerId?: string;
78
+ @IsUUID('4')
79
+ signatureId: string;
152
80
  }
153
81
 
154
- /** Resposta RPC: um documento por ID solicitado (apenas linhas do tenant). */
155
- export type SignatureDocumentSummaryItemDto = {
82
+ /** Resumo por ID (listagem na ficha do paciente). */
83
+ export type PrintedSignatureSummaryItemDto = {
156
84
  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 */
85
+ method: SignatureMethodValue;
86
+ signature_status: PrintedSignatureStatusValue;
165
87
  signed_at: string | null;
166
88
  };