@muni-sanfer/types-gestor-documental 0.0.1-beta.37 → 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 +57 -2
- package/dist/base/entities.js +13 -2
- package/dist/contracts/document.contract.d.ts +24 -2
- package/dist/contracts/document.contract.js +2 -0
- package/dist/contracts/documentTemplate.contract.d.ts +58 -0
- package/dist/contracts/documentTemplate.contract.js +12 -0
- package/dist/contracts/documentType.contract.d.ts +2 -0
- package/dist/contracts/index.d.ts +13 -1
- package/dist/contracts/index.js +3 -0
- package/dist/entities/document/document.entity.d.ts +48 -1
- package/dist/entities/documentTemplate/documentTemplate.entity.d.ts +51 -0
- package/dist/entities/documentTemplate/documentTemplate.entity.js +2 -0
- package/dist/entities/documentTemplate/index.d.ts +1 -0
- package/dist/entities/documentTemplate/index.js +17 -0
- package/dist/entities/documentType/documentType.entity.d.ts +2 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/package.json +1 -1
- package/src/base/entities.ts +67 -2
- package/src/contracts/document.contract.ts +21 -0
- package/src/contracts/documentTemplate.contract.ts +61 -0
- package/src/contracts/documentType.contract.ts +4 -0
- package/src/contracts/index.ts +4 -0
- package/src/entities/document/document.entity.ts +48 -1
- package/src/entities/documentTemplate/documentTemplate.entity.ts +58 -0
- package/src/entities/documentTemplate/index.ts +1 -0
- package/src/entities/documentType/documentType.entity.ts +3 -0
- package/src/entities/index.ts +1 -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: {
|
|
@@ -220,7 +231,7 @@ export declare const DocumentAccessAction: {
|
|
|
220
231
|
FileDownloaded: "FileDownloaded";
|
|
221
232
|
TrailExported: "TrailExported";
|
|
222
233
|
};
|
|
223
|
-
export type AuditEntity = 'DocumentType' | 'IssuingEntity' | 'ArchivalSeries' | 'TextSnippet' | 'Holiday' | 'Procedure' | 'QualityMetric' | 'ServiceOutage' | 'Repository' | 'DataTreatment';
|
|
234
|
+
export type AuditEntity = 'DocumentType' | 'IssuingEntity' | 'ArchivalSeries' | 'TextSnippet' | 'Holiday' | 'Procedure' | 'QualityMetric' | 'ServiceOutage' | 'Repository' | 'DataTreatment' | 'DocumentTemplate';
|
|
224
235
|
export declare const AuditEntity: {
|
|
225
236
|
DocumentType: "DocumentType";
|
|
226
237
|
IssuingEntity: "IssuingEntity";
|
|
@@ -232,6 +243,7 @@ export declare const AuditEntity: {
|
|
|
232
243
|
ServiceOutage: "ServiceOutage";
|
|
233
244
|
Repository: "Repository";
|
|
234
245
|
DataTreatment: "DataTreatment";
|
|
246
|
+
DocumentTemplate: "DocumentTemplate";
|
|
235
247
|
};
|
|
236
248
|
export type AuditAction = 'Created' | 'Updated' | 'Enabled' | 'Disabled' | 'Removed' | 'Exported';
|
|
237
249
|
export declare const AuditAction: {
|
|
@@ -406,6 +418,8 @@ export interface DocumentTypeEntity {
|
|
|
406
418
|
activeTransparency: boolean;
|
|
407
419
|
transparencySection?: string | null;
|
|
408
420
|
directorateCodeReference?: number | null;
|
|
421
|
+
draftReviewDirectorateCode?: number | null;
|
|
422
|
+
draftReviewDirectorateName?: string | null;
|
|
409
423
|
archivalSeries?: ArchivalSeriesEntity | null;
|
|
410
424
|
archivalSeriesId?: string | null;
|
|
411
425
|
issuingEntity?: IssuingEntityEntity | null;
|
|
@@ -490,6 +504,7 @@ export interface DocumentEntity {
|
|
|
490
504
|
dataRightsResponses?: DataRightsRequestEntity[];
|
|
491
505
|
versions?: DocumentVersionEntity[];
|
|
492
506
|
comments?: DocumentCommentEntity[];
|
|
507
|
+
draftReviews?: DocumentDraftReviewEntity[];
|
|
493
508
|
accessRequestDeliveries?: AccessRequestDocumentEntity[];
|
|
494
509
|
dispatch?: DocumentDispatchEntity | null;
|
|
495
510
|
docDigitalInbound?: DocDigitalInboundEntity | null;
|
|
@@ -887,6 +902,46 @@ export interface TextSnippetEntity {
|
|
|
887
902
|
createdAt: string;
|
|
888
903
|
updatedAt: string;
|
|
889
904
|
}
|
|
905
|
+
export interface DocumentTemplateEntity {
|
|
906
|
+
id: string;
|
|
907
|
+
name: string;
|
|
908
|
+
description?: string | null;
|
|
909
|
+
documentTypeIds: string[];
|
|
910
|
+
content: JsonValue;
|
|
911
|
+
version: number;
|
|
912
|
+
enabled: boolean;
|
|
913
|
+
updatedByFullName?: string | null;
|
|
914
|
+
versions?: DocumentTemplateVersionEntity[];
|
|
915
|
+
deleted: boolean;
|
|
916
|
+
createdAt: string;
|
|
917
|
+
updatedAt: string;
|
|
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
|
+
}
|
|
936
|
+
export interface DocumentTemplateVersionEntity {
|
|
937
|
+
id: string;
|
|
938
|
+
templateId: string;
|
|
939
|
+
template?: DocumentTemplateEntity;
|
|
940
|
+
version: number;
|
|
941
|
+
content: JsonValue;
|
|
942
|
+
createdByFullName?: string | null;
|
|
943
|
+
createdAt: string;
|
|
944
|
+
}
|
|
890
945
|
export interface ArchivalSeriesEntity {
|
|
891
946
|
id: string;
|
|
892
947
|
code: 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',
|
|
@@ -207,6 +217,7 @@ exports.AuditEntity = {
|
|
|
207
217
|
ServiceOutage: 'ServiceOutage',
|
|
208
218
|
Repository: 'Repository',
|
|
209
219
|
DataTreatment: 'DataTreatment',
|
|
220
|
+
DocumentTemplate: 'DocumentTemplate',
|
|
210
221
|
};
|
|
211
222
|
exports.AuditAction = {
|
|
212
223
|
Created: 'Created',
|
|
@@ -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',
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../base/entities';
|
|
2
|
+
import { type DocumentTemplateAvailableResponseEntity, type DocumentTemplateContent, type DocumentTemplateCreateResponseEntity, type DocumentTemplateGetAllResponseEntity, type DocumentTemplateGetByIdResponseEntity, type DocumentTemplateUpdateResponseEntity } from '../entities';
|
|
3
|
+
import { type RpcPage } from './contract';
|
|
4
|
+
/** Patrones NATS de `documentTemplate` (plantillas propias del editor): `<servicio>.<recurso>.<acción>`. */
|
|
5
|
+
export declare const DocumentTemplatePatterns: {
|
|
6
|
+
readonly getAll: "gestorDocumental.documentTemplate.getAll";
|
|
7
|
+
readonly getById: "gestorDocumental.documentTemplate.getById";
|
|
8
|
+
readonly create: "gestorDocumental.documentTemplate.create";
|
|
9
|
+
readonly update: "gestorDocumental.documentTemplate.update";
|
|
10
|
+
readonly setEnabled: "gestorDocumental.documentTemplate.setEnabled";
|
|
11
|
+
readonly getAvailable: "gestorDocumental.documentTemplate.getAvailable";
|
|
12
|
+
};
|
|
13
|
+
/** Datos de una plantilla propia al crearla o editarla. */
|
|
14
|
+
export interface DocumentTemplateWritePayload {
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string | null;
|
|
17
|
+
documentTypeIds?: string[];
|
|
18
|
+
content: DocumentTemplateContent;
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface DocumentTemplateContract {
|
|
22
|
+
[DocumentTemplatePatterns.getAll]: {
|
|
23
|
+
payload: {
|
|
24
|
+
pagination?: {
|
|
25
|
+
page?: number;
|
|
26
|
+
limit?: number;
|
|
27
|
+
};
|
|
28
|
+
filters?: {
|
|
29
|
+
search?: string;
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
response: RpcPage<DocumentTemplateGetAllResponseEntity[]>;
|
|
34
|
+
};
|
|
35
|
+
[DocumentTemplatePatterns.getById]: {
|
|
36
|
+
payload: Pick<DocumentTemplateEntity, 'id'>;
|
|
37
|
+
response: DocumentTemplateGetByIdResponseEntity;
|
|
38
|
+
};
|
|
39
|
+
[DocumentTemplatePatterns.create]: {
|
|
40
|
+
payload: DocumentTemplateWritePayload;
|
|
41
|
+
response: DocumentTemplateCreateResponseEntity;
|
|
42
|
+
};
|
|
43
|
+
[DocumentTemplatePatterns.update]: {
|
|
44
|
+
payload: DocumentTemplateWritePayload & Pick<DocumentTemplateEntity, 'id'>;
|
|
45
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
46
|
+
};
|
|
47
|
+
[DocumentTemplatePatterns.setEnabled]: {
|
|
48
|
+
payload: Pick<DocumentTemplateEntity, 'id' | 'enabled'>;
|
|
49
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
50
|
+
};
|
|
51
|
+
/** Las habilitadas que se ofrecen al redactar un documento del tipo (las de todos los tipos y las suyas). */
|
|
52
|
+
[DocumentTemplatePatterns.getAvailable]: {
|
|
53
|
+
payload: {
|
|
54
|
+
documentTypeId: string;
|
|
55
|
+
};
|
|
56
|
+
response: DocumentTemplateAvailableResponseEntity[];
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentTemplatePatterns = void 0;
|
|
4
|
+
/** Patrones NATS de `documentTemplate` (plantillas propias del editor): `<servicio>.<recurso>.<acción>`. */
|
|
5
|
+
exports.DocumentTemplatePatterns = {
|
|
6
|
+
getAll: 'gestorDocumental.documentTemplate.getAll',
|
|
7
|
+
getById: 'gestorDocumental.documentTemplate.getById',
|
|
8
|
+
create: 'gestorDocumental.documentTemplate.create',
|
|
9
|
+
update: 'gestorDocumental.documentTemplate.update',
|
|
10
|
+
setEnabled: 'gestorDocumental.documentTemplate.setEnabled',
|
|
11
|
+
getAvailable: 'gestorDocumental.documentTemplate.getAvailable',
|
|
12
|
+
};
|
|
@@ -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;
|
|
@@ -4,6 +4,7 @@ import { type DocumentTypeContract } from './documentType.contract';
|
|
|
4
4
|
import { type IssuingEntityContract } from './issuingEntity.contract';
|
|
5
5
|
import { type ArchivalSeriesContract } from './archivalSeries.contract';
|
|
6
6
|
import { type TextSnippetContract } from './textSnippet.contract';
|
|
7
|
+
import { type DocumentTemplateContract } from './documentTemplate.contract';
|
|
7
8
|
import { type HolidayContract } from './holiday.contract';
|
|
8
9
|
import { type IndicatorsContract } from './indicators.contract';
|
|
9
10
|
import { type AuditContract } from './audit.contract';
|
|
@@ -35,6 +36,7 @@ export * from './workFolder.contract';
|
|
|
35
36
|
export * from './scan.contract';
|
|
36
37
|
export * from './archivalSeries.contract';
|
|
37
38
|
export * from './textSnippet.contract';
|
|
39
|
+
export * from './documentTemplate.contract';
|
|
38
40
|
export * from './holiday.contract';
|
|
39
41
|
export * from './indicators.contract';
|
|
40
42
|
export * from './audit.contract';
|
|
@@ -66,6 +68,8 @@ export declare const GestorDocumentalPatterns: {
|
|
|
66
68
|
readonly review: "gestorDocumental.document.review";
|
|
67
69
|
readonly signMany: "gestorDocumental.document.signMany";
|
|
68
70
|
readonly reassign: "gestorDocumental.document.reassign";
|
|
71
|
+
readonly requestDraftReview: "gestorDocumental.document.requestDraftReview";
|
|
72
|
+
readonly resolveDraftReview: "gestorDocumental.document.resolveDraftReview";
|
|
69
73
|
readonly discard: "gestorDocumental.document.discard";
|
|
70
74
|
readonly annul: "gestorDocumental.document.annul";
|
|
71
75
|
readonly derive: "gestorDocumental.document.derive";
|
|
@@ -192,6 +196,14 @@ export declare const GestorDocumentalPatterns: {
|
|
|
192
196
|
readonly update: "gestorDocumental.textSnippet.update";
|
|
193
197
|
readonly setEnabled: "gestorDocumental.textSnippet.setEnabled";
|
|
194
198
|
};
|
|
199
|
+
readonly documentTemplate: {
|
|
200
|
+
readonly getAll: "gestorDocumental.documentTemplate.getAll";
|
|
201
|
+
readonly getById: "gestorDocumental.documentTemplate.getById";
|
|
202
|
+
readonly create: "gestorDocumental.documentTemplate.create";
|
|
203
|
+
readonly update: "gestorDocumental.documentTemplate.update";
|
|
204
|
+
readonly setEnabled: "gestorDocumental.documentTemplate.setEnabled";
|
|
205
|
+
readonly getAvailable: "gestorDocumental.documentTemplate.getAvailable";
|
|
206
|
+
};
|
|
195
207
|
readonly holiday: {
|
|
196
208
|
readonly getAll: "gestorDocumental.holiday.getAll";
|
|
197
209
|
readonly create: "gestorDocumental.holiday.create";
|
|
@@ -288,4 +300,4 @@ export declare const GestorDocumentalPatterns: {
|
|
|
288
300
|
};
|
|
289
301
|
};
|
|
290
302
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
291
|
-
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract;
|
|
303
|
+
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & DocumentTemplateContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract;
|
package/dist/contracts/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const documentType_contract_1 = require("./documentType.contract");
|
|
|
21
21
|
const issuingEntity_contract_1 = require("./issuingEntity.contract");
|
|
22
22
|
const archivalSeries_contract_1 = require("./archivalSeries.contract");
|
|
23
23
|
const textSnippet_contract_1 = require("./textSnippet.contract");
|
|
24
|
+
const documentTemplate_contract_1 = require("./documentTemplate.contract");
|
|
24
25
|
const holiday_contract_1 = require("./holiday.contract");
|
|
25
26
|
const indicators_contract_1 = require("./indicators.contract");
|
|
26
27
|
const audit_contract_1 = require("./audit.contract");
|
|
@@ -52,6 +53,7 @@ __exportStar(require("./workFolder.contract"), exports);
|
|
|
52
53
|
__exportStar(require("./scan.contract"), exports);
|
|
53
54
|
__exportStar(require("./archivalSeries.contract"), exports);
|
|
54
55
|
__exportStar(require("./textSnippet.contract"), exports);
|
|
56
|
+
__exportStar(require("./documentTemplate.contract"), exports);
|
|
55
57
|
__exportStar(require("./holiday.contract"), exports);
|
|
56
58
|
__exportStar(require("./indicators.contract"), exports);
|
|
57
59
|
__exportStar(require("./audit.contract"), exports);
|
|
@@ -78,6 +80,7 @@ exports.GestorDocumentalPatterns = {
|
|
|
78
80
|
scan: scan_contract_1.ScanPatterns,
|
|
79
81
|
archivalSeries: archivalSeries_contract_1.ArchivalSeriesPatterns,
|
|
80
82
|
textSnippet: textSnippet_contract_1.TextSnippetPatterns,
|
|
83
|
+
documentTemplate: documentTemplate_contract_1.DocumentTemplatePatterns,
|
|
81
84
|
holiday: holiday_contract_1.HolidayPatterns,
|
|
82
85
|
indicators: indicators_contract_1.IndicatorsPatterns,
|
|
83
86
|
audit: audit_contract_1.AuditPatterns,
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../../base/entities';
|
|
2
|
+
import { type RichBlock, type RichField } from '../document/document.entity';
|
|
3
|
+
/**
|
|
4
|
+
* Contenido de una plantilla propia: los bloques del editor (con sus partes fijas) y los campos que completa quien
|
|
5
|
+
* redacta (en la plantilla, sin valor).
|
|
6
|
+
*/
|
|
7
|
+
export interface DocumentTemplateContent {
|
|
8
|
+
blocks: RichBlock[];
|
|
9
|
+
fields: RichField[];
|
|
10
|
+
}
|
|
11
|
+
/** Plantilla propia en el listado de quien las administra. */
|
|
12
|
+
export interface DocumentTemplateGetAllResponseEntity {
|
|
13
|
+
id: DocumentTemplateEntity['id'];
|
|
14
|
+
name: DocumentTemplateEntity['name'];
|
|
15
|
+
description: string | null;
|
|
16
|
+
/** Tipos documentales donde se ofrece; vacío, en todos. */
|
|
17
|
+
documentTypeIds: DocumentTemplateEntity['documentTypeIds'];
|
|
18
|
+
documentTypeNames: string[];
|
|
19
|
+
version: DocumentTemplateEntity['version'];
|
|
20
|
+
enabled: DocumentTemplateEntity['enabled'];
|
|
21
|
+
updatedAt: DocumentTemplateEntity['updatedAt'];
|
|
22
|
+
updatedByFullName: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** Una versión del contenido de una plantilla. */
|
|
25
|
+
export interface DocumentTemplateVersionResponseEntity {
|
|
26
|
+
version: number;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
createdByFullName: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface DocumentTemplateGetByIdResponseEntity extends DocumentTemplateGetAllResponseEntity {
|
|
31
|
+
content: DocumentTemplateContent;
|
|
32
|
+
versions: DocumentTemplateVersionResponseEntity[];
|
|
33
|
+
}
|
|
34
|
+
/** Plantilla que se ofrece al redactar un documento de un tipo: con su contenido, lista para usar. */
|
|
35
|
+
export interface DocumentTemplateAvailableResponseEntity {
|
|
36
|
+
id: DocumentTemplateEntity['id'];
|
|
37
|
+
name: DocumentTemplateEntity['name'];
|
|
38
|
+
description: string | null;
|
|
39
|
+
version: DocumentTemplateEntity['version'];
|
|
40
|
+
content: DocumentTemplateContent;
|
|
41
|
+
}
|
|
42
|
+
export interface DocumentTemplateCreateResponseEntity {
|
|
43
|
+
id: DocumentTemplateEntity['id'];
|
|
44
|
+
ok: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface DocumentTemplateUpdateResponseEntity {
|
|
47
|
+
id: DocumentTemplateEntity['id'];
|
|
48
|
+
ok: boolean;
|
|
49
|
+
/** Versión vigente: sube solo si cambió el contenido. */
|
|
50
|
+
version: number;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './documentTemplate.entity';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./documentTemplate.entity"), exports);
|
|
@@ -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/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
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 = {
|
|
@@ -344,7 +361,8 @@ export type AuditEntity =
|
|
|
344
361
|
| 'QualityMetric'
|
|
345
362
|
| 'ServiceOutage'
|
|
346
363
|
| 'Repository'
|
|
347
|
-
| 'DataTreatment'
|
|
364
|
+
| 'DataTreatment'
|
|
365
|
+
| 'DocumentTemplate';
|
|
348
366
|
|
|
349
367
|
export const AuditEntity = {
|
|
350
368
|
DocumentType: 'DocumentType',
|
|
@@ -357,6 +375,7 @@ export const AuditEntity = {
|
|
|
357
375
|
ServiceOutage: 'ServiceOutage',
|
|
358
376
|
Repository: 'Repository',
|
|
359
377
|
DataTreatment: 'DataTreatment',
|
|
378
|
+
DocumentTemplate: 'DocumentTemplate',
|
|
360
379
|
} satisfies Record<string, AuditEntity>;
|
|
361
380
|
|
|
362
381
|
export type AuditAction = 'Created' | 'Updated' | 'Enabled' | 'Disabled' | 'Removed' | 'Exported';
|
|
@@ -598,6 +617,8 @@ export interface DocumentTypeEntity {
|
|
|
598
617
|
activeTransparency: boolean;
|
|
599
618
|
transparencySection?: string | null;
|
|
600
619
|
directorateCodeReference?: number | null;
|
|
620
|
+
draftReviewDirectorateCode?: number | null;
|
|
621
|
+
draftReviewDirectorateName?: string | null;
|
|
601
622
|
archivalSeries?: ArchivalSeriesEntity | null;
|
|
602
623
|
archivalSeriesId?: string | null;
|
|
603
624
|
issuingEntity?: IssuingEntityEntity | null;
|
|
@@ -683,6 +704,7 @@ export interface DocumentEntity {
|
|
|
683
704
|
dataRightsResponses?: DataRightsRequestEntity[];
|
|
684
705
|
versions?: DocumentVersionEntity[];
|
|
685
706
|
comments?: DocumentCommentEntity[];
|
|
707
|
+
draftReviews?: DocumentDraftReviewEntity[];
|
|
686
708
|
accessRequestDeliveries?: AccessRequestDocumentEntity[];
|
|
687
709
|
dispatch?: DocumentDispatchEntity | null;
|
|
688
710
|
docDigitalInbound?: DocDigitalInboundEntity | null;
|
|
@@ -1106,6 +1128,49 @@ export interface TextSnippetEntity {
|
|
|
1106
1128
|
updatedAt: string;
|
|
1107
1129
|
}
|
|
1108
1130
|
|
|
1131
|
+
export interface DocumentTemplateEntity {
|
|
1132
|
+
id: string;
|
|
1133
|
+
name: string;
|
|
1134
|
+
description?: string | null;
|
|
1135
|
+
documentTypeIds: string[];
|
|
1136
|
+
content: JsonValue;
|
|
1137
|
+
version: number;
|
|
1138
|
+
enabled: boolean;
|
|
1139
|
+
updatedByFullName?: string | null;
|
|
1140
|
+
versions?: DocumentTemplateVersionEntity[];
|
|
1141
|
+
deleted: boolean;
|
|
1142
|
+
createdAt: string;
|
|
1143
|
+
updatedAt: string;
|
|
1144
|
+
}
|
|
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
|
+
|
|
1164
|
+
export interface DocumentTemplateVersionEntity {
|
|
1165
|
+
id: string;
|
|
1166
|
+
templateId: string;
|
|
1167
|
+
template?: DocumentTemplateEntity;
|
|
1168
|
+
version: number;
|
|
1169
|
+
content: JsonValue;
|
|
1170
|
+
createdByFullName?: string | null;
|
|
1171
|
+
createdAt: string;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1109
1174
|
export interface ArchivalSeriesEntity {
|
|
1110
1175
|
id: string;
|
|
1111
1176
|
code: 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'];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../base/entities';
|
|
2
|
+
import {
|
|
3
|
+
type DocumentTemplateAvailableResponseEntity,
|
|
4
|
+
type DocumentTemplateContent,
|
|
5
|
+
type DocumentTemplateCreateResponseEntity,
|
|
6
|
+
type DocumentTemplateGetAllResponseEntity,
|
|
7
|
+
type DocumentTemplateGetByIdResponseEntity,
|
|
8
|
+
type DocumentTemplateUpdateResponseEntity,
|
|
9
|
+
} from '../entities';
|
|
10
|
+
import { type RpcPage } from './contract';
|
|
11
|
+
|
|
12
|
+
/** Patrones NATS de `documentTemplate` (plantillas propias del editor): `<servicio>.<recurso>.<acción>`. */
|
|
13
|
+
export const DocumentTemplatePatterns = {
|
|
14
|
+
getAll: 'gestorDocumental.documentTemplate.getAll',
|
|
15
|
+
getById: 'gestorDocumental.documentTemplate.getById',
|
|
16
|
+
create: 'gestorDocumental.documentTemplate.create',
|
|
17
|
+
update: 'gestorDocumental.documentTemplate.update',
|
|
18
|
+
setEnabled: 'gestorDocumental.documentTemplate.setEnabled',
|
|
19
|
+
getAvailable: 'gestorDocumental.documentTemplate.getAvailable',
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
/** Datos de una plantilla propia al crearla o editarla. */
|
|
23
|
+
export interface DocumentTemplateWritePayload {
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string | null;
|
|
26
|
+
documentTypeIds?: string[];
|
|
27
|
+
content: DocumentTemplateContent;
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface DocumentTemplateContract {
|
|
32
|
+
[DocumentTemplatePatterns.getAll]: {
|
|
33
|
+
// sin `page` y `limit` responde todas en una sola página
|
|
34
|
+
payload: {
|
|
35
|
+
pagination?: { page?: number; limit?: number };
|
|
36
|
+
filters?: { search?: string; enabled?: boolean };
|
|
37
|
+
};
|
|
38
|
+
response: RpcPage<DocumentTemplateGetAllResponseEntity[]>;
|
|
39
|
+
};
|
|
40
|
+
[DocumentTemplatePatterns.getById]: {
|
|
41
|
+
payload: Pick<DocumentTemplateEntity, 'id'>;
|
|
42
|
+
response: DocumentTemplateGetByIdResponseEntity;
|
|
43
|
+
};
|
|
44
|
+
[DocumentTemplatePatterns.create]: {
|
|
45
|
+
payload: DocumentTemplateWritePayload;
|
|
46
|
+
response: DocumentTemplateCreateResponseEntity;
|
|
47
|
+
};
|
|
48
|
+
[DocumentTemplatePatterns.update]: {
|
|
49
|
+
payload: DocumentTemplateWritePayload & Pick<DocumentTemplateEntity, 'id'>;
|
|
50
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
51
|
+
};
|
|
52
|
+
[DocumentTemplatePatterns.setEnabled]: {
|
|
53
|
+
payload: Pick<DocumentTemplateEntity, 'id' | 'enabled'>;
|
|
54
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
55
|
+
};
|
|
56
|
+
/** Las habilitadas que se ofrecen al redactar un documento del tipo (las de todos los tipos y las suyas). */
|
|
57
|
+
[DocumentTemplatePatterns.getAvailable]: {
|
|
58
|
+
payload: { documentTypeId: string };
|
|
59
|
+
response: DocumentTemplateAvailableResponseEntity[];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -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).
|
package/src/contracts/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { DocumentTypePatterns, type DocumentTypeContract } from './documentType.
|
|
|
4
4
|
import { IssuingEntityPatterns, type IssuingEntityContract } from './issuingEntity.contract';
|
|
5
5
|
import { ArchivalSeriesPatterns, type ArchivalSeriesContract } from './archivalSeries.contract';
|
|
6
6
|
import { TextSnippetPatterns, type TextSnippetContract } from './textSnippet.contract';
|
|
7
|
+
import { DocumentTemplatePatterns, type DocumentTemplateContract } from './documentTemplate.contract';
|
|
7
8
|
import { HolidayPatterns, type HolidayContract } from './holiday.contract';
|
|
8
9
|
import { IndicatorsPatterns, type IndicatorsContract } from './indicators.contract';
|
|
9
10
|
import { AuditPatterns, type AuditContract } from './audit.contract';
|
|
@@ -36,6 +37,7 @@ export * from './workFolder.contract';
|
|
|
36
37
|
export * from './scan.contract';
|
|
37
38
|
export * from './archivalSeries.contract';
|
|
38
39
|
export * from './textSnippet.contract';
|
|
40
|
+
export * from './documentTemplate.contract';
|
|
39
41
|
export * from './holiday.contract';
|
|
40
42
|
export * from './indicators.contract';
|
|
41
43
|
export * from './audit.contract';
|
|
@@ -63,6 +65,7 @@ export const GestorDocumentalPatterns = {
|
|
|
63
65
|
scan: ScanPatterns,
|
|
64
66
|
archivalSeries: ArchivalSeriesPatterns,
|
|
65
67
|
textSnippet: TextSnippetPatterns,
|
|
68
|
+
documentTemplate: DocumentTemplatePatterns,
|
|
66
69
|
holiday: HolidayPatterns,
|
|
67
70
|
indicators: IndicatorsPatterns,
|
|
68
71
|
audit: AuditPatterns,
|
|
@@ -90,6 +93,7 @@ export type GestorDocumentalContract = DocumentTypeContract &
|
|
|
90
93
|
ScanContract &
|
|
91
94
|
ArchivalSeriesContract &
|
|
92
95
|
TextSnippetContract &
|
|
96
|
+
DocumentTemplateContract &
|
|
93
97
|
HolidayContract &
|
|
94
98
|
IndicatorsContract &
|
|
95
99
|
AuditContract &
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../../base/entities';
|
|
2
|
+
import { type RichBlock, type RichField } from '../document/document.entity';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Contenido de una plantilla propia: los bloques del editor (con sus partes fijas) y los campos que completa quien
|
|
6
|
+
* redacta (en la plantilla, sin valor).
|
|
7
|
+
*/
|
|
8
|
+
export interface DocumentTemplateContent {
|
|
9
|
+
blocks: RichBlock[];
|
|
10
|
+
fields: RichField[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Plantilla propia en el listado de quien las administra. */
|
|
14
|
+
export interface DocumentTemplateGetAllResponseEntity {
|
|
15
|
+
id: DocumentTemplateEntity['id'];
|
|
16
|
+
name: DocumentTemplateEntity['name'];
|
|
17
|
+
description: string | null;
|
|
18
|
+
/** Tipos documentales donde se ofrece; vacío, en todos. */
|
|
19
|
+
documentTypeIds: DocumentTemplateEntity['documentTypeIds'];
|
|
20
|
+
documentTypeNames: string[];
|
|
21
|
+
version: DocumentTemplateEntity['version'];
|
|
22
|
+
enabled: DocumentTemplateEntity['enabled'];
|
|
23
|
+
updatedAt: DocumentTemplateEntity['updatedAt'];
|
|
24
|
+
updatedByFullName: string | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Una versión del contenido de una plantilla. */
|
|
28
|
+
export interface DocumentTemplateVersionResponseEntity {
|
|
29
|
+
version: number;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
createdByFullName: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface DocumentTemplateGetByIdResponseEntity extends DocumentTemplateGetAllResponseEntity {
|
|
35
|
+
content: DocumentTemplateContent;
|
|
36
|
+
versions: DocumentTemplateVersionResponseEntity[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Plantilla que se ofrece al redactar un documento de un tipo: con su contenido, lista para usar. */
|
|
40
|
+
export interface DocumentTemplateAvailableResponseEntity {
|
|
41
|
+
id: DocumentTemplateEntity['id'];
|
|
42
|
+
name: DocumentTemplateEntity['name'];
|
|
43
|
+
description: string | null;
|
|
44
|
+
version: DocumentTemplateEntity['version'];
|
|
45
|
+
content: DocumentTemplateContent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DocumentTemplateCreateResponseEntity {
|
|
49
|
+
id: DocumentTemplateEntity['id'];
|
|
50
|
+
ok: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface DocumentTemplateUpdateResponseEntity {
|
|
54
|
+
id: DocumentTemplateEntity['id'];
|
|
55
|
+
ok: boolean;
|
|
56
|
+
/** Versión vigente: sube solo si cambió el contenido. */
|
|
57
|
+
version: number;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './documentTemplate.entity';
|
|
@@ -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.
|
package/src/entities/index.ts
CHANGED