@muni-sanfer/types-gestor-documental 0.0.1-beta.0 → 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.
- package/dist/base/entities.d.ts +459 -2
- package/dist/base/entities.js +102 -1
- package/dist/contracts/caseFile.contract.d.ts +159 -0
- package/dist/contracts/caseFile.contract.js +18 -0
- package/dist/contracts/document.contract.d.ts +167 -3
- package/dist/contracts/document.contract.js +10 -0
- package/dist/contracts/documentType.contract.d.ts +18 -1
- package/dist/contracts/index.d.ts +86 -1
- package/dist/contracts/index.js +18 -0
- package/dist/contracts/partsOffice.contract.d.ts +171 -0
- package/dist/contracts/partsOffice.contract.js +22 -0
- package/dist/contracts/procedure.contract.d.ts +50 -0
- package/dist/contracts/procedure.contract.js +11 -0
- package/dist/contracts/registerBook.contract.d.ts +27 -0
- package/dist/contracts/registerBook.contract.js +8 -0
- package/dist/contracts/signatureBatch.contract.d.ts +109 -0
- package/dist/contracts/signatureBatch.contract.js +12 -0
- package/dist/contracts/workFolder.contract.d.ts +114 -0
- package/dist/contracts/workFolder.contract.js +16 -0
- package/dist/entities/caseFile/caseFile.entity.d.ts +176 -0
- package/dist/entities/caseFile/caseFile.entity.js +2 -0
- package/dist/entities/caseFile/index.d.ts +1 -0
- package/dist/entities/caseFile/index.js +17 -0
- package/dist/entities/document/document.entity.d.ts +250 -1
- package/dist/entities/documentType/documentType.entity.d.ts +18 -1
- package/dist/entities/index.d.ts +6 -0
- package/dist/entities/index.js +6 -0
- package/dist/entities/partsOffice/index.d.ts +1 -0
- package/dist/entities/partsOffice/index.js +17 -0
- package/dist/entities/partsOffice/partsOffice.entity.d.ts +98 -0
- package/dist/entities/partsOffice/partsOffice.entity.js +2 -0
- package/dist/entities/procedure/index.d.ts +1 -0
- package/dist/entities/procedure/index.js +17 -0
- package/dist/entities/procedure/procedure.entity.d.ts +20 -0
- package/dist/entities/procedure/procedure.entity.js +2 -0
- package/dist/entities/registerBook/index.d.ts +1 -0
- package/dist/entities/registerBook/index.js +17 -0
- package/dist/entities/registerBook/registerBook.entity.d.ts +42 -0
- package/dist/entities/registerBook/registerBook.entity.js +2 -0
- package/dist/entities/signatureBatch/index.d.ts +1 -0
- package/dist/entities/signatureBatch/index.js +17 -0
- package/dist/entities/signatureBatch/signatureBatch.entity.d.ts +107 -0
- package/dist/entities/signatureBatch/signatureBatch.entity.js +2 -0
- package/dist/entities/workFolder/index.d.ts +1 -0
- package/dist/entities/workFolder/index.js +17 -0
- package/dist/entities/workFolder/workFolder.entity.d.ts +83 -0
- package/dist/entities/workFolder/workFolder.entity.js +2 -0
- package/package.json +1 -1
- package/src/base/entities.ts +544 -2
- package/src/contracts/caseFile.contract.ts +141 -0
- package/src/contracts/document.contract.ts +153 -0
- package/src/contracts/documentType.contract.ts +14 -1
- package/src/contracts/index.ts +26 -1
- package/src/contracts/partsOffice.contract.ts +120 -0
- package/src/contracts/procedure.contract.ts +53 -0
- package/src/contracts/registerBook.contract.ts +24 -0
- package/src/contracts/signatureBatch.contract.ts +96 -0
- package/src/contracts/workFolder.contract.ts +75 -0
- package/src/entities/caseFile/caseFile.entity.ts +204 -0
- package/src/entities/caseFile/index.ts +1 -0
- package/src/entities/document/document.entity.ts +271 -0
- package/src/entities/documentType/documentType.entity.ts +20 -1
- package/src/entities/index.ts +6 -0
- package/src/entities/partsOffice/index.ts +1 -0
- package/src/entities/partsOffice/partsOffice.entity.ts +103 -0
- package/src/entities/procedure/index.ts +1 -0
- package/src/entities/procedure/procedure.entity.ts +24 -0
- package/src/entities/registerBook/index.ts +1 -0
- package/src/entities/registerBook/registerBook.entity.ts +46 -0
- package/src/entities/signatureBatch/index.ts +1 -0
- package/src/entities/signatureBatch/signatureBatch.entity.ts +110 -0
- package/src/entities/workFolder/index.ts +1 -0
- package/src/entities/workFolder/workFolder.entity.ts +84 -0
- package/tsconfig.json +1 -3
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DocumentAnnulledNumberEntity,
|
|
2
3
|
DocumentAttachmentEntity,
|
|
4
|
+
DocumentDeliveryEntity,
|
|
3
5
|
DocumentEntity,
|
|
4
6
|
DocumentParticipantEntity,
|
|
7
|
+
DocumentRecipientEntity,
|
|
5
8
|
DocumentTrackingEntity,
|
|
6
9
|
DocumentTypeEntity,
|
|
7
10
|
} from '../../base/entities';
|
|
@@ -18,6 +21,8 @@ export interface DocumentParticipantResponseEntity {
|
|
|
18
21
|
id: DocumentParticipantEntity['id'];
|
|
19
22
|
role: DocumentParticipantEntity['role'];
|
|
20
23
|
order: DocumentParticipantEntity['order'];
|
|
24
|
+
/** Los visadores de una misma etapa visan a la vez. */
|
|
25
|
+
stage: DocumentParticipantEntity['stage'];
|
|
21
26
|
status: DocumentParticipantEntity['status'];
|
|
22
27
|
employeeId: DocumentParticipantEntity['employeeId'];
|
|
23
28
|
fullName: DocumentParticipantEntity['fullName'];
|
|
@@ -26,6 +31,78 @@ export interface DocumentParticipantResponseEntity {
|
|
|
26
31
|
resolvedAt: DocumentParticipantEntity['resolvedAt'];
|
|
27
32
|
}
|
|
28
33
|
|
|
34
|
+
/** Destinatario de un documento, como lo eligió el redactor: una persona o un área completa. */
|
|
35
|
+
export interface DocumentRecipientResponseEntity {
|
|
36
|
+
id: DocumentRecipientEntity['id'];
|
|
37
|
+
type: DocumentRecipientEntity['type'];
|
|
38
|
+
employeeId: DocumentRecipientEntity['employeeId'];
|
|
39
|
+
directorateCodeReference: DocumentRecipientEntity['directorateCodeReference'];
|
|
40
|
+
departmentId: DocumentRecipientEntity['departmentId'];
|
|
41
|
+
name: DocumentRecipientEntity['name'];
|
|
42
|
+
position: DocumentRecipientEntity['position'];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Un documento en la bandeja de un funcionario: como destinatario o porque se lo derivaron. */
|
|
46
|
+
export interface DocumentDeliveryResponseEntity {
|
|
47
|
+
id: DocumentDeliveryEntity['id'];
|
|
48
|
+
origin: DocumentDeliveryEntity['origin'];
|
|
49
|
+
employeeId: DocumentDeliveryEntity['employeeId'];
|
|
50
|
+
fullName: DocumentDeliveryEntity['fullName'];
|
|
51
|
+
position: DocumentDeliveryEntity['position'];
|
|
52
|
+
// Área por la que le llegó, si el documento iba dirigido a un área.
|
|
53
|
+
areaName: DocumentDeliveryEntity['areaName'];
|
|
54
|
+
// Quién se lo derivó. Null si es uno de los destinatarios originales.
|
|
55
|
+
sentByEmployeeId: DocumentDeliveryEntity['sentByEmployeeId'];
|
|
56
|
+
sentByFullName: DocumentDeliveryEntity['sentByFullName'];
|
|
57
|
+
instruction: DocumentDeliveryEntity['instruction'];
|
|
58
|
+
note: DocumentDeliveryEntity['note'];
|
|
59
|
+
dueAt: DocumentDeliveryEntity['dueAt'];
|
|
60
|
+
// Null mientras el documento no termina su tramitación.
|
|
61
|
+
deliveredAt: DocumentDeliveryEntity['deliveredAt'];
|
|
62
|
+
readAt: DocumentDeliveryEntity['readAt'];
|
|
63
|
+
closedAt: DocumentDeliveryEntity['closedAt'];
|
|
64
|
+
closingNote: DocumentDeliveryEntity['closingNote'];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Lo necesario para citar otro documento y enlazarlo (el que se responde, o las respuestas). */
|
|
68
|
+
export interface DocumentLinkEntity {
|
|
69
|
+
id: DocumentEntity['id'];
|
|
70
|
+
subject: DocumentEntity['subject'];
|
|
71
|
+
status: DocumentEntity['status'];
|
|
72
|
+
correlative: DocumentEntity['correlative'];
|
|
73
|
+
correlativeYear: DocumentEntity['correlativeYear'];
|
|
74
|
+
createdByFullName: DocumentEntity['createdByFullName'];
|
|
75
|
+
finishedAt: DocumentEntity['finishedAt'];
|
|
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;
|
|
104
|
+
}
|
|
105
|
+
|
|
29
106
|
export interface DocumentGetAllResponseEntity {
|
|
30
107
|
id: DocumentEntity['id'];
|
|
31
108
|
subject: DocumentEntity['subject'];
|
|
@@ -39,8 +116,22 @@ export interface DocumentGetAllResponseEntity {
|
|
|
39
116
|
createdByEmployeeId: DocumentEntity['createdByEmployeeId'];
|
|
40
117
|
createdByFullName: DocumentEntity['createdByFullName'];
|
|
41
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;
|
|
42
124
|
// A quién le toca visar o firmar (null si el documento no está en tramitación).
|
|
43
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;
|
|
128
|
+
// A cuántos funcionarios llegó y cuántos ya lo abrieron (null si aún no se distribuye a nadie).
|
|
129
|
+
distribution: { total: number; read: number } | null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Una entrada de la bandeja de recibidos: la entrega y el documento al que corresponde. */
|
|
133
|
+
export interface DocumentInboxItemEntity extends DocumentDeliveryResponseEntity {
|
|
134
|
+
document: DocumentLinkEntity;
|
|
44
135
|
}
|
|
45
136
|
|
|
46
137
|
export interface DocumentGetByIdResponseEntity {
|
|
@@ -64,6 +155,46 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
64
155
|
createdAt: DocumentEntity['createdAt'];
|
|
65
156
|
submittedAt: DocumentEntity['submittedAt'];
|
|
66
157
|
finishedAt: DocumentEntity['finishedAt'];
|
|
158
|
+
// Código con que se comprueba el documento en la página pública. Null mientras no se envía a tramitación.
|
|
159
|
+
verificationCode: DocumentEntity['verificationCode'];
|
|
160
|
+
// Dirección de esa página para este documento. Null si el servicio no la tiene configurada.
|
|
161
|
+
verificationUrl: string | null;
|
|
162
|
+
// El redactor pidió una hoja aparte para firmas y visaciones.
|
|
163
|
+
signatureSheet: DocumentEntity['signatureSheet'];
|
|
164
|
+
// Anulación de un documento ya finalizado.
|
|
165
|
+
annulledAt: DocumentEntity['annulledAt'];
|
|
166
|
+
annulmentReason: DocumentEntity['annulmentReason'];
|
|
167
|
+
// Números que el documento tuvo y perdió: lo rechazaron cuando ya estaba numerado.
|
|
168
|
+
annulledNumbers: {
|
|
169
|
+
correlative: DocumentAnnulledNumberEntity['correlative'];
|
|
170
|
+
correlativeYear: DocumentAnnulledNumberEntity['correlativeYear'];
|
|
171
|
+
reason: DocumentAnnulledNumberEntity['reason'];
|
|
172
|
+
employeeFullName: DocumentAnnulledNumberEntity['employeeFullName'];
|
|
173
|
+
createdAt: DocumentAnnulledNumberEntity['createdAt'];
|
|
174
|
+
}[];
|
|
175
|
+
// Plazo en que el redactor espera respuesta de los destinatarios.
|
|
176
|
+
responseDueAt: DocumentEntity['responseDueAt'];
|
|
177
|
+
// A quién va dirigido, como lo indicó el redactor (personas y áreas).
|
|
178
|
+
recipients: DocumentRecipientResponseEntity[];
|
|
179
|
+
// En la bandeja de quién está: destinatarios y derivaciones, con su lectura y atención.
|
|
180
|
+
deliveries: DocumentDeliveryResponseEntity[];
|
|
181
|
+
// Documento al que este responde, y los que le responden (solo los ya finalizados, más los propios de quien consulta).
|
|
182
|
+
replyTo: DocumentLinkEntity | null;
|
|
183
|
+
/** Lote de firma al que pertenece. */
|
|
184
|
+
batch: { id: string; name: string } | null;
|
|
185
|
+
replies: DocumentLinkEntity[];
|
|
186
|
+
/** Expedientes en que está incorporado y que quien consulta puede ver. */
|
|
187
|
+
caseFiles: { id: string; code: string; title: string; status: 'Open' | 'Closed' }[];
|
|
188
|
+
/** De dónde viene: del gestor o recibido por DocDigital, con su folio de ingreso y los datos de quien lo envió. */
|
|
189
|
+
origin: DocumentEntity['origin'];
|
|
190
|
+
intakeNumber: DocumentEntity['intakeNumber'];
|
|
191
|
+
intakeYear: DocumentEntity['intakeYear'];
|
|
192
|
+
externalFolio: DocumentEntity['externalFolio'];
|
|
193
|
+
externalSender: DocumentEntity['externalSender'];
|
|
194
|
+
externalDate: DocumentEntity['externalDate'];
|
|
195
|
+
/** Instituciones de DocDigital a quienes va dirigido, y su despacho por Oficina de Partes. */
|
|
196
|
+
externalRecipients: DocumentExternalRecipientResponseEntity[];
|
|
197
|
+
dispatch: DocumentDispatchResponseEntity | null;
|
|
67
198
|
documentType: DocumentTypeSummaryEntity;
|
|
68
199
|
participants: DocumentParticipantResponseEntity[];
|
|
69
200
|
attachments: {
|
|
@@ -87,6 +218,15 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
87
218
|
turn: Pick<DocumentParticipantResponseEntity, 'id' | 'role'> | null;
|
|
88
219
|
canEdit: boolean;
|
|
89
220
|
canDiscard: boolean;
|
|
221
|
+
// Puede derivarlo a otros funcionarios y responderlo: el documento ya es oficial y está a su alcance.
|
|
222
|
+
canDerive: boolean;
|
|
223
|
+
canReply: boolean;
|
|
224
|
+
// Es quien redactó un documento en tramitación: puede pasar un turno pendiente a otro funcionario.
|
|
225
|
+
canReassign: boolean;
|
|
226
|
+
/** Quien consulta redactó el documento (o lo ingresó, si llegó por DocDigital). */
|
|
227
|
+
isAuthor: boolean;
|
|
228
|
+
// Sus propias entregas de este documento (puede tener más de una si además se lo derivaron).
|
|
229
|
+
inbox: DocumentDeliveryResponseEntity[];
|
|
90
230
|
};
|
|
91
231
|
// Firmar exige el código OTP de quien firma (firma atendida).
|
|
92
232
|
signatureRequiresOtp: boolean;
|
|
@@ -96,12 +236,20 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
96
236
|
export interface DocumentGetSummaryResponseEntity {
|
|
97
237
|
toVisa: number;
|
|
98
238
|
toSign: number;
|
|
239
|
+
/** Lotes de firma con documentos en su turno (los documentos de un lote no se cuentan en `toVisa` ni `toSign`). */
|
|
240
|
+
batches: { toVisa: number; toSign: number };
|
|
99
241
|
created: {
|
|
100
242
|
drafted: number;
|
|
101
243
|
inProgress: number;
|
|
102
244
|
rejected: number;
|
|
103
245
|
finished: number;
|
|
104
246
|
};
|
|
247
|
+
// Su bandeja de recibidos: sin abrir, sin atender y, de estos, con el plazo vencido.
|
|
248
|
+
received: {
|
|
249
|
+
unread: number;
|
|
250
|
+
pending: number;
|
|
251
|
+
overdue: number;
|
|
252
|
+
};
|
|
105
253
|
}
|
|
106
254
|
|
|
107
255
|
export interface DocumentCreateResponseEntity {
|
|
@@ -120,7 +268,130 @@ export interface DocumentReviewResponseEntity {
|
|
|
120
268
|
status: DocumentEntity['status'];
|
|
121
269
|
}
|
|
122
270
|
|
|
271
|
+
/** Resultado de un documento en una firma de varios documentos. */
|
|
272
|
+
export interface DocumentSignManyResultEntity {
|
|
273
|
+
id: DocumentEntity['id'];
|
|
274
|
+
ok: boolean;
|
|
275
|
+
/** Estado en que quedó, si se firmó. */
|
|
276
|
+
status?: DocumentEntity['status'];
|
|
277
|
+
/** Por qué no se firmó. */
|
|
278
|
+
message?: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Firma de varios documentos con un solo OTP. FirmaGob admite 5 MB por solicitud: los que no cupieron quedan en
|
|
283
|
+
* `remaining`, en el turno del firmante, para firmarlos con un OTP nuevo.
|
|
284
|
+
*/
|
|
285
|
+
export interface DocumentSignManyResponseEntity {
|
|
286
|
+
results: DocumentSignManyResultEntity[];
|
|
287
|
+
signed: number;
|
|
288
|
+
failed: number;
|
|
289
|
+
remaining: DocumentEntity['id'][];
|
|
290
|
+
/** FirmaGob avisó que el OTP venció antes de firmar todos los documentos de la solicitud. */
|
|
291
|
+
otpExpired: boolean;
|
|
292
|
+
}
|
|
293
|
+
|
|
123
294
|
export interface DocumentDiscardResponseEntity {
|
|
124
295
|
id: DocumentEntity['id'];
|
|
125
296
|
ok: boolean;
|
|
126
297
|
}
|
|
298
|
+
|
|
299
|
+
export interface DocumentAnnulResponseEntity {
|
|
300
|
+
id: DocumentEntity['id'];
|
|
301
|
+
ok: boolean;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Qué se le dice a quien comprueba un documento con su código, sin sesión:
|
|
306
|
+
* - `Finished`: es un documento oficial vigente;
|
|
307
|
+
* - `Annulled`: lo fue, pero quedó sin efecto;
|
|
308
|
+
* - `InProgress`: todavía se está firmando, así que la copia que tiene no es el documento oficial.
|
|
309
|
+
*/
|
|
310
|
+
export type DocumentVerificationState = 'Finished' | 'Annulled' | 'InProgress';
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Respuesta pública de la verificación. Dice lo necesario para comprobar la autenticidad (tipo, número, fecha y
|
|
314
|
+
* quiénes firmaron); la materia y la descarga solo se entregan si el documento es de acceso público.
|
|
315
|
+
*/
|
|
316
|
+
export interface DocumentVerifyResponseEntity {
|
|
317
|
+
state: DocumentVerificationState;
|
|
318
|
+
verificationCode: string;
|
|
319
|
+
documentType: Pick<DocumentTypeSummaryEntity, 'name' | 'abbreviation'>;
|
|
320
|
+
correlative: DocumentEntity['correlative'];
|
|
321
|
+
correlativeYear: DocumentEntity['correlativeYear'];
|
|
322
|
+
numberedAt: DocumentEntity['numberedAt'];
|
|
323
|
+
finishedAt: DocumentEntity['finishedAt'];
|
|
324
|
+
annulledAt: DocumentEntity['annulledAt'];
|
|
325
|
+
// Quiénes firmaron (o deben firmar, si aún está en tramitación), en su orden.
|
|
326
|
+
signers: {
|
|
327
|
+
fullName: DocumentParticipantEntity['fullName'];
|
|
328
|
+
position: DocumentParticipantEntity['position'];
|
|
329
|
+
signedAt: DocumentParticipantEntity['resolvedAt'];
|
|
330
|
+
}[];
|
|
331
|
+
// Solo en documentos de acceso público y sin datos sensibles.
|
|
332
|
+
subject: DocumentEntity['subject'] | null;
|
|
333
|
+
canDownload: boolean;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** Archivo de un documento público, para que el gateway lo entregue a quien lo verifica. */
|
|
337
|
+
export interface DocumentPublicFileResponseEntity {
|
|
338
|
+
fileId: string;
|
|
339
|
+
fileName: string;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export interface DocumentDeriveResponseEntity {
|
|
343
|
+
id: DocumentEntity['id'];
|
|
344
|
+
ok: boolean;
|
|
345
|
+
// A cuántos funcionarios llegó la derivación.
|
|
346
|
+
delivered: number;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface DocumentCloseDeliveryResponseEntity {
|
|
350
|
+
id: DocumentDeliveryEntity['id'];
|
|
351
|
+
ok: boolean;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface DocumentReassignResponseEntity {
|
|
355
|
+
id: DocumentEntity['id'];
|
|
356
|
+
ok: boolean;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Un plazo en la agenda de un funcionario: lo que recibió (como destinatario o por derivación) y debe atender, o un
|
|
361
|
+
* documento que envió y del que espera respuesta.
|
|
362
|
+
*/
|
|
363
|
+
export interface DocumentAgendaItemEntity {
|
|
364
|
+
kind: 'Received' | 'Sent';
|
|
365
|
+
/** La entrega (lo recibido) o el documento (lo enviado). */
|
|
366
|
+
id: string;
|
|
367
|
+
documentId: DocumentEntity['id'];
|
|
368
|
+
subject: DocumentEntity['subject'];
|
|
369
|
+
documentType: { name: string; abbreviation: string | null };
|
|
370
|
+
correlative: DocumentEntity['correlative'];
|
|
371
|
+
correlativeYear: DocumentEntity['correlativeYear'];
|
|
372
|
+
intakeNumber: DocumentEntity['intakeNumber'];
|
|
373
|
+
intakeYear: DocumentEntity['intakeYear'];
|
|
374
|
+
/** Plazo, en ISO 8601. */
|
|
375
|
+
dueAt: string;
|
|
376
|
+
/** Lo recibido: cuándo lo marcó como atendido (sin valor si sigue pendiente). */
|
|
377
|
+
closedAt: string | null;
|
|
378
|
+
/** Lo recibido: la providencia y quién lo derivó. */
|
|
379
|
+
instruction: DocumentDeliveryEntity['instruction'] | null;
|
|
380
|
+
sentByFullName: string | null;
|
|
381
|
+
/** Lo enviado: a cuántos les llegó y cuántos aún no lo atienden. */
|
|
382
|
+
recipients: { total: number; pending: number } | null;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface DocumentAgendaResponseEntity {
|
|
386
|
+
/** Plazos dentro del período pedido. */
|
|
387
|
+
items: DocumentAgendaItemEntity[];
|
|
388
|
+
/** Lo recibido con el plazo vencido y sin atender, de cualquier fecha (los 50 más antiguos). */
|
|
389
|
+
overdue: DocumentAgendaItemEntity[];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/** Trazabilidad de un documento en PDF, lista para descargar. */
|
|
393
|
+
export interface DocumentTrailExportEntity {
|
|
394
|
+
fileName: string;
|
|
395
|
+
contentType: string;
|
|
396
|
+
contentBase64: string;
|
|
397
|
+
}
|
|
@@ -1,4 +1,17 @@
|
|
|
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
|
+
}
|
|
2
15
|
|
|
3
16
|
export interface DocumentTypeGetAllResponseEntity {
|
|
4
17
|
id: DocumentTypeEntity['id'];
|
|
@@ -9,14 +22,20 @@ export interface DocumentTypeGetAllResponseEntity {
|
|
|
9
22
|
nextCorrelative: DocumentTypeEntity['nextCorrelative'];
|
|
10
23
|
correlativeYear: DocumentTypeEntity['correlativeYear'];
|
|
11
24
|
resetsYearly: DocumentTypeEntity['resetsYearly'];
|
|
25
|
+
// Sin numeración, sus documentos solo llevan fecha, código de verificación y QR.
|
|
26
|
+
numbered: DocumentTypeEntity['numbered'];
|
|
12
27
|
directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
|
|
13
28
|
enabled: DocumentTypeEntity['enabled'];
|
|
29
|
+
// Cuántos visadores y firmantes tiene su flujo sugerido.
|
|
30
|
+
flow: { visa: number; signature: number };
|
|
14
31
|
}
|
|
15
32
|
|
|
16
33
|
export interface DocumentTypeGetByIdResponseEntity extends DocumentTypeGetAllResponseEntity {
|
|
17
34
|
// Último número ya asignado en el año vigente del correlativo (null si aún no se numera ninguno): el próximo
|
|
18
35
|
// correlativo no puede quedar por debajo de él.
|
|
19
36
|
lastCorrelative: number | null;
|
|
37
|
+
// Flujo sugerido: primero los visadores y después los firmantes, cada grupo en su orden.
|
|
38
|
+
flowSteps: DocumentTypeFlowStepResponseEntity[];
|
|
20
39
|
}
|
|
21
40
|
|
|
22
41
|
export interface DocumentTypeCreateResponseEntity {
|
package/src/entities/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './partsOffice.entity';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type DocumentDispatchResponseEntity,
|
|
3
|
+
type DocumentExternalRecipientResponseEntity,
|
|
4
|
+
type DocumentLinkEntity,
|
|
5
|
+
} from '../document';
|
|
6
|
+
|
|
7
|
+
/** Institución del Estado en DocDigital. */
|
|
8
|
+
export interface DocDigitalEntityEntity {
|
|
9
|
+
id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
/** Organismo al que pertenece (la entidad padre). */
|
|
12
|
+
organism: string | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Usuario habilitado de una institución en DocDigital. */
|
|
16
|
+
export interface DocDigitalUserEntity {
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
position: string | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface DocDigitalDocumentTypeEntity {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Si DocDigital está configurado en el gestor y cada cuánto se revisa lo recibido. */
|
|
28
|
+
export interface PartsOfficeStatusEntity {
|
|
29
|
+
configured: boolean;
|
|
30
|
+
syncMinutes: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Totales del Panel de Partes. */
|
|
34
|
+
export interface PartsOfficeSummaryEntity {
|
|
35
|
+
toDispatch: number;
|
|
36
|
+
received: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Documento firmado que va a otras instituciones: lo despacha Oficina de Partes. */
|
|
40
|
+
export interface PartsOfficeDispatchEntity extends DocumentDispatchResponseEntity {
|
|
41
|
+
document: DocumentLinkEntity & { accessLevel: string };
|
|
42
|
+
externalRecipients: DocumentExternalRecipientResponseEntity[];
|
|
43
|
+
createdAt: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Documento que llegó por DocDigital. */
|
|
47
|
+
export interface PartsOfficeInboundEntity {
|
|
48
|
+
id: string;
|
|
49
|
+
docDigitalDocumentId: string;
|
|
50
|
+
status: 'Pending' | 'Registered' | 'Returned';
|
|
51
|
+
subject: string;
|
|
52
|
+
description: string | null;
|
|
53
|
+
folio: string | null;
|
|
54
|
+
folioDate: string | null;
|
|
55
|
+
typeName: string | null;
|
|
56
|
+
reserved: boolean;
|
|
57
|
+
senderEntityName: string | null;
|
|
58
|
+
senderName: string | null;
|
|
59
|
+
senderPosition: string | null;
|
|
60
|
+
fileName: string | null;
|
|
61
|
+
hasFile: boolean;
|
|
62
|
+
attachments: { name: string; url: string | null; hasFile: boolean }[];
|
|
63
|
+
createdAt: string;
|
|
64
|
+
registeredAt: string | null;
|
|
65
|
+
registeredByFullName: string | null;
|
|
66
|
+
acknowledgedAt: string | null;
|
|
67
|
+
acknowledgeError: string | null;
|
|
68
|
+
returnedAt: string | null;
|
|
69
|
+
returnedByFullName: string | null;
|
|
70
|
+
returnReason: string | null;
|
|
71
|
+
/** El documento con que quedó ingresado al gestor. */
|
|
72
|
+
document: { id: string; intakeNumber: number | null; intakeYear: number | null } | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface PartsOfficeOkResponseEntity {
|
|
76
|
+
id: string;
|
|
77
|
+
ok: boolean;
|
|
78
|
+
/** Documento al que corresponde el despacho (al despachar o devolver). */
|
|
79
|
+
documentId?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface PartsOfficeSyncResponseEntity {
|
|
83
|
+
/** Recibidos nuevos que se trajeron. */
|
|
84
|
+
created: number;
|
|
85
|
+
/** Los que no se pudieron traer (se reintentan en la próxima revisión). */
|
|
86
|
+
failed: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface PartsOfficeRegisterResponseEntity {
|
|
90
|
+
id: string;
|
|
91
|
+
documentId: string;
|
|
92
|
+
intakeNumber: number;
|
|
93
|
+
intakeYear: number;
|
|
94
|
+
/** `false` si DocDigital no aceptó el acuse de recibo: se puede reintentar. */
|
|
95
|
+
acknowledged: boolean;
|
|
96
|
+
ok: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Archivo de un recibido, ya copiado al gestor. */
|
|
100
|
+
export interface PartsOfficeFileEntity {
|
|
101
|
+
fileId: string;
|
|
102
|
+
fileName: string;
|
|
103
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './procedure.entity';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ProcedureEntity } from '../../base/entities';
|
|
2
|
+
|
|
3
|
+
export interface ProcedureGetAllResponseEntity {
|
|
4
|
+
id: ProcedureEntity['id'];
|
|
5
|
+
name: ProcedureEntity['name'];
|
|
6
|
+
cpatId: ProcedureEntity['cpatId'];
|
|
7
|
+
cpatCode: ProcedureEntity['cpatCode'];
|
|
8
|
+
description: ProcedureEntity['description'];
|
|
9
|
+
enabled: ProcedureEntity['enabled'];
|
|
10
|
+
/** Cuántos expedientes pertenecen a este procedimiento. */
|
|
11
|
+
caseFiles: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type ProcedureGetByIdResponseEntity = ProcedureGetAllResponseEntity;
|
|
15
|
+
|
|
16
|
+
export interface ProcedureCreateResponseEntity {
|
|
17
|
+
id: ProcedureEntity['id'];
|
|
18
|
+
ok: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ProcedureUpdateResponseEntity {
|
|
22
|
+
id: ProcedureEntity['id'];
|
|
23
|
+
ok: boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './registerBook.entity';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Libro de registro: el de un tipo documental (sus números) o el de ingresos de Oficina de Partes. */
|
|
2
|
+
export type RegisterBookKind = 'documentType' | 'intake';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Estado de un número en el libro: vigente, en tramitación (numerado con la primera firma, aún sin todas las firmas),
|
|
6
|
+
* documento anulado, número anulado por un rechazo, o número sin registro en el gestor (un salto en la numeración).
|
|
7
|
+
*/
|
|
8
|
+
export type RegisterBookRowState = 'Valid' | 'InProgress' | 'Annulled' | 'NumberAnnulled' | 'Unused';
|
|
9
|
+
|
|
10
|
+
export interface RegisterBookRowEntity {
|
|
11
|
+
number: number;
|
|
12
|
+
/** Fecha del número (o del ingreso), en ISO 8601. `null` en un salto. */
|
|
13
|
+
date: string | null;
|
|
14
|
+
state: RegisterBookRowState;
|
|
15
|
+
documentId: string | null;
|
|
16
|
+
subject: string | null;
|
|
17
|
+
/** Quién redactó el documento (o, en el libro de ingresos, quién lo ingresó). */
|
|
18
|
+
author: string | null;
|
|
19
|
+
signers: string[];
|
|
20
|
+
/** Libro de ingresos: institución que lo envió y su folio. */
|
|
21
|
+
sender: string | null;
|
|
22
|
+
externalFolio: string | null;
|
|
23
|
+
/** Libro de ingresos: a quiénes se derivó. */
|
|
24
|
+
recipients: string[];
|
|
25
|
+
/** Despacho por DocDigital: «DocDigital N° 777001 · 14-10-2026». */
|
|
26
|
+
dispatch: string | null;
|
|
27
|
+
/** Motivo de la anulación (del documento o del número). */
|
|
28
|
+
observation: string | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface RegisterBookEntity {
|
|
32
|
+
kind: RegisterBookKind;
|
|
33
|
+
/** «Decreto alcaldicio exento» o «Ingresos de Oficina de Partes». */
|
|
34
|
+
title: string;
|
|
35
|
+
year: number;
|
|
36
|
+
month: number | null;
|
|
37
|
+
rows: RegisterBookRowEntity[];
|
|
38
|
+
totals: Record<RegisterBookRowState, number>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Libro exportado, listo para descargar. */
|
|
42
|
+
export interface RegisterBookExportEntity {
|
|
43
|
+
fileName: string;
|
|
44
|
+
contentType: string;
|
|
45
|
+
contentBase64: string;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './signatureBatch.entity';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type DocumentAccessLevel,
|
|
3
|
+
type DocumentEntity,
|
|
4
|
+
type DocumentParticipantRole,
|
|
5
|
+
type DocumentStatus,
|
|
6
|
+
type SignatureBatchEntity,
|
|
7
|
+
} from '../../base/entities';
|
|
8
|
+
import { type DocumentSignManyResponseEntity, type DocumentSignManyResultEntity } from '../document';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Estado de un lote, deducido del de sus documentos: en tramitación mientras alguno lo esté; devuelto si no queda
|
|
12
|
+
* ninguno en tramitación y alguno volvió a su redactor; finalizado si todos terminaron (o se anularon después).
|
|
13
|
+
*/
|
|
14
|
+
export type SignatureBatchStatus = 'InProgress' | 'Returned' | 'Finished';
|
|
15
|
+
|
|
16
|
+
/** Lista de lotes: los que esperan al funcionario, los que redactó o todos en que participa. */
|
|
17
|
+
export type SignatureBatchTab = 'pending' | 'created' | 'participated';
|
|
18
|
+
|
|
19
|
+
/** Cuántos documentos del lote hay en cada situación. */
|
|
20
|
+
export interface SignatureBatchCountsEntity {
|
|
21
|
+
total: number;
|
|
22
|
+
inProgress: number;
|
|
23
|
+
finished: number;
|
|
24
|
+
/** Devueltos a su redactor (rechazados), para corregirlos y reenviarlos. */
|
|
25
|
+
returned: number;
|
|
26
|
+
annulled: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SignatureBatchGetAllResponseEntity {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
documentType: { id: string; name: string };
|
|
33
|
+
createdByEmployeeId: string;
|
|
34
|
+
createdByFullName: string;
|
|
35
|
+
createdAt: SignatureBatchEntity['createdAt'];
|
|
36
|
+
status: SignatureBatchStatus;
|
|
37
|
+
counts: SignatureBatchCountsEntity;
|
|
38
|
+
/** Documentos del lote que esperan al funcionario que consulta, por rol. */
|
|
39
|
+
myPending: { visa: number; signature: number };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Un documento del lote, con su turno vigente. */
|
|
43
|
+
export interface SignatureBatchDocumentEntity {
|
|
44
|
+
id: string;
|
|
45
|
+
subject: string;
|
|
46
|
+
status: DocumentStatus;
|
|
47
|
+
correlative: number | null;
|
|
48
|
+
correlativeYear: number | null;
|
|
49
|
+
numberedAt: DocumentEntity['numberedAt'];
|
|
50
|
+
verificationCode: string | null;
|
|
51
|
+
originalFileName: string;
|
|
52
|
+
currentTurn: { employeeId: string; fullName: string; role: DocumentParticipantRole } | null;
|
|
53
|
+
/** Si el turno vigente es del funcionario que consulta, qué le toca hacer. */
|
|
54
|
+
myTurn: DocumentParticipantRole | null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface SignatureBatchGetByIdResponseEntity extends SignatureBatchGetAllResponseEntity {
|
|
58
|
+
documentType: { id: string; name: string; abbreviation: string | null; numbered: boolean };
|
|
59
|
+
keywords: string[];
|
|
60
|
+
accessLevel: DocumentAccessLevel;
|
|
61
|
+
hasSensitiveData: boolean;
|
|
62
|
+
/** Visadores y firmantes del lote, en orden (los del primer documento: todos parten con el mismo flujo). */
|
|
63
|
+
flow: {
|
|
64
|
+
role: DocumentParticipantRole;
|
|
65
|
+
stage: number;
|
|
66
|
+
employeeId: string;
|
|
67
|
+
fullName: string;
|
|
68
|
+
position: string | null;
|
|
69
|
+
}[];
|
|
70
|
+
documents: SignatureBatchDocumentEntity[];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A quién le quedó el turno después de una operación sobre el lote: para avisarle una sola vez por lote. */
|
|
74
|
+
export interface SignatureBatchTurnEntity {
|
|
75
|
+
employeeId: string;
|
|
76
|
+
fullName: string;
|
|
77
|
+
role: DocumentParticipantRole;
|
|
78
|
+
count: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Lo que el gateway necesita para avisar: el lote, su redactor, a quién le toca ahora y cuántos terminaron. */
|
|
82
|
+
export interface SignatureBatchOutcomeEntity {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
createdByEmployeeId: string;
|
|
86
|
+
nextTurns: SignatureBatchTurnEntity[];
|
|
87
|
+
/** Documentos que quedaron finalizados con esta operación. */
|
|
88
|
+
finished: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface SignatureBatchCreateResponseEntity extends SignatureBatchOutcomeEntity {
|
|
92
|
+
ok: boolean;
|
|
93
|
+
documentIds: string[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface SignatureBatchVisaResponseEntity extends SignatureBatchOutcomeEntity {
|
|
97
|
+
ok: boolean;
|
|
98
|
+
visaed: number;
|
|
99
|
+
/** Los que no se pudieron visar, con el motivo. */
|
|
100
|
+
failures: DocumentSignManyResultEntity[];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type SignatureBatchSignResponseEntity = SignatureBatchOutcomeEntity & DocumentSignManyResponseEntity;
|
|
104
|
+
|
|
105
|
+
export interface SignatureBatchRejectResponseEntity extends SignatureBatchOutcomeEntity {
|
|
106
|
+
ok: boolean;
|
|
107
|
+
/** Documentos devueltos a su redactor. */
|
|
108
|
+
rejected: number;
|
|
109
|
+
observation: string;
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './workFolder.entity';
|