@muni-sanfer/types-gestor-documental 0.0.1-beta.24 → 0.0.1-beta.26

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.
@@ -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' | 'Received' | 'EmailCopySent' | 'EmailCopyOpened' | 'DispositionRecorded';
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';
37
37
  export declare const DocumentTrackingAction: {
38
38
  Created: "Created";
39
39
  Updated: "Updated";
@@ -51,15 +51,24 @@ export declare const DocumentTrackingAction: {
51
51
  Reassigned: "Reassigned";
52
52
  Dispatched: "Dispatched";
53
53
  DispatchReturned: "DispatchReturned";
54
+ DispatchedByContingency: "DispatchedByContingency";
54
55
  Received: "Received";
55
56
  EmailCopySent: "EmailCopySent";
56
57
  EmailCopyOpened: "EmailCopyOpened";
57
58
  DispositionRecorded: "DispositionRecorded";
58
59
  };
59
- export type DocumentOrigin = 'Internal' | 'DocDigital';
60
+ export type DocumentOrigin = 'Internal' | 'DocDigital' | 'Manual';
60
61
  export declare const DocumentOrigin: {
61
62
  Internal: "Internal";
62
63
  DocDigital: "DocDigital";
64
+ Manual: "Manual";
65
+ };
66
+ export type CommunicationMeans = 'Paper' | 'Email' | 'Courier' | 'Other';
67
+ export declare const CommunicationMeans: {
68
+ Paper: "Paper";
69
+ Email: "Email";
70
+ Courier: "Courier";
71
+ Other: "Other";
63
72
  };
64
73
  export type DocumentDispatchStatus = 'Pending' | 'Dispatched' | 'Returned';
65
74
  export declare const DocumentDispatchStatus: {
@@ -239,6 +248,42 @@ export declare const DispositionKind: {
239
248
  Transfer: "Transfer";
240
249
  Elimination: "Elimination";
241
250
  };
251
+ export type AccessRequestChannel = 'Portal' | 'Email' | 'InPerson' | 'Letter';
252
+ export declare const AccessRequestChannel: {
253
+ Portal: "Portal";
254
+ Email: "Email";
255
+ InPerson: "InPerson";
256
+ Letter: "Letter";
257
+ };
258
+ export type AccessRequestStatus = 'Received' | 'InCorrection' | 'InProgress' | 'Resolved';
259
+ export declare const AccessRequestStatus: {
260
+ Received: "Received";
261
+ InCorrection: "InCorrection";
262
+ InProgress: "InProgress";
263
+ Resolved: "Resolved";
264
+ };
265
+ export type AccessRequestResolution = 'Delivered' | 'PartiallyDelivered' | 'Denied' | 'Derived' | 'NonExistent' | 'Withdrawn';
266
+ export declare const AccessRequestResolution: {
267
+ Delivered: "Delivered";
268
+ PartiallyDelivered: "PartiallyDelivered";
269
+ Denied: "Denied";
270
+ Derived: "Derived";
271
+ NonExistent: "NonExistent";
272
+ Withdrawn: "Withdrawn";
273
+ };
274
+ export type AccessRequestEventAction = 'Received' | 'Updated' | 'CorrectionRequested' | 'Corrected' | 'Assigned' | 'ThirdPartyNotified' | 'OppositionRegistered' | 'Extended' | 'Resolved' | 'AppealRegistered';
275
+ export declare const AccessRequestEventAction: {
276
+ Received: "Received";
277
+ Updated: "Updated";
278
+ CorrectionRequested: "CorrectionRequested";
279
+ Corrected: "Corrected";
280
+ Assigned: "Assigned";
281
+ ThirdPartyNotified: "ThirdPartyNotified";
282
+ OppositionRegistered: "OppositionRegistered";
283
+ Extended: "Extended";
284
+ Resolved: "Resolved";
285
+ AppealRegistered: "AppealRegistered";
286
+ };
242
287
  export interface DocumentTypeEntity {
243
288
  id: string;
244
289
  name: string;
@@ -288,6 +333,7 @@ export interface DocumentEntity {
288
333
  externalFolio?: string | null;
289
334
  externalSender?: string | null;
290
335
  externalDate?: string | null;
336
+ intakeMeans?: CommunicationMeans | null;
291
337
  composition?: JsonValue | null;
292
338
  contentText?: string | null;
293
339
  textExtractedAt?: string | null;
@@ -321,6 +367,8 @@ export interface DocumentEntity {
321
367
  accesses?: DocumentAccessEntity[];
322
368
  disposition?: DispositionRecordEntity | null;
323
369
  dispositionId?: string | null;
370
+ accessRequestResponses?: AccessRequestEntity[];
371
+ accessRequestDeliveries?: AccessRequestDocumentEntity[];
324
372
  dispatch?: DocumentDispatchEntity | null;
325
373
  docDigitalInbound?: DocDigitalInboundEntity | null;
326
374
  deleted: boolean;
@@ -653,6 +701,11 @@ export interface DocumentDispatchEntity {
653
701
  returnedByEmployeeId?: string | null;
654
702
  returnedByFullName?: string | null;
655
703
  returnReason?: string | null;
704
+ contingencyMeans?: CommunicationMeans | null;
705
+ contingencySentTo?: string | null;
706
+ contingencyReason?: string | null;
707
+ contingencyReceiptFileId?: string | null;
708
+ contingencyReceiptName?: string | null;
656
709
  document?: DocumentEntity;
657
710
  documentId: string;
658
711
  createdAt: string;
@@ -851,6 +904,62 @@ export interface DispositionRecordEntity {
851
904
  createdByFullName: string;
852
905
  createdAt: string;
853
906
  }
907
+ export interface AccessRequestEntity {
908
+ id: string;
909
+ number: number;
910
+ year: number;
911
+ externalFolio?: string | null;
912
+ channel: AccessRequestChannel;
913
+ receivedAt: string;
914
+ requesterName: string;
915
+ requesterEmail?: string | null;
916
+ requesterAddress?: string | null;
917
+ requestText: string;
918
+ deliveryFormat?: string | null;
919
+ status: AccessRequestStatus;
920
+ correctionRequestedAt?: string | null;
921
+ correctionDueAt?: string | null;
922
+ correctedAt?: string | null;
923
+ dueAt: string;
924
+ extendedAt?: string | null;
925
+ extensionNote?: string | null;
926
+ assigneeEmployeeId?: string | null;
927
+ assigneeFullName?: string | null;
928
+ thirdPartyNotifiedAt?: string | null;
929
+ oppositionDueAt?: string | null;
930
+ thirdPartyOpposed?: boolean | null;
931
+ resolution?: AccessRequestResolution | null;
932
+ resolvedAt?: string | null;
933
+ denialGrounds: string[];
934
+ derivedTo?: string | null;
935
+ resolutionNote?: string | null;
936
+ responseDocument?: DocumentEntity | null;
937
+ responseDocumentId?: string | null;
938
+ appealedAt?: string | null;
939
+ appealNote?: string | null;
940
+ createdByEmployeeId: string;
941
+ createdByFullName: string;
942
+ documents?: AccessRequestDocumentEntity[];
943
+ events?: AccessRequestEventEntity[];
944
+ createdAt: string;
945
+ updatedAt: string;
946
+ }
947
+ export interface AccessRequestDocumentEntity {
948
+ accessRequest?: AccessRequestEntity;
949
+ accessRequestId: string;
950
+ document?: DocumentEntity;
951
+ documentId: string;
952
+ }
953
+ export interface AccessRequestEventEntity {
954
+ id: string;
955
+ action: AccessRequestEventAction;
956
+ note?: string | null;
957
+ employeeId?: string | null;
958
+ employeeFullName: string;
959
+ accessRequest?: AccessRequestEntity;
960
+ accessRequestId: string;
961
+ createdAt: string;
962
+ }
854
963
  type JsonValue = string | number | boolean | {
855
964
  [key in string]?: JsonValue;
856
965
  } | Array<JsonValue> | null;
@@ -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.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.DocumentOrigin = exports.DocumentTrackingAction = exports.DocumentParticipantStatus = exports.DocumentParticipantRole = exports.DocumentAccessLevel = exports.DocumentStatus = exports.DocumentCategory = void 0;
4
+ 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.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',
@@ -49,6 +49,7 @@ exports.DocumentTrackingAction = {
49
49
  Reassigned: 'Reassigned',
50
50
  Dispatched: 'Dispatched',
51
51
  DispatchReturned: 'DispatchReturned',
52
+ DispatchedByContingency: 'DispatchedByContingency',
52
53
  Received: 'Received',
53
54
  EmailCopySent: 'EmailCopySent',
54
55
  EmailCopyOpened: 'EmailCopyOpened',
@@ -57,6 +58,13 @@ exports.DocumentTrackingAction = {
57
58
  exports.DocumentOrigin = {
58
59
  Internal: 'Internal',
59
60
  DocDigital: 'DocDigital',
61
+ Manual: 'Manual',
62
+ };
63
+ exports.CommunicationMeans = {
64
+ Paper: 'Paper',
65
+ Email: 'Email',
66
+ Courier: 'Courier',
67
+ Other: 'Other',
60
68
  };
61
69
  exports.DocumentDispatchStatus = {
62
70
  Pending: 'Pending',
@@ -211,3 +219,35 @@ exports.DispositionKind = {
211
219
  Transfer: 'Transfer',
212
220
  Elimination: 'Elimination',
213
221
  };
222
+ exports.AccessRequestChannel = {
223
+ Portal: 'Portal',
224
+ Email: 'Email',
225
+ InPerson: 'InPerson',
226
+ Letter: 'Letter',
227
+ };
228
+ exports.AccessRequestStatus = {
229
+ Received: 'Received',
230
+ InCorrection: 'InCorrection',
231
+ InProgress: 'InProgress',
232
+ Resolved: 'Resolved',
233
+ };
234
+ exports.AccessRequestResolution = {
235
+ Delivered: 'Delivered',
236
+ PartiallyDelivered: 'PartiallyDelivered',
237
+ Denied: 'Denied',
238
+ Derived: 'Derived',
239
+ NonExistent: 'NonExistent',
240
+ Withdrawn: 'Withdrawn',
241
+ };
242
+ exports.AccessRequestEventAction = {
243
+ Received: 'Received',
244
+ Updated: 'Updated',
245
+ CorrectionRequested: 'CorrectionRequested',
246
+ Corrected: 'Corrected',
247
+ Assigned: 'Assigned',
248
+ ThirdPartyNotified: 'ThirdPartyNotified',
249
+ OppositionRegistered: 'OppositionRegistered',
250
+ Extended: 'Extended',
251
+ Resolved: 'Resolved',
252
+ AppealRegistered: 'AppealRegistered',
253
+ };
@@ -0,0 +1,109 @@
1
+ import { type AccessRequestChannel, type AccessRequestResolution } from '../base/entities';
2
+ import { type AccessRequestDetailEntity, type AccessRequestListItemEntity, type AccessRequestSummaryEntity } from '../entities';
3
+ import { type RpcPage } from './contract';
4
+ /** Patrones NATS de `accessRequest`: solicitudes de acceso a la información pública (Ley 20.285). */
5
+ export declare const AccessRequestPatterns: {
6
+ readonly getAll: "gestorDocumental.accessRequest.getAll";
7
+ readonly getById: "gestorDocumental.accessRequest.getById";
8
+ readonly getSummary: "gestorDocumental.accessRequest.getSummary";
9
+ readonly create: "gestorDocumental.accessRequest.create";
10
+ readonly update: "gestorDocumental.accessRequest.update";
11
+ readonly act: "gestorDocumental.accessRequest.act";
12
+ };
13
+ export interface AccessRequestWritePayload {
14
+ externalFolio?: string | null;
15
+ channel: AccessRequestChannel;
16
+ /** Fecha y hora de ingreso (ISO): desde ahí corren los 20 días hábiles. */
17
+ receivedAt: string;
18
+ requesterName: string;
19
+ requesterEmail?: string | null;
20
+ requesterAddress?: string | null;
21
+ requestText: string;
22
+ deliveryFormat?: string | null;
23
+ }
24
+ /** Lo que se hace con una solicitud, un paso a la vez. */
25
+ export type AccessRequestAction = {
26
+ type: 'requestCorrection';
27
+ note: string;
28
+ } | {
29
+ type: 'registerCorrection';
30
+ correctedAt?: string | null;
31
+ note?: string | null;
32
+ } | {
33
+ type: 'assign';
34
+ employeeId: string;
35
+ fullName: string;
36
+ note?: string | null;
37
+ } | {
38
+ type: 'notifyThirdParty';
39
+ note: string;
40
+ } | {
41
+ type: 'registerOpposition';
42
+ opposed: boolean;
43
+ note?: string | null;
44
+ } | {
45
+ type: 'extend';
46
+ note: string;
47
+ } | {
48
+ type: 'resolve';
49
+ resolution: AccessRequestResolution;
50
+ grounds?: string[];
51
+ derivedTo?: string | null;
52
+ note?: string | null;
53
+ responseDocumentId?: string | null;
54
+ documentIds?: string[];
55
+ } | {
56
+ type: 'registerAppeal';
57
+ appealedAt?: string | null;
58
+ note: string;
59
+ };
60
+ export interface AccessRequestActor {
61
+ employeeId: string;
62
+ fullName: string;
63
+ }
64
+ export interface AccessRequestContract {
65
+ [AccessRequestPatterns.getAll]: {
66
+ payload: {
67
+ status?: 'open' | 'resolved' | 'all';
68
+ year?: number | null;
69
+ search?: string;
70
+ page?: number;
71
+ limit?: number;
72
+ };
73
+ response: RpcPage<AccessRequestListItemEntity[]>;
74
+ };
75
+ [AccessRequestPatterns.getById]: {
76
+ payload: {
77
+ id: string;
78
+ };
79
+ response: AccessRequestDetailEntity;
80
+ };
81
+ [AccessRequestPatterns.getSummary]: {
82
+ payload: {
83
+ year: number;
84
+ };
85
+ response: AccessRequestSummaryEntity;
86
+ };
87
+ [AccessRequestPatterns.create]: {
88
+ payload: AccessRequestWritePayload & {
89
+ actor: AccessRequestActor;
90
+ };
91
+ response: AccessRequestDetailEntity;
92
+ };
93
+ /** Corrige los datos mientras no está resuelta. */
94
+ [AccessRequestPatterns.update]: {
95
+ payload: AccessRequestWritePayload & {
96
+ id: string;
97
+ actor: AccessRequestActor;
98
+ };
99
+ response: AccessRequestDetailEntity;
100
+ };
101
+ [AccessRequestPatterns.act]: {
102
+ payload: {
103
+ id: string;
104
+ action: AccessRequestAction;
105
+ actor: AccessRequestActor;
106
+ };
107
+ response: AccessRequestDetailEntity;
108
+ };
109
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccessRequestPatterns = void 0;
4
+ /** Patrones NATS de `accessRequest`: solicitudes de acceso a la información pública (Ley 20.285). */
5
+ exports.AccessRequestPatterns = {
6
+ getAll: 'gestorDocumental.accessRequest.getAll',
7
+ getById: 'gestorDocumental.accessRequest.getById',
8
+ getSummary: 'gestorDocumental.accessRequest.getSummary',
9
+ create: 'gestorDocumental.accessRequest.create',
10
+ update: 'gestorDocumental.accessRequest.update',
11
+ act: 'gestorDocumental.accessRequest.act',
12
+ };
@@ -10,6 +10,7 @@ import { type AuditContract } from './audit.contract';
10
10
  import { type SignatureCheckContract } from './signatureCheck.contract';
11
11
  import { type RepositoryExportContract } from './repositoryExport.contract';
12
12
  import { type RetentionContract } from './retention.contract';
13
+ import { type AccessRequestContract } from './accessRequest.contract';
13
14
  import { type ScanContract } from './scan.contract';
14
15
  import { type PartsOfficeContract } from './partsOffice.contract';
15
16
  import { type ProcedureContract } from './procedure.contract';
@@ -35,6 +36,7 @@ export * from './audit.contract';
35
36
  export * from './signatureCheck.contract';
36
37
  export * from './repositoryExport.contract';
37
38
  export * from './retention.contract';
39
+ export * from './accessRequest.contract';
38
40
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
39
41
  export declare const GestorDocumentalPatterns: {
40
42
  readonly documentType: {
@@ -124,6 +126,8 @@ export declare const GestorDocumentalPatterns: {
124
126
  readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
125
127
  readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
126
128
  readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
129
+ readonly dispatchByContingency: "gestorDocumental.partsOffice.dispatchByContingency";
130
+ readonly registerManualIntake: "gestorDocumental.partsOffice.registerManualIntake";
127
131
  };
128
132
  readonly registerBook: {
129
133
  readonly get: "gestorDocumental.registerBook.get";
@@ -207,6 +211,14 @@ export declare const GestorDocumentalPatterns: {
207
211
  readonly getRecords: "gestorDocumental.retention.getRecords";
208
212
  readonly getRecordPdf: "gestorDocumental.retention.getRecordPdf";
209
213
  };
214
+ readonly accessRequest: {
215
+ readonly getAll: "gestorDocumental.accessRequest.getAll";
216
+ readonly getById: "gestorDocumental.accessRequest.getById";
217
+ readonly getSummary: "gestorDocumental.accessRequest.getSummary";
218
+ readonly create: "gestorDocumental.accessRequest.create";
219
+ readonly update: "gestorDocumental.accessRequest.update";
220
+ readonly act: "gestorDocumental.accessRequest.act";
221
+ };
210
222
  };
211
223
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
212
- export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract;
224
+ export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract;
@@ -27,6 +27,7 @@ const audit_contract_1 = require("./audit.contract");
27
27
  const signatureCheck_contract_1 = require("./signatureCheck.contract");
28
28
  const repositoryExport_contract_1 = require("./repositoryExport.contract");
29
29
  const retention_contract_1 = require("./retention.contract");
30
+ const accessRequest_contract_1 = require("./accessRequest.contract");
30
31
  const scan_contract_1 = require("./scan.contract");
31
32
  const partsOffice_contract_1 = require("./partsOffice.contract");
32
33
  const procedure_contract_1 = require("./procedure.contract");
@@ -52,6 +53,7 @@ __exportStar(require("./audit.contract"), exports);
52
53
  __exportStar(require("./signatureCheck.contract"), exports);
53
54
  __exportStar(require("./repositoryExport.contract"), exports);
54
55
  __exportStar(require("./retention.contract"), exports);
56
+ __exportStar(require("./accessRequest.contract"), exports);
55
57
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
56
58
  exports.GestorDocumentalPatterns = {
57
59
  documentType: documentType_contract_1.DocumentTypePatterns,
@@ -72,4 +74,5 @@ exports.GestorDocumentalPatterns = {
72
74
  signatureCheck: signatureCheck_contract_1.SignatureCheckPatterns,
73
75
  repositoryExport: repositoryExport_contract_1.RepositoryExportPatterns,
74
76
  retention: retention_contract_1.RetentionPatterns,
77
+ accessRequest: accessRequest_contract_1.AccessRequestPatterns,
75
78
  };
@@ -1,4 +1,4 @@
1
- import { type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
1
+ import { type CommunicationMeans, type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
2
2
  import { type DocDigitalDocumentTypeEntity, type DocDigitalEntityEntity, type PartsOfficeInboundEntity, type DocDigitalUserEntity, type EnablementPersonInput, type PartsOfficeEnablementEntity, type PartsOfficeDispatchEntity, type PartsOfficeFileEntity, type PartsOfficeOkResponseEntity, type PartsOfficeRegisterResponseEntity, type PartsOfficeStatusEntity, type PartsOfficeSummaryEntity, type PartsOfficeSyncResponseEntity } from '../entities';
3
3
  import { type RpcPage } from './contract';
4
4
  import { type DocumentActor, type DocumentExternalRecipientInput } from './document.contract';
@@ -22,6 +22,8 @@ export declare const PartsOfficePatterns: {
22
22
  readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
23
23
  readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
24
24
  readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
25
+ readonly dispatchByContingency: "gestorDocumental.partsOffice.dispatchByContingency";
26
+ readonly registerManualIntake: "gestorDocumental.partsOffice.registerManualIntake";
25
27
  };
26
28
  /** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
27
29
  export type PartsOfficeRecipientInput = {
@@ -48,6 +50,35 @@ interface IListPayload<S> {
48
50
  status?: S;
49
51
  };
50
52
  }
53
+ /** Lo que llegó fuera de DocDigital y Oficina de Partes ingresa a mano. */
54
+ export interface ManualIntakePayload {
55
+ file: {
56
+ fileId: string;
57
+ name: string;
58
+ };
59
+ attachments?: {
60
+ fileId: string;
61
+ name: string;
62
+ }[];
63
+ means: CommunicationMeans;
64
+ /** Cuándo llegó (ISO); sin él, ahora. */
65
+ receivedAt?: string | null;
66
+ senderEntityName: string;
67
+ senderName?: string | null;
68
+ externalFolio?: string | null;
69
+ externalDate?: string | null;
70
+ subject: string;
71
+ documentTypeId: string;
72
+ keywords: string[];
73
+ accessLevel?: DocumentAccessLevel;
74
+ hasSensitiveData?: boolean;
75
+ recipients: unknown[];
76
+ instruction: DocumentInstruction;
77
+ note?: string | null;
78
+ dueAt?: string | null;
79
+ dueBusinessDays?: number | null;
80
+ actor: DocumentActor;
81
+ }
51
82
  export interface PartsOfficeContract {
52
83
  [PartsOfficePatterns.getStatus]: {
53
84
  payload: Record<string, never>;
@@ -118,6 +149,7 @@ export interface PartsOfficeContract {
118
149
  [PartsOfficePatterns.getDispatchFile]: {
119
150
  payload: {
120
151
  id: string;
152
+ receipt?: boolean;
121
153
  };
122
154
  response: PartsOfficeFileEntity;
123
155
  };
@@ -184,5 +216,33 @@ export interface PartsOfficeContract {
184
216
  };
185
217
  response: PartsOfficeEnablementEntity;
186
218
  };
219
+ /**
220
+ * Registro por contingencia: el documento no se pudo despachar por DocDigital y salió por otro medio. Queda
221
+ * despachado, con el medio, a quién, el motivo y el comprobante; si después se registra en DocDigital, su número.
222
+ */
223
+ [PartsOfficePatterns.dispatchByContingency]: {
224
+ payload: {
225
+ id: string;
226
+ means: CommunicationMeans;
227
+ sentAt: string;
228
+ sentTo: string;
229
+ reason: string;
230
+ receipt?: {
231
+ fileId: string;
232
+ name: string;
233
+ } | null;
234
+ docDigitalDocumentId?: string | null;
235
+ actor: DocumentActor;
236
+ };
237
+ response: PartsOfficeOkResponseEntity;
238
+ };
239
+ /**
240
+ * Ingreso manual: lo que llegó fuera de DocDigital (papel, correo) entra con folio de ingreso, como lo recibido
241
+ * por DocDigital, y se deriva.
242
+ */
243
+ [PartsOfficePatterns.registerManualIntake]: {
244
+ payload: ManualIntakePayload;
245
+ response: PartsOfficeRegisterResponseEntity;
246
+ };
187
247
  }
188
248
  export {};
@@ -21,4 +21,6 @@ exports.PartsOfficePatterns = {
21
21
  returnInbound: 'gestorDocumental.partsOffice.returnInbound',
22
22
  getInboundFile: 'gestorDocumental.partsOffice.getInboundFile',
23
23
  checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
24
+ dispatchByContingency: 'gestorDocumental.partsOffice.dispatchByContingency',
25
+ registerManualIntake: 'gestorDocumental.partsOffice.registerManualIntake',
24
26
  };
@@ -0,0 +1,73 @@
1
+ import { type AccessRequestChannel, type AccessRequestEventAction, type AccessRequestResolution, type AccessRequestStatus } from '../../base/entities';
2
+ /** Semáforo del plazo de respuesta: a tiempo, por vencer (2 días hábiles o menos) o vencido. */
3
+ export type AccessRequestDueStatus = 'OnTime' | 'DueSoon' | 'Overdue';
4
+ export interface AccessRequestListItemEntity {
5
+ id: string;
6
+ /** «N° 15/2026». */
7
+ label: string;
8
+ externalFolio: string | null;
9
+ channel: AccessRequestChannel;
10
+ requesterName: string;
11
+ requestText: string;
12
+ receivedAt: string;
13
+ dueAt: string;
14
+ status: AccessRequestStatus;
15
+ resolution: AccessRequestResolution | null;
16
+ assigneeFullName: string | null;
17
+ /** Solo mientras está abierta. */
18
+ dueStatus: AccessRequestDueStatus | null;
19
+ businessDaysLeft: number | null;
20
+ /** Ya resuelta: si se respondió dentro del plazo. */
21
+ resolvedOnTime: boolean | null;
22
+ }
23
+ export interface AccessRequestDocumentLinkEntity {
24
+ id: string;
25
+ folio: string | null;
26
+ subject: string;
27
+ }
28
+ export interface AccessRequestDetailEntity extends AccessRequestListItemEntity {
29
+ year: number;
30
+ number: number;
31
+ requesterEmail: string | null;
32
+ requesterAddress: string | null;
33
+ deliveryFormat: string | null;
34
+ correctionRequestedAt: string | null;
35
+ correctionDueAt: string | null;
36
+ correctedAt: string | null;
37
+ extendedAt: string | null;
38
+ extensionNote: string | null;
39
+ assigneeEmployeeId: string | null;
40
+ thirdPartyNotifiedAt: string | null;
41
+ oppositionDueAt: string | null;
42
+ thirdPartyOpposed: boolean | null;
43
+ resolvedAt: string | null;
44
+ denialGrounds: string[];
45
+ derivedTo: string | null;
46
+ resolutionNote: string | null;
47
+ responseDocument: AccessRequestDocumentLinkEntity | null;
48
+ documents: AccessRequestDocumentLinkEntity[];
49
+ appealedAt: string | null;
50
+ appealNote: string | null;
51
+ createdByFullName: string;
52
+ /** Se puede prorrogar: abierta, sin prórroga y antes de vencer. */
53
+ canExtend: boolean;
54
+ events: {
55
+ action: AccessRequestEventAction;
56
+ note: string | null;
57
+ employeeFullName: string;
58
+ createdAt: string;
59
+ }[];
60
+ }
61
+ export interface AccessRequestSummaryEntity {
62
+ year: number;
63
+ total: number;
64
+ open: number;
65
+ overdue: number;
66
+ dueSoon: number;
67
+ resolved: Record<AccessRequestResolution, number>;
68
+ /** Respondidas dentro del plazo sobre las respondidas, en %. */
69
+ onTimeRate: number | null;
70
+ /** Días hábiles promedio entre el ingreso (o la subsanación) y la respuesta. */
71
+ averageBusinessDays: number | null;
72
+ appealed: number;
73
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './accessRequest.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("./accessRequest.entity"), exports);
@@ -1,4 +1,4 @@
1
- import { DocumentAnnulledNumberEntity, DocumentAttachmentEntity, DocumentDeliveryEntity, DocumentEntity, DocumentParticipantEntity, DocumentRecipientEntity, DocumentTrackingEntity, DocumentTypeEntity } from '../../base/entities';
1
+ import { type CommunicationMeans, DocumentAnnulledNumberEntity, DocumentAttachmentEntity, DocumentDeliveryEntity, DocumentEntity, DocumentParticipantEntity, DocumentRecipientEntity, DocumentTrackingEntity, DocumentTypeEntity } from '../../base/entities';
2
2
  /** Tipo documental de un documento, con lo necesario para citarlo. */
3
3
  export interface DocumentTypeSummaryEntity {
4
4
  id: DocumentTypeEntity['id'];
@@ -82,6 +82,14 @@ export interface DocumentDispatchResponseEntity {
82
82
  returnedAt: string | null;
83
83
  returnedByFullName: string | null;
84
84
  returnReason: string | null;
85
+ /** Registro por contingencia: salió por otro medio porque no se pudo por DocDigital. */
86
+ contingency: {
87
+ means: CommunicationMeans;
88
+ sentTo: string | null;
89
+ reason: string | null;
90
+ /** Nombre del comprobante, si se adjuntó. */
91
+ receiptName: string | null;
92
+ } | null;
85
93
  }
86
94
  export interface DocumentGetAllResponseEntity {
87
95
  id: DocumentEntity['id'];
@@ -16,3 +16,4 @@ export * from './audit';
16
16
  export * from './signatureCheck';
17
17
  export * from './repositoryExport';
18
18
  export * from './retention';
19
+ export * from './accessRequest';
@@ -32,3 +32,4 @@ __exportStar(require("./audit"), exports);
32
32
  __exportStar(require("./signatureCheck"), exports);
33
33
  __exportStar(require("./repositoryExport"), exports);
34
34
  __exportStar(require("./retention"), exports);
35
+ __exportStar(require("./accessRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.24",
3
+ "version": "0.0.1-beta.26",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -63,6 +63,7 @@ export type DocumentTrackingAction =
63
63
  | 'Reassigned'
64
64
  | 'Dispatched'
65
65
  | 'DispatchReturned'
66
+ | 'DispatchedByContingency'
66
67
  | 'Received'
67
68
  | 'EmailCopySent'
68
69
  | 'EmailCopyOpened'
@@ -85,19 +86,30 @@ export const DocumentTrackingAction = {
85
86
  Reassigned: 'Reassigned',
86
87
  Dispatched: 'Dispatched',
87
88
  DispatchReturned: 'DispatchReturned',
89
+ DispatchedByContingency: 'DispatchedByContingency',
88
90
  Received: 'Received',
89
91
  EmailCopySent: 'EmailCopySent',
90
92
  EmailCopyOpened: 'EmailCopyOpened',
91
93
  DispositionRecorded: 'DispositionRecorded',
92
94
  } satisfies Record<string, DocumentTrackingAction>;
93
95
 
94
- export type DocumentOrigin = 'Internal' | 'DocDigital';
96
+ export type DocumentOrigin = 'Internal' | 'DocDigital' | 'Manual';
95
97
 
96
98
  export const DocumentOrigin = {
97
99
  Internal: 'Internal',
98
100
  DocDigital: 'DocDigital',
101
+ Manual: 'Manual',
99
102
  } satisfies Record<string, DocumentOrigin>;
100
103
 
104
+ export type CommunicationMeans = 'Paper' | 'Email' | 'Courier' | 'Other';
105
+
106
+ export const CommunicationMeans = {
107
+ Paper: 'Paper',
108
+ Email: 'Email',
109
+ Courier: 'Courier',
110
+ Other: 'Other',
111
+ } satisfies Record<string, CommunicationMeans>;
112
+
101
113
  export type DocumentDispatchStatus = 'Pending' | 'Dispatched' | 'Returned';
102
114
 
103
115
  export const DocumentDispatchStatus = {
@@ -363,6 +375,61 @@ export const DispositionKind = {
363
375
  Elimination: 'Elimination',
364
376
  } satisfies Record<string, DispositionKind>;
365
377
 
378
+ export type AccessRequestChannel = 'Portal' | 'Email' | 'InPerson' | 'Letter';
379
+
380
+ export const AccessRequestChannel = {
381
+ Portal: 'Portal',
382
+ Email: 'Email',
383
+ InPerson: 'InPerson',
384
+ Letter: 'Letter',
385
+ } satisfies Record<string, AccessRequestChannel>;
386
+
387
+ export type AccessRequestStatus = 'Received' | 'InCorrection' | 'InProgress' | 'Resolved';
388
+
389
+ export const AccessRequestStatus = {
390
+ Received: 'Received',
391
+ InCorrection: 'InCorrection',
392
+ InProgress: 'InProgress',
393
+ Resolved: 'Resolved',
394
+ } satisfies Record<string, AccessRequestStatus>;
395
+
396
+ export type AccessRequestResolution =
397
+ 'Delivered' | 'PartiallyDelivered' | 'Denied' | 'Derived' | 'NonExistent' | 'Withdrawn';
398
+
399
+ export const AccessRequestResolution = {
400
+ Delivered: 'Delivered',
401
+ PartiallyDelivered: 'PartiallyDelivered',
402
+ Denied: 'Denied',
403
+ Derived: 'Derived',
404
+ NonExistent: 'NonExistent',
405
+ Withdrawn: 'Withdrawn',
406
+ } satisfies Record<string, AccessRequestResolution>;
407
+
408
+ export type AccessRequestEventAction =
409
+ | 'Received'
410
+ | 'Updated'
411
+ | 'CorrectionRequested'
412
+ | 'Corrected'
413
+ | 'Assigned'
414
+ | 'ThirdPartyNotified'
415
+ | 'OppositionRegistered'
416
+ | 'Extended'
417
+ | 'Resolved'
418
+ | 'AppealRegistered';
419
+
420
+ export const AccessRequestEventAction = {
421
+ Received: 'Received',
422
+ Updated: 'Updated',
423
+ CorrectionRequested: 'CorrectionRequested',
424
+ Corrected: 'Corrected',
425
+ Assigned: 'Assigned',
426
+ ThirdPartyNotified: 'ThirdPartyNotified',
427
+ OppositionRegistered: 'OppositionRegistered',
428
+ Extended: 'Extended',
429
+ Resolved: 'Resolved',
430
+ AppealRegistered: 'AppealRegistered',
431
+ } satisfies Record<string, AccessRequestEventAction>;
432
+
366
433
  export interface DocumentTypeEntity {
367
434
  id: string;
368
435
  name: string;
@@ -413,6 +480,7 @@ export interface DocumentEntity {
413
480
  externalFolio?: string | null;
414
481
  externalSender?: string | null;
415
482
  externalDate?: string | null;
483
+ intakeMeans?: CommunicationMeans | null;
416
484
  composition?: JsonValue | null;
417
485
  contentText?: string | null;
418
486
  textExtractedAt?: string | null;
@@ -446,6 +514,8 @@ export interface DocumentEntity {
446
514
  accesses?: DocumentAccessEntity[];
447
515
  disposition?: DispositionRecordEntity | null;
448
516
  dispositionId?: string | null;
517
+ accessRequestResponses?: AccessRequestEntity[];
518
+ accessRequestDeliveries?: AccessRequestDocumentEntity[];
449
519
  dispatch?: DocumentDispatchEntity | null;
450
520
  docDigitalInbound?: DocDigitalInboundEntity | null;
451
521
  deleted: boolean;
@@ -800,6 +870,11 @@ export interface DocumentDispatchEntity {
800
870
  returnedByEmployeeId?: string | null;
801
871
  returnedByFullName?: string | null;
802
872
  returnReason?: string | null;
873
+ contingencyMeans?: CommunicationMeans | null;
874
+ contingencySentTo?: string | null;
875
+ contingencyReason?: string | null;
876
+ contingencyReceiptFileId?: string | null;
877
+ contingencyReceiptName?: string | null;
803
878
  document?: DocumentEntity;
804
879
  documentId: string;
805
880
  createdAt: string;
@@ -1014,4 +1089,63 @@ export interface DispositionRecordEntity {
1014
1089
  createdAt: string;
1015
1090
  }
1016
1091
 
1092
+ export interface AccessRequestEntity {
1093
+ id: string;
1094
+ number: number;
1095
+ year: number;
1096
+ externalFolio?: string | null;
1097
+ channel: AccessRequestChannel;
1098
+ receivedAt: string;
1099
+ requesterName: string;
1100
+ requesterEmail?: string | null;
1101
+ requesterAddress?: string | null;
1102
+ requestText: string;
1103
+ deliveryFormat?: string | null;
1104
+ status: AccessRequestStatus;
1105
+ correctionRequestedAt?: string | null;
1106
+ correctionDueAt?: string | null;
1107
+ correctedAt?: string | null;
1108
+ dueAt: string;
1109
+ extendedAt?: string | null;
1110
+ extensionNote?: string | null;
1111
+ assigneeEmployeeId?: string | null;
1112
+ assigneeFullName?: string | null;
1113
+ thirdPartyNotifiedAt?: string | null;
1114
+ oppositionDueAt?: string | null;
1115
+ thirdPartyOpposed?: boolean | null;
1116
+ resolution?: AccessRequestResolution | null;
1117
+ resolvedAt?: string | null;
1118
+ denialGrounds: string[];
1119
+ derivedTo?: string | null;
1120
+ resolutionNote?: string | null;
1121
+ responseDocument?: DocumentEntity | null;
1122
+ responseDocumentId?: string | null;
1123
+ appealedAt?: string | null;
1124
+ appealNote?: string | null;
1125
+ createdByEmployeeId: string;
1126
+ createdByFullName: string;
1127
+ documents?: AccessRequestDocumentEntity[];
1128
+ events?: AccessRequestEventEntity[];
1129
+ createdAt: string;
1130
+ updatedAt: string;
1131
+ }
1132
+
1133
+ export interface AccessRequestDocumentEntity {
1134
+ accessRequest?: AccessRequestEntity;
1135
+ accessRequestId: string;
1136
+ document?: DocumentEntity;
1137
+ documentId: string;
1138
+ }
1139
+
1140
+ export interface AccessRequestEventEntity {
1141
+ id: string;
1142
+ action: AccessRequestEventAction;
1143
+ note?: string | null;
1144
+ employeeId?: string | null;
1145
+ employeeFullName: string;
1146
+ accessRequest?: AccessRequestEntity;
1147
+ accessRequestId: string;
1148
+ createdAt: string;
1149
+ }
1150
+
1017
1151
  type JsonValue = string | number | boolean | { [key in string]?: JsonValue } | Array<JsonValue> | null;
@@ -0,0 +1,81 @@
1
+ import { type AccessRequestChannel, type AccessRequestResolution } from '../base/entities';
2
+ import {
3
+ type AccessRequestDetailEntity,
4
+ type AccessRequestListItemEntity,
5
+ type AccessRequestSummaryEntity,
6
+ } from '../entities';
7
+ import { type RpcPage } from './contract';
8
+
9
+ /** Patrones NATS de `accessRequest`: solicitudes de acceso a la información pública (Ley 20.285). */
10
+ export const AccessRequestPatterns = {
11
+ getAll: 'gestorDocumental.accessRequest.getAll',
12
+ getById: 'gestorDocumental.accessRequest.getById',
13
+ getSummary: 'gestorDocumental.accessRequest.getSummary',
14
+ create: 'gestorDocumental.accessRequest.create',
15
+ update: 'gestorDocumental.accessRequest.update',
16
+ act: 'gestorDocumental.accessRequest.act',
17
+ } as const;
18
+
19
+ export interface AccessRequestWritePayload {
20
+ externalFolio?: string | null;
21
+ channel: AccessRequestChannel;
22
+ /** Fecha y hora de ingreso (ISO): desde ahí corren los 20 días hábiles. */
23
+ receivedAt: string;
24
+ requesterName: string;
25
+ requesterEmail?: string | null;
26
+ requesterAddress?: string | null;
27
+ requestText: string;
28
+ deliveryFormat?: string | null;
29
+ }
30
+
31
+ /** Lo que se hace con una solicitud, un paso a la vez. */
32
+ export type AccessRequestAction =
33
+ | { type: 'requestCorrection'; note: string }
34
+ | { type: 'registerCorrection'; correctedAt?: string | null; note?: string | null }
35
+ | { type: 'assign'; employeeId: string; fullName: string; note?: string | null }
36
+ | { type: 'notifyThirdParty'; note: string }
37
+ | { type: 'registerOpposition'; opposed: boolean; note?: string | null }
38
+ | { type: 'extend'; note: string }
39
+ | {
40
+ type: 'resolve';
41
+ resolution: AccessRequestResolution;
42
+ grounds?: string[];
43
+ derivedTo?: string | null;
44
+ note?: string | null;
45
+ responseDocumentId?: string | null;
46
+ documentIds?: string[];
47
+ }
48
+ | { type: 'registerAppeal'; appealedAt?: string | null; note: string };
49
+
50
+ export interface AccessRequestActor {
51
+ employeeId: string;
52
+ fullName: string;
53
+ }
54
+
55
+ export interface AccessRequestContract {
56
+ [AccessRequestPatterns.getAll]: {
57
+ payload: {
58
+ status?: 'open' | 'resolved' | 'all';
59
+ year?: number | null;
60
+ search?: string;
61
+ page?: number;
62
+ limit?: number;
63
+ };
64
+ response: RpcPage<AccessRequestListItemEntity[]>;
65
+ };
66
+ [AccessRequestPatterns.getById]: { payload: { id: string }; response: AccessRequestDetailEntity };
67
+ [AccessRequestPatterns.getSummary]: { payload: { year: number }; response: AccessRequestSummaryEntity };
68
+ [AccessRequestPatterns.create]: {
69
+ payload: AccessRequestWritePayload & { actor: AccessRequestActor };
70
+ response: AccessRequestDetailEntity;
71
+ };
72
+ /** Corrige los datos mientras no está resuelta. */
73
+ [AccessRequestPatterns.update]: {
74
+ payload: AccessRequestWritePayload & { id: string; actor: AccessRequestActor };
75
+ response: AccessRequestDetailEntity;
76
+ };
77
+ [AccessRequestPatterns.act]: {
78
+ payload: { id: string; action: AccessRequestAction; actor: AccessRequestActor };
79
+ response: AccessRequestDetailEntity;
80
+ };
81
+ }
@@ -10,6 +10,7 @@ import { AuditPatterns, type AuditContract } from './audit.contract';
10
10
  import { SignatureCheckPatterns, type SignatureCheckContract } from './signatureCheck.contract';
11
11
  import { RepositoryExportPatterns, type RepositoryExportContract } from './repositoryExport.contract';
12
12
  import { RetentionPatterns, type RetentionContract } from './retention.contract';
13
+ import { AccessRequestPatterns, type AccessRequestContract } from './accessRequest.contract';
13
14
  import { ScanPatterns, type ScanContract } from './scan.contract';
14
15
  import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
15
16
  import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
@@ -36,6 +37,7 @@ export * from './audit.contract';
36
37
  export * from './signatureCheck.contract';
37
38
  export * from './repositoryExport.contract';
38
39
  export * from './retention.contract';
40
+ export * from './accessRequest.contract';
39
41
 
40
42
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
41
43
  export const GestorDocumentalPatterns = {
@@ -57,6 +59,7 @@ export const GestorDocumentalPatterns = {
57
59
  signatureCheck: SignatureCheckPatterns,
58
60
  repositoryExport: RepositoryExportPatterns,
59
61
  retention: RetentionPatterns,
62
+ accessRequest: AccessRequestPatterns,
60
63
  } as const;
61
64
 
62
65
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -77,4 +80,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
77
80
  AuditContract &
78
81
  SignatureCheckContract &
79
82
  RepositoryExportContract &
80
- RetentionContract;
83
+ RetentionContract &
84
+ AccessRequestContract;
@@ -1,4 +1,4 @@
1
- import { type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
1
+ import { type CommunicationMeans, type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
2
2
  import {
3
3
  type DocDigitalDocumentTypeEntity,
4
4
  type DocDigitalEntityEntity,
@@ -37,6 +37,8 @@ export const PartsOfficePatterns = {
37
37
  returnInbound: 'gestorDocumental.partsOffice.returnInbound',
38
38
  getInboundFile: 'gestorDocumental.partsOffice.getInboundFile',
39
39
  checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
40
+ dispatchByContingency: 'gestorDocumental.partsOffice.dispatchByContingency',
41
+ registerManualIntake: 'gestorDocumental.partsOffice.registerManualIntake',
40
42
  } as const;
41
43
 
42
44
  /** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
@@ -50,6 +52,30 @@ interface IListPayload<S> {
50
52
  filters?: { search?: string; status?: S };
51
53
  }
52
54
 
55
+ /** Lo que llegó fuera de DocDigital y Oficina de Partes ingresa a mano. */
56
+ export interface ManualIntakePayload {
57
+ file: { fileId: string; name: string };
58
+ attachments?: { fileId: string; name: string }[];
59
+ means: CommunicationMeans;
60
+ /** Cuándo llegó (ISO); sin él, ahora. */
61
+ receivedAt?: string | null;
62
+ senderEntityName: string;
63
+ senderName?: string | null;
64
+ externalFolio?: string | null;
65
+ externalDate?: string | null;
66
+ subject: string;
67
+ documentTypeId: string;
68
+ keywords: string[];
69
+ accessLevel?: DocumentAccessLevel;
70
+ hasSensitiveData?: boolean;
71
+ recipients: unknown[];
72
+ instruction: DocumentInstruction;
73
+ note?: string | null;
74
+ dueAt?: string | null;
75
+ dueBusinessDays?: number | null;
76
+ actor: DocumentActor;
77
+ }
78
+
53
79
  export interface PartsOfficeContract {
54
80
  [PartsOfficePatterns.getStatus]: { payload: Record<string, never>; response: PartsOfficeStatusEntity };
55
81
  [PartsOfficePatterns.getSummary]: { payload: Record<string, never>; response: PartsOfficeSummaryEntity };
@@ -82,7 +108,11 @@ export interface PartsOfficeContract {
82
108
  response: PartsOfficeOkResponseEntity;
83
109
  };
84
110
  /** PDF firmado de un documento por despachar, para que Oficina de Partes lo revise. */
85
- [PartsOfficePatterns.getDispatchFile]: { payload: { id: string }; response: PartsOfficeFileEntity };
111
+ [PartsOfficePatterns.getDispatchFile]: {
112
+ // con `receipt`, el comprobante del despacho por contingencia
113
+ payload: { id: string; receipt?: boolean };
114
+ response: PartsOfficeFileEntity;
115
+ };
86
116
  [PartsOfficePatterns.getInbound]: {
87
117
  payload: IListPayload<'Pending' | 'Registered' | 'Returned'>;
88
118
  response: RpcPage<PartsOfficeInboundEntity[]>;
@@ -131,4 +161,29 @@ export interface PartsOfficeContract {
131
161
  payload: { people: EnablementPersonInput[] };
132
162
  response: PartsOfficeEnablementEntity;
133
163
  };
164
+ /**
165
+ * Registro por contingencia: el documento no se pudo despachar por DocDigital y salió por otro medio. Queda
166
+ * despachado, con el medio, a quién, el motivo y el comprobante; si después se registra en DocDigital, su número.
167
+ */
168
+ [PartsOfficePatterns.dispatchByContingency]: {
169
+ payload: {
170
+ id: string;
171
+ means: CommunicationMeans;
172
+ sentAt: string;
173
+ sentTo: string;
174
+ reason: string;
175
+ receipt?: { fileId: string; name: string } | null;
176
+ docDigitalDocumentId?: string | null;
177
+ actor: DocumentActor;
178
+ };
179
+ response: PartsOfficeOkResponseEntity;
180
+ };
181
+ /**
182
+ * Ingreso manual: lo que llegó fuera de DocDigital (papel, correo) entra con folio de ingreso, como lo recibido
183
+ * por DocDigital, y se deriva.
184
+ */
185
+ [PartsOfficePatterns.registerManualIntake]: {
186
+ payload: ManualIntakePayload;
187
+ response: PartsOfficeRegisterResponseEntity;
188
+ };
134
189
  }
@@ -0,0 +1,78 @@
1
+ import {
2
+ type AccessRequestChannel,
3
+ type AccessRequestEventAction,
4
+ type AccessRequestResolution,
5
+ type AccessRequestStatus,
6
+ } from '../../base/entities';
7
+
8
+ /** Semáforo del plazo de respuesta: a tiempo, por vencer (2 días hábiles o menos) o vencido. */
9
+ export type AccessRequestDueStatus = 'OnTime' | 'DueSoon' | 'Overdue';
10
+
11
+ export interface AccessRequestListItemEntity {
12
+ id: string;
13
+ /** «N° 15/2026». */
14
+ label: string;
15
+ externalFolio: string | null;
16
+ channel: AccessRequestChannel;
17
+ requesterName: string;
18
+ requestText: string;
19
+ receivedAt: string;
20
+ dueAt: string;
21
+ status: AccessRequestStatus;
22
+ resolution: AccessRequestResolution | null;
23
+ assigneeFullName: string | null;
24
+ /** Solo mientras está abierta. */
25
+ dueStatus: AccessRequestDueStatus | null;
26
+ businessDaysLeft: number | null;
27
+ /** Ya resuelta: si se respondió dentro del plazo. */
28
+ resolvedOnTime: boolean | null;
29
+ }
30
+
31
+ export interface AccessRequestDocumentLinkEntity {
32
+ id: string;
33
+ folio: string | null;
34
+ subject: string;
35
+ }
36
+
37
+ export interface AccessRequestDetailEntity extends AccessRequestListItemEntity {
38
+ year: number;
39
+ number: number;
40
+ requesterEmail: string | null;
41
+ requesterAddress: string | null;
42
+ deliveryFormat: string | null;
43
+ correctionRequestedAt: string | null;
44
+ correctionDueAt: string | null;
45
+ correctedAt: string | null;
46
+ extendedAt: string | null;
47
+ extensionNote: string | null;
48
+ assigneeEmployeeId: string | null;
49
+ thirdPartyNotifiedAt: string | null;
50
+ oppositionDueAt: string | null;
51
+ thirdPartyOpposed: boolean | null;
52
+ resolvedAt: string | null;
53
+ denialGrounds: string[];
54
+ derivedTo: string | null;
55
+ resolutionNote: string | null;
56
+ responseDocument: AccessRequestDocumentLinkEntity | null;
57
+ documents: AccessRequestDocumentLinkEntity[];
58
+ appealedAt: string | null;
59
+ appealNote: string | null;
60
+ createdByFullName: string;
61
+ /** Se puede prorrogar: abierta, sin prórroga y antes de vencer. */
62
+ canExtend: boolean;
63
+ events: { action: AccessRequestEventAction; note: string | null; employeeFullName: string; createdAt: string }[];
64
+ }
65
+
66
+ export interface AccessRequestSummaryEntity {
67
+ year: number;
68
+ total: number;
69
+ open: number;
70
+ overdue: number;
71
+ dueSoon: number;
72
+ resolved: Record<AccessRequestResolution, number>;
73
+ /** Respondidas dentro del plazo sobre las respondidas, en %. */
74
+ onTimeRate: number | null;
75
+ /** Días hábiles promedio entre el ingreso (o la subsanación) y la respuesta. */
76
+ averageBusinessDays: number | null;
77
+ appealed: number;
78
+ }
@@ -0,0 +1 @@
1
+ export * from './accessRequest.entity';
@@ -1,4 +1,5 @@
1
1
  import {
2
+ type CommunicationMeans,
2
3
  DocumentAnnulledNumberEntity,
3
4
  DocumentAttachmentEntity,
4
5
  DocumentDeliveryEntity,
@@ -101,6 +102,14 @@ export interface DocumentDispatchResponseEntity {
101
102
  returnedAt: string | null;
102
103
  returnedByFullName: string | null;
103
104
  returnReason: string | null;
105
+ /** Registro por contingencia: salió por otro medio porque no se pudo por DocDigital. */
106
+ contingency: {
107
+ means: CommunicationMeans;
108
+ sentTo: string | null;
109
+ reason: string | null;
110
+ /** Nombre del comprobante, si se adjuntó. */
111
+ receiptName: string | null;
112
+ } | null;
104
113
  }
105
114
 
106
115
  export interface DocumentGetAllResponseEntity {
@@ -16,3 +16,4 @@ export * from './audit';
16
16
  export * from './signatureCheck';
17
17
  export * from './repositoryExport';
18
18
  export * from './retention';
19
+ export * from './accessRequest';