@muni-sanfer/types-gestor-documental 0.0.1-beta.27 → 0.0.1-beta.29

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.
@@ -1,5 +1,5 @@
1
1
  import { type CommunicationMeans, type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
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';
2
+ import { type CaseFileAddEntryResponseEntity, 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';
5
5
  /** Patrones NATS de `partsOffice` (Oficina de Partes y DocDigital): `<servicio>.<recurso>.<acción>`. */
@@ -24,6 +24,7 @@ export declare const PartsOfficePatterns: {
24
24
  readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
25
25
  readonly dispatchByContingency: "gestorDocumental.partsOffice.dispatchByContingency";
26
26
  readonly registerManualIntake: "gestorDocumental.partsOffice.registerManualIntake";
27
+ readonly addCaseFileReceipt: "gestorDocumental.partsOffice.addCaseFileReceipt";
27
28
  };
28
29
  /** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
29
30
  export type PartsOfficeRecipientInput = {
@@ -244,5 +245,19 @@ export interface PartsOfficeContract {
244
245
  payload: ManualIntakePayload;
245
246
  response: PartsOfficeRegisterResponseEntity;
246
247
  };
248
+ /**
249
+ * Comprobante de trazabilidad de DocDigital de un documento del índice de un expediente (despachado o recibido por
250
+ * DocDigital): se arma con el estado y el historial que informa DocDigital y entra como comunicación oficial.
251
+ */
252
+ [PartsOfficePatterns.addCaseFileReceipt]: {
253
+ payload: {
254
+ caseFileId: string;
255
+ documentId: string;
256
+ actor: {
257
+ employeeId: string;
258
+ };
259
+ };
260
+ response: CaseFileAddEntryResponseEntity;
261
+ };
247
262
  }
248
263
  export {};
@@ -23,4 +23,5 @@ exports.PartsOfficePatterns = {
23
23
  checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
24
24
  dispatchByContingency: 'gestorDocumental.partsOffice.dispatchByContingency',
25
25
  registerManualIntake: 'gestorDocumental.partsOffice.registerManualIntake',
26
+ addCaseFileReceipt: 'gestorDocumental.partsOffice.addCaseFileReceipt',
26
27
  };
@@ -29,6 +29,8 @@ export interface CaseFileEntryDocumentEntity {
29
29
  correlative: DocumentEntity['correlative'];
30
30
  correlativeYear: DocumentEntity['correlativeYear'];
31
31
  documentType: DocumentTypeSummaryEntity;
32
+ /** N° del documento en DocDigital, si se despachó o se recibió por ahí: tiene comprobante de trazabilidad. */
33
+ docDigitalDocumentId: string | null;
32
34
  }
33
35
  /** Entrada del índice electrónico: una actuación, en su orden de incorporación. */
34
36
  export interface CaseFileEntryResponseEntity {
@@ -0,0 +1,174 @@
1
+ import { type CommunicationMeans, type DataBreachEventAction, type DataBreachKind, type DataBreachNoticeMeans, type DataBreachStatus, type DataLegalBasis, type DataRight, type DataRightsChannel, type DataRightsEventAction, type DataRightsRequestStatus, type DataRightsResolution } from '../../base/entities';
2
+ /** Tratamiento de datos personales de la municipalidad: lo que se informa al público (Ley 19.628, art. 14 ter). */
3
+ export interface DataTreatmentResponseEntity {
4
+ id: string;
5
+ name: string;
6
+ purpose: string;
7
+ legalBasis: DataLegalBasis;
8
+ legalBasisDetail: string | null;
9
+ dataCategories: string[];
10
+ sensitiveData: boolean;
11
+ dataSubjects: string;
12
+ recipients: string | null;
13
+ source: string | null;
14
+ retention: string | null;
15
+ securityMeasures: string | null;
16
+ internationalTransfer: string | null;
17
+ responsibleUnit: string | null;
18
+ published: boolean;
19
+ enabled: boolean;
20
+ /** Solicitudes de titulares que lo mencionan. */
21
+ requests: number;
22
+ updatedAt: string;
23
+ }
24
+ /** Página pública de protección de datos: quién es el responsable, cómo ejercer los derechos y qué se trata. */
25
+ export interface DataProtectionPolicyEntity {
26
+ organ: string;
27
+ /** Correo o medio en que se reciben las solicitudes de los titulares (art. 14 ter letra c). */
28
+ contact: string | null;
29
+ /** Dirección de la política de tratamiento, si está publicada aparte. */
30
+ policyUrl: string | null;
31
+ treatments: Omit<DataTreatmentResponseEntity, 'published' | 'enabled' | 'requests' | 'securityMeasures'>[];
32
+ }
33
+ /** Semáforo del plazo: a tiempo, por vencer (5 días corridos o menos) o vencido. */
34
+ export type DataRightsDueStatus = 'OnTime' | 'DueSoon' | 'Overdue';
35
+ export interface DataRightsRequestListItemEntity {
36
+ id: string;
37
+ /** «N° 4/2026». */
38
+ label: string;
39
+ channel: DataRightsChannel;
40
+ rights: DataRight[];
41
+ requesterName: string;
42
+ requestText: string;
43
+ treatmentName: string | null;
44
+ receivedAt: string;
45
+ dueAt: string;
46
+ status: DataRightsRequestStatus;
47
+ resolution: DataRightsResolution | null;
48
+ assigneeFullName: string | null;
49
+ acknowledged: boolean;
50
+ identityVerified: boolean;
51
+ /** Bloqueo temporal pedido y sin resolver. */
52
+ blockingPending: boolean;
53
+ /** Solo mientras está abierta. */
54
+ dueStatus: DataRightsDueStatus | null;
55
+ daysLeft: number | null;
56
+ resolvedOnTime: boolean | null;
57
+ }
58
+ export interface DataRightsDocumentLinkEntity {
59
+ id: string;
60
+ folio: string | null;
61
+ subject: string;
62
+ }
63
+ export interface DataRightsRequestDetailEntity extends DataRightsRequestListItemEntity {
64
+ year: number;
65
+ number: number;
66
+ requesterRut: string | null;
67
+ requesterEmail: string | null;
68
+ requesterAddress: string | null;
69
+ representativeName: string | null;
70
+ identityVerifiedAt: string | null;
71
+ identityNote: string | null;
72
+ treatmentId: string | null;
73
+ acknowledgedAt: string | null;
74
+ extendedAt: string | null;
75
+ extensionNote: string | null;
76
+ blockingRequested: boolean;
77
+ blockingReason: string | null;
78
+ blockingDueAt: string | null;
79
+ blockingGranted: boolean | null;
80
+ blockingResolvedAt: string | null;
81
+ blockingNote: string | null;
82
+ assigneeEmployeeId: string | null;
83
+ resolvedAt: string | null;
84
+ denialGrounds: string[];
85
+ resolutionNote: string | null;
86
+ responseDocument: DataRightsDocumentLinkEntity | null;
87
+ responseSentAt: string | null;
88
+ responseSentTo: string | null;
89
+ responseSentMeans: CommunicationMeans | null;
90
+ /** Hasta cuándo el titular puede reclamar ante la Agencia (30 días hábiles), si se denegó en todo o en parte. */
91
+ complaintDeadline: string | null;
92
+ complaintAt: string | null;
93
+ complaintNote: string | null;
94
+ createdByFullName: string;
95
+ /** Se puede prorrogar: abierta, sin prórroga y antes de vencer. */
96
+ canExtend: boolean;
97
+ /** El titular ya puede reclamar ante la Agencia: denegación o plazo vencido sin respuesta. */
98
+ canRegisterComplaint: boolean;
99
+ events: {
100
+ action: DataRightsEventAction;
101
+ note: string | null;
102
+ employeeFullName: string;
103
+ createdAt: string;
104
+ }[];
105
+ }
106
+ export interface DataRightsSummaryEntity {
107
+ year: number;
108
+ total: number;
109
+ open: number;
110
+ overdue: number;
111
+ dueSoon: number;
112
+ /** Abiertas sin acuse de recibo. */
113
+ unacknowledged: number;
114
+ /** Bloqueos temporales pedidos y sin resolver. */
115
+ blockingPending: number;
116
+ byRight: Record<DataRight, number>;
117
+ resolved: Record<DataRightsResolution, number>;
118
+ /** Respondidas dentro del plazo sobre las respondidas, en %. */
119
+ onTimeRate: number | null;
120
+ complaints: number;
121
+ }
122
+ /** Datos personales que se reconocen en el texto de un documento, enmascarados: ayudan a tarjar. */
123
+ export interface PersonalDataHintsEntity {
124
+ ruts: number;
125
+ emails: number;
126
+ phones: number;
127
+ /** Algunos ejemplos enmascarados («11.1••.•••-1»). */
128
+ samples: string[];
129
+ }
130
+ /** Vulneración de las medidas de seguridad que afecta datos personales (Ley 19.628, art. 14 sexies). */
131
+ export interface DataBreachResponseEntity {
132
+ id: string;
133
+ /** «N° 2/2026». */
134
+ label: string;
135
+ year: number;
136
+ number: number;
137
+ detectedAt: string;
138
+ occurredAt: string | null;
139
+ kinds: DataBreachKind[];
140
+ description: string;
141
+ effects: string | null;
142
+ dataCategories: string[];
143
+ affectedCount: number | null;
144
+ measures: string | null;
145
+ sensitiveData: boolean;
146
+ minorsData: boolean;
147
+ financialData: boolean;
148
+ riskToRights: boolean;
149
+ treatmentId: string | null;
150
+ treatmentName: string | null;
151
+ status: DataBreachStatus;
152
+ /** Hay riesgo razonable para los titulares: se reporta a la Agencia sin dilaciones indebidas. */
153
+ mustReportAgency: boolean;
154
+ /** Además, datos sensibles, de menores de 14 o de obligaciones económicas: se comunica a los titulares. */
155
+ mustNotifyHolders: boolean;
156
+ agencyReportedAt: string | null;
157
+ agencyReportNote: string | null;
158
+ /** Horas entre la detección y el reporte a la Agencia (o hasta ahora, si falta reportarla). */
159
+ agencyDelayHours: number | null;
160
+ holdersNotifiedAt: string | null;
161
+ holdersNoticeMeans: DataBreachNoticeMeans | null;
162
+ holdersNoticeNote: string | null;
163
+ closedAt: string | null;
164
+ closeNote: string | null;
165
+ createdByFullName: string;
166
+ /** Por qué todavía no se puede cerrar, o `null` si se puede. */
167
+ closeBlock: string | null;
168
+ events: {
169
+ action: DataBreachEventAction;
170
+ note: string | null;
171
+ employeeFullName: string;
172
+ createdAt: string;
173
+ }[];
174
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './dataProtection.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("./dataProtection.entity"), exports);
@@ -18,3 +18,4 @@ export * from './repositoryExport';
18
18
  export * from './retention';
19
19
  export * from './accessRequest';
20
20
  export * from './transparency';
21
+ export * from './dataProtection';
@@ -34,3 +34,4 @@ __exportStar(require("./repositoryExport"), exports);
34
34
  __exportStar(require("./retention"), exports);
35
35
  __exportStar(require("./accessRequest"), exports);
36
36
  __exportStar(require("./transparency"), exports);
37
+ __exportStar(require("./dataProtection"), exports);
@@ -1,4 +1,5 @@
1
1
  import { type DocumentAccessLevel, type DocumentStatus } from '../../base/entities';
2
+ import { type PersonalDataHintsEntity } from '../dataProtection';
2
3
  /** En qué quedó un documento en Transparencia Activa: aún sin decidir, publicado o excluido con su motivo. */
3
4
  export type TransparencyItemStatus = 'Pending' | 'Published' | 'Excluded';
4
5
  /** Un documento que se publica en Transparencia Activa (Ley 20.285, art. 7°), con lo que se decidió de él. */
@@ -24,6 +25,8 @@ export interface TransparencyItemEntity {
24
25
  /** Para publicarlo hace falta antes la versión tarjada. */
25
26
  needsRedacted: boolean;
26
27
  redactedFileName: string | null;
28
+ /** RUN, correos y teléfonos que se reconocen en el texto del original (`null` si no tiene texto): ayudan a tarjar. */
29
+ personalData: PersonalDataHintsEntity | null;
27
30
  status: TransparencyItemStatus;
28
31
  /** Dirección de la publicación en el Portal de Transparencia, si se anotó. */
29
32
  transparencyUrl: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.27",
3
+ "version": "0.0.1-beta.29",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -518,6 +518,40 @@ export const DataRightsEventAction = {
518
518
  ComplaintRegistered: 'ComplaintRegistered',
519
519
  } satisfies Record<string, DataRightsEventAction>;
520
520
 
521
+ export type DataBreachKind = 'Destruction' | 'Leak' | 'Loss' | 'Alteration' | 'UnauthorizedAccess';
522
+
523
+ export const DataBreachKind = {
524
+ Destruction: 'Destruction',
525
+ Leak: 'Leak',
526
+ Loss: 'Loss',
527
+ Alteration: 'Alteration',
528
+ UnauthorizedAccess: 'UnauthorizedAccess',
529
+ } satisfies Record<string, DataBreachKind>;
530
+
531
+ export type DataBreachStatus = 'Open' | 'Closed';
532
+
533
+ export const DataBreachStatus = {
534
+ Open: 'Open',
535
+ Closed: 'Closed',
536
+ } satisfies Record<string, DataBreachStatus>;
537
+
538
+ export type DataBreachEventAction = 'Registered' | 'Updated' | 'AgencyReported' | 'HoldersNotified' | 'Closed';
539
+
540
+ export const DataBreachEventAction = {
541
+ Registered: 'Registered',
542
+ Updated: 'Updated',
543
+ AgencyReported: 'AgencyReported',
544
+ HoldersNotified: 'HoldersNotified',
545
+ Closed: 'Closed',
546
+ } satisfies Record<string, DataBreachEventAction>;
547
+
548
+ export type DataBreachNoticeMeans = 'Individual' | 'PublicNotice';
549
+
550
+ export const DataBreachNoticeMeans = {
551
+ Individual: 'Individual',
552
+ PublicNotice: 'PublicNotice',
553
+ } satisfies Record<string, DataBreachNoticeMeans>;
554
+
521
555
  export interface DocumentTypeEntity {
522
556
  id: string;
523
557
  name: string;
@@ -1263,6 +1297,7 @@ export interface DataTreatmentEntity {
1263
1297
  responsibleUnit?: string | null;
1264
1298
  published: boolean;
1265
1299
  requests?: DataRightsRequestEntity[];
1300
+ breaches?: DataBreachEntity[];
1266
1301
  enabled: boolean;
1267
1302
  deleted: boolean;
1268
1303
  createdAt: string;
@@ -1328,4 +1363,48 @@ export interface DataRightsEventEntity {
1328
1363
  createdAt: string;
1329
1364
  }
1330
1365
 
1366
+ export interface DataBreachEntity {
1367
+ id: string;
1368
+ number: number;
1369
+ year: number;
1370
+ detectedAt: string;
1371
+ occurredAt?: string | null;
1372
+ kinds: DataBreachKind[];
1373
+ description: string;
1374
+ effects?: string | null;
1375
+ dataCategories: string[];
1376
+ affectedCount?: number | null;
1377
+ measures?: string | null;
1378
+ sensitiveData: boolean;
1379
+ minorsData: boolean;
1380
+ financialData: boolean;
1381
+ riskToRights: boolean;
1382
+ treatment?: DataTreatmentEntity | null;
1383
+ treatmentId?: string | null;
1384
+ status: DataBreachStatus;
1385
+ agencyReportedAt?: string | null;
1386
+ agencyReportNote?: string | null;
1387
+ holdersNotifiedAt?: string | null;
1388
+ holdersNoticeMeans?: DataBreachNoticeMeans | null;
1389
+ holdersNoticeNote?: string | null;
1390
+ closedAt?: string | null;
1391
+ closeNote?: string | null;
1392
+ createdByEmployeeId: string;
1393
+ createdByFullName: string;
1394
+ events?: DataBreachEventEntity[];
1395
+ createdAt: string;
1396
+ updatedAt: string;
1397
+ }
1398
+
1399
+ export interface DataBreachEventEntity {
1400
+ id: string;
1401
+ action: DataBreachEventAction;
1402
+ note?: string | null;
1403
+ employeeId?: string | null;
1404
+ employeeFullName: string;
1405
+ breach?: DataBreachEntity;
1406
+ breachId: string;
1407
+ createdAt: string;
1408
+ }
1409
+
1331
1410
  type JsonValue = string | number | boolean | { [key in string]?: JsonValue } | Array<JsonValue> | null;
@@ -0,0 +1,195 @@
1
+ import {
2
+ type CommunicationMeans,
3
+ type DataBreachKind,
4
+ type DataBreachNoticeMeans,
5
+ type DataLegalBasis,
6
+ type DataRight,
7
+ type DataRightsChannel,
8
+ type DataRightsResolution,
9
+ } from '../base/entities';
10
+ import {
11
+ type DataBreachResponseEntity,
12
+ type DataProtectionPolicyEntity,
13
+ type IndicatorsFileEntity,
14
+ type DataRightsRequestDetailEntity,
15
+ type DataRightsRequestListItemEntity,
16
+ type DataRightsSummaryEntity,
17
+ type DataTreatmentResponseEntity,
18
+ } from '../entities';
19
+ import { type RpcPage } from './contract';
20
+
21
+ /** Patrones NATS de `dataProtection`: tratamientos de datos y solicitudes de los titulares (Ley 19.628). */
22
+ export const DataProtectionPatterns = {
23
+ getTreatments: 'gestorDocumental.dataProtection.getTreatments',
24
+ createTreatment: 'gestorDocumental.dataProtection.createTreatment',
25
+ updateTreatment: 'gestorDocumental.dataProtection.updateTreatment',
26
+ setTreatmentEnabled: 'gestorDocumental.dataProtection.setTreatmentEnabled',
27
+ getPolicy: 'gestorDocumental.dataProtection.getPolicy',
28
+ getRequests: 'gestorDocumental.dataProtection.getRequests',
29
+ getRequest: 'gestorDocumental.dataProtection.getRequest',
30
+ getSummary: 'gestorDocumental.dataProtection.getSummary',
31
+ createRequest: 'gestorDocumental.dataProtection.createRequest',
32
+ updateRequest: 'gestorDocumental.dataProtection.updateRequest',
33
+ actOnRequest: 'gestorDocumental.dataProtection.actOnRequest',
34
+ getBreaches: 'gestorDocumental.dataProtection.getBreaches',
35
+ getBreach: 'gestorDocumental.dataProtection.getBreach',
36
+ createBreach: 'gestorDocumental.dataProtection.createBreach',
37
+ updateBreach: 'gestorDocumental.dataProtection.updateBreach',
38
+ actOnBreach: 'gestorDocumental.dataProtection.actOnBreach',
39
+ getBreachPdf: 'gestorDocumental.dataProtection.getBreachPdf',
40
+ } as const;
41
+
42
+ type TActor = { employeeId: string; fullName: string };
43
+
44
+ /** Datos de un tratamiento al crearlo o editarlo. */
45
+ export interface DataTreatmentWritePayload {
46
+ name: string;
47
+ purpose: string;
48
+ legalBasis: DataLegalBasis;
49
+ legalBasisDetail?: string | null;
50
+ dataCategories: string[];
51
+ sensitiveData?: boolean;
52
+ dataSubjects: string;
53
+ recipients?: string | null;
54
+ source?: string | null;
55
+ retention?: string | null;
56
+ securityMeasures?: string | null;
57
+ internationalTransfer?: string | null;
58
+ responsibleUnit?: string | null;
59
+ published?: boolean;
60
+ }
61
+
62
+ /** Datos de una solicitud al ingresarla o corregirla. */
63
+ export interface DataRightsRequestWritePayload {
64
+ channel: DataRightsChannel;
65
+ receivedAt: string;
66
+ rights: DataRight[];
67
+ requesterName: string;
68
+ requesterRut?: string | null;
69
+ requesterEmail?: string | null;
70
+ requesterAddress?: string | null;
71
+ representativeName?: string | null;
72
+ requestText: string;
73
+ treatmentId?: string | null;
74
+ /** Bloqueo temporal: solo con rectificación, supresión u oposición, y fundado. */
75
+ blockingRequested?: boolean;
76
+ blockingReason?: string | null;
77
+ }
78
+
79
+ /** Un paso de la tramitación. */
80
+ export type DataRightsAction =
81
+ | { type: 'acknowledge'; note?: string | null }
82
+ | { type: 'verifyIdentity'; note?: string | null }
83
+ | { type: 'assign'; employeeId: string; fullName: string; note?: string | null }
84
+ /** Bloqueo temporal, en 2 días hábiles; si se rechaza, fundado (y se comunica a la Agencia). */
85
+ | { type: 'resolveBlocking'; granted: boolean; note?: string | null }
86
+ | { type: 'extend'; note: string }
87
+ | {
88
+ type: 'resolve';
89
+ resolution: DataRightsResolution;
90
+ grounds?: string[];
91
+ note?: string | null;
92
+ responseDocumentId?: string | null;
93
+ }
94
+ /** Respaldo del envío de la respuesta escrita (art. 11). */
95
+ | {
96
+ type: 'registerResponseSent';
97
+ sentAt?: string | null;
98
+ sentTo: string;
99
+ means: CommunicationMeans;
100
+ note?: string | null;
101
+ }
102
+ | { type: 'registerComplaint'; complaintAt?: string | null; note: string };
103
+
104
+ /** Datos de una vulneración al registrarla o corregirla. */
105
+ export interface DataBreachWritePayload {
106
+ detectedAt: string;
107
+ occurredAt?: string | null;
108
+ kinds: DataBreachKind[];
109
+ description: string;
110
+ effects?: string | null;
111
+ dataCategories: string[];
112
+ affectedCount?: number | null;
113
+ measures?: string | null;
114
+ sensitiveData?: boolean;
115
+ minorsData?: boolean;
116
+ financialData?: boolean;
117
+ riskToRights?: boolean;
118
+ treatmentId?: string | null;
119
+ }
120
+
121
+ /** Un paso de la gestión de una vulneración. */
122
+ export type DataBreachAction =
123
+ /** Reporte a la Agencia, con el medio y su número o folio. */
124
+ | { type: 'reportAgency'; reportedAt?: string | null; note: string }
125
+ /** Comunicación a los titulares: a cada uno o, si no es posible, un aviso en un medio masivo nacional. */
126
+ | { type: 'notifyHolders'; notifiedAt?: string | null; means: DataBreachNoticeMeans; note: string }
127
+ | { type: 'close'; note?: string | null };
128
+
129
+ export interface DataProtectionContract {
130
+ [DataProtectionPatterns.getTreatments]: {
131
+ payload: { enabled?: boolean | null };
132
+ response: DataTreatmentResponseEntity[];
133
+ };
134
+ [DataProtectionPatterns.createTreatment]: {
135
+ payload: DataTreatmentWritePayload;
136
+ response: DataTreatmentResponseEntity;
137
+ };
138
+ [DataProtectionPatterns.updateTreatment]: {
139
+ payload: DataTreatmentWritePayload & { id: string };
140
+ response: DataTreatmentResponseEntity;
141
+ };
142
+ [DataProtectionPatterns.setTreatmentEnabled]: {
143
+ payload: { id: string; enabled: boolean };
144
+ response: DataTreatmentResponseEntity;
145
+ };
146
+ /** Lo que se publica sin sesión (art. 14 ter): los tratamientos habilitados y publicados. */
147
+ [DataProtectionPatterns.getPolicy]: { payload: Record<string, never>; response: DataProtectionPolicyEntity };
148
+ [DataProtectionPatterns.getRequests]: {
149
+ payload: {
150
+ status?: 'open' | 'resolved' | 'all';
151
+ year?: number | null;
152
+ search?: string;
153
+ page?: number;
154
+ limit?: number;
155
+ };
156
+ response: RpcPage<DataRightsRequestListItemEntity[]>;
157
+ };
158
+ [DataProtectionPatterns.getRequest]: { payload: { id: string }; response: DataRightsRequestDetailEntity };
159
+ [DataProtectionPatterns.getSummary]: { payload: { year: number }; response: DataRightsSummaryEntity };
160
+ [DataProtectionPatterns.createRequest]: {
161
+ payload: DataRightsRequestWritePayload & { actor: TActor };
162
+ response: DataRightsRequestDetailEntity;
163
+ };
164
+ [DataProtectionPatterns.updateRequest]: {
165
+ payload: DataRightsRequestWritePayload & { id: string; actor: TActor };
166
+ response: DataRightsRequestDetailEntity;
167
+ };
168
+ [DataProtectionPatterns.actOnRequest]: {
169
+ payload: { id: string; action: DataRightsAction; actor: TActor };
170
+ response: DataRightsRequestDetailEntity;
171
+ };
172
+ /** Las vulneraciones del año (o todas las abiertas), de la más reciente a la más antigua. */
173
+ [DataProtectionPatterns.getBreaches]: {
174
+ payload: { year?: number | null; openOnly?: boolean };
175
+ response: DataBreachResponseEntity[];
176
+ };
177
+ [DataProtectionPatterns.getBreach]: { payload: { id: string }; response: DataBreachResponseEntity };
178
+ [DataProtectionPatterns.createBreach]: {
179
+ payload: DataBreachWritePayload & { actor: TActor };
180
+ response: DataBreachResponseEntity;
181
+ };
182
+ [DataProtectionPatterns.updateBreach]: {
183
+ payload: DataBreachWritePayload & { id: string; actor: TActor };
184
+ response: DataBreachResponseEntity;
185
+ };
186
+ [DataProtectionPatterns.actOnBreach]: {
187
+ payload: { id: string; action: DataBreachAction; actor: TActor };
188
+ response: DataBreachResponseEntity;
189
+ };
190
+ /** El registro de la vulneración en PDF, para reportarla o archivarla. */
191
+ [DataProtectionPatterns.getBreachPdf]: {
192
+ payload: { id: string; generatedBy: string };
193
+ response: IndicatorsFileEntity;
194
+ };
195
+ }
@@ -12,6 +12,7 @@ import { RepositoryExportPatterns, type RepositoryExportContract } from './repos
12
12
  import { RetentionPatterns, type RetentionContract } from './retention.contract';
13
13
  import { AccessRequestPatterns, type AccessRequestContract } from './accessRequest.contract';
14
14
  import { TransparencyPatterns, type TransparencyContract } from './transparency.contract';
15
+ import { DataProtectionPatterns, type DataProtectionContract } from './dataProtection.contract';
15
16
  import { ScanPatterns, type ScanContract } from './scan.contract';
16
17
  import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
17
18
  import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
@@ -40,6 +41,7 @@ export * from './repositoryExport.contract';
40
41
  export * from './retention.contract';
41
42
  export * from './accessRequest.contract';
42
43
  export * from './transparency.contract';
44
+ export * from './dataProtection.contract';
43
45
 
44
46
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
45
47
  export const GestorDocumentalPatterns = {
@@ -63,6 +65,7 @@ export const GestorDocumentalPatterns = {
63
65
  retention: RetentionPatterns,
64
66
  accessRequest: AccessRequestPatterns,
65
67
  transparency: TransparencyPatterns,
68
+ dataProtection: DataProtectionPatterns,
66
69
  } as const;
67
70
 
68
71
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -85,4 +88,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
85
88
  RepositoryExportContract &
86
89
  RetentionContract &
87
90
  AccessRequestContract &
88
- TransparencyContract;
91
+ TransparencyContract &
92
+ DataProtectionContract;
@@ -1,5 +1,6 @@
1
1
  import { type CommunicationMeans, type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
2
2
  import {
3
+ type CaseFileAddEntryResponseEntity,
3
4
  type DocDigitalDocumentTypeEntity,
4
5
  type DocDigitalEntityEntity,
5
6
  type PartsOfficeInboundEntity,
@@ -39,6 +40,7 @@ export const PartsOfficePatterns = {
39
40
  checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
40
41
  dispatchByContingency: 'gestorDocumental.partsOffice.dispatchByContingency',
41
42
  registerManualIntake: 'gestorDocumental.partsOffice.registerManualIntake',
43
+ addCaseFileReceipt: 'gestorDocumental.partsOffice.addCaseFileReceipt',
42
44
  } as const;
43
45
 
44
46
  /** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
@@ -186,4 +188,12 @@ export interface PartsOfficeContract {
186
188
  payload: ManualIntakePayload;
187
189
  response: PartsOfficeRegisterResponseEntity;
188
190
  };
191
+ /**
192
+ * Comprobante de trazabilidad de DocDigital de un documento del índice de un expediente (despachado o recibido por
193
+ * DocDigital): se arma con el estado y el historial que informa DocDigital y entra como comunicación oficial.
194
+ */
195
+ [PartsOfficePatterns.addCaseFileReceipt]: {
196
+ payload: { caseFileId: string; documentId: string; actor: { employeeId: string } };
197
+ response: CaseFileAddEntryResponseEntity;
198
+ };
189
199
  }
@@ -42,6 +42,8 @@ export interface CaseFileEntryDocumentEntity {
42
42
  correlative: DocumentEntity['correlative'];
43
43
  correlativeYear: DocumentEntity['correlativeYear'];
44
44
  documentType: DocumentTypeSummaryEntity;
45
+ /** N° del documento en DocDigital, si se despachó o se recibió por ahí: tiene comprobante de trazabilidad. */
46
+ docDigitalDocumentId: string | null;
45
47
  }
46
48
 
47
49
  /** Entrada del índice electrónico: una actuación, en su orden de incorporación. */