@muni-sanfer/types-gestor-documental 0.0.1-beta.40 → 0.0.1-beta.41

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.
@@ -231,7 +231,7 @@ export declare const DocumentAccessAction: {
231
231
  FileDownloaded: "FileDownloaded";
232
232
  TrailExported: "TrailExported";
233
233
  };
234
- export type AuditEntity = 'DocumentType' | 'IssuingEntity' | 'ArchivalSeries' | 'TextSnippet' | 'Holiday' | 'Procedure' | 'QualityMetric' | 'ServiceOutage' | 'Repository' | 'DataTreatment' | 'DocumentTemplate';
234
+ export type AuditEntity = 'DocumentType' | 'IssuingEntity' | 'ArchivalSeries' | 'TextSnippet' | 'Holiday' | 'Procedure' | 'QualityMetric' | 'ServiceOutage' | 'Repository' | 'DataTreatment' | 'DocumentTemplate' | 'DirectorateReviewer';
235
235
  export declare const AuditEntity: {
236
236
  DocumentType: "DocumentType";
237
237
  IssuingEntity: "IssuingEntity";
@@ -244,6 +244,7 @@ export declare const AuditEntity: {
244
244
  Repository: "Repository";
245
245
  DataTreatment: "DataTreatment";
246
246
  DocumentTemplate: "DocumentTemplate";
247
+ DirectorateReviewer: "DirectorateReviewer";
247
248
  };
248
249
  export type AuditAction = 'Created' | 'Updated' | 'Enabled' | 'Disabled' | 'Removed' | 'Exported';
249
250
  export declare const AuditAction: {
@@ -523,6 +524,7 @@ export interface DocumentEntity {
523
524
  comments?: DocumentCommentEntity[];
524
525
  draftReviews?: DocumentDraftReviewEntity[];
525
526
  draftingRequest?: DraftingRequestEntity | null;
527
+ internalNotes?: DocumentInternalNoteEntity[];
526
528
  accessRequestDeliveries?: AccessRequestDocumentEntity[];
527
529
  dispatch?: DocumentDispatchEntity | null;
528
530
  docDigitalInbound?: DocDigitalInboundEntity | null;
@@ -1417,6 +1419,28 @@ export interface DraftingRequestEventEntity {
1417
1419
  employeeFullName: string;
1418
1420
  createdAt: string;
1419
1421
  }
1422
+ export interface DirectorateReviewerEntity {
1423
+ id: string;
1424
+ directorateCode: number;
1425
+ directorateName: string;
1426
+ employeeId: string;
1427
+ fullName: string;
1428
+ createdAt: string;
1429
+ }
1430
+ export interface DocumentInternalNoteEntity {
1431
+ id: string;
1432
+ documentId: string;
1433
+ document?: DocumentEntity;
1434
+ directorateCode: number;
1435
+ directorateName: string;
1436
+ headEmployeeIds: string[];
1437
+ versionNumber: number;
1438
+ authorEmployeeId: string;
1439
+ authorFullName: string;
1440
+ authorRole: string;
1441
+ text: string;
1442
+ createdAt: string;
1443
+ }
1420
1444
  type JsonValue = string | number | boolean | {
1421
1445
  [key in string]?: JsonValue;
1422
1446
  } | Array<JsonValue> | null;
@@ -218,6 +218,7 @@ exports.AuditEntity = {
218
218
  Repository: 'Repository',
219
219
  DataTreatment: 'DataTreatment',
220
220
  DocumentTemplate: 'DocumentTemplate',
221
+ DirectorateReviewer: 'DirectorateReviewer',
221
222
  };
222
223
  exports.AuditAction = {
223
224
  Created: 'Created',
@@ -42,6 +42,11 @@ export interface DocumentActor {
42
42
  employeeId: string;
43
43
  directorateCodes: number[];
44
44
  departmentIds: string[];
45
+ /**
46
+ * Jefaturas para las que revisa (revisora de jefatura): ve los documentos que les esperan. Lo resuelve el gateway
47
+ * solo donde hace falta (el detalle y el PDF).
48
+ */
49
+ reviewFor?: string[];
45
50
  }
46
51
  /** Bandeja desde la que se lista. Todas son del funcionario (`actor`), salvo `all`. */
47
52
  export type DocumentBucket = 'created' | 'sent' | 'toVisa' | 'toSign' | 'participated' | 'toReview' | 'all';
@@ -24,6 +24,7 @@ import { type RegisterBookContract } from './registerBook.contract';
24
24
  import { type SignatureBatchContract } from './signatureBatch.contract';
25
25
  import { type WorkFolderContract } from './workFolder.contract';
26
26
  import { type DraftingRequestContract } from './draftingRequest.contract';
27
+ import { type InternalReviewContract } from './internalReview.contract';
27
28
  export * from './contract';
28
29
  export * from './document.contract';
29
30
  export * from './documentType.contract';
@@ -51,6 +52,7 @@ export * from './desk.contract';
51
52
  export * from './mailIntake.contract';
52
53
  export * from './push.contract';
53
54
  export * from './draftingRequest.contract';
55
+ export * from './internalReview.contract';
54
56
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
55
57
  export declare const GestorDocumentalPatterns: {
56
58
  readonly documentType: {
@@ -307,6 +309,14 @@ export declare const GestorDocumentalPatterns: {
307
309
  readonly act: "gestorDocumental.draftingRequest.act";
308
310
  readonly getAttachmentFile: "gestorDocumental.draftingRequest.getAttachmentFile";
309
311
  };
312
+ readonly internalReview: {
313
+ readonly getReviewers: "gestorDocumental.internalReview.getReviewers";
314
+ readonly setReviewers: "gestorDocumental.internalReview.setReviewers";
315
+ readonly getAssignments: "gestorDocumental.internalReview.getAssignments";
316
+ readonly getQueue: "gestorDocumental.internalReview.getQueue";
317
+ readonly getNotes: "gestorDocumental.internalReview.getNotes";
318
+ readonly addNote: "gestorDocumental.internalReview.addNote";
319
+ };
310
320
  };
311
321
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
312
- 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 & DraftingRequestContract;
322
+ 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 & DraftingRequestContract & InternalReviewContract;
@@ -41,6 +41,7 @@ const registerBook_contract_1 = require("./registerBook.contract");
41
41
  const signatureBatch_contract_1 = require("./signatureBatch.contract");
42
42
  const workFolder_contract_1 = require("./workFolder.contract");
43
43
  const draftingRequest_contract_1 = require("./draftingRequest.contract");
44
+ const internalReview_contract_1 = require("./internalReview.contract");
44
45
  __exportStar(require("./contract"), exports);
45
46
  __exportStar(require("./document.contract"), exports);
46
47
  __exportStar(require("./documentType.contract"), exports);
@@ -68,6 +69,7 @@ __exportStar(require("./desk.contract"), exports);
68
69
  __exportStar(require("./mailIntake.contract"), exports);
69
70
  __exportStar(require("./push.contract"), exports);
70
71
  __exportStar(require("./draftingRequest.contract"), exports);
72
+ __exportStar(require("./internalReview.contract"), exports);
71
73
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
72
74
  exports.GestorDocumentalPatterns = {
73
75
  documentType: documentType_contract_1.DocumentTypePatterns,
@@ -96,4 +98,5 @@ exports.GestorDocumentalPatterns = {
96
98
  mailIntake: mailIntake_contract_1.MailIntakePatterns,
97
99
  push: push_contract_1.PushPatterns,
98
100
  draftingRequest: draftingRequest_contract_1.DraftingRequestPatterns,
101
+ internalReview: internalReview_contract_1.InternalReviewPatterns,
99
102
  };
@@ -0,0 +1,86 @@
1
+ import { type DirectorateReviewersEntity, type DocumentInternalNoteResponseEntity, type DocumentInternalNotesResponseEntity, type InternalReviewQueueItemEntity } from '../entities';
2
+ import { type AuditActorInput } from '../entities';
3
+ /** Patrones NATS de `internalReview`: revisoras de jefatura y sus observaciones internas. */
4
+ export declare const InternalReviewPatterns: {
5
+ readonly getReviewers: "gestorDocumental.internalReview.getReviewers";
6
+ readonly setReviewers: "gestorDocumental.internalReview.setReviewers";
7
+ readonly getAssignments: "gestorDocumental.internalReview.getAssignments";
8
+ readonly getQueue: "gestorDocumental.internalReview.getQueue";
9
+ readonly getNotes: "gestorDocumental.internalReview.getNotes";
10
+ readonly addNote: "gestorDocumental.internalReview.addNote";
11
+ };
12
+ /**
13
+ * Dirección para la que actúa quien consulta: como revisora de su jefatura o como la jefatura misma. La resuelve el
14
+ * gateway: quiénes la dirigen hoy (titular y subrogante) no los dice el navegador.
15
+ */
16
+ export interface InternalReviewScope {
17
+ directorateCode: number;
18
+ directorateName: string;
19
+ headEmployeeIds: string[];
20
+ role: 'Reviewer' | 'Head';
21
+ }
22
+ export interface InternalReviewContract {
23
+ [InternalReviewPatterns.getReviewers]: {
24
+ payload: Record<string, never>;
25
+ response: DirectorateReviewersEntity[];
26
+ };
27
+ /** Reemplaza las revisoras de una dirección (sin ninguna, la dirección queda sin revisoras). */
28
+ [InternalReviewPatterns.setReviewers]: {
29
+ payload: {
30
+ directorateCode: number;
31
+ directorateName: string;
32
+ reviewers: {
33
+ employeeId: string;
34
+ fullName: string;
35
+ }[];
36
+ auditActor?: AuditActorInput;
37
+ };
38
+ response: {
39
+ id: string;
40
+ ok: boolean;
41
+ };
42
+ };
43
+ /** Direcciones para cuya jefatura revisa una funcionaria. */
44
+ [InternalReviewPatterns.getAssignments]: {
45
+ payload: {
46
+ employeeId: string;
47
+ };
48
+ response: {
49
+ directorateCode: number;
50
+ directorateName: string;
51
+ }[];
52
+ };
53
+ /** Documentos que esperan a las jefaturas para las que revisa quien consulta. */
54
+ [InternalReviewPatterns.getQueue]: {
55
+ payload: {
56
+ actor: {
57
+ employeeId: string;
58
+ };
59
+ scopes: InternalReviewScope[];
60
+ };
61
+ response: InternalReviewQueueItemEntity[];
62
+ };
63
+ [InternalReviewPatterns.getNotes]: {
64
+ payload: {
65
+ documentId: string;
66
+ actor: {
67
+ employeeId: string;
68
+ };
69
+ scopes: InternalReviewScope[];
70
+ };
71
+ response: DocumentInternalNotesResponseEntity;
72
+ };
73
+ [InternalReviewPatterns.addNote]: {
74
+ payload: {
75
+ documentId: string;
76
+ directorateCode: number;
77
+ text: string;
78
+ actor: {
79
+ employeeId: string;
80
+ fullName: string;
81
+ };
82
+ scopes: InternalReviewScope[];
83
+ };
84
+ response: DocumentInternalNoteResponseEntity;
85
+ };
86
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InternalReviewPatterns = void 0;
4
+ /** Patrones NATS de `internalReview`: revisoras de jefatura y sus observaciones internas. */
5
+ exports.InternalReviewPatterns = {
6
+ getReviewers: 'gestorDocumental.internalReview.getReviewers',
7
+ setReviewers: 'gestorDocumental.internalReview.setReviewers',
8
+ getAssignments: 'gestorDocumental.internalReview.getAssignments',
9
+ getQueue: 'gestorDocumental.internalReview.getQueue',
10
+ getNotes: 'gestorDocumental.internalReview.getNotes',
11
+ addNote: 'gestorDocumental.internalReview.addNote',
12
+ };
@@ -24,3 +24,4 @@ export * from './mailIntake';
24
24
  export * from './push';
25
25
  export * from './documentTemplate';
26
26
  export * from './draftingRequest';
27
+ export * from './internalReview';
@@ -40,3 +40,4 @@ __exportStar(require("./mailIntake"), exports);
40
40
  __exportStar(require("./push"), exports);
41
41
  __exportStar(require("./documentTemplate"), exports);
42
42
  __exportStar(require("./draftingRequest"), exports);
43
+ __exportStar(require("./internalReview"), exports);
@@ -0,0 +1 @@
1
+ export * from './internalReview.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("./internalReview.entity"), exports);
@@ -0,0 +1,59 @@
1
+ import { type DocumentStatus } from '../../base/entities';
2
+ /** Revisoras asignadas a la jefatura de una dirección. */
3
+ export interface DirectorateReviewersEntity {
4
+ directorateCode: number;
5
+ directorateName: string;
6
+ reviewers: {
7
+ employeeId: string;
8
+ fullName: string;
9
+ }[];
10
+ }
11
+ /** Qué espera de la jefatura un documento de la cola de revisión. */
12
+ export type InternalReviewTurn = 'Visa' | 'Signature' | 'DraftReview';
13
+ /** Documento que espera a la jefatura para la que revisa la funcionaria. */
14
+ export interface InternalReviewQueueItemEntity {
15
+ documentId: string;
16
+ subject: string;
17
+ documentTypeName: string;
18
+ /** «D.E. N° 590/2026», o `null` mientras no tiene número. */
19
+ folio: string | null;
20
+ status: DocumentStatus;
21
+ createdByFullName: string;
22
+ directorateCode: number;
23
+ directorateName: string;
24
+ /** Quién de la jefatura tiene el turno (titular o subrogante). */
25
+ headFullName: string;
26
+ turn: InternalReviewTurn;
27
+ /** Ya le toca a la jefatura (si no, espera turnos anteriores). */
28
+ isCurrent: boolean;
29
+ /** Observaciones internas ya dejadas para esta jefatura. */
30
+ notes: number;
31
+ updatedAt: string;
32
+ }
33
+ /** Observación interna para la jefatura de una dirección. */
34
+ export interface InternalNoteResponseEntity {
35
+ id: string;
36
+ directorateCode: number;
37
+ directorateName: string;
38
+ authorFullName: string;
39
+ /** `Reviewer`: la revisora; `Head`: la jefatura que responde. */
40
+ authorRole: 'Reviewer' | 'Head';
41
+ versionNumber: number;
42
+ text: string;
43
+ createdAt: string;
44
+ }
45
+ export interface DocumentInternalNotesResponseEntity {
46
+ notes: InternalNoteResponseEntity[];
47
+ /** Direcciones para las que quien consulta puede dejar una observación en este documento. */
48
+ canAddFor: {
49
+ directorateCode: number;
50
+ directorateName: string;
51
+ }[];
52
+ }
53
+ export interface DocumentInternalNoteResponseEntity {
54
+ note: InternalNoteResponseEntity;
55
+ /** A quién avisar (lo usa el gateway): la jefatura, si escribió la revisora; las revisoras, si respondió la jefatura. */
56
+ notify: {
57
+ employeeIds: string[];
58
+ };
59
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.40",
3
+ "version": "0.0.1-beta.41",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -362,7 +362,8 @@ export type AuditEntity =
362
362
  | 'ServiceOutage'
363
363
  | 'Repository'
364
364
  | 'DataTreatment'
365
- | 'DocumentTemplate';
365
+ | 'DocumentTemplate'
366
+ | 'DirectorateReviewer';
366
367
 
367
368
  export const AuditEntity = {
368
369
  DocumentType: 'DocumentType',
@@ -376,6 +377,7 @@ export const AuditEntity = {
376
377
  Repository: 'Repository',
377
378
  DataTreatment: 'DataTreatment',
378
379
  DocumentTemplate: 'DocumentTemplate',
380
+ DirectorateReviewer: 'DirectorateReviewer',
379
381
  } satisfies Record<string, AuditEntity>;
380
382
 
381
383
  export type AuditAction = 'Created' | 'Updated' | 'Enabled' | 'Disabled' | 'Removed' | 'Exported';
@@ -727,6 +729,7 @@ export interface DocumentEntity {
727
729
  comments?: DocumentCommentEntity[];
728
730
  draftReviews?: DocumentDraftReviewEntity[];
729
731
  draftingRequest?: DraftingRequestEntity | null;
732
+ internalNotes?: DocumentInternalNoteEntity[];
730
733
  accessRequestDeliveries?: AccessRequestDocumentEntity[];
731
734
  dispatch?: DocumentDispatchEntity | null;
732
735
  docDigitalInbound?: DocDigitalInboundEntity | null;
@@ -1679,4 +1682,28 @@ export interface DraftingRequestEventEntity {
1679
1682
  createdAt: string;
1680
1683
  }
1681
1684
 
1685
+ export interface DirectorateReviewerEntity {
1686
+ id: string;
1687
+ directorateCode: number;
1688
+ directorateName: string;
1689
+ employeeId: string;
1690
+ fullName: string;
1691
+ createdAt: string;
1692
+ }
1693
+
1694
+ export interface DocumentInternalNoteEntity {
1695
+ id: string;
1696
+ documentId: string;
1697
+ document?: DocumentEntity;
1698
+ directorateCode: number;
1699
+ directorateName: string;
1700
+ headEmployeeIds: string[];
1701
+ versionNumber: number;
1702
+ authorEmployeeId: string;
1703
+ authorFullName: string;
1704
+ authorRole: string;
1705
+ text: string;
1706
+ createdAt: string;
1707
+ }
1708
+
1682
1709
  type JsonValue = string | number | boolean | { [key in string]?: JsonValue } | Array<JsonValue> | null;
@@ -80,6 +80,11 @@ export interface DocumentActor {
80
80
  employeeId: string;
81
81
  directorateCodes: number[];
82
82
  departmentIds: string[];
83
+ /**
84
+ * Jefaturas para las que revisa (revisora de jefatura): ve los documentos que les esperan. Lo resuelve el gateway
85
+ * solo donde hace falta (el detalle y el PDF).
86
+ */
87
+ reviewFor?: string[];
83
88
  }
84
89
 
85
90
  /** Bandeja desde la que se lista. Todas son del funcionario (`actor`), salvo `all`. */
@@ -24,6 +24,7 @@ import { RegisterBookPatterns, type RegisterBookContract } from './registerBook.
24
24
  import { SignatureBatchPatterns, type SignatureBatchContract } from './signatureBatch.contract';
25
25
  import { WorkFolderPatterns, type WorkFolderContract } from './workFolder.contract';
26
26
  import { DraftingRequestPatterns, type DraftingRequestContract } from './draftingRequest.contract';
27
+ import { InternalReviewPatterns, type InternalReviewContract } from './internalReview.contract';
27
28
 
28
29
  export * from './contract';
29
30
  export * from './document.contract';
@@ -52,6 +53,7 @@ export * from './desk.contract';
52
53
  export * from './mailIntake.contract';
53
54
  export * from './push.contract';
54
55
  export * from './draftingRequest.contract';
56
+ export * from './internalReview.contract';
55
57
 
56
58
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
57
59
  export const GestorDocumentalPatterns = {
@@ -81,6 +83,7 @@ export const GestorDocumentalPatterns = {
81
83
  mailIntake: MailIntakePatterns,
82
84
  push: PushPatterns,
83
85
  draftingRequest: DraftingRequestPatterns,
86
+ internalReview: InternalReviewPatterns,
84
87
  } as const;
85
88
 
86
89
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -109,4 +112,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
109
112
  DeskContract &
110
113
  MailIntakeContract &
111
114
  PushContract &
112
- DraftingRequestContract;
115
+ DraftingRequestContract &
116
+ InternalReviewContract;
@@ -0,0 +1,66 @@
1
+ import {
2
+ type DirectorateReviewersEntity,
3
+ type DocumentInternalNoteResponseEntity,
4
+ type DocumentInternalNotesResponseEntity,
5
+ type InternalReviewQueueItemEntity,
6
+ } from '../entities';
7
+ import { type AuditActorInput } from '../entities';
8
+
9
+ /** Patrones NATS de `internalReview`: revisoras de jefatura y sus observaciones internas. */
10
+ export const InternalReviewPatterns = {
11
+ getReviewers: 'gestorDocumental.internalReview.getReviewers',
12
+ setReviewers: 'gestorDocumental.internalReview.setReviewers',
13
+ getAssignments: 'gestorDocumental.internalReview.getAssignments',
14
+ getQueue: 'gestorDocumental.internalReview.getQueue',
15
+ getNotes: 'gestorDocumental.internalReview.getNotes',
16
+ addNote: 'gestorDocumental.internalReview.addNote',
17
+ } as const;
18
+
19
+ /**
20
+ * Dirección para la que actúa quien consulta: como revisora de su jefatura o como la jefatura misma. La resuelve el
21
+ * gateway: quiénes la dirigen hoy (titular y subrogante) no los dice el navegador.
22
+ */
23
+ export interface InternalReviewScope {
24
+ directorateCode: number;
25
+ directorateName: string;
26
+ headEmployeeIds: string[];
27
+ role: 'Reviewer' | 'Head';
28
+ }
29
+
30
+ export interface InternalReviewContract {
31
+ [InternalReviewPatterns.getReviewers]: { payload: Record<string, never>; response: DirectorateReviewersEntity[] };
32
+ /** Reemplaza las revisoras de una dirección (sin ninguna, la dirección queda sin revisoras). */
33
+ [InternalReviewPatterns.setReviewers]: {
34
+ payload: {
35
+ directorateCode: number;
36
+ directorateName: string;
37
+ reviewers: { employeeId: string; fullName: string }[];
38
+ auditActor?: AuditActorInput;
39
+ };
40
+ response: { id: string; ok: boolean };
41
+ };
42
+ /** Direcciones para cuya jefatura revisa una funcionaria. */
43
+ [InternalReviewPatterns.getAssignments]: {
44
+ payload: { employeeId: string };
45
+ response: { directorateCode: number; directorateName: string }[];
46
+ };
47
+ /** Documentos que esperan a las jefaturas para las que revisa quien consulta. */
48
+ [InternalReviewPatterns.getQueue]: {
49
+ payload: { actor: { employeeId: string }; scopes: InternalReviewScope[] };
50
+ response: InternalReviewQueueItemEntity[];
51
+ };
52
+ [InternalReviewPatterns.getNotes]: {
53
+ payload: { documentId: string; actor: { employeeId: string }; scopes: InternalReviewScope[] };
54
+ response: DocumentInternalNotesResponseEntity;
55
+ };
56
+ [InternalReviewPatterns.addNote]: {
57
+ payload: {
58
+ documentId: string;
59
+ directorateCode: number;
60
+ text: string;
61
+ actor: { employeeId: string; fullName: string };
62
+ scopes: InternalReviewScope[];
63
+ };
64
+ response: DocumentInternalNoteResponseEntity;
65
+ };
66
+ }
@@ -24,3 +24,4 @@ export * from './mailIntake';
24
24
  export * from './push';
25
25
  export * from './documentTemplate';
26
26
  export * from './draftingRequest';
27
+ export * from './internalReview';
@@ -0,0 +1 @@
1
+ export * from './internalReview.entity';
@@ -0,0 +1,57 @@
1
+ import { type DocumentStatus } from '../../base/entities';
2
+
3
+ /** Revisoras asignadas a la jefatura de una dirección. */
4
+ export interface DirectorateReviewersEntity {
5
+ directorateCode: number;
6
+ directorateName: string;
7
+ reviewers: { employeeId: string; fullName: string }[];
8
+ }
9
+
10
+ /** Qué espera de la jefatura un documento de la cola de revisión. */
11
+ export type InternalReviewTurn = 'Visa' | 'Signature' | 'DraftReview';
12
+
13
+ /** Documento que espera a la jefatura para la que revisa la funcionaria. */
14
+ export interface InternalReviewQueueItemEntity {
15
+ documentId: string;
16
+ subject: string;
17
+ documentTypeName: string;
18
+ /** «D.E. N° 590/2026», o `null` mientras no tiene número. */
19
+ folio: string | null;
20
+ status: DocumentStatus;
21
+ createdByFullName: string;
22
+ directorateCode: number;
23
+ directorateName: string;
24
+ /** Quién de la jefatura tiene el turno (titular o subrogante). */
25
+ headFullName: string;
26
+ turn: InternalReviewTurn;
27
+ /** Ya le toca a la jefatura (si no, espera turnos anteriores). */
28
+ isCurrent: boolean;
29
+ /** Observaciones internas ya dejadas para esta jefatura. */
30
+ notes: number;
31
+ updatedAt: string;
32
+ }
33
+
34
+ /** Observación interna para la jefatura de una dirección. */
35
+ export interface InternalNoteResponseEntity {
36
+ id: string;
37
+ directorateCode: number;
38
+ directorateName: string;
39
+ authorFullName: string;
40
+ /** `Reviewer`: la revisora; `Head`: la jefatura que responde. */
41
+ authorRole: 'Reviewer' | 'Head';
42
+ versionNumber: number;
43
+ text: string;
44
+ createdAt: string;
45
+ }
46
+
47
+ export interface DocumentInternalNotesResponseEntity {
48
+ notes: InternalNoteResponseEntity[];
49
+ /** Direcciones para las que quien consulta puede dejar una observación en este documento. */
50
+ canAddFor: { directorateCode: number; directorateName: string }[];
51
+ }
52
+
53
+ export interface DocumentInternalNoteResponseEntity {
54
+ note: InternalNoteResponseEntity;
55
+ /** A quién avisar (lo usa el gateway): la jefatura, si escribió la revisora; las revisoras, si respondió la jefatura. */
56
+ notify: { employeeIds: string[] };
57
+ }