@muni-sanfer/types-gestor-documental 0.0.1-beta.1 → 0.0.1-beta.11

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.
Files changed (74) hide show
  1. package/dist/base/entities.d.ts +436 -1
  2. package/dist/base/entities.js +98 -1
  3. package/dist/contracts/caseFile.contract.d.ts +159 -0
  4. package/dist/contracts/caseFile.contract.js +18 -0
  5. package/dist/contracts/document.contract.d.ts +163 -3
  6. package/dist/contracts/document.contract.js +8 -0
  7. package/dist/contracts/documentType.contract.d.ts +18 -1
  8. package/dist/contracts/index.d.ts +84 -1
  9. package/dist/contracts/index.js +18 -0
  10. package/dist/contracts/partsOffice.contract.d.ts +171 -0
  11. package/dist/contracts/partsOffice.contract.js +22 -0
  12. package/dist/contracts/procedure.contract.d.ts +50 -0
  13. package/dist/contracts/procedure.contract.js +11 -0
  14. package/dist/contracts/registerBook.contract.d.ts +27 -0
  15. package/dist/contracts/registerBook.contract.js +8 -0
  16. package/dist/contracts/signatureBatch.contract.d.ts +109 -0
  17. package/dist/contracts/signatureBatch.contract.js +12 -0
  18. package/dist/contracts/workFolder.contract.d.ts +114 -0
  19. package/dist/contracts/workFolder.contract.js +16 -0
  20. package/dist/entities/caseFile/caseFile.entity.d.ts +176 -0
  21. package/dist/entities/caseFile/caseFile.entity.js +2 -0
  22. package/dist/entities/caseFile/index.d.ts +1 -0
  23. package/dist/entities/caseFile/index.js +17 -0
  24. package/dist/entities/document/document.entity.d.ts +248 -1
  25. package/dist/entities/documentType/documentType.entity.d.ts +18 -1
  26. package/dist/entities/index.d.ts +6 -0
  27. package/dist/entities/index.js +6 -0
  28. package/dist/entities/partsOffice/index.d.ts +1 -0
  29. package/dist/entities/partsOffice/index.js +17 -0
  30. package/dist/entities/partsOffice/partsOffice.entity.d.ts +98 -0
  31. package/dist/entities/partsOffice/partsOffice.entity.js +2 -0
  32. package/dist/entities/procedure/index.d.ts +1 -0
  33. package/dist/entities/procedure/index.js +17 -0
  34. package/dist/entities/procedure/procedure.entity.d.ts +20 -0
  35. package/dist/entities/procedure/procedure.entity.js +2 -0
  36. package/dist/entities/registerBook/index.d.ts +1 -0
  37. package/dist/entities/registerBook/index.js +17 -0
  38. package/dist/entities/registerBook/registerBook.entity.d.ts +42 -0
  39. package/dist/entities/registerBook/registerBook.entity.js +2 -0
  40. package/dist/entities/signatureBatch/index.d.ts +1 -0
  41. package/dist/entities/signatureBatch/index.js +17 -0
  42. package/dist/entities/signatureBatch/signatureBatch.entity.d.ts +107 -0
  43. package/dist/entities/signatureBatch/signatureBatch.entity.js +2 -0
  44. package/dist/entities/workFolder/index.d.ts +1 -0
  45. package/dist/entities/workFolder/index.js +17 -0
  46. package/dist/entities/workFolder/workFolder.entity.d.ts +83 -0
  47. package/dist/entities/workFolder/workFolder.entity.js +2 -0
  48. package/package.json +1 -1
  49. package/src/base/entities.ts +509 -1
  50. package/src/contracts/caseFile.contract.ts +141 -0
  51. package/src/contracts/document.contract.ts +155 -0
  52. package/src/contracts/documentType.contract.ts +14 -1
  53. package/src/contracts/index.ts +26 -1
  54. package/src/contracts/partsOffice.contract.ts +120 -0
  55. package/src/contracts/procedure.contract.ts +53 -0
  56. package/src/contracts/registerBook.contract.ts +24 -0
  57. package/src/contracts/signatureBatch.contract.ts +96 -0
  58. package/src/contracts/workFolder.contract.ts +75 -0
  59. package/src/entities/caseFile/caseFile.entity.ts +204 -0
  60. package/src/entities/caseFile/index.ts +1 -0
  61. package/src/entities/document/document.entity.ts +259 -0
  62. package/src/entities/documentType/documentType.entity.ts +20 -1
  63. package/src/entities/index.ts +6 -0
  64. package/src/entities/partsOffice/index.ts +1 -0
  65. package/src/entities/partsOffice/partsOffice.entity.ts +103 -0
  66. package/src/entities/procedure/index.ts +1 -0
  67. package/src/entities/procedure/procedure.entity.ts +24 -0
  68. package/src/entities/registerBook/index.ts +1 -0
  69. package/src/entities/registerBook/registerBook.entity.ts +46 -0
  70. package/src/entities/signatureBatch/index.ts +1 -0
  71. package/src/entities/signatureBatch/signatureBatch.entity.ts +110 -0
  72. package/src/entities/workFolder/index.ts +1 -0
  73. package/src/entities/workFolder/workFolder.entity.ts +84 -0
  74. package/tsconfig.json +1 -3
@@ -0,0 +1,176 @@
1
+ import { CaseFileAccessEntity, CaseFileActorEntity, CaseFileEntity, CaseFileEntryEntity, CaseFileMetadataChangeEntity, CaseFileParticipantEntity, CaseFileTrackingEntity, DocumentEntity, ProcedureEntity } from '../../base/entities';
2
+ import { DocumentTypeSummaryEntity } from '../document';
3
+ /** Expediente al que se hace referencia desde otro lado: cómo se cita y en qué estado está. */
4
+ export interface CaseFileLinkEntity {
5
+ id: CaseFileEntity['id'];
6
+ code: CaseFileEntity['code'];
7
+ title: CaseFileEntity['title'];
8
+ status: CaseFileEntity['status'];
9
+ }
10
+ export interface CaseFileGetAllResponseEntity extends CaseFileLinkEntity {
11
+ subject: CaseFileEntity['subject'];
12
+ accessLevel: CaseFileEntity['accessLevel'];
13
+ hasSensitiveData: CaseFileEntity['hasSensitiveData'];
14
+ procedure: Pick<ProcedureEntity, 'id' | 'name'>;
15
+ responsibleEmployeeId: CaseFileEntity['responsibleEmployeeId'];
16
+ responsibleFullName: CaseFileEntity['responsibleFullName'];
17
+ /** Actuaciones vigentes del índice (las que quedaron sin efecto no cuentan). */
18
+ entries: number;
19
+ participants: number;
20
+ createdAt: CaseFileEntity['createdAt'];
21
+ closedAt: CaseFileEntity['closedAt'];
22
+ }
23
+ /** Documento del gestor incorporado al expediente. */
24
+ export interface CaseFileEntryDocumentEntity {
25
+ id: DocumentEntity['id'];
26
+ subject: DocumentEntity['subject'];
27
+ status: DocumentEntity['status'];
28
+ correlative: DocumentEntity['correlative'];
29
+ correlativeYear: DocumentEntity['correlativeYear'];
30
+ documentType: DocumentTypeSummaryEntity;
31
+ }
32
+ /** Entrada del índice electrónico: una actuación, en su orden de incorporación. */
33
+ export interface CaseFileEntryResponseEntity {
34
+ id: CaseFileEntryEntity['id'];
35
+ sequence: CaseFileEntryEntity['sequence'];
36
+ kind: CaseFileEntryEntity['kind'];
37
+ actuationType: CaseFileEntryEntity['actuationType'];
38
+ title: CaseFileEntryEntity['title'];
39
+ document: CaseFileEntryDocumentEntity | null;
40
+ fileName: CaseFileEntryEntity['fileName'];
41
+ documentTypeName: CaseFileEntryEntity['documentTypeName'];
42
+ originDate: CaseFileEntryEntity['originDate'];
43
+ author: CaseFileEntryEntity['author'];
44
+ keywords: CaseFileEntryEntity['keywords'];
45
+ accessLevel: CaseFileEntryEntity['accessLevel'];
46
+ hasSensitiveData: CaseFileEntryEntity['hasSensitiveData'];
47
+ linkedCaseFile: CaseFileLinkEntity | null;
48
+ /** `true` si la entrada tiene un archivo que se puede abrir (un documento o un archivo subido). */
49
+ hasFile: boolean;
50
+ sha256: CaseFileEntryEntity['sha256'];
51
+ size: CaseFileEntryEntity['size'];
52
+ hasAdvancedSignature: CaseFileEntryEntity['hasAdvancedSignature'];
53
+ incorporatedByEmployeeId: CaseFileEntryEntity['incorporatedByEmployeeId'];
54
+ incorporatedByFullName: CaseFileEntryEntity['incorporatedByFullName'];
55
+ createdAt: CaseFileEntryEntity['createdAt'];
56
+ voidedAt: CaseFileEntryEntity['voidedAt'];
57
+ voidedByFullName: CaseFileEntryEntity['voidedByFullName'];
58
+ voidReason: CaseFileEntryEntity['voidReason'];
59
+ /** `true` si quien consulta puede dejarla sin efecto: el responsable o quien la incorporó, con el expediente abierto. */
60
+ canVoid: boolean;
61
+ }
62
+ export interface CaseFileParticipantResponseEntity {
63
+ id: CaseFileParticipantEntity['id'];
64
+ employeeId: CaseFileParticipantEntity['employeeId'];
65
+ fullName: CaseFileParticipantEntity['fullName'];
66
+ position: CaseFileParticipantEntity['position'];
67
+ addedByFullName: CaseFileParticipantEntity['addedByFullName'];
68
+ createdAt: CaseFileParticipantEntity['createdAt'];
69
+ }
70
+ export interface CaseFileActorResponseEntity {
71
+ id: CaseFileActorEntity['id'];
72
+ relation: CaseFileActorEntity['relation'];
73
+ actorType: CaseFileActorEntity['actorType'];
74
+ identifier: CaseFileActorEntity['identifier'];
75
+ name: CaseFileActorEntity['name'];
76
+ }
77
+ export interface CaseFileTrackingResponseEntity {
78
+ id: CaseFileTrackingEntity['id'];
79
+ action: CaseFileTrackingEntity['action'];
80
+ observation: CaseFileTrackingEntity['observation'];
81
+ employeeFullName: CaseFileTrackingEntity['employeeFullName'];
82
+ createdAt: CaseFileTrackingEntity['createdAt'];
83
+ }
84
+ export interface CaseFileMetadataChangeResponseEntity {
85
+ id: CaseFileMetadataChangeEntity['id'];
86
+ /** Código oficial del metadato. Ej: `MGDEE1_5`. */
87
+ field: CaseFileMetadataChangeEntity['field'];
88
+ previousValue: CaseFileMetadataChangeEntity['previousValue'];
89
+ newValue: CaseFileMetadataChangeEntity['newValue'];
90
+ employeeFullName: CaseFileMetadataChangeEntity['employeeFullName'];
91
+ createdAt: CaseFileMetadataChangeEntity['createdAt'];
92
+ }
93
+ export interface CaseFileAccessResponseEntity {
94
+ id: CaseFileAccessEntity['id'];
95
+ action: CaseFileAccessEntity['action'];
96
+ entryId: CaseFileAccessEntity['entryId'];
97
+ /** Título del documento que se abrió, si el acceso fue a uno. */
98
+ entryTitle: string | null;
99
+ employeeFullName: CaseFileAccessEntity['employeeFullName'];
100
+ createdAt: CaseFileAccessEntity['createdAt'];
101
+ }
102
+ export interface CaseFileGetByIdResponseEntity extends CaseFileGetAllResponseEntity {
103
+ summary: CaseFileEntity['summary'];
104
+ procedure: Pick<ProcedureEntity, 'id' | 'name' | 'cpatId' | 'cpatCode'>;
105
+ responsiblePosition: CaseFileEntity['responsiblePosition'];
106
+ incorporationMechanism: CaseFileEntity['incorporationMechanism'];
107
+ schemaVersion: CaseFileEntity['schemaVersion'];
108
+ /** Enlace persistente del expediente (MGDEE4_2). `null` si el servicio no tiene configurada la dirección. */
109
+ uri: string | null;
110
+ closedByFullName: CaseFileEntity['closedByFullName'];
111
+ closingNote: CaseFileEntity['closingNote'];
112
+ index: CaseFileEntryResponseEntity[];
113
+ sharedWith: CaseFileParticipantResponseEntity[];
114
+ actors: CaseFileActorResponseEntity[];
115
+ trackings: CaseFileTrackingResponseEntity[];
116
+ metadataChanges: CaseFileMetadataChangeResponseEntity[];
117
+ /** Registro de accesos. Solo lo recibe el responsable y quien puede ver todos los expedientes. */
118
+ accesses: CaseFileAccessResponseEntity[];
119
+ /** Qué puede hacer con el expediente quien lo consulta. Sin `actor` en la consulta, no viene. */
120
+ actorCapabilities?: {
121
+ isResponsible: boolean;
122
+ /** Editar sus metadatos y cerrarlo: el responsable, mientras esté abierto. */
123
+ canEdit: boolean;
124
+ /** Incorporar actuaciones: el responsable y aquellos con quienes se compartió, mientras esté abierto. */
125
+ canIncorporate: boolean;
126
+ /** Compartirlo con otros funcionarios: el responsable, también después de cerrado. */
127
+ canShare: boolean;
128
+ };
129
+ }
130
+ export interface CaseFileCreateResponseEntity {
131
+ id: CaseFileEntity['id'];
132
+ code: CaseFileEntity['code'];
133
+ ok: boolean;
134
+ }
135
+ export interface CaseFileUpdateResponseEntity {
136
+ id: CaseFileEntity['id'];
137
+ ok: boolean;
138
+ }
139
+ /** Lote incorporado: cuántos documentos entraron y cuántos se omitieron (ya estaban, o no finalizados). */
140
+ export interface CaseFileAddBatchResponseEntity {
141
+ id: CaseFileEntity['id'];
142
+ added: number;
143
+ skipped: number;
144
+ ok: boolean;
145
+ }
146
+ export interface CaseFileAddEntryResponseEntity {
147
+ id: CaseFileEntity['id'];
148
+ entryId: CaseFileEntryEntity['id'];
149
+ sequence: CaseFileEntryEntity['sequence'];
150
+ ok: boolean;
151
+ }
152
+ /** Archivo de una entrada del índice, para servirlo a quien puede ver el expediente. */
153
+ export interface CaseFileEntryFileResponseEntity {
154
+ fileId: string;
155
+ fileName: string;
156
+ }
157
+ /** Archivo que va dentro del expediente exportado, con la huella que tenía al incorporarse. */
158
+ export interface CaseFileExportFileEntity {
159
+ entryId: CaseFileEntryEntity['id'];
160
+ sequence: CaseFileEntryEntity['sequence'];
161
+ /** Ruta dentro del ZIP. Ej: `documentos/001-decreto-alcaldicio-exento-590-2026.pdf`. */
162
+ path: string;
163
+ fileId: string;
164
+ sha256: string | null;
165
+ }
166
+ /**
167
+ * Expediente listo para exportar: los metadatos con sus códigos oficiales (va tal cual como `expediente.json`) y los
168
+ * archivos que hay que agregar. El ZIP lo arma el gateway.
169
+ */
170
+ export interface CaseFileExportResponseEntity {
171
+ code: CaseFileEntity['code'];
172
+ manifest: Record<string, unknown>;
173
+ files: CaseFileExportFileEntity[];
174
+ }
175
+ /** Expediente en que está incorporado un documento, visto desde el documento. */
176
+ export type DocumentCaseFileEntity = CaseFileLinkEntity;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './caseFile.entity';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./caseFile.entity"), exports);
@@ -1,4 +1,4 @@
1
- import { DocumentAnnulledNumberEntity, DocumentAttachmentEntity, DocumentEntity, DocumentParticipantEntity, DocumentTrackingEntity, DocumentTypeEntity } from '../../base/entities';
1
+ import { DocumentAnnulledNumberEntity, DocumentAttachmentEntity, DocumentDeliveryEntity, DocumentEntity, DocumentParticipantEntity, DocumentRecipientEntity, DocumentTrackingEntity, DocumentTypeEntity } from '../../base/entities';
2
2
  /** Tipo documental de un documento, con lo necesario para citarlo. */
3
3
  export interface DocumentTypeSummaryEntity {
4
4
  id: DocumentTypeEntity['id'];
@@ -10,6 +10,8 @@ export interface DocumentParticipantResponseEntity {
10
10
  id: DocumentParticipantEntity['id'];
11
11
  role: DocumentParticipantEntity['role'];
12
12
  order: DocumentParticipantEntity['order'];
13
+ /** Los visadores de una misma etapa visan a la vez. */
14
+ stage: DocumentParticipantEntity['stage'];
13
15
  status: DocumentParticipantEntity['status'];
14
16
  employeeId: DocumentParticipantEntity['employeeId'];
15
17
  fullName: DocumentParticipantEntity['fullName'];
@@ -17,6 +19,70 @@ export interface DocumentParticipantResponseEntity {
17
19
  observation: DocumentParticipantEntity['observation'];
18
20
  resolvedAt: DocumentParticipantEntity['resolvedAt'];
19
21
  }
22
+ /** Destinatario de un documento, como lo eligió el redactor: una persona o un área completa. */
23
+ export interface DocumentRecipientResponseEntity {
24
+ id: DocumentRecipientEntity['id'];
25
+ type: DocumentRecipientEntity['type'];
26
+ employeeId: DocumentRecipientEntity['employeeId'];
27
+ directorateCodeReference: DocumentRecipientEntity['directorateCodeReference'];
28
+ departmentId: DocumentRecipientEntity['departmentId'];
29
+ name: DocumentRecipientEntity['name'];
30
+ position: DocumentRecipientEntity['position'];
31
+ }
32
+ /** Un documento en la bandeja de un funcionario: como destinatario o porque se lo derivaron. */
33
+ export interface DocumentDeliveryResponseEntity {
34
+ id: DocumentDeliveryEntity['id'];
35
+ origin: DocumentDeliveryEntity['origin'];
36
+ employeeId: DocumentDeliveryEntity['employeeId'];
37
+ fullName: DocumentDeliveryEntity['fullName'];
38
+ position: DocumentDeliveryEntity['position'];
39
+ areaName: DocumentDeliveryEntity['areaName'];
40
+ sentByEmployeeId: DocumentDeliveryEntity['sentByEmployeeId'];
41
+ sentByFullName: DocumentDeliveryEntity['sentByFullName'];
42
+ instruction: DocumentDeliveryEntity['instruction'];
43
+ note: DocumentDeliveryEntity['note'];
44
+ dueAt: DocumentDeliveryEntity['dueAt'];
45
+ deliveredAt: DocumentDeliveryEntity['deliveredAt'];
46
+ readAt: DocumentDeliveryEntity['readAt'];
47
+ closedAt: DocumentDeliveryEntity['closedAt'];
48
+ closingNote: DocumentDeliveryEntity['closingNote'];
49
+ }
50
+ /** Lo necesario para citar otro documento y enlazarlo (el que se responde, o las respuestas). */
51
+ export interface DocumentLinkEntity {
52
+ id: DocumentEntity['id'];
53
+ subject: DocumentEntity['subject'];
54
+ status: DocumentEntity['status'];
55
+ correlative: DocumentEntity['correlative'];
56
+ correlativeYear: DocumentEntity['correlativeYear'];
57
+ createdByFullName: DocumentEntity['createdByFullName'];
58
+ finishedAt: DocumentEntity['finishedAt'];
59
+ documentType: DocumentTypeSummaryEntity;
60
+ /** Folio de ingreso de Oficina de Partes, si llegó por DocDigital. */
61
+ intakeNumber: DocumentEntity['intakeNumber'];
62
+ intakeYear: DocumentEntity['intakeYear'];
63
+ }
64
+ /** Institución (y usuario) de DocDigital a la que va dirigido un documento. */
65
+ export interface DocumentExternalRecipientResponseEntity {
66
+ id: string;
67
+ entityId: number;
68
+ entityName: string;
69
+ userId: number | null;
70
+ userName: string | null;
71
+ userPosition: string | null;
72
+ }
73
+ /** Despacho de un documento por DocDigital. */
74
+ export interface DocumentDispatchResponseEntity {
75
+ id: string;
76
+ status: 'Pending' | 'Dispatched' | 'Returned';
77
+ folio: string | null;
78
+ docDigitalTypeName: string | null;
79
+ docDigitalDocumentId: string | null;
80
+ dispatchedAt: string | null;
81
+ dispatchedByFullName: string | null;
82
+ returnedAt: string | null;
83
+ returnedByFullName: string | null;
84
+ returnReason: string | null;
85
+ }
20
86
  export interface DocumentGetAllResponseEntity {
21
87
  id: DocumentEntity['id'];
22
88
  subject: DocumentEntity['subject'];
@@ -30,7 +96,21 @@ export interface DocumentGetAllResponseEntity {
30
96
  createdByEmployeeId: DocumentEntity['createdByEmployeeId'];
31
97
  createdByFullName: DocumentEntity['createdByFullName'];
32
98
  documentType: DocumentTypeSummaryEntity;
99
+ intakeNumber: DocumentEntity['intakeNumber'];
100
+ intakeYear: DocumentEntity['intakeYear'];
101
+ origin: DocumentEntity['origin'];
102
+ /** Con búsqueda de texto completo: el fragmento donde aparece lo buscado, con lo encontrado entre ⟦ y ⟧. */
103
+ snippet?: string | null;
33
104
  currentParticipant: Pick<DocumentParticipantResponseEntity, 'role' | 'employeeId' | 'fullName'> | null;
105
+ otherCurrentCount: number;
106
+ distribution: {
107
+ total: number;
108
+ read: number;
109
+ } | null;
110
+ }
111
+ /** Una entrada de la bandeja de recibidos: la entrega y el documento al que corresponde. */
112
+ export interface DocumentInboxItemEntity extends DocumentDeliveryResponseEntity {
113
+ document: DocumentLinkEntity;
34
114
  }
35
115
  export interface DocumentGetByIdResponseEntity {
36
116
  id: DocumentEntity['id'];
@@ -64,6 +144,35 @@ export interface DocumentGetByIdResponseEntity {
64
144
  employeeFullName: DocumentAnnulledNumberEntity['employeeFullName'];
65
145
  createdAt: DocumentAnnulledNumberEntity['createdAt'];
66
146
  }[];
147
+ responseDueAt: DocumentEntity['responseDueAt'];
148
+ recipients: DocumentRecipientResponseEntity[];
149
+ deliveries: DocumentDeliveryResponseEntity[];
150
+ replyTo: DocumentLinkEntity | null;
151
+ /** Lote de firma al que pertenece. */
152
+ batch: {
153
+ id: string;
154
+ name: string;
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;
158
+ replies: DocumentLinkEntity[];
159
+ /** Expedientes en que está incorporado y que quien consulta puede ver. */
160
+ caseFiles: {
161
+ id: string;
162
+ code: string;
163
+ title: string;
164
+ status: 'Open' | 'Closed';
165
+ }[];
166
+ /** De dónde viene: del gestor o recibido por DocDigital, con su folio de ingreso y los datos de quien lo envió. */
167
+ origin: DocumentEntity['origin'];
168
+ intakeNumber: DocumentEntity['intakeNumber'];
169
+ intakeYear: DocumentEntity['intakeYear'];
170
+ externalFolio: DocumentEntity['externalFolio'];
171
+ externalSender: DocumentEntity['externalSender'];
172
+ externalDate: DocumentEntity['externalDate'];
173
+ /** Instituciones de DocDigital a quienes va dirigido, y su despacho por Oficina de Partes. */
174
+ externalRecipients: DocumentExternalRecipientResponseEntity[];
175
+ dispatch: DocumentDispatchResponseEntity | null;
67
176
  documentType: DocumentTypeSummaryEntity;
68
177
  participants: DocumentParticipantResponseEntity[];
69
178
  attachments: {
@@ -85,6 +194,12 @@ export interface DocumentGetByIdResponseEntity {
85
194
  turn: Pick<DocumentParticipantResponseEntity, 'id' | 'role'> | null;
86
195
  canEdit: boolean;
87
196
  canDiscard: boolean;
197
+ canDerive: boolean;
198
+ canReply: boolean;
199
+ canReassign: boolean;
200
+ /** Quien consulta redactó el documento (o lo ingresó, si llegó por DocDigital). */
201
+ isAuthor: boolean;
202
+ inbox: DocumentDeliveryResponseEntity[];
88
203
  };
89
204
  signatureRequiresOtp: boolean;
90
205
  }
@@ -92,12 +207,22 @@ export interface DocumentGetByIdResponseEntity {
92
207
  export interface DocumentGetSummaryResponseEntity {
93
208
  toVisa: number;
94
209
  toSign: number;
210
+ /** Lotes de firma con documentos en su turno (los documentos de un lote no se cuentan en `toVisa` ni `toSign`). */
211
+ batches: {
212
+ toVisa: number;
213
+ toSign: number;
214
+ };
95
215
  created: {
96
216
  drafted: number;
97
217
  inProgress: number;
98
218
  rejected: number;
99
219
  finished: number;
100
220
  };
221
+ received: {
222
+ unread: number;
223
+ pending: number;
224
+ overdue: number;
225
+ };
101
226
  }
102
227
  export interface DocumentCreateResponseEntity {
103
228
  id: DocumentEntity['id'];
@@ -112,6 +237,27 @@ export interface DocumentReviewResponseEntity {
112
237
  ok: boolean;
113
238
  status: DocumentEntity['status'];
114
239
  }
240
+ /** Resultado de un documento en una firma de varios documentos. */
241
+ export interface DocumentSignManyResultEntity {
242
+ id: DocumentEntity['id'];
243
+ ok: boolean;
244
+ /** Estado en que quedó, si se firmó. */
245
+ status?: DocumentEntity['status'];
246
+ /** Por qué no se firmó. */
247
+ message?: string;
248
+ }
249
+ /**
250
+ * Firma de varios documentos con un solo OTP. FirmaGob admite 5 MB por solicitud: los que no cupieron quedan en
251
+ * `remaining`, en el turno del firmante, para firmarlos con un OTP nuevo.
252
+ */
253
+ export interface DocumentSignManyResponseEntity {
254
+ results: DocumentSignManyResultEntity[];
255
+ signed: number;
256
+ failed: number;
257
+ remaining: DocumentEntity['id'][];
258
+ /** FirmaGob avisó que el OTP venció antes de firmar todos los documentos de la solicitud. */
259
+ otpExpired: boolean;
260
+ }
115
261
  export interface DocumentDiscardResponseEntity {
116
262
  id: DocumentEntity['id'];
117
263
  ok: boolean;
@@ -153,3 +299,104 @@ export interface DocumentPublicFileResponseEntity {
153
299
  fileId: string;
154
300
  fileName: string;
155
301
  }
302
+ export interface DocumentDeriveResponseEntity {
303
+ id: DocumentEntity['id'];
304
+ ok: boolean;
305
+ delivered: number;
306
+ }
307
+ export interface DocumentCloseDeliveryResponseEntity {
308
+ id: DocumentDeliveryEntity['id'];
309
+ ok: boolean;
310
+ }
311
+ export interface DocumentReassignResponseEntity {
312
+ id: DocumentEntity['id'];
313
+ ok: boolean;
314
+ }
315
+ /**
316
+ * Un plazo en la agenda de un funcionario: lo que recibió (como destinatario o por derivación) y debe atender, o un
317
+ * documento que envió y del que espera respuesta.
318
+ */
319
+ export interface DocumentAgendaItemEntity {
320
+ kind: 'Received' | 'Sent';
321
+ /** La entrega (lo recibido) o el documento (lo enviado). */
322
+ id: string;
323
+ documentId: DocumentEntity['id'];
324
+ subject: DocumentEntity['subject'];
325
+ documentType: {
326
+ name: string;
327
+ abbreviation: string | null;
328
+ };
329
+ correlative: DocumentEntity['correlative'];
330
+ correlativeYear: DocumentEntity['correlativeYear'];
331
+ intakeNumber: DocumentEntity['intakeNumber'];
332
+ intakeYear: DocumentEntity['intakeYear'];
333
+ /** Plazo, en ISO 8601. */
334
+ dueAt: string;
335
+ /** Lo recibido: cuándo lo marcó como atendido (sin valor si sigue pendiente). */
336
+ closedAt: string | null;
337
+ /** Lo recibido: la providencia y quién lo derivó. */
338
+ instruction: DocumentDeliveryEntity['instruction'] | null;
339
+ sentByFullName: string | null;
340
+ /** Lo enviado: a cuántos les llegó y cuántos aún no lo atienden. */
341
+ recipients: {
342
+ total: number;
343
+ pending: number;
344
+ } | null;
345
+ }
346
+ export interface DocumentAgendaResponseEntity {
347
+ /** Plazos dentro del período pedido. */
348
+ items: DocumentAgendaItemEntity[];
349
+ /** Lo recibido con el plazo vencido y sin atender, de cualquier fecha (los 50 más antiguos). */
350
+ overdue: DocumentAgendaItemEntity[];
351
+ }
352
+ /** Trazabilidad de un documento en PDF, lista para descargar. */
353
+ export interface DocumentTrailExportEntity {
354
+ fileName: string;
355
+ contentType: string;
356
+ contentBase64: string;
357
+ }
358
+ /** Plantilla oficial con que se redacta un documento en el sistema. */
359
+ export type DocumentTemplateKind = 'Decree' | 'Office' | 'Memorandum' | 'General';
360
+ /**
361
+ * Contenido de un documento redactado en el sistema. Cada plantilla tiene su estructura; los párrafos son texto
362
+ * (un salto de línea dentro de un párrafo se respeta). La materia es el asunto del documento.
363
+ */
364
+ export type DocumentComposition = {
365
+ template: 'Decree';
366
+ /** VISTOS: las normas y antecedentes. */
367
+ vistos: string[];
368
+ /** CONSIDERANDO: cada fundamento, numerado. */
369
+ considerando: string[];
370
+ /** DECRETO: cada punto resolutivo, numerado. */
371
+ resolutive: string[];
372
+ /** Fórmula de cierre: «Anótese, comuníquese y archívese». */
373
+ closing: string;
374
+ distribution: string[];
375
+ } | {
376
+ template: 'Office';
377
+ /** ANT.: antecedentes (otro oficio, una solicitud). */
378
+ antecedents?: string | null;
379
+ from: string;
380
+ to: string;
381
+ body: string[];
382
+ closing: string;
383
+ distribution: string[];
384
+ } | {
385
+ template: 'Memorandum';
386
+ from: string;
387
+ to: string;
388
+ body: string[];
389
+ closing?: string | null;
390
+ distribution: string[];
391
+ } | {
392
+ template: 'General';
393
+ title: string;
394
+ body: string[];
395
+ closing?: string | null;
396
+ };
397
+ /** PDF armado con una plantilla: para la vista previa (`contentBase64`) o ya subido (`fileId`). */
398
+ export interface DocumentComposeResponseEntity {
399
+ fileName: string;
400
+ fileId?: string;
401
+ contentBase64?: string;
402
+ }
@@ -1,4 +1,15 @@
1
- import { DocumentTypeEntity } from '../../base/entities';
1
+ import { DocumentTypeEntity, DocumentTypeFlowStepEntity } from '../../base/entities';
2
+ /** Paso del flujo sugerido de un tipo documental: quién visa o firma, en su orden. */
3
+ export interface DocumentTypeFlowStepResponseEntity {
4
+ id: DocumentTypeFlowStepEntity['id'];
5
+ role: DocumentTypeFlowStepEntity['role'];
6
+ order: DocumentTypeFlowStepEntity['order'];
7
+ type: DocumentTypeFlowStepEntity['type'];
8
+ employeeId: DocumentTypeFlowStepEntity['employeeId'];
9
+ directorateCodeReference: DocumentTypeFlowStepEntity['directorateCodeReference'];
10
+ name: DocumentTypeFlowStepEntity['name'];
11
+ position: DocumentTypeFlowStepEntity['position'];
12
+ }
2
13
  export interface DocumentTypeGetAllResponseEntity {
3
14
  id: DocumentTypeEntity['id'];
4
15
  name: DocumentTypeEntity['name'];
@@ -8,11 +19,17 @@ export interface DocumentTypeGetAllResponseEntity {
8
19
  nextCorrelative: DocumentTypeEntity['nextCorrelative'];
9
20
  correlativeYear: DocumentTypeEntity['correlativeYear'];
10
21
  resetsYearly: DocumentTypeEntity['resetsYearly'];
22
+ numbered: DocumentTypeEntity['numbered'];
11
23
  directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
12
24
  enabled: DocumentTypeEntity['enabled'];
25
+ flow: {
26
+ visa: number;
27
+ signature: number;
28
+ };
13
29
  }
14
30
  export interface DocumentTypeGetByIdResponseEntity extends DocumentTypeGetAllResponseEntity {
15
31
  lastCorrelative: number | null;
32
+ flowSteps: DocumentTypeFlowStepResponseEntity[];
16
33
  }
17
34
  export interface DocumentTypeCreateResponseEntity {
18
35
  id: DocumentTypeEntity['id'];
@@ -1,2 +1,8 @@
1
1
  export * from './documentType';
2
2
  export * from './document';
3
+ export * from './procedure';
4
+ export * from './caseFile';
5
+ export * from './partsOffice';
6
+ export * from './registerBook';
7
+ export * from './signatureBatch';
8
+ export * from './workFolder';
@@ -16,3 +16,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./documentType"), exports);
18
18
  __exportStar(require("./document"), exports);
19
+ __exportStar(require("./procedure"), exports);
20
+ __exportStar(require("./caseFile"), exports);
21
+ __exportStar(require("./partsOffice"), exports);
22
+ __exportStar(require("./registerBook"), exports);
23
+ __exportStar(require("./signatureBatch"), exports);
24
+ __exportStar(require("./workFolder"), exports);
@@ -0,0 +1 @@
1
+ export * from './partsOffice.entity';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./partsOffice.entity"), exports);