@muni-sanfer/types-gestor-documental 0.0.1-beta.38 → 0.0.1-beta.39
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 +32 -1
- package/dist/base/entities.js +12 -2
- package/dist/contracts/document.contract.d.ts +24 -2
- package/dist/contracts/document.contract.js +2 -0
- package/dist/contracts/documentType.contract.d.ts +2 -0
- package/dist/contracts/index.d.ts +2 -0
- package/dist/entities/document/document.entity.d.ts +48 -1
- package/dist/entities/documentType/documentType.entity.d.ts +2 -0
- package/package.json +1 -1
- package/src/base/entities.ts +39 -1
- package/src/contracts/document.contract.ts +21 -0
- package/src/contracts/documentType.contract.ts +4 -0
- package/src/entities/document/document.entity.ts +48 -1
- package/src/entities/documentType/documentType.entity.ts +3 -0
package/dist/base/entities.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare const DocumentParticipantStatus: {
|
|
|
33
33
|
Resolved: "Resolved";
|
|
34
34
|
Rejected: "Rejected";
|
|
35
35
|
};
|
|
36
|
-
export type DocumentTrackingAction = 'Created' | 'Updated' | 'Submitted' | 'Visaed' | 'Signed' | 'Rejected' | 'Finished' | 'Discarded' | 'Numbered' | 'NumberAnnulled' | 'Annulled' | 'Delivered' | 'Derived' | 'Reassigned' | 'Dispatched' | 'DispatchReturned' | 'DispatchedByContingency' | 'Received' | 'EmailCopySent' | 'EmailCopyOpened' | 'DispositionRecorded' | 'TransparencyRedacted' | 'TransparencyPublished' | 'TransparencyExcluded' | 'TransparencyWithdrawn';
|
|
36
|
+
export type DocumentTrackingAction = 'Created' | 'Updated' | 'Submitted' | 'Visaed' | 'Signed' | 'Rejected' | 'Finished' | 'Discarded' | 'Numbered' | 'NumberAnnulled' | 'Annulled' | 'Delivered' | 'Derived' | 'Reassigned' | 'Dispatched' | 'DispatchReturned' | 'DispatchedByContingency' | 'Received' | 'EmailCopySent' | 'EmailCopyOpened' | 'DispositionRecorded' | 'TransparencyRedacted' | 'TransparencyPublished' | 'TransparencyExcluded' | 'TransparencyWithdrawn' | 'DraftReviewRequested' | 'DraftReviewApproved' | 'DraftReviewRejected' | 'DraftReviewCancelled';
|
|
37
37
|
export declare const DocumentTrackingAction: {
|
|
38
38
|
Created: "Created";
|
|
39
39
|
Updated: "Updated";
|
|
@@ -60,6 +60,17 @@ export declare const DocumentTrackingAction: {
|
|
|
60
60
|
TransparencyPublished: "TransparencyPublished";
|
|
61
61
|
TransparencyExcluded: "TransparencyExcluded";
|
|
62
62
|
TransparencyWithdrawn: "TransparencyWithdrawn";
|
|
63
|
+
DraftReviewRequested: "DraftReviewRequested";
|
|
64
|
+
DraftReviewApproved: "DraftReviewApproved";
|
|
65
|
+
DraftReviewRejected: "DraftReviewRejected";
|
|
66
|
+
DraftReviewCancelled: "DraftReviewCancelled";
|
|
67
|
+
};
|
|
68
|
+
export type DraftReviewStatus = 'Pending' | 'Approved' | 'Rejected' | 'Cancelled';
|
|
69
|
+
export declare const DraftReviewStatus: {
|
|
70
|
+
Pending: "Pending";
|
|
71
|
+
Approved: "Approved";
|
|
72
|
+
Rejected: "Rejected";
|
|
73
|
+
Cancelled: "Cancelled";
|
|
63
74
|
};
|
|
64
75
|
export type DocumentOrigin = 'Internal' | 'DocDigital' | 'Manual';
|
|
65
76
|
export declare const DocumentOrigin: {
|
|
@@ -407,6 +418,8 @@ export interface DocumentTypeEntity {
|
|
|
407
418
|
activeTransparency: boolean;
|
|
408
419
|
transparencySection?: string | null;
|
|
409
420
|
directorateCodeReference?: number | null;
|
|
421
|
+
draftReviewDirectorateCode?: number | null;
|
|
422
|
+
draftReviewDirectorateName?: string | null;
|
|
410
423
|
archivalSeries?: ArchivalSeriesEntity | null;
|
|
411
424
|
archivalSeriesId?: string | null;
|
|
412
425
|
issuingEntity?: IssuingEntityEntity | null;
|
|
@@ -491,6 +504,7 @@ export interface DocumentEntity {
|
|
|
491
504
|
dataRightsResponses?: DataRightsRequestEntity[];
|
|
492
505
|
versions?: DocumentVersionEntity[];
|
|
493
506
|
comments?: DocumentCommentEntity[];
|
|
507
|
+
draftReviews?: DocumentDraftReviewEntity[];
|
|
494
508
|
accessRequestDeliveries?: AccessRequestDocumentEntity[];
|
|
495
509
|
dispatch?: DocumentDispatchEntity | null;
|
|
496
510
|
docDigitalInbound?: DocDigitalInboundEntity | null;
|
|
@@ -902,6 +916,23 @@ export interface DocumentTemplateEntity {
|
|
|
902
916
|
createdAt: string;
|
|
903
917
|
updatedAt: string;
|
|
904
918
|
}
|
|
919
|
+
export interface DocumentDraftReviewEntity {
|
|
920
|
+
id: string;
|
|
921
|
+
documentId: string;
|
|
922
|
+
document?: DocumentEntity;
|
|
923
|
+
round: number;
|
|
924
|
+
versionNumber: number;
|
|
925
|
+
directorateCodeReference: number;
|
|
926
|
+
directorateName: string;
|
|
927
|
+
reviewerEmployeeId: string;
|
|
928
|
+
reviewerFullName: string;
|
|
929
|
+
requestedByEmployeeId: string;
|
|
930
|
+
requestedByFullName: string;
|
|
931
|
+
requestedAt: string;
|
|
932
|
+
status: DraftReviewStatus;
|
|
933
|
+
observation?: string | null;
|
|
934
|
+
resolvedAt?: string | null;
|
|
935
|
+
}
|
|
905
936
|
export interface DocumentTemplateVersionEntity {
|
|
906
937
|
id: string;
|
|
907
938
|
templateId: string;
|
package/dist/base/entities.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by prisma-generator-typescript-interfaces
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.MailAuthentication = exports.MailIntakeStatus = void 0;
|
|
4
|
+
exports.DeskFileSource = exports.DataBreachNoticeMeans = exports.DataBreachEventAction = exports.DataBreachStatus = exports.DataBreachKind = exports.DataRightsEventAction = exports.DataRightsResolution = exports.DataRightsRequestStatus = exports.DataRightsChannel = exports.DataRight = exports.DataLegalBasis = exports.TransparencyStatus = exports.AccessRequestEventAction = exports.AccessRequestResolution = exports.AccessRequestStatus = exports.AccessRequestChannel = exports.DispositionKind = exports.FinalDisposition = exports.AuditAction = exports.AuditEntity = exports.DocumentAccessAction = exports.QualityMetricKey = exports.ServiceOutageKind = exports.WorkFolderItemKind = exports.TextSnippetSection = exports.ScanSessionStatus = exports.CaseFileAccessAction = exports.CaseFileTrackingAction = exports.CaseFileActorType = exports.CaseFileActorRelation = exports.CaseFileEntryKind = exports.CaseFileActuationType = exports.CaseFileIncorporationMechanism = exports.CaseFileStatus = exports.DocumentInstruction = exports.DocumentDeliveryOrigin = exports.DocumentRecipientType = exports.DocumentAttachmentType = exports.DocumentFlowStepType = exports.DocDigitalInboundStatus = exports.DocumentDispatchStatus = exports.CommunicationMeans = exports.DocumentOrigin = exports.DraftReviewStatus = exports.DocumentTrackingAction = exports.DocumentParticipantStatus = exports.DocumentParticipantRole = exports.DocumentAccessLevel = exports.DocumentStatus = exports.DocumentCategory = void 0;
|
|
5
|
+
exports.MailAuthentication = exports.MailIntakeStatus = exports.DeskFileTarget = void 0;
|
|
6
6
|
exports.DocumentCategory = {
|
|
7
7
|
Decree: 'Decree',
|
|
8
8
|
Communication: 'Communication',
|
|
@@ -59,6 +59,16 @@ exports.DocumentTrackingAction = {
|
|
|
59
59
|
TransparencyPublished: 'TransparencyPublished',
|
|
60
60
|
TransparencyExcluded: 'TransparencyExcluded',
|
|
61
61
|
TransparencyWithdrawn: 'TransparencyWithdrawn',
|
|
62
|
+
DraftReviewRequested: 'DraftReviewRequested',
|
|
63
|
+
DraftReviewApproved: 'DraftReviewApproved',
|
|
64
|
+
DraftReviewRejected: 'DraftReviewRejected',
|
|
65
|
+
DraftReviewCancelled: 'DraftReviewCancelled',
|
|
66
|
+
};
|
|
67
|
+
exports.DraftReviewStatus = {
|
|
68
|
+
Pending: 'Pending',
|
|
69
|
+
Approved: 'Approved',
|
|
70
|
+
Rejected: 'Rejected',
|
|
71
|
+
Cancelled: 'Cancelled',
|
|
62
72
|
};
|
|
63
73
|
exports.DocumentOrigin = {
|
|
64
74
|
Internal: 'Internal',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DocumentAccessAction, type DocumentAccessLevel, type DocumentAttachmentEntity, type DocumentDeliveryEntity, type DocumentEntity, type DocumentInstruction, type DocumentParticipantEntity, type DocumentStatus } from '../base/entities';
|
|
2
|
-
import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentEmailCopyIssuedEntity, type DocumentEmailCopyViewEntity, type DocumentReminderEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentComposeResponseEntity, type DocumentComposition, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity, type DocumentCommentResponseEntity, type DocumentCommentsResponseEntity, type DocumentVersionResponseEntity } from '../entities';
|
|
2
|
+
import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentEmailCopyIssuedEntity, type DocumentEmailCopyViewEntity, type DocumentReminderEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentComposeResponseEntity, type DocumentComposition, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity, type DocumentCommentResponseEntity, type DocumentCommentsResponseEntity, type DocumentVersionResponseEntity, type DocumentDraftReviewResponseEntity } from '../entities';
|
|
3
3
|
import { type RpcPage } from './contract';
|
|
4
4
|
/** Patrones NATS de `document`: `<servicio>.<recurso>.<acción>`. */
|
|
5
5
|
export declare const DocumentPatterns: {
|
|
@@ -12,6 +12,8 @@ export declare const DocumentPatterns: {
|
|
|
12
12
|
readonly review: "gestorDocumental.document.review";
|
|
13
13
|
readonly signMany: "gestorDocumental.document.signMany";
|
|
14
14
|
readonly reassign: "gestorDocumental.document.reassign";
|
|
15
|
+
readonly requestDraftReview: "gestorDocumental.document.requestDraftReview";
|
|
16
|
+
readonly resolveDraftReview: "gestorDocumental.document.resolveDraftReview";
|
|
15
17
|
readonly discard: "gestorDocumental.document.discard";
|
|
16
18
|
readonly annul: "gestorDocumental.document.annul";
|
|
17
19
|
readonly derive: "gestorDocumental.document.derive";
|
|
@@ -42,7 +44,7 @@ export interface DocumentActor {
|
|
|
42
44
|
departmentIds: string[];
|
|
43
45
|
}
|
|
44
46
|
/** Bandeja desde la que se lista. Todas son del funcionario (`actor`), salvo `all`. */
|
|
45
|
-
export type DocumentBucket = 'created' | 'sent' | 'toVisa' | 'toSign' | 'participated' | 'all';
|
|
47
|
+
export type DocumentBucket = 'created' | 'sent' | 'toVisa' | 'toSign' | 'participated' | 'toReview' | 'all';
|
|
46
48
|
/**
|
|
47
49
|
* Destinatario de un documento o de una derivación: una persona o un área completa. El gateway resuelve el nombre del
|
|
48
50
|
* área y quiénes la integran hoy; el navegador solo indica cuál es.
|
|
@@ -256,6 +258,26 @@ export interface DocumentContract {
|
|
|
256
258
|
* Pasa un turno pendiente (de visación o de firma) a otro funcionario, por ausencia o por error, y lo deja en la
|
|
257
259
|
* trazabilidad con su motivo. Puede hacerlo quien redactó el documento; con `anyDocument`, quien lleva el registro.
|
|
258
260
|
*/
|
|
261
|
+
/** El redactor pide la revisión del borrador; el gateway resuelve quién dirige hoy la dirección revisora. */
|
|
262
|
+
[DocumentPatterns.requestDraftReview]: {
|
|
263
|
+
payload: Pick<DocumentEntity, 'id'> & {
|
|
264
|
+
reviewer: {
|
|
265
|
+
employeeId: string;
|
|
266
|
+
fullName: string;
|
|
267
|
+
};
|
|
268
|
+
actor: DocumentActor;
|
|
269
|
+
};
|
|
270
|
+
response: DocumentDraftReviewResponseEntity;
|
|
271
|
+
};
|
|
272
|
+
/** La jefatura revisora aprueba o devuelve (con observaciones); el redactor puede retirar la solicitud. */
|
|
273
|
+
[DocumentPatterns.resolveDraftReview]: {
|
|
274
|
+
payload: Pick<DocumentEntity, 'id'> & {
|
|
275
|
+
decision: 'Approve' | 'Reject' | 'Cancel';
|
|
276
|
+
observation?: string | null;
|
|
277
|
+
actor: DocumentActor;
|
|
278
|
+
};
|
|
279
|
+
response: DocumentDraftReviewResponseEntity;
|
|
280
|
+
};
|
|
259
281
|
[DocumentPatterns.reassign]: {
|
|
260
282
|
payload: Pick<DocumentEntity, 'id'> & {
|
|
261
283
|
participantId: DocumentParticipantEntity['id'];
|
|
@@ -12,6 +12,8 @@ exports.DocumentPatterns = {
|
|
|
12
12
|
review: 'gestorDocumental.document.review',
|
|
13
13
|
signMany: 'gestorDocumental.document.signMany',
|
|
14
14
|
reassign: 'gestorDocumental.document.reassign',
|
|
15
|
+
requestDraftReview: 'gestorDocumental.document.requestDraftReview',
|
|
16
|
+
resolveDraftReview: 'gestorDocumental.document.resolveDraftReview',
|
|
15
17
|
discard: 'gestorDocumental.document.discard',
|
|
16
18
|
annul: 'gestorDocumental.document.annul',
|
|
17
19
|
derive: 'gestorDocumental.document.derive',
|
|
@@ -39,6 +39,8 @@ export interface DocumentTypeWritePayload {
|
|
|
39
39
|
activeTransparency?: boolean;
|
|
40
40
|
transparencySection?: string | null;
|
|
41
41
|
directorateCodeReference?: number | null;
|
|
42
|
+
draftReviewDirectorateCode?: number | null;
|
|
43
|
+
draftReviewDirectorateName?: string | null;
|
|
42
44
|
archivalSeriesId?: string | null;
|
|
43
45
|
issuingEntityId?: string | null;
|
|
44
46
|
sharesNumberingWithId?: string | null;
|
|
@@ -68,6 +68,8 @@ export declare const GestorDocumentalPatterns: {
|
|
|
68
68
|
readonly review: "gestorDocumental.document.review";
|
|
69
69
|
readonly signMany: "gestorDocumental.document.signMany";
|
|
70
70
|
readonly reassign: "gestorDocumental.document.reassign";
|
|
71
|
+
readonly requestDraftReview: "gestorDocumental.document.requestDraftReview";
|
|
72
|
+
readonly resolveDraftReview: "gestorDocumental.document.resolveDraftReview";
|
|
71
73
|
readonly discard: "gestorDocumental.document.discard";
|
|
72
74
|
readonly annul: "gestorDocumental.document.annul";
|
|
73
75
|
readonly derive: "gestorDocumental.document.derive";
|
|
@@ -181,6 +181,11 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
181
181
|
} | null;
|
|
182
182
|
/** Contenido redactado en el sistema con una plantilla, para volver a editarlo (sin valor si se subió un PDF). */
|
|
183
183
|
composition: DocumentComposition | null;
|
|
184
|
+
/**
|
|
185
|
+
* Revisión del borrador antes de enviarlo a tramitación, si su tipo la exige: qué dirección revisa, las rondas (la
|
|
186
|
+
* más reciente primero) y si la versión vigente ya está aprobada. `null` si el tipo no la exige.
|
|
187
|
+
*/
|
|
188
|
+
draftReview: DocumentDraftReviewInfoEntity | null;
|
|
184
189
|
replies: DocumentLinkEntity[];
|
|
185
190
|
/** Expedientes en que está incorporado y que quien consulta puede ver. */
|
|
186
191
|
caseFiles: {
|
|
@@ -227,6 +232,8 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
227
232
|
canReassign: boolean;
|
|
228
233
|
/** Quien consulta redactó el documento (o lo ingresó, si llegó por DocDigital). */
|
|
229
234
|
isAuthor: boolean;
|
|
235
|
+
/** Le toca aprobar o devolver el borrador: es la jefatura de la revisión pendiente. */
|
|
236
|
+
canResolveDraftReview: boolean;
|
|
230
237
|
inbox: DocumentDeliveryResponseEntity[];
|
|
231
238
|
};
|
|
232
239
|
signatureRequiresOtp: boolean;
|
|
@@ -235,6 +242,8 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
235
242
|
export interface DocumentGetSummaryResponseEntity {
|
|
236
243
|
toVisa: number;
|
|
237
244
|
toSign: number;
|
|
245
|
+
/** Borradores que esperan su revisión (como jefatura de la dirección que los revisa). */
|
|
246
|
+
toReview: number;
|
|
238
247
|
/** Lotes de firma con documentos en su turno (los documentos de un lote no se cuentan en `toVisa` ni `toSign`). */
|
|
239
248
|
batches: {
|
|
240
249
|
toVisa: number;
|
|
@@ -600,7 +609,8 @@ export interface DocumentCommentResponseEntity {
|
|
|
600
609
|
text: string;
|
|
601
610
|
authorEmployeeId: string;
|
|
602
611
|
authorFullName: string;
|
|
603
|
-
|
|
612
|
+
/** `Review`: la jefatura que revisa el borrador antes de enviarlo a tramitación. */
|
|
613
|
+
authorRole: 'Author' | 'Visa' | 'Signature' | 'Review';
|
|
604
614
|
createdAt: string;
|
|
605
615
|
resolvedAt: string | null;
|
|
606
616
|
resolvedByFullName: string | null;
|
|
@@ -614,3 +624,40 @@ export interface DocumentCommentsResponseEntity {
|
|
|
614
624
|
canComment: boolean;
|
|
615
625
|
currentVersion: number;
|
|
616
626
|
}
|
|
627
|
+
/** Una ronda de revisión del borrador. */
|
|
628
|
+
export interface DocumentDraftReviewRoundEntity {
|
|
629
|
+
id: string;
|
|
630
|
+
round: number;
|
|
631
|
+
/** Versión del borrador que se revisó. */
|
|
632
|
+
versionNumber: number;
|
|
633
|
+
directorateName: string;
|
|
634
|
+
reviewerEmployeeId: string;
|
|
635
|
+
reviewerFullName: string;
|
|
636
|
+
requestedByFullName: string;
|
|
637
|
+
requestedAt: string;
|
|
638
|
+
status: 'Pending' | 'Approved' | 'Rejected' | 'Cancelled';
|
|
639
|
+
observation: string | null;
|
|
640
|
+
resolvedAt: string | null;
|
|
641
|
+
}
|
|
642
|
+
/** La revisión del borrador que exige el tipo documental. */
|
|
643
|
+
export interface DocumentDraftReviewInfoEntity {
|
|
644
|
+
directorateCodeReference: number;
|
|
645
|
+
directorateName: string;
|
|
646
|
+
rounds: DocumentDraftReviewRoundEntity[];
|
|
647
|
+
/** La versión vigente del borrador está aprobada: se puede enviar a tramitación. */
|
|
648
|
+
approved: boolean;
|
|
649
|
+
/** Hay una ronda esperando respuesta: el borrador no se edita mientras tanto. */
|
|
650
|
+
pending: boolean;
|
|
651
|
+
}
|
|
652
|
+
/** Resultado de pedir, resolver o retirar una revisión del borrador. */
|
|
653
|
+
export interface DocumentDraftReviewResponseEntity {
|
|
654
|
+
id: string;
|
|
655
|
+
ok: boolean;
|
|
656
|
+
round: number;
|
|
657
|
+
status: DocumentDraftReviewRoundEntity['status'];
|
|
658
|
+
/** A quién avisar: la jefatura revisora (al pedirla) o el redactor (al resolverla). */
|
|
659
|
+
notify: {
|
|
660
|
+
employeeId: string;
|
|
661
|
+
fullName: string;
|
|
662
|
+
} | null;
|
|
663
|
+
}
|
|
@@ -25,6 +25,8 @@ export interface DocumentTypeGetAllResponseEntity {
|
|
|
25
25
|
activeTransparency: DocumentTypeEntity['activeTransparency'];
|
|
26
26
|
transparencySection: DocumentTypeEntity['transparencySection'];
|
|
27
27
|
directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
|
|
28
|
+
draftReviewDirectorateCode: DocumentTypeEntity['draftReviewDirectorateCode'];
|
|
29
|
+
draftReviewDirectorateName: DocumentTypeEntity['draftReviewDirectorateName'];
|
|
28
30
|
archivalSeries: {
|
|
29
31
|
id: string;
|
|
30
32
|
code: string;
|
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -71,7 +71,11 @@ export type DocumentTrackingAction =
|
|
|
71
71
|
| 'TransparencyRedacted'
|
|
72
72
|
| 'TransparencyPublished'
|
|
73
73
|
| 'TransparencyExcluded'
|
|
74
|
-
| 'TransparencyWithdrawn'
|
|
74
|
+
| 'TransparencyWithdrawn'
|
|
75
|
+
| 'DraftReviewRequested'
|
|
76
|
+
| 'DraftReviewApproved'
|
|
77
|
+
| 'DraftReviewRejected'
|
|
78
|
+
| 'DraftReviewCancelled';
|
|
75
79
|
|
|
76
80
|
export const DocumentTrackingAction = {
|
|
77
81
|
Created: 'Created',
|
|
@@ -99,8 +103,21 @@ export const DocumentTrackingAction = {
|
|
|
99
103
|
TransparencyPublished: 'TransparencyPublished',
|
|
100
104
|
TransparencyExcluded: 'TransparencyExcluded',
|
|
101
105
|
TransparencyWithdrawn: 'TransparencyWithdrawn',
|
|
106
|
+
DraftReviewRequested: 'DraftReviewRequested',
|
|
107
|
+
DraftReviewApproved: 'DraftReviewApproved',
|
|
108
|
+
DraftReviewRejected: 'DraftReviewRejected',
|
|
109
|
+
DraftReviewCancelled: 'DraftReviewCancelled',
|
|
102
110
|
} satisfies Record<string, DocumentTrackingAction>;
|
|
103
111
|
|
|
112
|
+
export type DraftReviewStatus = 'Pending' | 'Approved' | 'Rejected' | 'Cancelled';
|
|
113
|
+
|
|
114
|
+
export const DraftReviewStatus = {
|
|
115
|
+
Pending: 'Pending',
|
|
116
|
+
Approved: 'Approved',
|
|
117
|
+
Rejected: 'Rejected',
|
|
118
|
+
Cancelled: 'Cancelled',
|
|
119
|
+
} satisfies Record<string, DraftReviewStatus>;
|
|
120
|
+
|
|
104
121
|
export type DocumentOrigin = 'Internal' | 'DocDigital' | 'Manual';
|
|
105
122
|
|
|
106
123
|
export const DocumentOrigin = {
|
|
@@ -600,6 +617,8 @@ export interface DocumentTypeEntity {
|
|
|
600
617
|
activeTransparency: boolean;
|
|
601
618
|
transparencySection?: string | null;
|
|
602
619
|
directorateCodeReference?: number | null;
|
|
620
|
+
draftReviewDirectorateCode?: number | null;
|
|
621
|
+
draftReviewDirectorateName?: string | null;
|
|
603
622
|
archivalSeries?: ArchivalSeriesEntity | null;
|
|
604
623
|
archivalSeriesId?: string | null;
|
|
605
624
|
issuingEntity?: IssuingEntityEntity | null;
|
|
@@ -685,6 +704,7 @@ export interface DocumentEntity {
|
|
|
685
704
|
dataRightsResponses?: DataRightsRequestEntity[];
|
|
686
705
|
versions?: DocumentVersionEntity[];
|
|
687
706
|
comments?: DocumentCommentEntity[];
|
|
707
|
+
draftReviews?: DocumentDraftReviewEntity[];
|
|
688
708
|
accessRequestDeliveries?: AccessRequestDocumentEntity[];
|
|
689
709
|
dispatch?: DocumentDispatchEntity | null;
|
|
690
710
|
docDigitalInbound?: DocDigitalInboundEntity | null;
|
|
@@ -1123,6 +1143,24 @@ export interface DocumentTemplateEntity {
|
|
|
1123
1143
|
updatedAt: string;
|
|
1124
1144
|
}
|
|
1125
1145
|
|
|
1146
|
+
export interface DocumentDraftReviewEntity {
|
|
1147
|
+
id: string;
|
|
1148
|
+
documentId: string;
|
|
1149
|
+
document?: DocumentEntity;
|
|
1150
|
+
round: number;
|
|
1151
|
+
versionNumber: number;
|
|
1152
|
+
directorateCodeReference: number;
|
|
1153
|
+
directorateName: string;
|
|
1154
|
+
reviewerEmployeeId: string;
|
|
1155
|
+
reviewerFullName: string;
|
|
1156
|
+
requestedByEmployeeId: string;
|
|
1157
|
+
requestedByFullName: string;
|
|
1158
|
+
requestedAt: string;
|
|
1159
|
+
status: DraftReviewStatus;
|
|
1160
|
+
observation?: string | null;
|
|
1161
|
+
resolvedAt?: string | null;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1126
1164
|
export interface DocumentTemplateVersionEntity {
|
|
1127
1165
|
id: string;
|
|
1128
1166
|
templateId: string;
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
type DocumentCommentResponseEntity,
|
|
35
35
|
type DocumentCommentsResponseEntity,
|
|
36
36
|
type DocumentVersionResponseEntity,
|
|
37
|
+
type DocumentDraftReviewResponseEntity,
|
|
37
38
|
} from '../entities';
|
|
38
39
|
import { type RpcPage } from './contract';
|
|
39
40
|
|
|
@@ -48,6 +49,8 @@ export const DocumentPatterns = {
|
|
|
48
49
|
review: 'gestorDocumental.document.review',
|
|
49
50
|
signMany: 'gestorDocumental.document.signMany',
|
|
50
51
|
reassign: 'gestorDocumental.document.reassign',
|
|
52
|
+
requestDraftReview: 'gestorDocumental.document.requestDraftReview',
|
|
53
|
+
resolveDraftReview: 'gestorDocumental.document.resolveDraftReview',
|
|
51
54
|
discard: 'gestorDocumental.document.discard',
|
|
52
55
|
annul: 'gestorDocumental.document.annul',
|
|
53
56
|
derive: 'gestorDocumental.document.derive',
|
|
@@ -86,6 +89,7 @@ export type DocumentBucket =
|
|
|
86
89
|
| 'toVisa' // le toca visarlos
|
|
87
90
|
| 'toSign' // le toca firmarlos
|
|
88
91
|
| 'participated' // ya los visó, firmó o rechazó
|
|
92
|
+
| 'toReview' // borradores que le toca revisar como jefatura de la dirección revisora
|
|
89
93
|
| 'all'; // todos los que están en tramitación o finalizados (historial)
|
|
90
94
|
|
|
91
95
|
/**
|
|
@@ -286,6 +290,23 @@ export interface DocumentContract {
|
|
|
286
290
|
* Pasa un turno pendiente (de visación o de firma) a otro funcionario, por ausencia o por error, y lo deja en la
|
|
287
291
|
* trazabilidad con su motivo. Puede hacerlo quien redactó el documento; con `anyDocument`, quien lleva el registro.
|
|
288
292
|
*/
|
|
293
|
+
/** El redactor pide la revisión del borrador; el gateway resuelve quién dirige hoy la dirección revisora. */
|
|
294
|
+
[DocumentPatterns.requestDraftReview]: {
|
|
295
|
+
payload: Pick<DocumentEntity, 'id'> & {
|
|
296
|
+
reviewer: { employeeId: string; fullName: string };
|
|
297
|
+
actor: DocumentActor;
|
|
298
|
+
};
|
|
299
|
+
response: DocumentDraftReviewResponseEntity;
|
|
300
|
+
};
|
|
301
|
+
/** La jefatura revisora aprueba o devuelve (con observaciones); el redactor puede retirar la solicitud. */
|
|
302
|
+
[DocumentPatterns.resolveDraftReview]: {
|
|
303
|
+
payload: Pick<DocumentEntity, 'id'> & {
|
|
304
|
+
decision: 'Approve' | 'Reject' | 'Cancel';
|
|
305
|
+
observation?: string | null;
|
|
306
|
+
actor: DocumentActor;
|
|
307
|
+
};
|
|
308
|
+
response: DocumentDraftReviewResponseEntity;
|
|
309
|
+
};
|
|
289
310
|
[DocumentPatterns.reassign]: {
|
|
290
311
|
payload: Pick<DocumentEntity, 'id'> & {
|
|
291
312
|
participantId: DocumentParticipantEntity['id'];
|
|
@@ -44,6 +44,10 @@ export interface DocumentTypeWritePayload {
|
|
|
44
44
|
activeTransparency?: boolean;
|
|
45
45
|
transparencySection?: string | null;
|
|
46
46
|
directorateCodeReference?: number | null;
|
|
47
|
+
// Dirección cuya jefatura revisa los borradores antes de enviarlos (sin valor: sin revisión). El nombre lo pone el
|
|
48
|
+
// gateway desde caschile-ms.
|
|
49
|
+
draftReviewDirectorateCode?: number | null;
|
|
50
|
+
draftReviewDirectorateName?: string | null;
|
|
47
51
|
// Serie documental del Cuadro de Clasificación (sin valor: sin clasificar).
|
|
48
52
|
archivalSeriesId?: string | null;
|
|
49
53
|
// Entidad emisora (sin valor: la municipalidad).
|
|
@@ -212,6 +212,11 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
212
212
|
batch: { id: string; name: string } | null;
|
|
213
213
|
/** Contenido redactado en el sistema con una plantilla, para volver a editarlo (sin valor si se subió un PDF). */
|
|
214
214
|
composition: DocumentComposition | null;
|
|
215
|
+
/**
|
|
216
|
+
* Revisión del borrador antes de enviarlo a tramitación, si su tipo la exige: qué dirección revisa, las rondas (la
|
|
217
|
+
* más reciente primero) y si la versión vigente ya está aprobada. `null` si el tipo no la exige.
|
|
218
|
+
*/
|
|
219
|
+
draftReview: DocumentDraftReviewInfoEntity | null;
|
|
215
220
|
replies: DocumentLinkEntity[];
|
|
216
221
|
/** Expedientes en que está incorporado y que quien consulta puede ver. */
|
|
217
222
|
caseFiles: { id: string; code: string; title: string; status: 'Open' | 'Closed' }[];
|
|
@@ -259,6 +264,8 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
259
264
|
canReassign: boolean;
|
|
260
265
|
/** Quien consulta redactó el documento (o lo ingresó, si llegó por DocDigital). */
|
|
261
266
|
isAuthor: boolean;
|
|
267
|
+
/** Le toca aprobar o devolver el borrador: es la jefatura de la revisión pendiente. */
|
|
268
|
+
canResolveDraftReview: boolean;
|
|
262
269
|
// Sus propias entregas de este documento (puede tener más de una si además se lo derivaron).
|
|
263
270
|
inbox: DocumentDeliveryResponseEntity[];
|
|
264
271
|
};
|
|
@@ -270,6 +277,8 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
270
277
|
export interface DocumentGetSummaryResponseEntity {
|
|
271
278
|
toVisa: number;
|
|
272
279
|
toSign: number;
|
|
280
|
+
/** Borradores que esperan su revisión (como jefatura de la dirección que los revisa). */
|
|
281
|
+
toReview: number;
|
|
273
282
|
/** Lotes de firma con documentos en su turno (los documentos de un lote no se cuentan en `toVisa` ni `toSign`). */
|
|
274
283
|
batches: { toVisa: number; toSign: number };
|
|
275
284
|
created: {
|
|
@@ -625,7 +634,8 @@ export interface DocumentCommentResponseEntity {
|
|
|
625
634
|
text: string;
|
|
626
635
|
authorEmployeeId: string;
|
|
627
636
|
authorFullName: string;
|
|
628
|
-
|
|
637
|
+
/** `Review`: la jefatura que revisa el borrador antes de enviarlo a tramitación. */
|
|
638
|
+
authorRole: 'Author' | 'Visa' | 'Signature' | 'Review';
|
|
629
639
|
createdAt: string;
|
|
630
640
|
resolvedAt: string | null;
|
|
631
641
|
resolvedByFullName: string | null;
|
|
@@ -640,3 +650,40 @@ export interface DocumentCommentsResponseEntity {
|
|
|
640
650
|
canComment: boolean;
|
|
641
651
|
currentVersion: number;
|
|
642
652
|
}
|
|
653
|
+
|
|
654
|
+
/** Una ronda de revisión del borrador. */
|
|
655
|
+
export interface DocumentDraftReviewRoundEntity {
|
|
656
|
+
id: string;
|
|
657
|
+
round: number;
|
|
658
|
+
/** Versión del borrador que se revisó. */
|
|
659
|
+
versionNumber: number;
|
|
660
|
+
directorateName: string;
|
|
661
|
+
reviewerEmployeeId: string;
|
|
662
|
+
reviewerFullName: string;
|
|
663
|
+
requestedByFullName: string;
|
|
664
|
+
requestedAt: string;
|
|
665
|
+
status: 'Pending' | 'Approved' | 'Rejected' | 'Cancelled';
|
|
666
|
+
observation: string | null;
|
|
667
|
+
resolvedAt: string | null;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/** La revisión del borrador que exige el tipo documental. */
|
|
671
|
+
export interface DocumentDraftReviewInfoEntity {
|
|
672
|
+
directorateCodeReference: number;
|
|
673
|
+
directorateName: string;
|
|
674
|
+
rounds: DocumentDraftReviewRoundEntity[];
|
|
675
|
+
/** La versión vigente del borrador está aprobada: se puede enviar a tramitación. */
|
|
676
|
+
approved: boolean;
|
|
677
|
+
/** Hay una ronda esperando respuesta: el borrador no se edita mientras tanto. */
|
|
678
|
+
pending: boolean;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/** Resultado de pedir, resolver o retirar una revisión del borrador. */
|
|
682
|
+
export interface DocumentDraftReviewResponseEntity {
|
|
683
|
+
id: string;
|
|
684
|
+
ok: boolean;
|
|
685
|
+
round: number;
|
|
686
|
+
status: DocumentDraftReviewRoundEntity['status'];
|
|
687
|
+
/** A quién avisar: la jefatura revisora (al pedirla) o el redactor (al resolverla). */
|
|
688
|
+
notify: { employeeId: string; fullName: string } | null;
|
|
689
|
+
}
|
|
@@ -30,6 +30,9 @@ export interface DocumentTypeGetAllResponseEntity {
|
|
|
30
30
|
activeTransparency: DocumentTypeEntity['activeTransparency'];
|
|
31
31
|
transparencySection: DocumentTypeEntity['transparencySection'];
|
|
32
32
|
directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
|
|
33
|
+
// Dirección cuya jefatura revisa los borradores antes de enviarlos a tramitación (sin valor: no hay revisión).
|
|
34
|
+
draftReviewDirectorateCode: DocumentTypeEntity['draftReviewDirectorateCode'];
|
|
35
|
+
draftReviewDirectorateName: DocumentTypeEntity['draftReviewDirectorateName'];
|
|
33
36
|
// Serie documental del Cuadro de Clasificación a la que van sus documentos (MGDDE1_2).
|
|
34
37
|
archivalSeries: { id: string; code: string; name: string } | null;
|
|
35
38
|
// Entidad que emite sus documentos (Educación, Salud, Juzgado). `null`: la municipalidad.
|