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

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 +435 -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 +141 -3
  6. package/dist/contracts/document.contract.js +7 -0
  7. package/dist/contracts/documentType.contract.d.ts +18 -1
  8. package/dist/contracts/index.d.ts +83 -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 +201 -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 +508 -1
  50. package/src/contracts/caseFile.contract.ts +141 -0
  51. package/src/contracts/document.contract.ts +130 -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 +210 -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,33 @@ 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
+ replies: DocumentLinkEntity[];
157
+ /** Expedientes en que está incorporado y que quien consulta puede ver. */
158
+ caseFiles: {
159
+ id: string;
160
+ code: string;
161
+ title: string;
162
+ status: 'Open' | 'Closed';
163
+ }[];
164
+ /** De dónde viene: del gestor o recibido por DocDigital, con su folio de ingreso y los datos de quien lo envió. */
165
+ origin: DocumentEntity['origin'];
166
+ intakeNumber: DocumentEntity['intakeNumber'];
167
+ intakeYear: DocumentEntity['intakeYear'];
168
+ externalFolio: DocumentEntity['externalFolio'];
169
+ externalSender: DocumentEntity['externalSender'];
170
+ externalDate: DocumentEntity['externalDate'];
171
+ /** Instituciones de DocDigital a quienes va dirigido, y su despacho por Oficina de Partes. */
172
+ externalRecipients: DocumentExternalRecipientResponseEntity[];
173
+ dispatch: DocumentDispatchResponseEntity | null;
67
174
  documentType: DocumentTypeSummaryEntity;
68
175
  participants: DocumentParticipantResponseEntity[];
69
176
  attachments: {
@@ -85,6 +192,12 @@ export interface DocumentGetByIdResponseEntity {
85
192
  turn: Pick<DocumentParticipantResponseEntity, 'id' | 'role'> | null;
86
193
  canEdit: boolean;
87
194
  canDiscard: boolean;
195
+ canDerive: boolean;
196
+ canReply: boolean;
197
+ canReassign: boolean;
198
+ /** Quien consulta redactó el documento (o lo ingresó, si llegó por DocDigital). */
199
+ isAuthor: boolean;
200
+ inbox: DocumentDeliveryResponseEntity[];
88
201
  };
89
202
  signatureRequiresOtp: boolean;
90
203
  }
@@ -92,12 +205,22 @@ export interface DocumentGetByIdResponseEntity {
92
205
  export interface DocumentGetSummaryResponseEntity {
93
206
  toVisa: number;
94
207
  toSign: number;
208
+ /** Lotes de firma con documentos en su turno (los documentos de un lote no se cuentan en `toVisa` ni `toSign`). */
209
+ batches: {
210
+ toVisa: number;
211
+ toSign: number;
212
+ };
95
213
  created: {
96
214
  drafted: number;
97
215
  inProgress: number;
98
216
  rejected: number;
99
217
  finished: number;
100
218
  };
219
+ received: {
220
+ unread: number;
221
+ pending: number;
222
+ overdue: number;
223
+ };
101
224
  }
102
225
  export interface DocumentCreateResponseEntity {
103
226
  id: DocumentEntity['id'];
@@ -112,6 +235,27 @@ export interface DocumentReviewResponseEntity {
112
235
  ok: boolean;
113
236
  status: DocumentEntity['status'];
114
237
  }
238
+ /** Resultado de un documento en una firma de varios documentos. */
239
+ export interface DocumentSignManyResultEntity {
240
+ id: DocumentEntity['id'];
241
+ ok: boolean;
242
+ /** Estado en que quedó, si se firmó. */
243
+ status?: DocumentEntity['status'];
244
+ /** Por qué no se firmó. */
245
+ message?: string;
246
+ }
247
+ /**
248
+ * Firma de varios documentos con un solo OTP. FirmaGob admite 5 MB por solicitud: los que no cupieron quedan en
249
+ * `remaining`, en el turno del firmante, para firmarlos con un OTP nuevo.
250
+ */
251
+ export interface DocumentSignManyResponseEntity {
252
+ results: DocumentSignManyResultEntity[];
253
+ signed: number;
254
+ failed: number;
255
+ remaining: DocumentEntity['id'][];
256
+ /** FirmaGob avisó que el OTP venció antes de firmar todos los documentos de la solicitud. */
257
+ otpExpired: boolean;
258
+ }
115
259
  export interface DocumentDiscardResponseEntity {
116
260
  id: DocumentEntity['id'];
117
261
  ok: boolean;
@@ -153,3 +297,59 @@ export interface DocumentPublicFileResponseEntity {
153
297
  fileId: string;
154
298
  fileName: string;
155
299
  }
300
+ export interface DocumentDeriveResponseEntity {
301
+ id: DocumentEntity['id'];
302
+ ok: boolean;
303
+ delivered: number;
304
+ }
305
+ export interface DocumentCloseDeliveryResponseEntity {
306
+ id: DocumentDeliveryEntity['id'];
307
+ ok: boolean;
308
+ }
309
+ export interface DocumentReassignResponseEntity {
310
+ id: DocumentEntity['id'];
311
+ ok: boolean;
312
+ }
313
+ /**
314
+ * Un plazo en la agenda de un funcionario: lo que recibió (como destinatario o por derivación) y debe atender, o un
315
+ * documento que envió y del que espera respuesta.
316
+ */
317
+ export interface DocumentAgendaItemEntity {
318
+ kind: 'Received' | 'Sent';
319
+ /** La entrega (lo recibido) o el documento (lo enviado). */
320
+ id: string;
321
+ documentId: DocumentEntity['id'];
322
+ subject: DocumentEntity['subject'];
323
+ documentType: {
324
+ name: string;
325
+ abbreviation: string | null;
326
+ };
327
+ correlative: DocumentEntity['correlative'];
328
+ correlativeYear: DocumentEntity['correlativeYear'];
329
+ intakeNumber: DocumentEntity['intakeNumber'];
330
+ intakeYear: DocumentEntity['intakeYear'];
331
+ /** Plazo, en ISO 8601. */
332
+ dueAt: string;
333
+ /** Lo recibido: cuándo lo marcó como atendido (sin valor si sigue pendiente). */
334
+ closedAt: string | null;
335
+ /** Lo recibido: la providencia y quién lo derivó. */
336
+ instruction: DocumentDeliveryEntity['instruction'] | null;
337
+ sentByFullName: string | null;
338
+ /** Lo enviado: a cuántos les llegó y cuántos aún no lo atienden. */
339
+ recipients: {
340
+ total: number;
341
+ pending: number;
342
+ } | null;
343
+ }
344
+ export interface DocumentAgendaResponseEntity {
345
+ /** Plazos dentro del período pedido. */
346
+ items: DocumentAgendaItemEntity[];
347
+ /** Lo recibido con el plazo vencido y sin atender, de cualquier fecha (los 50 más antiguos). */
348
+ overdue: DocumentAgendaItemEntity[];
349
+ }
350
+ /** Trazabilidad de un documento en PDF, lista para descargar. */
351
+ export interface DocumentTrailExportEntity {
352
+ fileName: string;
353
+ contentType: string;
354
+ contentBase64: string;
355
+ }
@@ -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);
@@ -0,0 +1,98 @@
1
+ import { type DocumentDispatchResponseEntity, type DocumentExternalRecipientResponseEntity, type DocumentLinkEntity } from '../document';
2
+ /** Institución del Estado en DocDigital. */
3
+ export interface DocDigitalEntityEntity {
4
+ id: number;
5
+ name: string;
6
+ /** Organismo al que pertenece (la entidad padre). */
7
+ organism: string | null;
8
+ }
9
+ /** Usuario habilitado de una institución en DocDigital. */
10
+ export interface DocDigitalUserEntity {
11
+ id: number;
12
+ name: string;
13
+ position: string | null;
14
+ }
15
+ export interface DocDigitalDocumentTypeEntity {
16
+ id: number;
17
+ name: string;
18
+ }
19
+ /** Si DocDigital está configurado en el gestor y cada cuánto se revisa lo recibido. */
20
+ export interface PartsOfficeStatusEntity {
21
+ configured: boolean;
22
+ syncMinutes: number;
23
+ }
24
+ /** Totales del Panel de Partes. */
25
+ export interface PartsOfficeSummaryEntity {
26
+ toDispatch: number;
27
+ received: number;
28
+ }
29
+ /** Documento firmado que va a otras instituciones: lo despacha Oficina de Partes. */
30
+ export interface PartsOfficeDispatchEntity extends DocumentDispatchResponseEntity {
31
+ document: DocumentLinkEntity & {
32
+ accessLevel: string;
33
+ };
34
+ externalRecipients: DocumentExternalRecipientResponseEntity[];
35
+ createdAt: string;
36
+ }
37
+ /** Documento que llegó por DocDigital. */
38
+ export interface PartsOfficeInboundEntity {
39
+ id: string;
40
+ docDigitalDocumentId: string;
41
+ status: 'Pending' | 'Registered' | 'Returned';
42
+ subject: string;
43
+ description: string | null;
44
+ folio: string | null;
45
+ folioDate: string | null;
46
+ typeName: string | null;
47
+ reserved: boolean;
48
+ senderEntityName: string | null;
49
+ senderName: string | null;
50
+ senderPosition: string | null;
51
+ fileName: string | null;
52
+ hasFile: boolean;
53
+ attachments: {
54
+ name: string;
55
+ url: string | null;
56
+ hasFile: boolean;
57
+ }[];
58
+ createdAt: string;
59
+ registeredAt: string | null;
60
+ registeredByFullName: string | null;
61
+ acknowledgedAt: string | null;
62
+ acknowledgeError: string | null;
63
+ returnedAt: string | null;
64
+ returnedByFullName: string | null;
65
+ returnReason: string | null;
66
+ /** El documento con que quedó ingresado al gestor. */
67
+ document: {
68
+ id: string;
69
+ intakeNumber: number | null;
70
+ intakeYear: number | null;
71
+ } | null;
72
+ }
73
+ export interface PartsOfficeOkResponseEntity {
74
+ id: string;
75
+ ok: boolean;
76
+ /** Documento al que corresponde el despacho (al despachar o devolver). */
77
+ documentId?: string;
78
+ }
79
+ export interface PartsOfficeSyncResponseEntity {
80
+ /** Recibidos nuevos que se trajeron. */
81
+ created: number;
82
+ /** Los que no se pudieron traer (se reintentan en la próxima revisión). */
83
+ failed: number;
84
+ }
85
+ export interface PartsOfficeRegisterResponseEntity {
86
+ id: string;
87
+ documentId: string;
88
+ intakeNumber: number;
89
+ intakeYear: number;
90
+ /** `false` si DocDigital no aceptó el acuse de recibo: se puede reintentar. */
91
+ acknowledged: boolean;
92
+ ok: boolean;
93
+ }
94
+ /** Archivo de un recibido, ya copiado al gestor. */
95
+ export interface PartsOfficeFileEntity {
96
+ fileId: string;
97
+ fileName: string;
98
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './procedure.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("./procedure.entity"), exports);