@muni-sanfer/types-gestor-documental 0.0.1-beta.2 → 0.0.1-beta.21

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 (146) hide show
  1. package/dist/base/entities.d.ts +607 -1
  2. package/dist/base/entities.js +133 -1
  3. package/dist/contracts/archivalSeries.contract.d.ts +50 -0
  4. package/dist/contracts/archivalSeries.contract.js +11 -0
  5. package/dist/contracts/audit.contract.d.ts +32 -0
  6. package/dist/contracts/audit.contract.js +8 -0
  7. package/dist/contracts/caseFile.contract.d.ts +262 -0
  8. package/dist/contracts/caseFile.contract.js +26 -0
  9. package/dist/contracts/document.contract.d.ts +145 -2
  10. package/dist/contracts/document.contract.js +9 -0
  11. package/dist/contracts/documentType.contract.d.ts +24 -1
  12. package/dist/contracts/holiday.contract.d.ts +30 -0
  13. package/dist/contracts/holiday.contract.js +9 -0
  14. package/dist/contracts/index.d.ts +162 -1
  15. package/dist/contracts/index.js +42 -0
  16. package/dist/contracts/indicators.contract.d.ts +103 -0
  17. package/dist/contracts/indicators.contract.js +15 -0
  18. package/dist/contracts/issuingEntity.contract.d.ts +52 -0
  19. package/dist/contracts/issuingEntity.contract.js +11 -0
  20. package/dist/contracts/partsOffice.contract.d.ts +177 -0
  21. package/dist/contracts/partsOffice.contract.js +23 -0
  22. package/dist/contracts/procedure.contract.d.ts +50 -0
  23. package/dist/contracts/procedure.contract.js +11 -0
  24. package/dist/contracts/registerBook.contract.d.ts +27 -0
  25. package/dist/contracts/registerBook.contract.js +8 -0
  26. package/dist/contracts/scan.contract.d.ts +63 -0
  27. package/dist/contracts/scan.contract.js +12 -0
  28. package/dist/contracts/signatureBatch.contract.d.ts +109 -0
  29. package/dist/contracts/signatureBatch.contract.js +12 -0
  30. package/dist/contracts/signatureCheck.contract.d.ts +14 -0
  31. package/dist/contracts/signatureCheck.contract.js +7 -0
  32. package/dist/contracts/textSnippet.contract.d.ts +51 -0
  33. package/dist/contracts/textSnippet.contract.js +11 -0
  34. package/dist/contracts/workFolder.contract.d.ts +114 -0
  35. package/dist/contracts/workFolder.contract.js +16 -0
  36. package/dist/entities/archivalSeries/archivalSeries.entity.d.ts +27 -0
  37. package/dist/entities/archivalSeries/archivalSeries.entity.js +2 -0
  38. package/dist/entities/archivalSeries/index.d.ts +1 -0
  39. package/dist/entities/archivalSeries/index.js +17 -0
  40. package/dist/entities/audit/audit.entity.d.ts +27 -0
  41. package/dist/entities/audit/audit.entity.js +2 -0
  42. package/dist/entities/audit/index.d.ts +1 -0
  43. package/dist/entities/audit/index.js +17 -0
  44. package/dist/entities/caseFile/caseFile.entity.d.ts +300 -0
  45. package/dist/entities/caseFile/caseFile.entity.js +2 -0
  46. package/dist/entities/caseFile/index.d.ts +1 -0
  47. package/dist/entities/caseFile/index.js +17 -0
  48. package/dist/entities/document/document.entity.d.ts +252 -0
  49. package/dist/entities/documentType/documentType.entity.d.ts +37 -1
  50. package/dist/entities/holiday/holiday.entity.d.ts +10 -0
  51. package/dist/entities/holiday/holiday.entity.js +2 -0
  52. package/dist/entities/holiday/index.d.ts +1 -0
  53. package/dist/entities/holiday/index.js +17 -0
  54. package/dist/entities/index.d.ts +14 -0
  55. package/dist/entities/index.js +14 -0
  56. package/dist/entities/indicators/index.d.ts +1 -0
  57. package/dist/entities/indicators/index.js +17 -0
  58. package/dist/entities/indicators/indicators.entity.d.ts +152 -0
  59. package/dist/entities/indicators/indicators.entity.js +2 -0
  60. package/dist/entities/issuingEntity/index.d.ts +1 -0
  61. package/dist/entities/issuingEntity/index.js +17 -0
  62. package/dist/entities/issuingEntity/issuingEntity.entity.d.ts +20 -0
  63. package/dist/entities/issuingEntity/issuingEntity.entity.js +2 -0
  64. package/dist/entities/partsOffice/index.d.ts +1 -0
  65. package/dist/entities/partsOffice/index.js +17 -0
  66. package/dist/entities/partsOffice/partsOffice.entity.d.ts +105 -0
  67. package/dist/entities/partsOffice/partsOffice.entity.js +2 -0
  68. package/dist/entities/procedure/index.d.ts +1 -0
  69. package/dist/entities/procedure/index.js +17 -0
  70. package/dist/entities/procedure/procedure.entity.d.ts +20 -0
  71. package/dist/entities/procedure/procedure.entity.js +2 -0
  72. package/dist/entities/registerBook/index.d.ts +1 -0
  73. package/dist/entities/registerBook/index.js +17 -0
  74. package/dist/entities/registerBook/registerBook.entity.d.ts +48 -0
  75. package/dist/entities/registerBook/registerBook.entity.js +2 -0
  76. package/dist/entities/scan/index.d.ts +1 -0
  77. package/dist/entities/scan/index.js +17 -0
  78. package/dist/entities/scan/scan.entity.d.ts +29 -0
  79. package/dist/entities/scan/scan.entity.js +2 -0
  80. package/dist/entities/signatureBatch/index.d.ts +1 -0
  81. package/dist/entities/signatureBatch/index.js +17 -0
  82. package/dist/entities/signatureBatch/signatureBatch.entity.d.ts +107 -0
  83. package/dist/entities/signatureBatch/signatureBatch.entity.js +2 -0
  84. package/dist/entities/signatureCheck/index.d.ts +1 -0
  85. package/dist/entities/signatureCheck/index.js +17 -0
  86. package/dist/entities/signatureCheck/signatureCheck.entity.d.ts +49 -0
  87. package/dist/entities/signatureCheck/signatureCheck.entity.js +2 -0
  88. package/dist/entities/textSnippet/index.d.ts +1 -0
  89. package/dist/entities/textSnippet/index.js +17 -0
  90. package/dist/entities/textSnippet/textSnippet.entity.d.ts +20 -0
  91. package/dist/entities/textSnippet/textSnippet.entity.js +2 -0
  92. package/dist/entities/workFolder/index.d.ts +1 -0
  93. package/dist/entities/workFolder/index.js +17 -0
  94. package/dist/entities/workFolder/workFolder.entity.d.ts +83 -0
  95. package/dist/entities/workFolder/workFolder.entity.js +2 -0
  96. package/package.json +1 -1
  97. package/src/base/entities.ts +716 -1
  98. package/src/contracts/archivalSeries.contract.ts +53 -0
  99. package/src/contracts/audit.contract.ts +30 -0
  100. package/src/contracts/caseFile.contract.ts +228 -0
  101. package/src/contracts/document.contract.ts +151 -2
  102. package/src/contracts/documentType.contract.ts +32 -2
  103. package/src/contracts/holiday.contract.ts +16 -0
  104. package/src/contracts/index.ts +58 -1
  105. package/src/contracts/indicators.contract.ts +80 -0
  106. package/src/contracts/issuingEntity.contract.ts +55 -0
  107. package/src/contracts/partsOffice.contract.ts +123 -0
  108. package/src/contracts/procedure.contract.ts +53 -0
  109. package/src/contracts/registerBook.contract.ts +24 -0
  110. package/src/contracts/scan.contract.ts +52 -0
  111. package/src/contracts/signatureBatch.contract.ts +96 -0
  112. package/src/contracts/signatureCheck.contract.ts +11 -0
  113. package/src/contracts/textSnippet.contract.ts +53 -0
  114. package/src/contracts/workFolder.contract.ts +75 -0
  115. package/src/entities/archivalSeries/archivalSeries.entity.ts +32 -0
  116. package/src/entities/archivalSeries/index.ts +1 -0
  117. package/src/entities/audit/audit.entity.ts +30 -0
  118. package/src/entities/audit/index.ts +1 -0
  119. package/src/entities/caseFile/caseFile.entity.ts +324 -0
  120. package/src/entities/caseFile/index.ts +1 -0
  121. package/src/entities/document/document.entity.ts +250 -0
  122. package/src/entities/documentType/documentType.entity.ts +31 -1
  123. package/src/entities/holiday/holiday.entity.ts +11 -0
  124. package/src/entities/holiday/index.ts +1 -0
  125. package/src/entities/index.ts +14 -0
  126. package/src/entities/indicators/index.ts +1 -0
  127. package/src/entities/indicators/indicators.entity.ts +157 -0
  128. package/src/entities/issuingEntity/index.ts +1 -0
  129. package/src/entities/issuingEntity/issuingEntity.entity.ts +24 -0
  130. package/src/entities/partsOffice/index.ts +1 -0
  131. package/src/entities/partsOffice/partsOffice.entity.ts +110 -0
  132. package/src/entities/procedure/index.ts +1 -0
  133. package/src/entities/procedure/procedure.entity.ts +24 -0
  134. package/src/entities/registerBook/index.ts +1 -0
  135. package/src/entities/registerBook/registerBook.entity.ts +52 -0
  136. package/src/entities/scan/index.ts +1 -0
  137. package/src/entities/scan/scan.entity.ts +32 -0
  138. package/src/entities/signatureBatch/index.ts +1 -0
  139. package/src/entities/signatureBatch/signatureBatch.entity.ts +110 -0
  140. package/src/entities/signatureCheck/index.ts +1 -0
  141. package/src/entities/signatureCheck/signatureCheck.entity.ts +51 -0
  142. package/src/entities/textSnippet/index.ts +1 -0
  143. package/src/entities/textSnippet/textSnippet.entity.ts +24 -0
  144. package/src/entities/workFolder/index.ts +1 -0
  145. package/src/entities/workFolder/workFolder.entity.ts +84 -0
  146. package/tsconfig.json +1 -3
@@ -21,6 +21,8 @@ export interface DocumentParticipantResponseEntity {
21
21
  id: DocumentParticipantEntity['id'];
22
22
  role: DocumentParticipantEntity['role'];
23
23
  order: DocumentParticipantEntity['order'];
24
+ /** Los visadores de una misma etapa visan a la vez. */
25
+ stage: DocumentParticipantEntity['stage'];
24
26
  status: DocumentParticipantEntity['status'];
25
27
  employeeId: DocumentParticipantEntity['employeeId'];
26
28
  fullName: DocumentParticipantEntity['fullName'];
@@ -72,6 +74,33 @@ export interface DocumentLinkEntity {
72
74
  createdByFullName: DocumentEntity['createdByFullName'];
73
75
  finishedAt: DocumentEntity['finishedAt'];
74
76
  documentType: DocumentTypeSummaryEntity;
77
+ /** Folio de ingreso de Oficina de Partes, si llegó por DocDigital. */
78
+ intakeNumber: DocumentEntity['intakeNumber'];
79
+ intakeYear: DocumentEntity['intakeYear'];
80
+ }
81
+
82
+ /** Institución (y usuario) de DocDigital a la que va dirigido un documento. */
83
+ export interface DocumentExternalRecipientResponseEntity {
84
+ id: string;
85
+ entityId: number;
86
+ entityName: string;
87
+ userId: number | null;
88
+ userName: string | null;
89
+ userPosition: string | null;
90
+ }
91
+
92
+ /** Despacho de un documento por DocDigital. */
93
+ export interface DocumentDispatchResponseEntity {
94
+ id: string;
95
+ status: 'Pending' | 'Dispatched' | 'Returned';
96
+ folio: string | null;
97
+ docDigitalTypeName: string | null;
98
+ docDigitalDocumentId: string | null;
99
+ dispatchedAt: string | null;
100
+ dispatchedByFullName: string | null;
101
+ returnedAt: string | null;
102
+ returnedByFullName: string | null;
103
+ returnReason: string | null;
75
104
  }
76
105
 
77
106
  export interface DocumentGetAllResponseEntity {
@@ -87,19 +116,39 @@ export interface DocumentGetAllResponseEntity {
87
116
  createdByEmployeeId: DocumentEntity['createdByEmployeeId'];
88
117
  createdByFullName: DocumentEntity['createdByFullName'];
89
118
  documentType: DocumentTypeSummaryEntity;
119
+ intakeNumber: DocumentEntity['intakeNumber'];
120
+ intakeYear: DocumentEntity['intakeYear'];
121
+ origin: DocumentEntity['origin'];
122
+ /** Con búsqueda de texto completo: el fragmento donde aparece lo buscado, con lo encontrado entre ⟦ y ⟧. */
123
+ snippet?: string | null;
90
124
  // A quién le toca visar o firmar (null si el documento no está en tramitación).
91
125
  currentParticipant: Pick<DocumentParticipantResponseEntity, 'role' | 'employeeId' | 'fullName'> | null;
126
+ // Cuántos más tienen el turno a la vez (visación en paralelo).
127
+ otherCurrentCount: number;
92
128
  // A cuántos funcionarios llegó y cuántos ya lo abrieron (null si aún no se distribuye a nadie).
93
129
  distribution: { total: number; read: number } | null;
94
130
  }
95
131
 
96
132
  /** Una entrada de la bandeja de recibidos: la entrega y el documento al que corresponde. */
133
+ /** Semáforo de un plazo pendiente: a tiempo, por vencer (2 días hábiles o menos) o vencido. */
134
+ export type DocumentDueStatus = 'OnTime' | 'DueSoon' | 'Overdue';
135
+
97
136
  export interface DocumentInboxItemEntity extends DocumentDeliveryResponseEntity {
137
+ /** Semáforo de lo pendiente con plazo (sin plazo o ya atendido, `null`). */
138
+ dueStatus: DocumentDueStatus | null;
139
+ /** Días hábiles que quedan, sin contar hoy (vencido: `null`). */
140
+ businessDaysLeft: number | null;
98
141
  document: DocumentLinkEntity;
99
142
  }
100
143
 
101
144
  export interface DocumentGetByIdResponseEntity {
102
145
  id: DocumentEntity['id'];
146
+ // Quién lo emite: la entidad emisora del tipo (Educación, Salud, Juzgado) o la municipalidad.
147
+ issuerName: string;
148
+ // Serie documental del Cuadro de Clasificación (la de su tipo documental; MGDDE1_2).
149
+ archivalSeries: { id: string; code: string; name: string } | null;
150
+ // Fin de la restricción de acceso: desde entonces se consulta como público si no tiene datos sensibles.
151
+ restrictionEndsAt: string | null;
103
152
  subject: DocumentEntity['subject'];
104
153
  keywords: DocumentEntity['keywords'];
105
154
  accessLevel: DocumentEntity['accessLevel'];
@@ -144,7 +193,25 @@ export interface DocumentGetByIdResponseEntity {
144
193
  deliveries: DocumentDeliveryResponseEntity[];
145
194
  // Documento al que este responde, y los que le responden (solo los ya finalizados, más los propios de quien consulta).
146
195
  replyTo: DocumentLinkEntity | null;
196
+ /** Lote de firma al que pertenece. */
197
+ batch: { id: string; name: string } | null;
198
+ /** Contenido redactado en el sistema con una plantilla, para volver a editarlo (sin valor si se subió un PDF). */
199
+ composition: DocumentComposition | null;
147
200
  replies: DocumentLinkEntity[];
201
+ /** Expedientes en que está incorporado y que quien consulta puede ver. */
202
+ caseFiles: { id: string; code: string; title: string; status: 'Open' | 'Closed' }[];
203
+ /** De dónde viene: del gestor o recibido por DocDigital, con su folio de ingreso y los datos de quien lo envió. */
204
+ origin: DocumentEntity['origin'];
205
+ intakeNumber: DocumentEntity['intakeNumber'];
206
+ intakeYear: DocumentEntity['intakeYear'];
207
+ externalFolio: DocumentEntity['externalFolio'];
208
+ externalSender: DocumentEntity['externalSender'];
209
+ externalDate: DocumentEntity['externalDate'];
210
+ /** Instituciones de DocDigital a quienes va dirigido, y su despacho por Oficina de Partes. */
211
+ externalRecipients: DocumentExternalRecipientResponseEntity[];
212
+ dispatch: DocumentDispatchResponseEntity | null;
213
+ // Copias por correo a quienes están fuera del Estado, con su envío y apertura.
214
+ emailCopies: DocumentEmailCopyResponseEntity[];
148
215
  documentType: DocumentTypeSummaryEntity;
149
216
  participants: DocumentParticipantResponseEntity[];
150
217
  attachments: {
@@ -158,6 +225,8 @@ export interface DocumentGetByIdResponseEntity {
158
225
  id: DocumentTrackingEntity['id'];
159
226
  action: DocumentTrackingEntity['action'];
160
227
  observation: DocumentTrackingEntity['observation'];
228
+ // Huella SHA-256 del PDF en ese hecho (firma, despacho o ingreso por DocDigital).
229
+ sha256: DocumentTrackingEntity['sha256'];
161
230
  employeeId: DocumentTrackingEntity['employeeId'];
162
231
  employeeFullName: DocumentTrackingEntity['employeeFullName'];
163
232
  createdAt: DocumentTrackingEntity['createdAt'];
@@ -171,6 +240,10 @@ export interface DocumentGetByIdResponseEntity {
171
240
  // Puede derivarlo a otros funcionarios y responderlo: el documento ya es oficial y está a su alcance.
172
241
  canDerive: boolean;
173
242
  canReply: boolean;
243
+ // Es quien redactó un documento en tramitación: puede pasar un turno pendiente a otro funcionario.
244
+ canReassign: boolean;
245
+ /** Quien consulta redactó el documento (o lo ingresó, si llegó por DocDigital). */
246
+ isAuthor: boolean;
174
247
  // Sus propias entregas de este documento (puede tener más de una si además se lo derivaron).
175
248
  inbox: DocumentDeliveryResponseEntity[];
176
249
  };
@@ -182,6 +255,8 @@ export interface DocumentGetByIdResponseEntity {
182
255
  export interface DocumentGetSummaryResponseEntity {
183
256
  toVisa: number;
184
257
  toSign: number;
258
+ /** Lotes de firma con documentos en su turno (los documentos de un lote no se cuentan en `toVisa` ni `toSign`). */
259
+ batches: { toVisa: number; toSign: number };
185
260
  created: {
186
261
  drafted: number;
187
262
  inProgress: number;
@@ -212,6 +287,29 @@ export interface DocumentReviewResponseEntity {
212
287
  status: DocumentEntity['status'];
213
288
  }
214
289
 
290
+ /** Resultado de un documento en una firma de varios documentos. */
291
+ export interface DocumentSignManyResultEntity {
292
+ id: DocumentEntity['id'];
293
+ ok: boolean;
294
+ /** Estado en que quedó, si se firmó. */
295
+ status?: DocumentEntity['status'];
296
+ /** Por qué no se firmó. */
297
+ message?: string;
298
+ }
299
+
300
+ /**
301
+ * Firma de varios documentos con un solo OTP. FirmaGob admite 5 MB por solicitud: los que no cupieron quedan en
302
+ * `remaining`, en el turno del firmante, para firmarlos con un OTP nuevo.
303
+ */
304
+ export interface DocumentSignManyResponseEntity {
305
+ results: DocumentSignManyResultEntity[];
306
+ signed: number;
307
+ failed: number;
308
+ remaining: DocumentEntity['id'][];
309
+ /** FirmaGob avisó que el OTP venció antes de firmar todos los documentos de la solicitud. */
310
+ otpExpired: boolean;
311
+ }
312
+
215
313
  export interface DocumentDiscardResponseEntity {
216
314
  id: DocumentEntity['id'];
217
315
  ok: boolean;
@@ -238,6 +336,8 @@ export interface DocumentVerifyResponseEntity {
238
336
  state: DocumentVerificationState;
239
337
  verificationCode: string;
240
338
  documentType: Pick<DocumentTypeSummaryEntity, 'name' | 'abbreviation'>;
339
+ // Quién lo emite: la entidad emisora del tipo (Educación, Salud, Juzgado) o la municipalidad.
340
+ issuerName: string;
241
341
  correlative: DocumentEntity['correlative'];
242
342
  correlativeYear: DocumentEntity['correlativeYear'];
243
343
  numberedAt: DocumentEntity['numberedAt'];
@@ -271,3 +371,153 @@ export interface DocumentCloseDeliveryResponseEntity {
271
371
  id: DocumentDeliveryEntity['id'];
272
372
  ok: boolean;
273
373
  }
374
+
375
+ export interface DocumentReassignResponseEntity {
376
+ id: DocumentEntity['id'];
377
+ ok: boolean;
378
+ }
379
+
380
+ /**
381
+ * Un plazo en la agenda de un funcionario: lo que recibió (como destinatario o por derivación) y debe atender, o un
382
+ * documento que envió y del que espera respuesta.
383
+ */
384
+ export interface DocumentAgendaItemEntity {
385
+ kind: 'Received' | 'Sent';
386
+ /** Semáforo de lo pendiente (atendido o ya respondido por todos: `null`). */
387
+ dueStatus: DocumentDueStatus | null;
388
+ /** Días hábiles que quedan, sin contar hoy (vencido: `null`). */
389
+ businessDaysLeft: number | null;
390
+ /** La entrega (lo recibido) o el documento (lo enviado). */
391
+ id: string;
392
+ documentId: DocumentEntity['id'];
393
+ subject: DocumentEntity['subject'];
394
+ documentType: { name: string; abbreviation: string | null };
395
+ correlative: DocumentEntity['correlative'];
396
+ correlativeYear: DocumentEntity['correlativeYear'];
397
+ intakeNumber: DocumentEntity['intakeNumber'];
398
+ intakeYear: DocumentEntity['intakeYear'];
399
+ /** Plazo, en ISO 8601. */
400
+ dueAt: string;
401
+ /** Lo recibido: cuándo lo marcó como atendido (sin valor si sigue pendiente). */
402
+ closedAt: string | null;
403
+ /** Lo recibido: la providencia y quién lo derivó. */
404
+ instruction: DocumentDeliveryEntity['instruction'] | null;
405
+ sentByFullName: string | null;
406
+ /** Lo enviado: a cuántos les llegó y cuántos aún no lo atienden. */
407
+ recipients: { total: number; pending: number } | null;
408
+ }
409
+
410
+ export interface DocumentAgendaResponseEntity {
411
+ /** Plazos dentro del período pedido. */
412
+ items: DocumentAgendaItemEntity[];
413
+ /** Lo recibido con el plazo vencido y sin atender, de cualquier fecha (los 50 más antiguos). */
414
+ overdue: DocumentAgendaItemEntity[];
415
+ }
416
+
417
+ /** Trazabilidad de un documento en PDF, lista para descargar. */
418
+ export interface DocumentTrailExportEntity {
419
+ fileName: string;
420
+ contentType: string;
421
+ contentBase64: string;
422
+ }
423
+
424
+ /** Plantilla oficial con que se redacta un documento en el sistema. */
425
+ export type DocumentTemplateKind = 'Decree' | 'Office' | 'Memorandum' | 'General';
426
+
427
+ /**
428
+ * Contenido de un documento redactado en el sistema. Cada plantilla tiene su estructura; los párrafos son texto
429
+ * (un salto de línea dentro de un párrafo se respeta). La materia es el asunto del documento.
430
+ */
431
+ export type DocumentComposition =
432
+ | {
433
+ template: 'Decree';
434
+ /** VISTOS: las normas y antecedentes. */
435
+ vistos: string[];
436
+ /** CONSIDERANDO: cada fundamento, numerado. */
437
+ considerando: string[];
438
+ /** DECRETO: cada punto resolutivo, numerado. */
439
+ resolutive: string[];
440
+ /** Fórmula de cierre: «Anótese, comuníquese y archívese». */
441
+ closing: string;
442
+ distribution: string[];
443
+ }
444
+ | {
445
+ template: 'Office';
446
+ /** ANT.: antecedentes (otro oficio, una solicitud). */
447
+ antecedents?: string | null;
448
+ from: string;
449
+ to: string;
450
+ body: string[];
451
+ closing: string;
452
+ distribution: string[];
453
+ }
454
+ | {
455
+ template: 'Memorandum';
456
+ from: string;
457
+ to: string;
458
+ body: string[];
459
+ closing?: string | null;
460
+ distribution: string[];
461
+ }
462
+ | { template: 'General'; title: string; body: string[]; closing?: string | null };
463
+
464
+ /** PDF armado con una plantilla: para la vista previa (`contentBase64`) o ya subido (`fileId`). */
465
+ export interface DocumentComposeResponseEntity {
466
+ fileName: string;
467
+ fileId?: string;
468
+ contentBase64?: string;
469
+ }
470
+
471
+ /** Copia por correo de un documento, como la ve quien lo consulta en el gestor. */
472
+ export interface DocumentEmailCopyResponseEntity {
473
+ id: string;
474
+ name: string;
475
+ email: string;
476
+ /** Cuándo se envió (sin valor: aún no corresponde). */
477
+ issuedAt: string | null;
478
+ expiresAt: string | null;
479
+ openedAt: string | null;
480
+ downloadCount: number;
481
+ }
482
+
483
+ /** Copia recién emitida: el gateway le envía el enlace a su destinatario. El token viaja solo aquí. */
484
+ export interface DocumentEmailCopyIssuedEntity {
485
+ copyId: string;
486
+ documentId: string;
487
+ name: string;
488
+ email: string;
489
+ token: string;
490
+ expiresAt: string;
491
+ /** Cómo se cita: «D.E. N° 590/2026», o el tipo si no lleva número. */
492
+ folio: string;
493
+ subject: string;
494
+ issuerName: string;
495
+ }
496
+
497
+ /** El documento como lo ve quien abre su copia por correo. */
498
+ export interface DocumentEmailCopyViewEntity {
499
+ recipientName: string;
500
+ expiresAt: string;
501
+ documentTypeName: string;
502
+ folio: string;
503
+ subject: string;
504
+ issuerName: string;
505
+ finishedAt: string | null;
506
+ verificationCode: string | null;
507
+ signers: { fullName: string; position: string | null; signedAt: string | null }[];
508
+ }
509
+
510
+ /** Recordatorio de un plazo: al recibido y, si venció, también a su jefatura (la resuelve el gateway). */
511
+ export interface DocumentReminderEntity {
512
+ deliveryId: string;
513
+ kind: 'DueSoon' | 'Overdue';
514
+ employeeId: string;
515
+ fullName: string;
516
+ documentId: string;
517
+ /** Cómo se cita: «D.E. N° 590/2026», el folio de ingreso o el tipo. */
518
+ folio: string;
519
+ subject: string;
520
+ dueAt: string;
521
+ instruction: DocumentDeliveryEntity['instruction'];
522
+ sentByFullName: string | null;
523
+ }
@@ -1,4 +1,19 @@
1
- import { DocumentTypeEntity } from '../../base/entities';
1
+ import { DocumentTypeEntity, DocumentTypeFlowStepEntity } from '../../base/entities';
2
+
3
+ /** Paso del flujo sugerido de un tipo documental: quién visa o firma, en su orden. */
4
+ export interface DocumentTypeFlowStepResponseEntity {
5
+ id: DocumentTypeFlowStepEntity['id'];
6
+ role: DocumentTypeFlowStepEntity['role'];
7
+ order: DocumentTypeFlowStepEntity['order'];
8
+ type: DocumentTypeFlowStepEntity['type'];
9
+ employeeId: DocumentTypeFlowStepEntity['employeeId'];
10
+ directorateCodeReference: DocumentTypeFlowStepEntity['directorateCodeReference'];
11
+ // Nombre del funcionario o de la dirección, como estaba al definir el flujo.
12
+ name: DocumentTypeFlowStepEntity['name'];
13
+ position: DocumentTypeFlowStepEntity['position'];
14
+ // Visa a la vez con el paso anterior (visación en paralelo).
15
+ withPrevious: DocumentTypeFlowStepEntity['withPrevious'];
16
+ }
2
17
 
3
18
  export interface DocumentTypeGetAllResponseEntity {
4
19
  id: DocumentTypeEntity['id'];
@@ -9,14 +24,29 @@ export interface DocumentTypeGetAllResponseEntity {
9
24
  nextCorrelative: DocumentTypeEntity['nextCorrelative'];
10
25
  correlativeYear: DocumentTypeEntity['correlativeYear'];
11
26
  resetsYearly: DocumentTypeEntity['resetsYearly'];
27
+ // Sin numeración, sus documentos solo llevan fecha, código de verificación y QR.
28
+ numbered: DocumentTypeEntity['numbered'];
12
29
  directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
30
+ // Serie documental del Cuadro de Clasificación a la que van sus documentos (MGDDE1_2).
31
+ archivalSeries: { id: string; code: string; name: string } | null;
32
+ // Entidad que emite sus documentos (Educación, Salud, Juzgado). `null`: la municipalidad.
33
+ issuingEntity: { id: string; name: string; shortName: string | null } | null;
34
+ // Tipo cuyo correlativo comparte: sus números salen de esa serie (y `nextCorrelative`, `correlativeYear` y
35
+ // `resetsYearly` son los de ese tipo). `null`: lleva su propio correlativo.
36
+ sharesNumberingWith: { id: string; name: string } | null;
37
+ // Tipos que toman sus números del correlativo de este.
38
+ numberingMembers: { id: string; name: string }[];
13
39
  enabled: DocumentTypeEntity['enabled'];
40
+ // Cuántos visadores y firmantes tiene su flujo sugerido.
41
+ flow: { visa: number; signature: number };
14
42
  }
15
43
 
16
44
  export interface DocumentTypeGetByIdResponseEntity extends DocumentTypeGetAllResponseEntity {
17
45
  // Último número ya asignado en el año vigente del correlativo (null si aún no se numera ninguno): el próximo
18
46
  // correlativo no puede quedar por debajo de él.
19
47
  lastCorrelative: number | null;
48
+ // Flujo sugerido: primero los visadores y después los firmantes, cada grupo en su orden.
49
+ flowSteps: DocumentTypeFlowStepResponseEntity[];
20
50
  }
21
51
 
22
52
  export interface DocumentTypeCreateResponseEntity {
@@ -0,0 +1,11 @@
1
+ /** Feriado: el día («AAAA-MM-DD») no cuenta como hábil en los plazos. */
2
+ export interface HolidayResponseEntity {
3
+ id: string;
4
+ date: string;
5
+ name: string;
6
+ }
7
+
8
+ export interface HolidayRemoveResponseEntity {
9
+ id: string;
10
+ ok: boolean;
11
+ }
@@ -0,0 +1 @@
1
+ export * from './holiday.entity';
@@ -1,2 +1,16 @@
1
1
  export * from './documentType';
2
2
  export * from './document';
3
+ export * from './procedure';
4
+ export * from './issuingEntity';
5
+ export * from './caseFile';
6
+ export * from './partsOffice';
7
+ export * from './registerBook';
8
+ export * from './signatureBatch';
9
+ export * from './workFolder';
10
+ export * from './scan';
11
+ export * from './archivalSeries';
12
+ export * from './textSnippet';
13
+ export * from './holiday';
14
+ export * from './indicators';
15
+ export * from './audit';
16
+ export * from './signatureCheck';
@@ -0,0 +1 @@
1
+ export * from './indicators.entity';
@@ -0,0 +1,157 @@
1
+ import { type DocumentParticipantRole, type QualityMetricKey, type ServiceOutageKind } from '../../base/entities';
2
+
3
+ /** Tiempos de tramitación, desde el primer envío a tramitación hasta la última firma. En días corridos y hábiles. */
4
+ export interface ProcessingTimeEntity {
5
+ count: number;
6
+ averageDays: number | null;
7
+ medianDays: number | null;
8
+ p90Days: number | null;
9
+ averageBusinessDays: number | null;
10
+ }
11
+
12
+ export interface IndicatorsByTypeEntity {
13
+ documentTypeId: string;
14
+ name: string;
15
+ submitted: number;
16
+ finished: number;
17
+ rejections: number;
18
+ averageDays: number | null;
19
+ averageBusinessDays: number | null;
20
+ }
21
+
22
+ /** Unidad emisora: una dirección (código de caschile) o un departamento; el nombre lo pone el front. */
23
+ export interface IndicatorsByUnitEntity {
24
+ directorateCode: number | null;
25
+ departmentId: string | null;
26
+ submitted: number;
27
+ finished: number;
28
+ averageDays: number | null;
29
+ averageBusinessDays: number | null;
30
+ }
31
+
32
+ /** Quién demora más en su turno de visación o firma, y cuánto tiene pendiente hoy. */
33
+ export interface IndicatorsBottleneckEntity {
34
+ employeeId: string;
35
+ fullName: string;
36
+ role: DocumentParticipantRole;
37
+ resolved: number;
38
+ averageDays: number | null;
39
+ pending: number;
40
+ oldestPendingDays: number | null;
41
+ }
42
+
43
+ export interface ManagementIndicatorsEntity {
44
+ /** Período consultado, días de Chile «AAAA-MM-DD». */
45
+ from: string;
46
+ to: string;
47
+ generatedAt: string;
48
+ filters: { documentTypeId: string | null; directorateCode: number | null };
49
+ volume: {
50
+ /** Enviados a tramitación por primera vez en el período. */
51
+ submitted: number;
52
+ finished: number;
53
+ /** Rechazos de visadores y firmantes (un documento puede tener varios). */
54
+ rejections: number;
55
+ annulled: number;
56
+ discarded: number;
57
+ /** En tramitación hoy, sin importar el período. */
58
+ inProcess: number;
59
+ };
60
+ processing: ProcessingTimeEntity;
61
+ byType: IndicatorsByTypeEntity[];
62
+ byUnit: IndicatorsByUnitEntity[];
63
+ /** Por mes de Chile «AAAA-MM». */
64
+ monthly: { month: string; submitted: number; finished: number }[];
65
+ bottlenecks: IndicatorsBottleneckEntity[];
66
+ /** Plazos de lo recibido y derivado que vencían en el período. */
67
+ deadlines: {
68
+ withDeadline: number;
69
+ onTime: number;
70
+ late: number;
71
+ /** Vencidos sin atender. */
72
+ overdue: number;
73
+ /** Sin atender, todavía en plazo. */
74
+ pending: number;
75
+ /** A tiempo sobre los ya resueltos o vencidos, en %. */
76
+ onTimeRate: number | null;
77
+ };
78
+ partsOffice: {
79
+ received: number;
80
+ registered: number;
81
+ returned: number;
82
+ /** Días desde que llegó por DocDigital hasta que Partes lo ingresó. */
83
+ averageIntakeDays: number | null;
84
+ dispatched: number;
85
+ dispatchReturned: number;
86
+ };
87
+ }
88
+
89
+ export type QualityMetricUnit = 'Percent' | 'Ratio' | 'Milliseconds';
90
+ export type QualityMetricDirection = 'AtLeast' | 'AtMost';
91
+
92
+ /** Una métrica del Plan de Mejora Continua, con su valor en el período y su umbral. */
93
+ export interface QualityMetricEntity {
94
+ key: QualityMetricKey;
95
+ /** Subcaracterística de la ISO/IEC 25010 que mide. */
96
+ subcharacteristic: string;
97
+ model: 'Product' | 'InUse';
98
+ name: string;
99
+ description: string;
100
+ /** La mide el sistema o la declara quien administra la calidad, con su respaldo. */
101
+ source: 'Measured' | 'Declared';
102
+ value: number | null;
103
+ unit: QualityMetricUnit;
104
+ threshold: number;
105
+ direction: QualityMetricDirection;
106
+ /** Cumple el umbral. `null` sin valor. */
107
+ meets: boolean | null;
108
+ /** Con qué se calculó: cantidades del período. */
109
+ detail: string | null;
110
+ declaredNote: string | null;
111
+ declaredAt: string | null;
112
+ declaredByFullName: string | null;
113
+ }
114
+
115
+ export interface ServiceOutageResponseEntity {
116
+ id: string;
117
+ kind: ServiceOutageKind;
118
+ startedAt: string;
119
+ endedAt: string | null;
120
+ /** Duración en minutos; si sigue caído, hasta ahora. */
121
+ minutes: number;
122
+ cause: string;
123
+ affectedServices: string | null;
124
+ createdByFullName: string;
125
+ updatedByFullName: string | null;
126
+ createdAt: string;
127
+ }
128
+
129
+ export interface QualityReportEntity {
130
+ from: string;
131
+ to: string;
132
+ generatedAt: string;
133
+ metrics: QualityMetricEntity[];
134
+ /** Caídas que tocan el período. */
135
+ outages: ServiceOutageResponseEntity[];
136
+ }
137
+
138
+ export interface QualityMetricSettingResponseEntity {
139
+ key: QualityMetricKey;
140
+ threshold: number;
141
+ declaredValue: number | null;
142
+ declaredNote: string | null;
143
+ declaredAt: string | null;
144
+ declaredByFullName: string | null;
145
+ }
146
+
147
+ export interface ServiceOutageRemoveResponseEntity {
148
+ id: string;
149
+ ok: boolean;
150
+ }
151
+
152
+ /** Un archivo generado (planilla o certificado), en base64. */
153
+ export interface IndicatorsFileEntity {
154
+ fileName: string;
155
+ contentType: string;
156
+ contentBase64: string;
157
+ }
@@ -0,0 +1 @@
1
+ export * from './issuingEntity.entity';
@@ -0,0 +1,24 @@
1
+ import { IssuingEntityEntity } from '../../base/entities';
2
+
3
+ export interface IssuingEntityGetAllResponseEntity {
4
+ id: IssuingEntityEntity['id'];
5
+ name: IssuingEntityEntity['name'];
6
+ shortName: IssuingEntityEntity['shortName'];
7
+ directorateCodeReferences: IssuingEntityEntity['directorateCodeReferences'];
8
+ docDigitalEntityId: IssuingEntityEntity['docDigitalEntityId'];
9
+ enabled: IssuingEntityEntity['enabled'];
10
+ /** Cuántos tipos documentales emite. */
11
+ documentTypes: number;
12
+ }
13
+
14
+ export type IssuingEntityGetByIdResponseEntity = IssuingEntityGetAllResponseEntity;
15
+
16
+ export interface IssuingEntityCreateResponseEntity {
17
+ id: IssuingEntityEntity['id'];
18
+ ok: boolean;
19
+ }
20
+
21
+ export interface IssuingEntityUpdateResponseEntity {
22
+ id: IssuingEntityEntity['id'];
23
+ ok: boolean;
24
+ }
@@ -0,0 +1 @@
1
+ export * from './partsOffice.entity';