@muni-sanfer/types-gestor-documental 0.0.1-beta.28 → 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.
@@ -343,6 +343,32 @@ export declare const DataRightsEventAction: {
343
343
  ResponseSent: "ResponseSent";
344
344
  ComplaintRegistered: "ComplaintRegistered";
345
345
  };
346
+ export type DataBreachKind = 'Destruction' | 'Leak' | 'Loss' | 'Alteration' | 'UnauthorizedAccess';
347
+ export declare const DataBreachKind: {
348
+ Destruction: "Destruction";
349
+ Leak: "Leak";
350
+ Loss: "Loss";
351
+ Alteration: "Alteration";
352
+ UnauthorizedAccess: "UnauthorizedAccess";
353
+ };
354
+ export type DataBreachStatus = 'Open' | 'Closed';
355
+ export declare const DataBreachStatus: {
356
+ Open: "Open";
357
+ Closed: "Closed";
358
+ };
359
+ export type DataBreachEventAction = 'Registered' | 'Updated' | 'AgencyReported' | 'HoldersNotified' | 'Closed';
360
+ export declare const DataBreachEventAction: {
361
+ Registered: "Registered";
362
+ Updated: "Updated";
363
+ AgencyReported: "AgencyReported";
364
+ HoldersNotified: "HoldersNotified";
365
+ Closed: "Closed";
366
+ };
367
+ export type DataBreachNoticeMeans = 'Individual' | 'PublicNotice';
368
+ export declare const DataBreachNoticeMeans: {
369
+ Individual: "Individual";
370
+ PublicNotice: "PublicNotice";
371
+ };
346
372
  export interface DocumentTypeEntity {
347
373
  id: string;
348
374
  name: string;
@@ -1046,6 +1072,7 @@ export interface DataTreatmentEntity {
1046
1072
  responsibleUnit?: string | null;
1047
1073
  published: boolean;
1048
1074
  requests?: DataRightsRequestEntity[];
1075
+ breaches?: DataBreachEntity[];
1049
1076
  enabled: boolean;
1050
1077
  deleted: boolean;
1051
1078
  createdAt: string;
@@ -1108,6 +1135,48 @@ export interface DataRightsEventEntity {
1108
1135
  requestId: string;
1109
1136
  createdAt: string;
1110
1137
  }
1138
+ export interface DataBreachEntity {
1139
+ id: string;
1140
+ number: number;
1141
+ year: number;
1142
+ detectedAt: string;
1143
+ occurredAt?: string | null;
1144
+ kinds: DataBreachKind[];
1145
+ description: string;
1146
+ effects?: string | null;
1147
+ dataCategories: string[];
1148
+ affectedCount?: number | null;
1149
+ measures?: string | null;
1150
+ sensitiveData: boolean;
1151
+ minorsData: boolean;
1152
+ financialData: boolean;
1153
+ riskToRights: boolean;
1154
+ treatment?: DataTreatmentEntity | null;
1155
+ treatmentId?: string | null;
1156
+ status: DataBreachStatus;
1157
+ agencyReportedAt?: string | null;
1158
+ agencyReportNote?: string | null;
1159
+ holdersNotifiedAt?: string | null;
1160
+ holdersNoticeMeans?: DataBreachNoticeMeans | null;
1161
+ holdersNoticeNote?: string | null;
1162
+ closedAt?: string | null;
1163
+ closeNote?: string | null;
1164
+ createdByEmployeeId: string;
1165
+ createdByFullName: string;
1166
+ events?: DataBreachEventEntity[];
1167
+ createdAt: string;
1168
+ updatedAt: string;
1169
+ }
1170
+ export interface DataBreachEventEntity {
1171
+ id: string;
1172
+ action: DataBreachEventAction;
1173
+ note?: string | null;
1174
+ employeeId?: string | null;
1175
+ employeeFullName: string;
1176
+ breach?: DataBreachEntity;
1177
+ breachId: string;
1178
+ createdAt: string;
1179
+ }
1111
1180
  type JsonValue = string | number | boolean | {
1112
1181
  [key in string]?: JsonValue;
1113
1182
  } | 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.DataRightsEventAction = exports.DataRightsResolution = exports.DataRightsRequestStatus = exports.DataRightsChannel = exports.DataRight = exports.DataLegalBasis = exports.TransparencyStatus = exports.AccessRequestEventAction = exports.AccessRequestResolution = exports.AccessRequestStatus = exports.AccessRequestChannel = exports.DispositionKind = exports.FinalDisposition = exports.AuditAction = exports.AuditEntity = exports.DocumentAccessAction = exports.QualityMetricKey = exports.ServiceOutageKind = exports.WorkFolderItemKind = exports.TextSnippetSection = exports.ScanSessionStatus = exports.CaseFileAccessAction = exports.CaseFileTrackingAction = exports.CaseFileActorType = exports.CaseFileActorRelation = exports.CaseFileEntryKind = exports.CaseFileActuationType = exports.CaseFileIncorporationMechanism = exports.CaseFileStatus = exports.DocumentInstruction = exports.DocumentDeliveryOrigin = exports.DocumentRecipientType = exports.DocumentAttachmentType = exports.DocumentFlowStepType = exports.DocDigitalInboundStatus = exports.DocumentDispatchStatus = exports.CommunicationMeans = exports.DocumentOrigin = exports.DocumentTrackingAction = exports.DocumentParticipantStatus = exports.DocumentParticipantRole = exports.DocumentAccessLevel = exports.DocumentStatus = exports.DocumentCategory = void 0;
4
+ exports.DataBreachNoticeMeans = exports.DataBreachEventAction = exports.DataBreachStatus = exports.DataBreachKind = exports.DataRightsEventAction = exports.DataRightsResolution = exports.DataRightsRequestStatus = exports.DataRightsChannel = exports.DataRight = exports.DataLegalBasis = exports.TransparencyStatus = exports.AccessRequestEventAction = exports.AccessRequestResolution = exports.AccessRequestStatus = exports.AccessRequestChannel = exports.DispositionKind = exports.FinalDisposition = exports.AuditAction = exports.AuditEntity = exports.DocumentAccessAction = exports.QualityMetricKey = exports.ServiceOutageKind = exports.WorkFolderItemKind = exports.TextSnippetSection = exports.ScanSessionStatus = exports.CaseFileAccessAction = exports.CaseFileTrackingAction = exports.CaseFileActorType = exports.CaseFileActorRelation = exports.CaseFileEntryKind = exports.CaseFileActuationType = exports.CaseFileIncorporationMechanism = exports.CaseFileStatus = exports.DocumentInstruction = exports.DocumentDeliveryOrigin = exports.DocumentRecipientType = exports.DocumentAttachmentType = exports.DocumentFlowStepType = exports.DocDigitalInboundStatus = exports.DocumentDispatchStatus = exports.CommunicationMeans = exports.DocumentOrigin = exports.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',
@@ -303,3 +303,25 @@ exports.DataRightsEventAction = {
303
303
  ResponseSent: 'ResponseSent',
304
304
  ComplaintRegistered: 'ComplaintRegistered',
305
305
  };
306
+ exports.DataBreachKind = {
307
+ Destruction: 'Destruction',
308
+ Leak: 'Leak',
309
+ Loss: 'Loss',
310
+ Alteration: 'Alteration',
311
+ UnauthorizedAccess: 'UnauthorizedAccess',
312
+ };
313
+ exports.DataBreachStatus = {
314
+ Open: 'Open',
315
+ Closed: 'Closed',
316
+ };
317
+ exports.DataBreachEventAction = {
318
+ Registered: 'Registered',
319
+ Updated: 'Updated',
320
+ AgencyReported: 'AgencyReported',
321
+ HoldersNotified: 'HoldersNotified',
322
+ Closed: 'Closed',
323
+ };
324
+ exports.DataBreachNoticeMeans = {
325
+ Individual: 'Individual',
326
+ PublicNotice: 'PublicNotice',
327
+ };
@@ -1,5 +1,5 @@
1
- import { type CommunicationMeans, type DataLegalBasis, type DataRight, type DataRightsChannel, type DataRightsResolution } from '../base/entities';
2
- import { type DataProtectionPolicyEntity, type DataRightsRequestDetailEntity, type DataRightsRequestListItemEntity, type DataRightsSummaryEntity, type DataTreatmentResponseEntity } from '../entities';
1
+ import { type CommunicationMeans, type DataBreachKind, type DataBreachNoticeMeans, type DataLegalBasis, type DataRight, type DataRightsChannel, type DataRightsResolution } from '../base/entities';
2
+ import { type DataBreachResponseEntity, type DataProtectionPolicyEntity, type IndicatorsFileEntity, type DataRightsRequestDetailEntity, type DataRightsRequestListItemEntity, type DataRightsSummaryEntity, type DataTreatmentResponseEntity } from '../entities';
3
3
  import { type RpcPage } from './contract';
4
4
  /** Patrones NATS de `dataProtection`: tratamientos de datos y solicitudes de los titulares (Ley 19.628). */
5
5
  export declare const DataProtectionPatterns: {
@@ -14,6 +14,12 @@ export declare const DataProtectionPatterns: {
14
14
  readonly createRequest: "gestorDocumental.dataProtection.createRequest";
15
15
  readonly updateRequest: "gestorDocumental.dataProtection.updateRequest";
16
16
  readonly actOnRequest: "gestorDocumental.dataProtection.actOnRequest";
17
+ readonly getBreaches: "gestorDocumental.dataProtection.getBreaches";
18
+ readonly getBreach: "gestorDocumental.dataProtection.getBreach";
19
+ readonly createBreach: "gestorDocumental.dataProtection.createBreach";
20
+ readonly updateBreach: "gestorDocumental.dataProtection.updateBreach";
21
+ readonly actOnBreach: "gestorDocumental.dataProtection.actOnBreach";
22
+ readonly getBreachPdf: "gestorDocumental.dataProtection.getBreachPdf";
17
23
  };
18
24
  type TActor = {
19
25
  employeeId: string;
@@ -92,6 +98,40 @@ export type DataRightsAction = {
92
98
  complaintAt?: string | null;
93
99
  note: string;
94
100
  };
101
+ /** Datos de una vulneración al registrarla o corregirla. */
102
+ export interface DataBreachWritePayload {
103
+ detectedAt: string;
104
+ occurredAt?: string | null;
105
+ kinds: DataBreachKind[];
106
+ description: string;
107
+ effects?: string | null;
108
+ dataCategories: string[];
109
+ affectedCount?: number | null;
110
+ measures?: string | null;
111
+ sensitiveData?: boolean;
112
+ minorsData?: boolean;
113
+ financialData?: boolean;
114
+ riskToRights?: boolean;
115
+ treatmentId?: string | null;
116
+ }
117
+ /** Un paso de la gestión de una vulneración. */
118
+ export type DataBreachAction =
119
+ /** Reporte a la Agencia, con el medio y su número o folio. */
120
+ {
121
+ type: 'reportAgency';
122
+ reportedAt?: string | null;
123
+ note: string;
124
+ }
125
+ /** Comunicación a los titulares: a cada uno o, si no es posible, un aviso en un medio masivo nacional. */
126
+ | {
127
+ type: 'notifyHolders';
128
+ notifiedAt?: string | null;
129
+ means: DataBreachNoticeMeans;
130
+ note: string;
131
+ } | {
132
+ type: 'close';
133
+ note?: string | null;
134
+ };
95
135
  export interface DataProtectionContract {
96
136
  [DataProtectionPatterns.getTreatments]: {
97
137
  payload: {
@@ -164,5 +204,48 @@ export interface DataProtectionContract {
164
204
  };
165
205
  response: DataRightsRequestDetailEntity;
166
206
  };
207
+ /** Las vulneraciones del año (o todas las abiertas), de la más reciente a la más antigua. */
208
+ [DataProtectionPatterns.getBreaches]: {
209
+ payload: {
210
+ year?: number | null;
211
+ openOnly?: boolean;
212
+ };
213
+ response: DataBreachResponseEntity[];
214
+ };
215
+ [DataProtectionPatterns.getBreach]: {
216
+ payload: {
217
+ id: string;
218
+ };
219
+ response: DataBreachResponseEntity;
220
+ };
221
+ [DataProtectionPatterns.createBreach]: {
222
+ payload: DataBreachWritePayload & {
223
+ actor: TActor;
224
+ };
225
+ response: DataBreachResponseEntity;
226
+ };
227
+ [DataProtectionPatterns.updateBreach]: {
228
+ payload: DataBreachWritePayload & {
229
+ id: string;
230
+ actor: TActor;
231
+ };
232
+ response: DataBreachResponseEntity;
233
+ };
234
+ [DataProtectionPatterns.actOnBreach]: {
235
+ payload: {
236
+ id: string;
237
+ action: DataBreachAction;
238
+ actor: TActor;
239
+ };
240
+ response: DataBreachResponseEntity;
241
+ };
242
+ /** El registro de la vulneración en PDF, para reportarla o archivarla. */
243
+ [DataProtectionPatterns.getBreachPdf]: {
244
+ payload: {
245
+ id: string;
246
+ generatedBy: string;
247
+ };
248
+ response: IndicatorsFileEntity;
249
+ };
167
250
  }
168
251
  export {};
@@ -14,4 +14,10 @@ exports.DataProtectionPatterns = {
14
14
  createRequest: 'gestorDocumental.dataProtection.createRequest',
15
15
  updateRequest: 'gestorDocumental.dataProtection.updateRequest',
16
16
  actOnRequest: 'gestorDocumental.dataProtection.actOnRequest',
17
+ getBreaches: 'gestorDocumental.dataProtection.getBreaches',
18
+ getBreach: 'gestorDocumental.dataProtection.getBreach',
19
+ createBreach: 'gestorDocumental.dataProtection.createBreach',
20
+ updateBreach: 'gestorDocumental.dataProtection.updateBreach',
21
+ actOnBreach: 'gestorDocumental.dataProtection.actOnBreach',
22
+ getBreachPdf: 'gestorDocumental.dataProtection.getBreachPdf',
17
23
  };
@@ -132,6 +132,7 @@ export declare const GestorDocumentalPatterns: {
132
132
  readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
133
133
  readonly dispatchByContingency: "gestorDocumental.partsOffice.dispatchByContingency";
134
134
  readonly registerManualIntake: "gestorDocumental.partsOffice.registerManualIntake";
135
+ readonly addCaseFileReceipt: "gestorDocumental.partsOffice.addCaseFileReceipt";
135
136
  };
136
137
  readonly registerBook: {
137
138
  readonly get: "gestorDocumental.registerBook.get";
@@ -243,6 +244,12 @@ export declare const GestorDocumentalPatterns: {
243
244
  readonly createRequest: "gestorDocumental.dataProtection.createRequest";
244
245
  readonly updateRequest: "gestorDocumental.dataProtection.updateRequest";
245
246
  readonly actOnRequest: "gestorDocumental.dataProtection.actOnRequest";
247
+ readonly getBreaches: "gestorDocumental.dataProtection.getBreaches";
248
+ readonly getBreach: "gestorDocumental.dataProtection.getBreach";
249
+ readonly createBreach: "gestorDocumental.dataProtection.createBreach";
250
+ readonly updateBreach: "gestorDocumental.dataProtection.updateBreach";
251
+ readonly actOnBreach: "gestorDocumental.dataProtection.actOnBreach";
252
+ readonly getBreachPdf: "gestorDocumental.dataProtection.getBreachPdf";
246
253
  };
247
254
  };
248
255
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -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 {
@@ -1,4 +1,4 @@
1
- import { type CommunicationMeans, type DataLegalBasis, type DataRight, type DataRightsChannel, type DataRightsEventAction, type DataRightsRequestStatus, type DataRightsResolution } from '../../base/entities';
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
2
  /** Tratamiento de datos personales de la municipalidad: lo que se informa al público (Ley 19.628, art. 14 ter). */
3
3
  export interface DataTreatmentResponseEntity {
4
4
  id: string;
@@ -127,3 +127,48 @@ export interface PersonalDataHintsEntity {
127
127
  /** Algunos ejemplos enmascarados («11.1••.•••-1»). */
128
128
  samples: string[];
129
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.28",
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;
@@ -1,12 +1,16 @@
1
1
  import {
2
2
  type CommunicationMeans,
3
+ type DataBreachKind,
4
+ type DataBreachNoticeMeans,
3
5
  type DataLegalBasis,
4
6
  type DataRight,
5
7
  type DataRightsChannel,
6
8
  type DataRightsResolution,
7
9
  } from '../base/entities';
8
10
  import {
11
+ type DataBreachResponseEntity,
9
12
  type DataProtectionPolicyEntity,
13
+ type IndicatorsFileEntity,
10
14
  type DataRightsRequestDetailEntity,
11
15
  type DataRightsRequestListItemEntity,
12
16
  type DataRightsSummaryEntity,
@@ -27,6 +31,12 @@ export const DataProtectionPatterns = {
27
31
  createRequest: 'gestorDocumental.dataProtection.createRequest',
28
32
  updateRequest: 'gestorDocumental.dataProtection.updateRequest',
29
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',
30
40
  } as const;
31
41
 
32
42
  type TActor = { employeeId: string; fullName: string };
@@ -91,6 +101,31 @@ export type DataRightsAction =
91
101
  }
92
102
  | { type: 'registerComplaint'; complaintAt?: string | null; note: string };
93
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
+
94
129
  export interface DataProtectionContract {
95
130
  [DataProtectionPatterns.getTreatments]: {
96
131
  payload: { enabled?: boolean | null };
@@ -134,4 +169,27 @@ export interface DataProtectionContract {
134
169
  payload: { id: string; action: DataRightsAction; actor: TActor };
135
170
  response: DataRightsRequestDetailEntity;
136
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
+ };
137
195
  }
@@ -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. */
@@ -1,5 +1,9 @@
1
1
  import {
2
2
  type CommunicationMeans,
3
+ type DataBreachEventAction,
4
+ type DataBreachKind,
5
+ type DataBreachNoticeMeans,
6
+ type DataBreachStatus,
3
7
  type DataLegalBasis,
4
8
  type DataRight,
5
9
  type DataRightsChannel,
@@ -138,3 +142,44 @@ export interface PersonalDataHintsEntity {
138
142
  /** Algunos ejemplos enmascarados («11.1••.•••-1»). */
139
143
  samples: string[];
140
144
  }
145
+
146
+ /** Vulneración de las medidas de seguridad que afecta datos personales (Ley 19.628, art. 14 sexies). */
147
+ export interface DataBreachResponseEntity {
148
+ id: string;
149
+ /** «N° 2/2026». */
150
+ label: string;
151
+ year: number;
152
+ number: number;
153
+ detectedAt: string;
154
+ occurredAt: string | null;
155
+ kinds: DataBreachKind[];
156
+ description: string;
157
+ effects: string | null;
158
+ dataCategories: string[];
159
+ affectedCount: number | null;
160
+ measures: string | null;
161
+ sensitiveData: boolean;
162
+ minorsData: boolean;
163
+ financialData: boolean;
164
+ riskToRights: boolean;
165
+ treatmentId: string | null;
166
+ treatmentName: string | null;
167
+ status: DataBreachStatus;
168
+ /** Hay riesgo razonable para los titulares: se reporta a la Agencia sin dilaciones indebidas. */
169
+ mustReportAgency: boolean;
170
+ /** Además, datos sensibles, de menores de 14 o de obligaciones económicas: se comunica a los titulares. */
171
+ mustNotifyHolders: boolean;
172
+ agencyReportedAt: string | null;
173
+ agencyReportNote: string | null;
174
+ /** Horas entre la detección y el reporte a la Agencia (o hasta ahora, si falta reportarla). */
175
+ agencyDelayHours: number | null;
176
+ holdersNotifiedAt: string | null;
177
+ holdersNoticeMeans: DataBreachNoticeMeans | null;
178
+ holdersNoticeNote: string | null;
179
+ closedAt: string | null;
180
+ closeNote: string | null;
181
+ createdByFullName: string;
182
+ /** Por qué todavía no se puede cerrar, o `null` si se puede. */
183
+ closeBlock: string | null;
184
+ events: { action: DataBreachEventAction; note: string | null; employeeFullName: string; createdAt: string }[];
185
+ }