@muni-sanfer/types-gestor-documental 0.0.1-beta.4 → 0.0.1-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/base/entities.d.ts +103 -1
  2. package/dist/base/entities.js +18 -1
  3. package/dist/contracts/document.contract.d.ts +12 -0
  4. package/dist/contracts/index.d.ts +27 -1
  5. package/dist/contracts/index.js +6 -0
  6. package/dist/contracts/partsOffice.contract.d.ts +171 -0
  7. package/dist/contracts/partsOffice.contract.js +22 -0
  8. package/dist/contracts/registerBook.contract.d.ts +27 -0
  9. package/dist/contracts/registerBook.contract.js +8 -0
  10. package/dist/entities/document/document.entity.d.ts +42 -0
  11. package/dist/entities/index.d.ts +2 -0
  12. package/dist/entities/index.js +2 -0
  13. package/dist/entities/partsOffice/index.d.ts +1 -0
  14. package/dist/entities/partsOffice/index.js +17 -0
  15. package/dist/entities/partsOffice/partsOffice.entity.d.ts +98 -0
  16. package/dist/entities/partsOffice/partsOffice.entity.js +2 -0
  17. package/dist/entities/registerBook/index.d.ts +1 -0
  18. package/dist/entities/registerBook/index.js +17 -0
  19. package/dist/entities/registerBook/registerBook.entity.d.ts +42 -0
  20. package/dist/entities/registerBook/registerBook.entity.js +2 -0
  21. package/package.json +1 -1
  22. package/src/base/entities.ts +114 -1
  23. package/src/contracts/document.contract.ts +16 -0
  24. package/src/contracts/index.ts +12 -1
  25. package/src/contracts/partsOffice.contract.ts +120 -0
  26. package/src/contracts/registerBook.contract.ts +24 -0
  27. package/src/entities/document/document.entity.ts +44 -0
  28. package/src/entities/index.ts +2 -0
  29. package/src/entities/partsOffice/index.ts +1 -0
  30. package/src/entities/partsOffice/partsOffice.entity.ts +103 -0
  31. package/src/entities/registerBook/index.ts +1 -0
  32. package/src/entities/registerBook/registerBook.entity.ts +46 -0
@@ -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';
36
+ export type DocumentTrackingAction = 'Created' | 'Updated' | 'Submitted' | 'Visaed' | 'Signed' | 'Rejected' | 'Finished' | 'Discarded' | 'Numbered' | 'NumberAnnulled' | 'Annulled' | 'Delivered' | 'Derived' | 'Reassigned' | 'Dispatched' | 'DispatchReturned' | 'Received';
37
37
  export declare const DocumentTrackingAction: {
38
38
  Created: "Created";
39
39
  Updated: "Updated";
@@ -49,6 +49,26 @@ export declare const DocumentTrackingAction: {
49
49
  Delivered: "Delivered";
50
50
  Derived: "Derived";
51
51
  Reassigned: "Reassigned";
52
+ Dispatched: "Dispatched";
53
+ DispatchReturned: "DispatchReturned";
54
+ Received: "Received";
55
+ };
56
+ export type DocumentOrigin = 'Internal' | 'DocDigital';
57
+ export declare const DocumentOrigin: {
58
+ Internal: "Internal";
59
+ DocDigital: "DocDigital";
60
+ };
61
+ export type DocumentDispatchStatus = 'Pending' | 'Dispatched' | 'Returned';
62
+ export declare const DocumentDispatchStatus: {
63
+ Pending: "Pending";
64
+ Dispatched: "Dispatched";
65
+ Returned: "Returned";
66
+ };
67
+ export type DocDigitalInboundStatus = 'Pending' | 'Registered' | 'Returned';
68
+ export declare const DocDigitalInboundStatus: {
69
+ Pending: "Pending";
70
+ Registered: "Registered";
71
+ Returned: "Returned";
52
72
  };
53
73
  export type DocumentFlowStepType = 'Employee' | 'DirectorateHead';
54
74
  export declare const DocumentFlowStepType: {
@@ -173,6 +193,14 @@ export interface DocumentEntity {
173
193
  annulledAt?: string | null;
174
194
  annulmentReason?: string | null;
175
195
  responseDueAt?: string | null;
196
+ origin: DocumentOrigin;
197
+ intakeNumber?: number | null;
198
+ intakeYear?: number | null;
199
+ externalFolio?: string | null;
200
+ externalSender?: string | null;
201
+ externalDate?: string | null;
202
+ contentText?: string | null;
203
+ textExtractedAt?: string | null;
176
204
  replyTo?: DocumentEntity | null;
177
205
  replyToDocumentId?: string | null;
178
206
  replies?: DocumentEntity[];
@@ -195,6 +223,9 @@ export interface DocumentEntity {
195
223
  recipients?: DocumentRecipientEntity[];
196
224
  deliveries?: DocumentDeliveryEntity[];
197
225
  caseFileEntries?: CaseFileEntryEntity[];
226
+ externalRecipients?: DocumentExternalRecipientEntity[];
227
+ dispatch?: DocumentDispatchEntity | null;
228
+ docDigitalInbound?: DocDigitalInboundEntity | null;
198
229
  deleted: boolean;
199
230
  createdAt: string;
200
231
  updatedAt: string;
@@ -425,3 +456,74 @@ export interface CaseFileAccessEntity {
425
456
  caseFileId: string;
426
457
  createdAt: string;
427
458
  }
459
+ export interface DocumentExternalRecipientEntity {
460
+ id: string;
461
+ entityId: number;
462
+ entityName: string;
463
+ userId?: number | null;
464
+ userName?: string | null;
465
+ userPosition?: string | null;
466
+ document?: DocumentEntity;
467
+ documentId: string;
468
+ createdAt: string;
469
+ }
470
+ export interface DocumentDispatchEntity {
471
+ id: string;
472
+ status: DocumentDispatchStatus;
473
+ folio?: string | null;
474
+ docDigitalTypeId?: number | null;
475
+ docDigitalTypeName?: string | null;
476
+ docDigitalDocumentId?: string | null;
477
+ docDigitalRequestId?: string | null;
478
+ dispatchedAt?: string | null;
479
+ dispatchedByEmployeeId?: string | null;
480
+ dispatchedByFullName?: string | null;
481
+ returnedAt?: string | null;
482
+ returnedByEmployeeId?: string | null;
483
+ returnedByFullName?: string | null;
484
+ returnReason?: string | null;
485
+ document?: DocumentEntity;
486
+ documentId: string;
487
+ createdAt: string;
488
+ updatedAt: string;
489
+ }
490
+ export interface DocDigitalInboundEntity {
491
+ id: string;
492
+ docDigitalDocumentId: string;
493
+ docDigitalRequestId?: string | null;
494
+ status: DocDigitalInboundStatus;
495
+ subject: string;
496
+ description?: string | null;
497
+ folio?: string | null;
498
+ folioDate?: string | null;
499
+ typeName?: string | null;
500
+ reserved: boolean;
501
+ senderEntityId?: number | null;
502
+ senderEntityName?: string | null;
503
+ senderName?: string | null;
504
+ senderPosition?: string | null;
505
+ fileId?: string | null;
506
+ fileName?: string | null;
507
+ attachments: JsonValue;
508
+ registeredAt?: string | null;
509
+ registeredByEmployeeId?: string | null;
510
+ registeredByFullName?: string | null;
511
+ acknowledgedAt?: string | null;
512
+ acknowledgeError?: string | null;
513
+ returnedAt?: string | null;
514
+ returnedByEmployeeId?: string | null;
515
+ returnedByFullName?: string | null;
516
+ returnReason?: string | null;
517
+ document?: DocumentEntity | null;
518
+ documentId?: string | null;
519
+ createdAt: string;
520
+ updatedAt: string;
521
+ }
522
+ export interface IntakeSequenceEntity {
523
+ year: number;
524
+ next: number;
525
+ }
526
+ type JsonValue = string | number | boolean | {
527
+ [key in string]?: JsonValue;
528
+ } | Array<JsonValue> | null;
529
+ export {};
@@ -1,7 +1,7 @@
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.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.DocumentTrackingAction = exports.DocumentParticipantStatus = exports.DocumentParticipantRole = exports.DocumentAccessLevel = exports.DocumentStatus = exports.DocumentCategory = void 0;
4
+ 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.DocumentOrigin = exports.DocumentTrackingAction = exports.DocumentParticipantStatus = exports.DocumentParticipantRole = exports.DocumentAccessLevel = exports.DocumentStatus = exports.DocumentCategory = void 0;
5
5
  exports.DocumentCategory = {
6
6
  Decree: 'Decree',
7
7
  Communication: 'Communication',
@@ -47,6 +47,23 @@ exports.DocumentTrackingAction = {
47
47
  Delivered: 'Delivered',
48
48
  Derived: 'Derived',
49
49
  Reassigned: 'Reassigned',
50
+ Dispatched: 'Dispatched',
51
+ DispatchReturned: 'DispatchReturned',
52
+ Received: 'Received',
53
+ };
54
+ exports.DocumentOrigin = {
55
+ Internal: 'Internal',
56
+ DocDigital: 'DocDigital',
57
+ };
58
+ exports.DocumentDispatchStatus = {
59
+ Pending: 'Pending',
60
+ Dispatched: 'Dispatched',
61
+ Returned: 'Returned',
62
+ };
63
+ exports.DocDigitalInboundStatus = {
64
+ Pending: 'Pending',
65
+ Registered: 'Registered',
66
+ Returned: 'Returned',
50
67
  };
51
68
  exports.DocumentFlowStepType = {
52
69
  Employee: 'Employee',
@@ -73,9 +73,15 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
73
73
  recipients?: DocumentRecipientInput[];
74
74
  responseDueAt?: string | null;
75
75
  replyToDocumentId?: string | null;
76
+ externalRecipients?: DocumentExternalRecipientInput[];
76
77
  action?: 'Submit';
77
78
  actor: DocumentActor;
78
79
  }
80
+ /** Destinatario externo: una institución de DocDigital y, si se indica, uno de sus usuarios. */
81
+ export interface DocumentExternalRecipientInput {
82
+ entityId: number;
83
+ userId?: number | null;
84
+ }
79
85
  /**
80
86
  * Qué se envía y qué se responde en cada patrón. Generado desde los handlers y los DTO del microservicio.
81
87
  */
@@ -93,6 +99,12 @@ export interface DocumentContract {
93
99
  documentTypeId?: string;
94
100
  dateFrom?: string;
95
101
  dateTo?: string;
102
+ number?: number;
103
+ year?: number;
104
+ signerEmployeeId?: string;
105
+ authorEmployeeId?: string;
106
+ directorateCodeReference?: number;
107
+ text?: string;
96
108
  };
97
109
  actor?: DocumentActor;
98
110
  };
@@ -1,12 +1,16 @@
1
1
  import { type CaseFileContract } from './caseFile.contract';
2
2
  import { type DocumentContract } from './document.contract';
3
3
  import { type DocumentTypeContract } from './documentType.contract';
4
+ import { type PartsOfficeContract } from './partsOffice.contract';
4
5
  import { type ProcedureContract } from './procedure.contract';
6
+ import { type RegisterBookContract } from './registerBook.contract';
5
7
  export * from './contract';
6
8
  export * from './document.contract';
7
9
  export * from './documentType.contract';
8
10
  export * from './procedure.contract';
9
11
  export * from './caseFile.contract';
12
+ export * from './partsOffice.contract';
13
+ export * from './registerBook.contract';
10
14
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
11
15
  export declare const GestorDocumentalPatterns: {
12
16
  readonly documentType: {
@@ -53,6 +57,28 @@ export declare const GestorDocumentalPatterns: {
53
57
  readonly getEntryFile: "gestorDocumental.caseFile.getEntryFile";
54
58
  readonly getExport: "gestorDocumental.caseFile.getExport";
55
59
  };
60
+ readonly partsOffice: {
61
+ readonly getStatus: "gestorDocumental.partsOffice.getStatus";
62
+ readonly getSummary: "gestorDocumental.partsOffice.getSummary";
63
+ readonly getEntities: "gestorDocumental.partsOffice.getEntities";
64
+ readonly getUsers: "gestorDocumental.partsOffice.getUsers";
65
+ readonly getDocumentTypes: "gestorDocumental.partsOffice.getDocumentTypes";
66
+ readonly getDispatches: "gestorDocumental.partsOffice.getDispatches";
67
+ readonly dispatch: "gestorDocumental.partsOffice.dispatch";
68
+ readonly returnDispatch: "gestorDocumental.partsOffice.returnDispatch";
69
+ readonly resendDispatch: "gestorDocumental.partsOffice.resendDispatch";
70
+ readonly getDispatchFile: "gestorDocumental.partsOffice.getDispatchFile";
71
+ readonly getInbound: "gestorDocumental.partsOffice.getInbound";
72
+ readonly syncInbound: "gestorDocumental.partsOffice.syncInbound";
73
+ readonly registerInbound: "gestorDocumental.partsOffice.registerInbound";
74
+ readonly acknowledgeInbound: "gestorDocumental.partsOffice.acknowledgeInbound";
75
+ readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
76
+ readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
77
+ };
78
+ readonly registerBook: {
79
+ readonly get: "gestorDocumental.registerBook.get";
80
+ readonly export: "gestorDocumental.registerBook.export";
81
+ };
56
82
  };
57
83
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
58
- export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & CaseFileContract;
84
+ export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & CaseFileContract & PartsOfficeContract & RegisterBookContract;
@@ -18,16 +18,22 @@ exports.GestorDocumentalPatterns = void 0;
18
18
  const caseFile_contract_1 = require("./caseFile.contract");
19
19
  const document_contract_1 = require("./document.contract");
20
20
  const documentType_contract_1 = require("./documentType.contract");
21
+ const partsOffice_contract_1 = require("./partsOffice.contract");
21
22
  const procedure_contract_1 = require("./procedure.contract");
23
+ const registerBook_contract_1 = require("./registerBook.contract");
22
24
  __exportStar(require("./contract"), exports);
23
25
  __exportStar(require("./document.contract"), exports);
24
26
  __exportStar(require("./documentType.contract"), exports);
25
27
  __exportStar(require("./procedure.contract"), exports);
26
28
  __exportStar(require("./caseFile.contract"), exports);
29
+ __exportStar(require("./partsOffice.contract"), exports);
30
+ __exportStar(require("./registerBook.contract"), exports);
27
31
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
28
32
  exports.GestorDocumentalPatterns = {
29
33
  documentType: documentType_contract_1.DocumentTypePatterns,
30
34
  document: document_contract_1.DocumentPatterns,
31
35
  procedure: procedure_contract_1.ProcedurePatterns,
32
36
  caseFile: caseFile_contract_1.CaseFilePatterns,
37
+ partsOffice: partsOffice_contract_1.PartsOfficePatterns,
38
+ registerBook: registerBook_contract_1.RegisterBookPatterns,
33
39
  };
@@ -0,0 +1,171 @@
1
+ import { type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
2
+ import { type DocDigitalDocumentTypeEntity, type DocDigitalEntityEntity, type PartsOfficeInboundEntity, type DocDigitalUserEntity, type PartsOfficeDispatchEntity, type PartsOfficeFileEntity, type PartsOfficeOkResponseEntity, type PartsOfficeRegisterResponseEntity, type PartsOfficeStatusEntity, type PartsOfficeSummaryEntity, type PartsOfficeSyncResponseEntity } from '../entities';
3
+ import { type RpcPage } from './contract';
4
+ import { type DocumentActor, type DocumentExternalRecipientInput } from './document.contract';
5
+ /** Patrones NATS de `partsOffice` (Oficina de Partes y DocDigital): `<servicio>.<recurso>.<acción>`. */
6
+ export declare const PartsOfficePatterns: {
7
+ readonly getStatus: "gestorDocumental.partsOffice.getStatus";
8
+ readonly getSummary: "gestorDocumental.partsOffice.getSummary";
9
+ readonly getEntities: "gestorDocumental.partsOffice.getEntities";
10
+ readonly getUsers: "gestorDocumental.partsOffice.getUsers";
11
+ readonly getDocumentTypes: "gestorDocumental.partsOffice.getDocumentTypes";
12
+ readonly getDispatches: "gestorDocumental.partsOffice.getDispatches";
13
+ readonly dispatch: "gestorDocumental.partsOffice.dispatch";
14
+ readonly returnDispatch: "gestorDocumental.partsOffice.returnDispatch";
15
+ readonly resendDispatch: "gestorDocumental.partsOffice.resendDispatch";
16
+ readonly getDispatchFile: "gestorDocumental.partsOffice.getDispatchFile";
17
+ readonly getInbound: "gestorDocumental.partsOffice.getInbound";
18
+ readonly syncInbound: "gestorDocumental.partsOffice.syncInbound";
19
+ readonly registerInbound: "gestorDocumental.partsOffice.registerInbound";
20
+ readonly acknowledgeInbound: "gestorDocumental.partsOffice.acknowledgeInbound";
21
+ readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
22
+ readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
23
+ };
24
+ /** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
25
+ export type PartsOfficeRecipientInput = {
26
+ type: 'Employee';
27
+ employeeId: string;
28
+ } | {
29
+ type: 'Directorate';
30
+ directorateCodeReference: number;
31
+ name: string;
32
+ memberEmployeeIds: string[];
33
+ } | {
34
+ type: 'Department';
35
+ departmentId: string;
36
+ name: string;
37
+ memberEmployeeIds: string[];
38
+ };
39
+ interface IListPayload<S> {
40
+ pagination?: {
41
+ page?: number;
42
+ limit?: number;
43
+ };
44
+ filters?: {
45
+ search?: string;
46
+ status?: S;
47
+ };
48
+ }
49
+ export interface PartsOfficeContract {
50
+ [PartsOfficePatterns.getStatus]: {
51
+ payload: Record<string, never>;
52
+ response: PartsOfficeStatusEntity;
53
+ };
54
+ [PartsOfficePatterns.getSummary]: {
55
+ payload: Record<string, never>;
56
+ response: PartsOfficeSummaryEntity;
57
+ };
58
+ /** Directorio de DocDigital: instituciones por nombre. */
59
+ [PartsOfficePatterns.getEntities]: {
60
+ payload: {
61
+ search?: string;
62
+ };
63
+ response: DocDigitalEntityEntity[];
64
+ };
65
+ [PartsOfficePatterns.getUsers]: {
66
+ payload: {
67
+ entityId: number;
68
+ search?: string;
69
+ };
70
+ response: DocDigitalUserEntity[];
71
+ };
72
+ [PartsOfficePatterns.getDocumentTypes]: {
73
+ payload: Record<string, never>;
74
+ response: DocDigitalDocumentTypeEntity[];
75
+ };
76
+ [PartsOfficePatterns.getDispatches]: {
77
+ payload: IListPayload<'Pending' | 'Dispatched' | 'Returned'>;
78
+ response: RpcPage<PartsOfficeDispatchEntity[]>;
79
+ };
80
+ /** Despacha por DocDigital, con el número del documento como folio. `operatorRun`: RUN de quien despacha. */
81
+ [PartsOfficePatterns.dispatch]: {
82
+ payload: {
83
+ id: string;
84
+ docDigitalTypeId: number;
85
+ operatorRun?: string | null;
86
+ actor: DocumentActor;
87
+ };
88
+ response: PartsOfficeOkResponseEntity & {
89
+ docDigitalDocumentId: string;
90
+ };
91
+ };
92
+ /** Devuelve el despacho al redactor, con el motivo (por ejemplo, un destinatario equivocado). */
93
+ [PartsOfficePatterns.returnDispatch]: {
94
+ payload: {
95
+ id: string;
96
+ reason: string;
97
+ actor: DocumentActor;
98
+ };
99
+ response: PartsOfficeOkResponseEntity;
100
+ };
101
+ /** El redactor corrige las instituciones de destino de un despacho devuelto y lo envía de nuevo a Partes. */
102
+ [PartsOfficePatterns.resendDispatch]: {
103
+ payload: {
104
+ id: string;
105
+ externalRecipients: DocumentExternalRecipientInput[];
106
+ actor: DocumentActor;
107
+ };
108
+ response: PartsOfficeOkResponseEntity;
109
+ };
110
+ /** PDF firmado de un documento por despachar, para que Oficina de Partes lo revise. */
111
+ [PartsOfficePatterns.getDispatchFile]: {
112
+ payload: {
113
+ id: string;
114
+ };
115
+ response: PartsOfficeFileEntity;
116
+ };
117
+ [PartsOfficePatterns.getInbound]: {
118
+ payload: IListPayload<'Pending' | 'Registered' | 'Returned'>;
119
+ response: RpcPage<PartsOfficeInboundEntity[]>;
120
+ };
121
+ /** Trae de DocDigital lo recibido que aún no tiene acuse de recibo. */
122
+ [PartsOfficePatterns.syncInbound]: {
123
+ payload: Record<string, never>;
124
+ response: PartsOfficeSyncResponseEntity;
125
+ };
126
+ /**
127
+ * Ingresa un recibido al gestor: le da folio de ingreso, lo deriva a quienes corresponda y da el acuse de recibo
128
+ * en DocDigital.
129
+ */
130
+ [PartsOfficePatterns.registerInbound]: {
131
+ payload: {
132
+ id: string;
133
+ documentTypeId: string;
134
+ keywords: string[];
135
+ accessLevel: DocumentAccessLevel;
136
+ hasSensitiveData: boolean;
137
+ recipients: PartsOfficeRecipientInput[];
138
+ instruction: DocumentInstruction;
139
+ note?: string | null;
140
+ dueAt?: string | null;
141
+ actor: DocumentActor;
142
+ };
143
+ response: PartsOfficeRegisterResponseEntity;
144
+ };
145
+ /** Reintenta el acuse de recibo de un recibido ya ingresado. */
146
+ [PartsOfficePatterns.acknowledgeInbound]: {
147
+ payload: {
148
+ id: string;
149
+ actor: DocumentActor;
150
+ };
151
+ response: PartsOfficeOkResponseEntity;
152
+ };
153
+ /** Devuelve el recibido a la institución que lo envió, con el motivo (entre 3 y 255 caracteres). */
154
+ [PartsOfficePatterns.returnInbound]: {
155
+ payload: {
156
+ id: string;
157
+ reason: string;
158
+ actor: DocumentActor;
159
+ };
160
+ response: PartsOfficeOkResponseEntity;
161
+ };
162
+ /** Archivo de un recibido: el principal o, con `attachment`, uno de sus anexos (por su posición). */
163
+ [PartsOfficePatterns.getInboundFile]: {
164
+ payload: {
165
+ id: string;
166
+ attachment?: number;
167
+ };
168
+ response: PartsOfficeFileEntity;
169
+ };
170
+ }
171
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartsOfficePatterns = void 0;
4
+ /** Patrones NATS de `partsOffice` (Oficina de Partes y DocDigital): `<servicio>.<recurso>.<acción>`. */
5
+ exports.PartsOfficePatterns = {
6
+ getStatus: 'gestorDocumental.partsOffice.getStatus',
7
+ getSummary: 'gestorDocumental.partsOffice.getSummary',
8
+ getEntities: 'gestorDocumental.partsOffice.getEntities',
9
+ getUsers: 'gestorDocumental.partsOffice.getUsers',
10
+ getDocumentTypes: 'gestorDocumental.partsOffice.getDocumentTypes',
11
+ getDispatches: 'gestorDocumental.partsOffice.getDispatches',
12
+ dispatch: 'gestorDocumental.partsOffice.dispatch',
13
+ returnDispatch: 'gestorDocumental.partsOffice.returnDispatch',
14
+ resendDispatch: 'gestorDocumental.partsOffice.resendDispatch',
15
+ getDispatchFile: 'gestorDocumental.partsOffice.getDispatchFile',
16
+ getInbound: 'gestorDocumental.partsOffice.getInbound',
17
+ syncInbound: 'gestorDocumental.partsOffice.syncInbound',
18
+ registerInbound: 'gestorDocumental.partsOffice.registerInbound',
19
+ acknowledgeInbound: 'gestorDocumental.partsOffice.acknowledgeInbound',
20
+ returnInbound: 'gestorDocumental.partsOffice.returnInbound',
21
+ getInboundFile: 'gestorDocumental.partsOffice.getInboundFile',
22
+ };
@@ -0,0 +1,27 @@
1
+ import { type RegisterBookEntity, type RegisterBookExportEntity, type RegisterBookKind } from '../entities';
2
+ /** Patrones NATS de `registerBook` (libros de registro): `<servicio>.<recurso>.<acción>`. */
3
+ export declare const RegisterBookPatterns: {
4
+ readonly get: "gestorDocumental.registerBook.get";
5
+ readonly export: "gestorDocumental.registerBook.export";
6
+ };
7
+ /** Qué libro y qué período: un año y, si se indica, un mes. El de un tipo documental exige el tipo. */
8
+ export interface RegisterBookQuery {
9
+ kind: RegisterBookKind;
10
+ documentTypeId?: string;
11
+ year: number;
12
+ month?: number | null;
13
+ }
14
+ export interface RegisterBookContract {
15
+ [RegisterBookPatterns.get]: {
16
+ payload: RegisterBookQuery;
17
+ response: RegisterBookEntity;
18
+ };
19
+ /** El libro en Excel o PDF. `generatedBy`: quién lo descarga (va en el encabezado). */
20
+ [RegisterBookPatterns.export]: {
21
+ payload: RegisterBookQuery & {
22
+ format: 'xlsx' | 'pdf';
23
+ generatedBy: string;
24
+ };
25
+ response: RegisterBookExportEntity;
26
+ };
27
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterBookPatterns = void 0;
4
+ /** Patrones NATS de `registerBook` (libros de registro): `<servicio>.<recurso>.<acción>`. */
5
+ exports.RegisterBookPatterns = {
6
+ get: 'gestorDocumental.registerBook.get',
7
+ export: 'gestorDocumental.registerBook.export',
8
+ };
@@ -55,6 +55,31 @@ export interface DocumentLinkEntity {
55
55
  createdByFullName: DocumentEntity['createdByFullName'];
56
56
  finishedAt: DocumentEntity['finishedAt'];
57
57
  documentType: DocumentTypeSummaryEntity;
58
+ /** Folio de ingreso de Oficina de Partes, si llegó por DocDigital. */
59
+ intakeNumber: DocumentEntity['intakeNumber'];
60
+ intakeYear: DocumentEntity['intakeYear'];
61
+ }
62
+ /** Institución (y usuario) de DocDigital a la que va dirigido un documento. */
63
+ export interface DocumentExternalRecipientResponseEntity {
64
+ id: string;
65
+ entityId: number;
66
+ entityName: string;
67
+ userId: number | null;
68
+ userName: string | null;
69
+ userPosition: string | null;
70
+ }
71
+ /** Despacho de un documento por DocDigital. */
72
+ export interface DocumentDispatchResponseEntity {
73
+ id: string;
74
+ status: 'Pending' | 'Dispatched' | 'Returned';
75
+ folio: string | null;
76
+ docDigitalTypeName: string | null;
77
+ docDigitalDocumentId: string | null;
78
+ dispatchedAt: string | null;
79
+ dispatchedByFullName: string | null;
80
+ returnedAt: string | null;
81
+ returnedByFullName: string | null;
82
+ returnReason: string | null;
58
83
  }
59
84
  export interface DocumentGetAllResponseEntity {
60
85
  id: DocumentEntity['id'];
@@ -69,6 +94,11 @@ export interface DocumentGetAllResponseEntity {
69
94
  createdByEmployeeId: DocumentEntity['createdByEmployeeId'];
70
95
  createdByFullName: DocumentEntity['createdByFullName'];
71
96
  documentType: DocumentTypeSummaryEntity;
97
+ intakeNumber: DocumentEntity['intakeNumber'];
98
+ intakeYear: DocumentEntity['intakeYear'];
99
+ origin: DocumentEntity['origin'];
100
+ /** Con búsqueda de texto completo: el fragmento donde aparece lo buscado, con lo encontrado entre ⟦ y ⟧. */
101
+ snippet?: string | null;
72
102
  currentParticipant: Pick<DocumentParticipantResponseEntity, 'role' | 'employeeId' | 'fullName'> | null;
73
103
  distribution: {
74
104
  total: number;
@@ -123,6 +153,16 @@ export interface DocumentGetByIdResponseEntity {
123
153
  title: string;
124
154
  status: 'Open' | 'Closed';
125
155
  }[];
156
+ /** De dónde viene: del gestor o recibido por DocDigital, con su folio de ingreso y los datos de quien lo envió. */
157
+ origin: DocumentEntity['origin'];
158
+ intakeNumber: DocumentEntity['intakeNumber'];
159
+ intakeYear: DocumentEntity['intakeYear'];
160
+ externalFolio: DocumentEntity['externalFolio'];
161
+ externalSender: DocumentEntity['externalSender'];
162
+ externalDate: DocumentEntity['externalDate'];
163
+ /** Instituciones de DocDigital a quienes va dirigido, y su despacho por Oficina de Partes. */
164
+ externalRecipients: DocumentExternalRecipientResponseEntity[];
165
+ dispatch: DocumentDispatchResponseEntity | null;
126
166
  documentType: DocumentTypeSummaryEntity;
127
167
  participants: DocumentParticipantResponseEntity[];
128
168
  attachments: {
@@ -147,6 +187,8 @@ export interface DocumentGetByIdResponseEntity {
147
187
  canDerive: boolean;
148
188
  canReply: boolean;
149
189
  canReassign: boolean;
190
+ /** Quien consulta redactó el documento (o lo ingresó, si llegó por DocDigital). */
191
+ isAuthor: boolean;
150
192
  inbox: DocumentDeliveryResponseEntity[];
151
193
  };
152
194
  signatureRequiresOtp: boolean;
@@ -2,3 +2,5 @@ export * from './documentType';
2
2
  export * from './document';
3
3
  export * from './procedure';
4
4
  export * from './caseFile';
5
+ export * from './partsOffice';
6
+ export * from './registerBook';
@@ -18,3 +18,5 @@ __exportStar(require("./documentType"), exports);
18
18
  __exportStar(require("./document"), exports);
19
19
  __exportStar(require("./procedure"), exports);
20
20
  __exportStar(require("./caseFile"), exports);
21
+ __exportStar(require("./partsOffice"), exports);
22
+ __exportStar(require("./registerBook"), exports);
@@ -0,0 +1 @@
1
+ export * from './partsOffice.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("./partsOffice.entity"), exports);