@muni-sanfer/types-gestor-documental 0.0.1-beta.10 → 0.0.1-beta.12

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.
@@ -143,12 +143,13 @@ export declare const CaseFileActorType: {
143
143
  PrivateInstitution: "PrivateInstitution";
144
144
  Official: "Official";
145
145
  };
146
- export type CaseFileTrackingAction = 'Created' | 'Updated' | 'EntryAdded' | 'EntryVoided' | 'ParticipantAdded' | 'ParticipantRemoved' | 'Closed' | 'Exported';
146
+ export type CaseFileTrackingAction = 'Created' | 'Updated' | 'EntryAdded' | 'EntryVoided' | 'EntryMoved' | 'ParticipantAdded' | 'ParticipantRemoved' | 'Closed' | 'Exported';
147
147
  export declare const CaseFileTrackingAction: {
148
148
  Created: "Created";
149
149
  Updated: "Updated";
150
150
  EntryAdded: "EntryAdded";
151
151
  EntryVoided: "EntryVoided";
152
+ EntryMoved: "EntryMoved";
152
153
  ParticipantAdded: "ParticipantAdded";
153
154
  ParticipantRemoved: "ParticipantRemoved";
154
155
  Closed: "Closed";
@@ -206,6 +207,7 @@ export interface DocumentEntity {
206
207
  externalFolio?: string | null;
207
208
  externalSender?: string | null;
208
209
  externalDate?: string | null;
210
+ composition?: JsonValue | null;
209
211
  contentText?: string | null;
210
212
  textExtractedAt?: string | null;
211
213
  batch?: SignatureBatchEntity | null;
@@ -284,6 +286,7 @@ export interface DocumentTrackingEntity {
284
286
  id: string;
285
287
  action: DocumentTrackingAction;
286
288
  observation?: string | null;
289
+ sha256?: string | null;
287
290
  employeeId?: string | null;
288
291
  employeeFullName?: string | null;
289
292
  document?: DocumentEntity;
@@ -344,6 +347,7 @@ export interface DocumentTypeFlowStepEntity {
344
347
  directorateCodeReference?: number | null;
345
348
  name: string;
346
349
  position?: string | null;
350
+ withPrevious: boolean;
347
351
  documentType?: DocumentTypeEntity;
348
352
  documentTypeId: string;
349
353
  createdAt: string;
@@ -424,6 +428,7 @@ export interface CaseFileEntryEntity {
424
428
  kind: CaseFileEntryKind;
425
429
  actuationType: CaseFileActuationType;
426
430
  title: string;
431
+ folder?: string | null;
427
432
  document?: DocumentEntity | null;
428
433
  documentId?: string | null;
429
434
  fileId?: string | null;
@@ -132,6 +132,7 @@ exports.CaseFileTrackingAction = {
132
132
  Updated: 'Updated',
133
133
  EntryAdded: 'EntryAdded',
134
134
  EntryVoided: 'EntryVoided',
135
+ EntryMoved: 'EntryMoved',
135
136
  ParticipantAdded: 'ParticipantAdded',
136
137
  ParticipantRemoved: 'ParticipantRemoved',
137
138
  Closed: 'Closed',
@@ -11,6 +11,7 @@ export declare const CaseFilePatterns: {
11
11
  readonly addEntry: "gestorDocumental.caseFile.addEntry";
12
12
  readonly addBatch: "gestorDocumental.caseFile.addBatch";
13
13
  readonly voidEntry: "gestorDocumental.caseFile.voidEntry";
14
+ readonly moveEntry: "gestorDocumental.caseFile.moveEntry";
14
15
  readonly share: "gestorDocumental.caseFile.share";
15
16
  readonly unshare: "gestorDocumental.caseFile.unshare";
16
17
  readonly close: "gestorDocumental.caseFile.close";
@@ -110,10 +111,20 @@ export interface CaseFileContract {
110
111
  [CaseFilePatterns.addEntry]: {
111
112
  payload: Pick<CaseFileEntity, 'id'> & {
112
113
  entry: CaseFileEntryInput;
114
+ folder?: string | null;
113
115
  } & CaseFileActorPayload;
114
116
  response: CaseFileAddEntryResponseEntity;
115
117
  };
116
118
  /** Deja una actuación sin efecto, con su motivo. No se elimina del índice. */
119
+ /** Pasa una actuación a otra subcarpeta del índice (`null`: a la raíz). El orden de incorporación no cambia. */
120
+ [CaseFilePatterns.moveEntry]: {
121
+ payload: {
122
+ id: string;
123
+ entryId: string;
124
+ folder: string | null;
125
+ } & CaseFileActorPayload;
126
+ response: CaseFileUpdateResponseEntity;
127
+ };
117
128
  [CaseFilePatterns.voidEntry]: {
118
129
  payload: Pick<CaseFileEntity, 'id'> & {
119
130
  entryId: string;
@@ -10,6 +10,7 @@ exports.CaseFilePatterns = {
10
10
  addEntry: 'gestorDocumental.caseFile.addEntry',
11
11
  addBatch: 'gestorDocumental.caseFile.addBatch',
12
12
  voidEntry: 'gestorDocumental.caseFile.voidEntry',
13
+ moveEntry: 'gestorDocumental.caseFile.moveEntry',
13
14
  share: 'gestorDocumental.caseFile.share',
14
15
  unshare: 'gestorDocumental.caseFile.unshare',
15
16
  close: 'gestorDocumental.caseFile.close',
@@ -1,5 +1,5 @@
1
1
  import { type DocumentAccessLevel, type DocumentAttachmentEntity, type DocumentDeliveryEntity, type DocumentEntity, type DocumentInstruction, type DocumentParticipantEntity, type DocumentStatus } from '../base/entities';
2
- import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity } from '../entities';
2
+ import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentComposeResponseEntity, type DocumentComposition, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity } from '../entities';
3
3
  import { type RpcPage } from './contract';
4
4
  /** Patrones NATS de `document`: `<servicio>.<recurso>.<acción>`. */
5
5
  export declare const DocumentPatterns: {
@@ -21,6 +21,7 @@ export declare const DocumentPatterns: {
21
21
  readonly getFilesFolder: "gestorDocumental.document.getFilesFolder";
22
22
  readonly getAgenda: "gestorDocumental.document.getAgenda";
23
23
  readonly exportTrail: "gestorDocumental.document.exportTrail";
24
+ readonly compose: "gestorDocumental.document.compose";
24
25
  };
25
26
  /**
26
27
  * Funcionario que hace la operación y sus áreas (direcciones y departamentos a los que pertenece o que dirige). Lo
@@ -73,6 +74,7 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
73
74
  visaEmployeeIds: string[];
74
75
  visaStages?: number[] | null;
75
76
  restartFlow?: boolean;
77
+ composition?: DocumentComposition | null;
76
78
  signatureEmployeeIds: string[];
77
79
  signatureSheet?: boolean;
78
80
  recipients?: DocumentRecipientInput[];
@@ -91,6 +93,26 @@ export interface DocumentExternalRecipientInput {
91
93
  * Qué se envía y qué se responde en cada patrón. Generado desde los handlers y los DTO del microservicio.
92
94
  */
93
95
  export interface DocumentContract {
96
+ /**
97
+ * Arma el PDF de un documento redactado con una plantilla oficial: membrete, estructura y espacio libre para el
98
+ * número, las visaciones, las firmas y el QR. Con `preview` lo entrega para verlo; si no, lo sube y entrega su
99
+ * `fileId` para guardarlo como el PDF del documento.
100
+ */
101
+ [DocumentPatterns.compose]: {
102
+ payload: {
103
+ documentTypeId: string;
104
+ subject: string;
105
+ composition: DocumentComposition;
106
+ visaCount: number;
107
+ signatureCount: number;
108
+ signatureSheet?: boolean;
109
+ /** Unidad que emite, para el membrete. */
110
+ issuingUnitName?: string | null;
111
+ preview?: boolean;
112
+ actor: DocumentActor;
113
+ };
114
+ response: DocumentComposeResponseEntity;
115
+ };
94
116
  /** Plazos del funcionario entre `from` y `to` (hasta 62 días), y lo que tiene vencido sin atender. */
95
117
  [DocumentPatterns.getAgenda]: {
96
118
  payload: {
@@ -21,4 +21,5 @@ exports.DocumentPatterns = {
21
21
  getFilesFolder: 'gestorDocumental.document.getFilesFolder',
22
22
  getAgenda: 'gestorDocumental.document.getAgenda',
23
23
  exportTrail: 'gestorDocumental.document.exportTrail',
24
+ compose: 'gestorDocumental.document.compose',
24
25
  };
@@ -14,7 +14,7 @@ export declare const DocumentTypePatterns: {
14
14
  * momento de redactar (su jefatura o, con subrogancia activa, el subrogante). El nombre de la dirección lo resuelve
15
15
  * el gateway; el navegador solo indica cuál es.
16
16
  */
17
- export type DocumentFlowStepInput = {
17
+ export type DocumentFlowStepInput = ({
18
18
  role: DocumentParticipantRole;
19
19
  type: 'Employee';
20
20
  employeeId: string;
@@ -23,6 +23,8 @@ export type DocumentFlowStepInput = {
23
23
  type: 'DirectorateHead';
24
24
  directorateCodeReference: number;
25
25
  name: string;
26
+ }) & {
27
+ withPrevious?: boolean;
26
28
  };
27
29
  /** Datos de un tipo documental al crearlo o editarlo. */
28
30
  export interface DocumentTypeWritePayload {
@@ -51,6 +53,7 @@ export interface DocumentTypeContract {
51
53
  search?: string;
52
54
  enabled?: boolean;
53
55
  category?: DocumentCategory;
56
+ usableByDirectorates?: number[];
54
57
  };
55
58
  };
56
59
  response: RpcPage<DocumentTypeGetAllResponseEntity[]>;
@@ -43,6 +43,7 @@ export declare const GestorDocumentalPatterns: {
43
43
  readonly getFilesFolder: "gestorDocumental.document.getFilesFolder";
44
44
  readonly getAgenda: "gestorDocumental.document.getAgenda";
45
45
  readonly exportTrail: "gestorDocumental.document.exportTrail";
46
+ readonly compose: "gestorDocumental.document.compose";
46
47
  };
47
48
  readonly procedure: {
48
49
  readonly getAll: "gestorDocumental.procedure.getAll";
@@ -59,6 +60,7 @@ export declare const GestorDocumentalPatterns: {
59
60
  readonly addEntry: "gestorDocumental.caseFile.addEntry";
60
61
  readonly addBatch: "gestorDocumental.caseFile.addBatch";
61
62
  readonly voidEntry: "gestorDocumental.caseFile.voidEntry";
63
+ readonly moveEntry: "gestorDocumental.caseFile.moveEntry";
62
64
  readonly share: "gestorDocumental.caseFile.share";
63
65
  readonly unshare: "gestorDocumental.caseFile.unshare";
64
66
  readonly close: "gestorDocumental.caseFile.close";
@@ -33,6 +33,8 @@ export interface CaseFileEntryDocumentEntity {
33
33
  export interface CaseFileEntryResponseEntity {
34
34
  id: CaseFileEntryEntity['id'];
35
35
  sequence: CaseFileEntryEntity['sequence'];
36
+ /** Subcarpeta del índice (sin valor: en la raíz). */
37
+ folder: CaseFileEntryEntity['folder'];
36
38
  kind: CaseFileEntryEntity['kind'];
37
39
  actuationType: CaseFileEntryEntity['actuationType'];
38
40
  title: CaseFileEntryEntity['title'];
@@ -153,6 +153,8 @@ export interface DocumentGetByIdResponseEntity {
153
153
  id: string;
154
154
  name: string;
155
155
  } | null;
156
+ /** Contenido redactado en el sistema con una plantilla, para volver a editarlo (sin valor si se subió un PDF). */
157
+ composition: DocumentComposition | null;
156
158
  replies: DocumentLinkEntity[];
157
159
  /** Expedientes en que está incorporado y que quien consulta puede ver. */
158
160
  caseFiles: {
@@ -184,6 +186,7 @@ export interface DocumentGetByIdResponseEntity {
184
186
  id: DocumentTrackingEntity['id'];
185
187
  action: DocumentTrackingEntity['action'];
186
188
  observation: DocumentTrackingEntity['observation'];
189
+ sha256: DocumentTrackingEntity['sha256'];
187
190
  employeeId: DocumentTrackingEntity['employeeId'];
188
191
  employeeFullName: DocumentTrackingEntity['employeeFullName'];
189
192
  createdAt: DocumentTrackingEntity['createdAt'];
@@ -353,3 +356,48 @@ export interface DocumentTrailExportEntity {
353
356
  contentType: string;
354
357
  contentBase64: string;
355
358
  }
359
+ /** Plantilla oficial con que se redacta un documento en el sistema. */
360
+ export type DocumentTemplateKind = 'Decree' | 'Office' | 'Memorandum' | 'General';
361
+ /**
362
+ * Contenido de un documento redactado en el sistema. Cada plantilla tiene su estructura; los párrafos son texto
363
+ * (un salto de línea dentro de un párrafo se respeta). La materia es el asunto del documento.
364
+ */
365
+ export type DocumentComposition = {
366
+ template: 'Decree';
367
+ /** VISTOS: las normas y antecedentes. */
368
+ vistos: string[];
369
+ /** CONSIDERANDO: cada fundamento, numerado. */
370
+ considerando: string[];
371
+ /** DECRETO: cada punto resolutivo, numerado. */
372
+ resolutive: string[];
373
+ /** Fórmula de cierre: «Anótese, comuníquese y archívese». */
374
+ closing: string;
375
+ distribution: string[];
376
+ } | {
377
+ template: 'Office';
378
+ /** ANT.: antecedentes (otro oficio, una solicitud). */
379
+ antecedents?: string | null;
380
+ from: string;
381
+ to: string;
382
+ body: string[];
383
+ closing: string;
384
+ distribution: string[];
385
+ } | {
386
+ template: 'Memorandum';
387
+ from: string;
388
+ to: string;
389
+ body: string[];
390
+ closing?: string | null;
391
+ distribution: string[];
392
+ } | {
393
+ template: 'General';
394
+ title: string;
395
+ body: string[];
396
+ closing?: string | null;
397
+ };
398
+ /** PDF armado con una plantilla: para la vista previa (`contentBase64`) o ya subido (`fileId`). */
399
+ export interface DocumentComposeResponseEntity {
400
+ fileName: string;
401
+ fileId?: string;
402
+ contentBase64?: string;
403
+ }
@@ -9,6 +9,7 @@ export interface DocumentTypeFlowStepResponseEntity {
9
9
  directorateCodeReference: DocumentTypeFlowStepEntity['directorateCodeReference'];
10
10
  name: DocumentTypeFlowStepEntity['name'];
11
11
  position: DocumentTypeFlowStepEntity['position'];
12
+ withPrevious: DocumentTypeFlowStepEntity['withPrevious'];
12
13
  }
13
14
  export interface DocumentTypeGetAllResponseEntity {
14
15
  id: DocumentTypeEntity['id'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.10",
3
+ "version": "0.0.1-beta.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -217,6 +217,7 @@ export type CaseFileTrackingAction =
217
217
  | 'Updated'
218
218
  | 'EntryAdded'
219
219
  | 'EntryVoided'
220
+ | 'EntryMoved'
220
221
  | 'ParticipantAdded'
221
222
  | 'ParticipantRemoved'
222
223
  | 'Closed'
@@ -227,6 +228,7 @@ export const CaseFileTrackingAction = {
227
228
  Updated: 'Updated',
228
229
  EntryAdded: 'EntryAdded',
229
230
  EntryVoided: 'EntryVoided',
231
+ EntryMoved: 'EntryMoved',
230
232
  ParticipantAdded: 'ParticipantAdded',
231
233
  ParticipantRemoved: 'ParticipantRemoved',
232
234
  Closed: 'Closed',
@@ -290,6 +292,7 @@ export interface DocumentEntity {
290
292
  externalFolio?: string | null;
291
293
  externalSender?: string | null;
292
294
  externalDate?: string | null;
295
+ composition?: JsonValue | null;
293
296
  contentText?: string | null;
294
297
  textExtractedAt?: string | null;
295
298
  batch?: SignatureBatchEntity | null;
@@ -372,6 +375,7 @@ export interface DocumentTrackingEntity {
372
375
  id: string;
373
376
  action: DocumentTrackingAction;
374
377
  observation?: string | null;
378
+ sha256?: string | null;
375
379
  employeeId?: string | null;
376
380
  employeeFullName?: string | null;
377
381
  document?: DocumentEntity;
@@ -436,6 +440,7 @@ export interface DocumentTypeFlowStepEntity {
436
440
  directorateCodeReference?: number | null;
437
441
  name: string;
438
442
  position?: string | null;
443
+ withPrevious: boolean;
439
444
  documentType?: DocumentTypeEntity;
440
445
  documentTypeId: string;
441
446
  createdAt: string;
@@ -522,6 +527,7 @@ export interface CaseFileEntryEntity {
522
527
  kind: CaseFileEntryKind;
523
528
  actuationType: CaseFileActuationType;
524
529
  title: string;
530
+ folder?: string | null;
525
531
  document?: DocumentEntity | null;
526
532
  documentId?: string | null;
527
533
  fileId?: string | null;
@@ -28,6 +28,7 @@ export const CaseFilePatterns = {
28
28
  addEntry: 'gestorDocumental.caseFile.addEntry',
29
29
  addBatch: 'gestorDocumental.caseFile.addBatch',
30
30
  voidEntry: 'gestorDocumental.caseFile.voidEntry',
31
+ moveEntry: 'gestorDocumental.caseFile.moveEntry',
31
32
  share: 'gestorDocumental.caseFile.share',
32
33
  unshare: 'gestorDocumental.caseFile.unshare',
33
34
  close: 'gestorDocumental.caseFile.close',
@@ -108,10 +109,16 @@ export interface CaseFileContract {
108
109
  response: CaseFileAddBatchResponseEntity;
109
110
  };
110
111
  [CaseFilePatterns.addEntry]: {
111
- payload: Pick<CaseFileEntity, 'id'> & { entry: CaseFileEntryInput } & CaseFileActorPayload;
112
+ // `folder`: subcarpeta del índice en que queda (sin valor: en la raíz)
113
+ payload: Pick<CaseFileEntity, 'id'> & { entry: CaseFileEntryInput; folder?: string | null } & CaseFileActorPayload;
112
114
  response: CaseFileAddEntryResponseEntity;
113
115
  };
114
116
  /** Deja una actuación sin efecto, con su motivo. No se elimina del índice. */
117
+ /** Pasa una actuación a otra subcarpeta del índice (`null`: a la raíz). El orden de incorporación no cambia. */
118
+ [CaseFilePatterns.moveEntry]: {
119
+ payload: { id: string; entryId: string; folder: string | null } & CaseFileActorPayload;
120
+ response: CaseFileUpdateResponseEntity;
121
+ };
115
122
  [CaseFilePatterns.voidEntry]: {
116
123
  payload: Pick<CaseFileEntity, 'id'> & { entryId: string; reason: string; actor: DocumentActor };
117
124
  response: CaseFileUpdateResponseEntity;
@@ -22,6 +22,8 @@ import {
22
22
  type DocumentReviewResponseEntity,
23
23
  type DocumentSignManyResponseEntity,
24
24
  type DocumentAgendaResponseEntity,
25
+ type DocumentComposeResponseEntity,
26
+ type DocumentComposition,
25
27
  type DocumentTrailExportEntity,
26
28
  type DocumentUpdateResponseEntity,
27
29
  type DocumentVerifyResponseEntity,
@@ -48,6 +50,7 @@ export const DocumentPatterns = {
48
50
  getFilesFolder: 'gestorDocumental.document.getFilesFolder',
49
51
  getAgenda: 'gestorDocumental.document.getAgenda',
50
52
  exportTrail: 'gestorDocumental.document.exportTrail',
53
+ compose: 'gestorDocumental.document.compose',
51
54
  } as const;
52
55
 
53
56
  /**
@@ -103,6 +106,8 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
103
106
  visaStages?: number[] | null;
104
107
  // Al reenviar un documento rechazado, pedir de nuevo las visaciones ya hechas en vez de seguir donde quedó.
105
108
  restartFlow?: boolean;
109
+ // Contenido redactado con una plantilla (el PDF ya armado va en `file`): se guarda para volver a editarlo.
110
+ composition?: DocumentComposition | null;
106
111
  signatureEmployeeIds: string[];
107
112
  // Firmas y visaciones en una hoja aparte al final, en vez de al pie de la última página.
108
113
  signatureSheet?: boolean;
@@ -128,6 +133,26 @@ export interface DocumentExternalRecipientInput {
128
133
  * Qué se envía y qué se responde en cada patrón. Generado desde los handlers y los DTO del microservicio.
129
134
  */
130
135
  export interface DocumentContract {
136
+ /**
137
+ * Arma el PDF de un documento redactado con una plantilla oficial: membrete, estructura y espacio libre para el
138
+ * número, las visaciones, las firmas y el QR. Con `preview` lo entrega para verlo; si no, lo sube y entrega su
139
+ * `fileId` para guardarlo como el PDF del documento.
140
+ */
141
+ [DocumentPatterns.compose]: {
142
+ payload: {
143
+ documentTypeId: string;
144
+ subject: string;
145
+ composition: DocumentComposition;
146
+ visaCount: number;
147
+ signatureCount: number;
148
+ signatureSheet?: boolean;
149
+ /** Unidad que emite, para el membrete. */
150
+ issuingUnitName?: string | null;
151
+ preview?: boolean;
152
+ actor: DocumentActor;
153
+ };
154
+ response: DocumentComposeResponseEntity;
155
+ };
131
156
  /** Plazos del funcionario entre `from` y `to` (hasta 62 días), y lo que tiene vencido sin atender. */
132
157
  [DocumentPatterns.getAgenda]: {
133
158
  payload: { from: string; to: string; actor: DocumentActor };
@@ -21,9 +21,13 @@ export const DocumentTypePatterns = {
21
21
  * momento de redactar (su jefatura o, con subrogancia activa, el subrogante). El nombre de la dirección lo resuelve
22
22
  * el gateway; el navegador solo indica cuál es.
23
23
  */
24
- export type DocumentFlowStepInput =
24
+ export type DocumentFlowStepInput = (
25
25
  | { role: DocumentParticipantRole; type: 'Employee'; employeeId: string }
26
- | { role: DocumentParticipantRole; type: 'DirectorateHead'; directorateCodeReference: number; name: string };
26
+ | { role: DocumentParticipantRole; type: 'DirectorateHead'; directorateCodeReference: number; name: string }
27
+ ) & {
28
+ // Visa a la vez con el paso anterior (visación en paralelo). Solo en visaciones.
29
+ withPrevious?: boolean;
30
+ };
27
31
 
28
32
  /** Datos de un tipo documental al crearlo o editarlo. */
29
33
  export interface DocumentTypeWritePayload {
@@ -50,7 +54,13 @@ export interface DocumentTypeContract {
50
54
  // sin `page` y `limit` responde todos los tipos en una sola página
51
55
  payload: {
52
56
  pagination?: { page?: number; limit?: number };
53
- filters?: { search?: string; enabled?: boolean; category?: DocumentCategory };
57
+ filters?: {
58
+ search?: string;
59
+ enabled?: boolean;
60
+ category?: DocumentCategory;
61
+ // Solo los que puede usar quien redacta: los de toda la municipalidad y los de estas direcciones.
62
+ usableByDirectorates?: number[];
63
+ };
54
64
  };
55
65
  response: RpcPage<DocumentTypeGetAllResponseEntity[]>;
56
66
  };
@@ -47,6 +47,8 @@ export interface CaseFileEntryDocumentEntity {
47
47
  export interface CaseFileEntryResponseEntity {
48
48
  id: CaseFileEntryEntity['id'];
49
49
  sequence: CaseFileEntryEntity['sequence'];
50
+ /** Subcarpeta del índice (sin valor: en la raíz). */
51
+ folder: CaseFileEntryEntity['folder'];
50
52
  kind: CaseFileEntryEntity['kind'];
51
53
  actuationType: CaseFileEntryEntity['actuationType'];
52
54
  title: CaseFileEntryEntity['title'];
@@ -182,6 +182,8 @@ export interface DocumentGetByIdResponseEntity {
182
182
  replyTo: DocumentLinkEntity | null;
183
183
  /** Lote de firma al que pertenece. */
184
184
  batch: { id: string; name: string } | null;
185
+ /** Contenido redactado en el sistema con una plantilla, para volver a editarlo (sin valor si se subió un PDF). */
186
+ composition: DocumentComposition | null;
185
187
  replies: DocumentLinkEntity[];
186
188
  /** Expedientes en que está incorporado y que quien consulta puede ver. */
187
189
  caseFiles: { id: string; code: string; title: string; status: 'Open' | 'Closed' }[];
@@ -208,6 +210,8 @@ export interface DocumentGetByIdResponseEntity {
208
210
  id: DocumentTrackingEntity['id'];
209
211
  action: DocumentTrackingEntity['action'];
210
212
  observation: DocumentTrackingEntity['observation'];
213
+ // Huella SHA-256 del PDF en ese hecho (firma, despacho o ingreso por DocDigital).
214
+ sha256: DocumentTrackingEntity['sha256'];
211
215
  employeeId: DocumentTrackingEntity['employeeId'];
212
216
  employeeFullName: DocumentTrackingEntity['employeeFullName'];
213
217
  createdAt: DocumentTrackingEntity['createdAt'];
@@ -395,3 +399,50 @@ export interface DocumentTrailExportEntity {
395
399
  contentType: string;
396
400
  contentBase64: string;
397
401
  }
402
+
403
+ /** Plantilla oficial con que se redacta un documento en el sistema. */
404
+ export type DocumentTemplateKind = 'Decree' | 'Office' | 'Memorandum' | 'General';
405
+
406
+ /**
407
+ * Contenido de un documento redactado en el sistema. Cada plantilla tiene su estructura; los párrafos son texto
408
+ * (un salto de línea dentro de un párrafo se respeta). La materia es el asunto del documento.
409
+ */
410
+ export type DocumentComposition =
411
+ | {
412
+ template: 'Decree';
413
+ /** VISTOS: las normas y antecedentes. */
414
+ vistos: string[];
415
+ /** CONSIDERANDO: cada fundamento, numerado. */
416
+ considerando: string[];
417
+ /** DECRETO: cada punto resolutivo, numerado. */
418
+ resolutive: string[];
419
+ /** Fórmula de cierre: «Anótese, comuníquese y archívese». */
420
+ closing: string;
421
+ distribution: string[];
422
+ }
423
+ | {
424
+ template: 'Office';
425
+ /** ANT.: antecedentes (otro oficio, una solicitud). */
426
+ antecedents?: string | null;
427
+ from: string;
428
+ to: string;
429
+ body: string[];
430
+ closing: string;
431
+ distribution: string[];
432
+ }
433
+ | {
434
+ template: 'Memorandum';
435
+ from: string;
436
+ to: string;
437
+ body: string[];
438
+ closing?: string | null;
439
+ distribution: string[];
440
+ }
441
+ | { template: 'General'; title: string; body: string[]; closing?: string | null };
442
+
443
+ /** PDF armado con una plantilla: para la vista previa (`contentBase64`) o ya subido (`fileId`). */
444
+ export interface DocumentComposeResponseEntity {
445
+ fileName: string;
446
+ fileId?: string;
447
+ contentBase64?: string;
448
+ }
@@ -11,6 +11,8 @@ export interface DocumentTypeFlowStepResponseEntity {
11
11
  // Nombre del funcionario o de la dirección, como estaba al definir el flujo.
12
12
  name: DocumentTypeFlowStepEntity['name'];
13
13
  position: DocumentTypeFlowStepEntity['position'];
14
+ // Visa a la vez con el paso anterior (visación en paralelo).
15
+ withPrevious: DocumentTypeFlowStepEntity['withPrevious'];
14
16
  }
15
17
 
16
18
  export interface DocumentTypeGetAllResponseEntity {