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

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' | 'DispatchedByContingency' | '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' | 'TransparencyRedacted' | 'TransparencyPublished' | 'TransparencyExcluded' | 'TransparencyWithdrawn';
37
37
  export declare const DocumentTrackingAction: {
38
38
  Created: "Created";
39
39
  Updated: "Updated";
@@ -56,6 +56,10 @@ export declare const DocumentTrackingAction: {
56
56
  EmailCopySent: "EmailCopySent";
57
57
  EmailCopyOpened: "EmailCopyOpened";
58
58
  DispositionRecorded: "DispositionRecorded";
59
+ TransparencyRedacted: "TransparencyRedacted";
60
+ TransparencyPublished: "TransparencyPublished";
61
+ TransparencyExcluded: "TransparencyExcluded";
62
+ TransparencyWithdrawn: "TransparencyWithdrawn";
59
63
  };
60
64
  export type DocumentOrigin = 'Internal' | 'DocDigital' | 'Manual';
61
65
  export declare const DocumentOrigin: {
@@ -284,6 +288,11 @@ export declare const AccessRequestEventAction: {
284
288
  Resolved: "Resolved";
285
289
  AppealRegistered: "AppealRegistered";
286
290
  };
291
+ export type TransparencyStatus = 'Published' | 'Excluded';
292
+ export declare const TransparencyStatus: {
293
+ Published: "Published";
294
+ Excluded: "Excluded";
295
+ };
287
296
  export interface DocumentTypeEntity {
288
297
  id: string;
289
298
  name: string;
@@ -294,6 +303,8 @@ export interface DocumentTypeEntity {
294
303
  correlativeYear?: number | null;
295
304
  resetsYearly: boolean;
296
305
  numbered: boolean;
306
+ activeTransparency: boolean;
307
+ transparencySection?: string | null;
297
308
  directorateCodeReference?: number | null;
298
309
  archivalSeries?: ArchivalSeriesEntity | null;
299
310
  archivalSeriesId?: string | null;
@@ -367,6 +378,13 @@ export interface DocumentEntity {
367
378
  accesses?: DocumentAccessEntity[];
368
379
  disposition?: DispositionRecordEntity | null;
369
380
  dispositionId?: string | null;
381
+ transparencyStatus?: TransparencyStatus | null;
382
+ transparencyUrl?: string | null;
383
+ transparencyNote?: string | null;
384
+ transparencyAt?: string | null;
385
+ transparencyByFullName?: string | null;
386
+ redactedFileId?: string | null;
387
+ redactedFileName?: string | null;
370
388
  accessRequestResponses?: AccessRequestEntity[];
371
389
  accessRequestDeliveries?: AccessRequestDocumentEntity[];
372
390
  dispatch?: DocumentDispatchEntity | 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.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.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',
@@ -54,6 +54,10 @@ exports.DocumentTrackingAction = {
54
54
  EmailCopySent: 'EmailCopySent',
55
55
  EmailCopyOpened: 'EmailCopyOpened',
56
56
  DispositionRecorded: 'DispositionRecorded',
57
+ TransparencyRedacted: 'TransparencyRedacted',
58
+ TransparencyPublished: 'TransparencyPublished',
59
+ TransparencyExcluded: 'TransparencyExcluded',
60
+ TransparencyWithdrawn: 'TransparencyWithdrawn',
57
61
  };
58
62
  exports.DocumentOrigin = {
59
63
  Internal: 'Internal',
@@ -251,3 +255,7 @@ exports.AccessRequestEventAction = {
251
255
  Resolved: 'Resolved',
252
256
  AppealRegistered: 'AppealRegistered',
253
257
  };
258
+ exports.TransparencyStatus = {
259
+ Published: 'Published',
260
+ Excluded: 'Excluded',
261
+ };
@@ -35,6 +35,9 @@ export interface DocumentTypeWritePayload {
35
35
  nextCorrelative?: number;
36
36
  resetsYearly?: boolean;
37
37
  numbered?: boolean;
38
+ /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
39
+ activeTransparency?: boolean;
40
+ transparencySection?: string | null;
38
41
  directorateCodeReference?: number | null;
39
42
  archivalSeriesId?: string | null;
40
43
  issuingEntityId?: string | null;
@@ -11,6 +11,7 @@ import { type SignatureCheckContract } from './signatureCheck.contract';
11
11
  import { type RepositoryExportContract } from './repositoryExport.contract';
12
12
  import { type RetentionContract } from './retention.contract';
13
13
  import { type AccessRequestContract } from './accessRequest.contract';
14
+ import { type TransparencyContract } from './transparency.contract';
14
15
  import { type ScanContract } from './scan.contract';
15
16
  import { type PartsOfficeContract } from './partsOffice.contract';
16
17
  import { type ProcedureContract } from './procedure.contract';
@@ -37,6 +38,7 @@ export * from './signatureCheck.contract';
37
38
  export * from './repositoryExport.contract';
38
39
  export * from './retention.contract';
39
40
  export * from './accessRequest.contract';
41
+ export * from './transparency.contract';
40
42
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
41
43
  export declare const GestorDocumentalPatterns: {
42
44
  readonly documentType: {
@@ -219,6 +221,14 @@ export declare const GestorDocumentalPatterns: {
219
221
  readonly update: "gestorDocumental.accessRequest.update";
220
222
  readonly act: "gestorDocumental.accessRequest.act";
221
223
  };
224
+ readonly transparency: {
225
+ readonly getMonth: "gestorDocumental.transparency.getMonth";
226
+ readonly update: "gestorDocumental.transparency.update";
227
+ readonly export: "gestorDocumental.transparency.export";
228
+ readonly getRedactedFile: "gestorDocumental.transparency.getRedactedFile";
229
+ readonly getPublic: "gestorDocumental.transparency.getPublic";
230
+ readonly getPublicFile: "gestorDocumental.transparency.getPublicFile";
231
+ };
222
232
  };
223
233
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
224
- export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract;
234
+ export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract;
@@ -28,6 +28,7 @@ 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
30
  const accessRequest_contract_1 = require("./accessRequest.contract");
31
+ const transparency_contract_1 = require("./transparency.contract");
31
32
  const scan_contract_1 = require("./scan.contract");
32
33
  const partsOffice_contract_1 = require("./partsOffice.contract");
33
34
  const procedure_contract_1 = require("./procedure.contract");
@@ -54,6 +55,7 @@ __exportStar(require("./signatureCheck.contract"), exports);
54
55
  __exportStar(require("./repositoryExport.contract"), exports);
55
56
  __exportStar(require("./retention.contract"), exports);
56
57
  __exportStar(require("./accessRequest.contract"), exports);
58
+ __exportStar(require("./transparency.contract"), exports);
57
59
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
58
60
  exports.GestorDocumentalPatterns = {
59
61
  documentType: documentType_contract_1.DocumentTypePatterns,
@@ -75,4 +77,5 @@ exports.GestorDocumentalPatterns = {
75
77
  repositoryExport: repositoryExport_contract_1.RepositoryExportPatterns,
76
78
  retention: retention_contract_1.RetentionPatterns,
77
79
  accessRequest: accessRequest_contract_1.AccessRequestPatterns,
80
+ transparency: transparency_contract_1.TransparencyPatterns,
78
81
  };
@@ -0,0 +1,96 @@
1
+ import { type DocumentPublicFileResponseEntity, type IndicatorsFileEntity, type TransparencyItemEntity, type TransparencyItemStatus, type TransparencyMonthEntity, type TransparencyPublicEntity } from '../entities';
2
+ /** Patrones NATS de `transparency`: Transparencia Activa de los documentos firmados (Ley 20.285, art. 7°). */
3
+ export declare const TransparencyPatterns: {
4
+ readonly getMonth: "gestorDocumental.transparency.getMonth";
5
+ readonly update: "gestorDocumental.transparency.update";
6
+ readonly export: "gestorDocumental.transparency.export";
7
+ readonly getRedactedFile: "gestorDocumental.transparency.getRedactedFile";
8
+ readonly getPublic: "gestorDocumental.transparency.getPublic";
9
+ readonly getPublicFile: "gestorDocumental.transparency.getPublicFile";
10
+ };
11
+ type TTransparencyActor = {
12
+ employeeId: string;
13
+ fullName: string;
14
+ };
15
+ /** Lo que se decide sobre un documento en Transparencia Activa. */
16
+ export type TransparencyUpdatePayload =
17
+ /** Publicarlo (o corregir el enlace): si el original no es público, exige antes la versión tarjada. */
18
+ {
19
+ action: 'publish';
20
+ documentId: string;
21
+ url?: string | null;
22
+ note?: string | null;
23
+ actor: TTransparencyActor;
24
+ }
25
+ /** No se publica, con su motivo (p. ej. reservado por el art. 21 de la Ley 20.285). */
26
+ | {
27
+ action: 'exclude';
28
+ documentId: string;
29
+ reason: string;
30
+ actor: TTransparencyActor;
31
+ }
32
+ /** Vuelve a pendiente: se retiró la publicación o se revisó la exclusión. */
33
+ | {
34
+ action: 'withdraw';
35
+ documentId: string;
36
+ reason: string;
37
+ actor: TTransparencyActor;
38
+ }
39
+ /** Versión tarjada ya subida al gestor de archivos (PDF). */
40
+ | {
41
+ action: 'setRedacted';
42
+ documentId: string;
43
+ fileId: string;
44
+ fileName: string;
45
+ actor: TTransparencyActor;
46
+ } | {
47
+ action: 'removeRedacted';
48
+ documentId: string;
49
+ actor: TTransparencyActor;
50
+ };
51
+ export interface TransparencyContract {
52
+ /** Lo firmado en el mes (hora de Chile) de los tipos que se publican, y lo que ya se publicó aunque el tipo cambie. */
53
+ [TransparencyPatterns.getMonth]: {
54
+ payload: {
55
+ year: number;
56
+ month: number;
57
+ status?: TransparencyItemStatus | null;
58
+ };
59
+ response: TransparencyMonthEntity;
60
+ };
61
+ [TransparencyPatterns.update]: {
62
+ payload: TransparencyUpdatePayload;
63
+ response: TransparencyItemEntity;
64
+ };
65
+ /** Planilla del mes (Excel) para cargar en el Portal de Transparencia. */
66
+ [TransparencyPatterns.export]: {
67
+ payload: {
68
+ year: number;
69
+ month: number;
70
+ generatedBy: string;
71
+ };
72
+ response: IndicatorsFileEntity;
73
+ };
74
+ /** La versión tarjada cargada, para revisarla antes de publicar. */
75
+ [TransparencyPatterns.getRedactedFile]: {
76
+ payload: {
77
+ documentId: string;
78
+ };
79
+ response: DocumentPublicFileResponseEntity;
80
+ };
81
+ /** Página pública de un documento publicado, por su código de verificación. No exige sesión. */
82
+ [TransparencyPatterns.getPublic]: {
83
+ payload: {
84
+ code: string;
85
+ };
86
+ response: TransparencyPublicEntity;
87
+ };
88
+ /** La versión publicada: la tarjada si existe; si no, el original público. Solo de un documento vigente. */
89
+ [TransparencyPatterns.getPublicFile]: {
90
+ payload: {
91
+ code: string;
92
+ };
93
+ response: DocumentPublicFileResponseEntity;
94
+ };
95
+ }
96
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransparencyPatterns = void 0;
4
+ /** Patrones NATS de `transparency`: Transparencia Activa de los documentos firmados (Ley 20.285, art. 7°). */
5
+ exports.TransparencyPatterns = {
6
+ getMonth: 'gestorDocumental.transparency.getMonth',
7
+ update: 'gestorDocumental.transparency.update',
8
+ export: 'gestorDocumental.transparency.export',
9
+ getRedactedFile: 'gestorDocumental.transparency.getRedactedFile',
10
+ getPublic: 'gestorDocumental.transparency.getPublic',
11
+ getPublicFile: 'gestorDocumental.transparency.getPublicFile',
12
+ };
@@ -21,6 +21,9 @@ export interface DocumentTypeGetAllResponseEntity {
21
21
  correlativeYear: DocumentTypeEntity['correlativeYear'];
22
22
  resetsYearly: DocumentTypeEntity['resetsYearly'];
23
23
  numbered: DocumentTypeEntity['numbered'];
24
+ /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
25
+ activeTransparency: DocumentTypeEntity['activeTransparency'];
26
+ transparencySection: DocumentTypeEntity['transparencySection'];
24
27
  directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
25
28
  archivalSeries: {
26
29
  id: string;
@@ -17,3 +17,4 @@ export * from './signatureCheck';
17
17
  export * from './repositoryExport';
18
18
  export * from './retention';
19
19
  export * from './accessRequest';
20
+ export * from './transparency';
@@ -33,3 +33,4 @@ __exportStar(require("./signatureCheck"), exports);
33
33
  __exportStar(require("./repositoryExport"), exports);
34
34
  __exportStar(require("./retention"), exports);
35
35
  __exportStar(require("./accessRequest"), exports);
36
+ __exportStar(require("./transparency"), exports);
@@ -0,0 +1 @@
1
+ export * from './transparency.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("./transparency.entity"), exports);
@@ -0,0 +1,74 @@
1
+ import { type DocumentAccessLevel, type DocumentStatus } from '../../base/entities';
2
+ /** En qué quedó un documento en Transparencia Activa: aún sin decidir, publicado o excluido con su motivo. */
3
+ export type TransparencyItemStatus = 'Pending' | 'Published' | 'Excluded';
4
+ /** Un documento que se publica en Transparencia Activa (Ley 20.285, art. 7°), con lo que se decidió de él. */
5
+ export interface TransparencyItemEntity {
6
+ documentId: string;
7
+ documentStatus: DocumentStatus;
8
+ verificationCode: string | null;
9
+ documentTypeName: string;
10
+ documentTypeAbbreviation: string | null;
11
+ /** Sección del Portal en que se publica, según su tipo documental. */
12
+ section: string | null;
13
+ /** Folio del documento (`Decreto Alcaldicio N° 15/2026`), o el nombre del tipo si no lleva número. */
14
+ reference: string;
15
+ correlative: number | null;
16
+ correlativeYear: number | null;
17
+ subject: string;
18
+ finishedAt: string | null;
19
+ annulledAt: string | null;
20
+ accessLevel: DocumentAccessLevel;
21
+ hasSensitiveData: boolean;
22
+ /** El original se puede publicar tal cual: es público (o su restricción terminó) y no tiene datos sensibles. */
23
+ originalIsPublic: boolean;
24
+ /** Para publicarlo hace falta antes la versión tarjada. */
25
+ needsRedacted: boolean;
26
+ redactedFileName: string | null;
27
+ status: TransparencyItemStatus;
28
+ /** Dirección de la publicación en el Portal de Transparencia, si se anotó. */
29
+ transparencyUrl: string | null;
30
+ /** Motivo de la exclusión, u observación de la publicación. */
31
+ transparencyNote: string | null;
32
+ transparencyAt: string | null;
33
+ transparencyByFullName: string | null;
34
+ /** Enlace público estable a la versión que se publica (`<TRANSPARENCY_URL>/<código>`), si está configurado. */
35
+ publicLink: string | null;
36
+ }
37
+ export interface TransparencyMonthCountsEntity {
38
+ total: number;
39
+ pending: number;
40
+ published: number;
41
+ excluded: number;
42
+ /** Publicados que después se anularon: hay que retirarlos o actualizarlos en el Portal. */
43
+ annulledPublished: number;
44
+ }
45
+ /** Lo firmado en un mes de los tipos documentales que se publican, con lo que falta por decidir. */
46
+ export interface TransparencyMonthEntity {
47
+ year: number;
48
+ month: number;
49
+ counts: TransparencyMonthCountsEntity;
50
+ /** Tipos documentales marcados para Transparencia Activa. Sin ninguno, la bandeja queda vacía. */
51
+ documentTypes: {
52
+ id: string;
53
+ name: string;
54
+ section: string | null;
55
+ }[];
56
+ items: TransparencyItemEntity[];
57
+ }
58
+ /** Lo que muestra la página pública de un documento publicado en Transparencia Activa. No exige sesión. */
59
+ export interface TransparencyPublicEntity {
60
+ verificationCode: string;
61
+ documentTypeName: string;
62
+ issuerName: string;
63
+ section: string | null;
64
+ reference: string;
65
+ /** La materia solo se muestra si el original es público; si se publicó tarjado, se lee en el archivo. */
66
+ subject: string | null;
67
+ finishedAt: string | null;
68
+ /** Anulado después de publicarse: se informa y ya no se descarga. */
69
+ annulled: boolean;
70
+ /** Se publicó una versión tarjada (sin datos personales o reservados). */
71
+ redacted: boolean;
72
+ canDownload: boolean;
73
+ publishedAt: string | null;
74
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.26",
3
+ "version": "0.0.1-beta.27",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -67,7 +67,11 @@ export type DocumentTrackingAction =
67
67
  | 'Received'
68
68
  | 'EmailCopySent'
69
69
  | 'EmailCopyOpened'
70
- | 'DispositionRecorded';
70
+ | 'DispositionRecorded'
71
+ | 'TransparencyRedacted'
72
+ | 'TransparencyPublished'
73
+ | 'TransparencyExcluded'
74
+ | 'TransparencyWithdrawn';
71
75
 
72
76
  export const DocumentTrackingAction = {
73
77
  Created: 'Created',
@@ -91,6 +95,10 @@ export const DocumentTrackingAction = {
91
95
  EmailCopySent: 'EmailCopySent',
92
96
  EmailCopyOpened: 'EmailCopyOpened',
93
97
  DispositionRecorded: 'DispositionRecorded',
98
+ TransparencyRedacted: 'TransparencyRedacted',
99
+ TransparencyPublished: 'TransparencyPublished',
100
+ TransparencyExcluded: 'TransparencyExcluded',
101
+ TransparencyWithdrawn: 'TransparencyWithdrawn',
94
102
  } satisfies Record<string, DocumentTrackingAction>;
95
103
 
96
104
  export type DocumentOrigin = 'Internal' | 'DocDigital' | 'Manual';
@@ -335,7 +343,8 @@ export type AuditEntity =
335
343
  | 'Procedure'
336
344
  | 'QualityMetric'
337
345
  | 'ServiceOutage'
338
- | 'Repository';
346
+ | 'Repository'
347
+ | 'DataTreatment';
339
348
 
340
349
  export const AuditEntity = {
341
350
  DocumentType: 'DocumentType',
@@ -347,6 +356,7 @@ export const AuditEntity = {
347
356
  QualityMetric: 'QualityMetric',
348
357
  ServiceOutage: 'ServiceOutage',
349
358
  Repository: 'Repository',
359
+ DataTreatment: 'DataTreatment',
350
360
  } satisfies Record<string, AuditEntity>;
351
361
 
352
362
  export type AuditAction = 'Created' | 'Updated' | 'Enabled' | 'Disabled' | 'Removed' | 'Exported';
@@ -430,6 +440,84 @@ export const AccessRequestEventAction = {
430
440
  AppealRegistered: 'AppealRegistered',
431
441
  } satisfies Record<string, AccessRequestEventAction>;
432
442
 
443
+ export type TransparencyStatus = 'Published' | 'Excluded';
444
+
445
+ export const TransparencyStatus = {
446
+ Published: 'Published',
447
+ Excluded: 'Excluded',
448
+ } satisfies Record<string, TransparencyStatus>;
449
+
450
+ export type DataLegalBasis = 'LegalFunction' | 'LegalObligation' | 'Consent' | 'Contract' | 'VitalInterest';
451
+
452
+ export const DataLegalBasis = {
453
+ LegalFunction: 'LegalFunction',
454
+ LegalObligation: 'LegalObligation',
455
+ Consent: 'Consent',
456
+ Contract: 'Contract',
457
+ VitalInterest: 'VitalInterest',
458
+ } satisfies Record<string, DataLegalBasis>;
459
+
460
+ export type DataRight = 'Access' | 'Rectification' | 'Suppression' | 'Opposition' | 'Portability';
461
+
462
+ export const DataRight = {
463
+ Access: 'Access',
464
+ Rectification: 'Rectification',
465
+ Suppression: 'Suppression',
466
+ Opposition: 'Opposition',
467
+ Portability: 'Portability',
468
+ } satisfies Record<string, DataRight>;
469
+
470
+ export type DataRightsChannel = 'Email' | 'WebForm' | 'InPerson' | 'Letter';
471
+
472
+ export const DataRightsChannel = {
473
+ Email: 'Email',
474
+ WebForm: 'WebForm',
475
+ InPerson: 'InPerson',
476
+ Letter: 'Letter',
477
+ } satisfies Record<string, DataRightsChannel>;
478
+
479
+ export type DataRightsRequestStatus = 'Received' | 'InProgress' | 'Resolved';
480
+
481
+ export const DataRightsRequestStatus = {
482
+ Received: 'Received',
483
+ InProgress: 'InProgress',
484
+ Resolved: 'Resolved',
485
+ } satisfies Record<string, DataRightsRequestStatus>;
486
+
487
+ export type DataRightsResolution = 'Granted' | 'PartiallyGranted' | 'Denied' | 'Withdrawn';
488
+
489
+ export const DataRightsResolution = {
490
+ Granted: 'Granted',
491
+ PartiallyGranted: 'PartiallyGranted',
492
+ Denied: 'Denied',
493
+ Withdrawn: 'Withdrawn',
494
+ } satisfies Record<string, DataRightsResolution>;
495
+
496
+ export type DataRightsEventAction =
497
+ | 'Received'
498
+ | 'Updated'
499
+ | 'Acknowledged'
500
+ | 'IdentityVerified'
501
+ | 'Assigned'
502
+ | 'BlockingResolved'
503
+ | 'Extended'
504
+ | 'Resolved'
505
+ | 'ResponseSent'
506
+ | 'ComplaintRegistered';
507
+
508
+ export const DataRightsEventAction = {
509
+ Received: 'Received',
510
+ Updated: 'Updated',
511
+ Acknowledged: 'Acknowledged',
512
+ IdentityVerified: 'IdentityVerified',
513
+ Assigned: 'Assigned',
514
+ BlockingResolved: 'BlockingResolved',
515
+ Extended: 'Extended',
516
+ Resolved: 'Resolved',
517
+ ResponseSent: 'ResponseSent',
518
+ ComplaintRegistered: 'ComplaintRegistered',
519
+ } satisfies Record<string, DataRightsEventAction>;
520
+
433
521
  export interface DocumentTypeEntity {
434
522
  id: string;
435
523
  name: string;
@@ -440,6 +528,8 @@ export interface DocumentTypeEntity {
440
528
  correlativeYear?: number | null;
441
529
  resetsYearly: boolean;
442
530
  numbered: boolean;
531
+ activeTransparency: boolean;
532
+ transparencySection?: string | null;
443
533
  directorateCodeReference?: number | null;
444
534
  archivalSeries?: ArchivalSeriesEntity | null;
445
535
  archivalSeriesId?: string | null;
@@ -514,7 +604,15 @@ export interface DocumentEntity {
514
604
  accesses?: DocumentAccessEntity[];
515
605
  disposition?: DispositionRecordEntity | null;
516
606
  dispositionId?: string | null;
607
+ transparencyStatus?: TransparencyStatus | null;
608
+ transparencyUrl?: string | null;
609
+ transparencyNote?: string | null;
610
+ transparencyAt?: string | null;
611
+ transparencyByFullName?: string | null;
612
+ redactedFileId?: string | null;
613
+ redactedFileName?: string | null;
517
614
  accessRequestResponses?: AccessRequestEntity[];
615
+ dataRightsResponses?: DataRightsRequestEntity[];
518
616
  accessRequestDeliveries?: AccessRequestDocumentEntity[];
519
617
  dispatch?: DocumentDispatchEntity | null;
520
618
  docDigitalInbound?: DocDigitalInboundEntity | null;
@@ -1148,4 +1246,86 @@ export interface AccessRequestEventEntity {
1148
1246
  createdAt: string;
1149
1247
  }
1150
1248
 
1249
+ export interface DataTreatmentEntity {
1250
+ id: string;
1251
+ name: string;
1252
+ purpose: string;
1253
+ legalBasis: DataLegalBasis;
1254
+ legalBasisDetail?: string | null;
1255
+ dataCategories: string[];
1256
+ sensitiveData: boolean;
1257
+ dataSubjects: string;
1258
+ recipients?: string | null;
1259
+ source?: string | null;
1260
+ retention?: string | null;
1261
+ securityMeasures?: string | null;
1262
+ internationalTransfer?: string | null;
1263
+ responsibleUnit?: string | null;
1264
+ published: boolean;
1265
+ requests?: DataRightsRequestEntity[];
1266
+ enabled: boolean;
1267
+ deleted: boolean;
1268
+ createdAt: string;
1269
+ updatedAt: string;
1270
+ }
1271
+
1272
+ export interface DataRightsRequestEntity {
1273
+ id: string;
1274
+ number: number;
1275
+ year: number;
1276
+ channel: DataRightsChannel;
1277
+ receivedAt: string;
1278
+ rights: DataRight[];
1279
+ requesterName: string;
1280
+ requesterRut?: string | null;
1281
+ requesterEmail?: string | null;
1282
+ requesterAddress?: string | null;
1283
+ representativeName?: string | null;
1284
+ identityVerifiedAt?: string | null;
1285
+ identityNote?: string | null;
1286
+ requestText: string;
1287
+ treatment?: DataTreatmentEntity | null;
1288
+ treatmentId?: string | null;
1289
+ status: DataRightsRequestStatus;
1290
+ acknowledgedAt?: string | null;
1291
+ dueAt: string;
1292
+ extendedAt?: string | null;
1293
+ extensionNote?: string | null;
1294
+ blockingRequested: boolean;
1295
+ blockingReason?: string | null;
1296
+ blockingDueAt?: string | null;
1297
+ blockingGranted?: boolean | null;
1298
+ blockingResolvedAt?: string | null;
1299
+ blockingNote?: string | null;
1300
+ assigneeEmployeeId?: string | null;
1301
+ assigneeFullName?: string | null;
1302
+ resolution?: DataRightsResolution | null;
1303
+ resolvedAt?: string | null;
1304
+ denialGrounds: string[];
1305
+ resolutionNote?: string | null;
1306
+ responseDocument?: DocumentEntity | null;
1307
+ responseDocumentId?: string | null;
1308
+ responseSentAt?: string | null;
1309
+ responseSentTo?: string | null;
1310
+ responseSentMeans?: CommunicationMeans | null;
1311
+ complaintAt?: string | null;
1312
+ complaintNote?: string | null;
1313
+ createdByEmployeeId: string;
1314
+ createdByFullName: string;
1315
+ events?: DataRightsEventEntity[];
1316
+ createdAt: string;
1317
+ updatedAt: string;
1318
+ }
1319
+
1320
+ export interface DataRightsEventEntity {
1321
+ id: string;
1322
+ action: DataRightsEventAction;
1323
+ note?: string | null;
1324
+ employeeId?: string | null;
1325
+ employeeFullName: string;
1326
+ request?: DataRightsRequestEntity;
1327
+ requestId: string;
1328
+ createdAt: string;
1329
+ }
1330
+
1151
1331
  type JsonValue = string | number | boolean | { [key in string]?: JsonValue } | Array<JsonValue> | null;
@@ -40,6 +40,9 @@ export interface DocumentTypeWritePayload {
40
40
  resetsYearly?: boolean;
41
41
  // Sus documentos llevan número (por omisión, sí).
42
42
  numbered?: boolean;
43
+ /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
44
+ activeTransparency?: boolean;
45
+ transparencySection?: string | null;
43
46
  directorateCodeReference?: number | null;
44
47
  // Serie documental del Cuadro de Clasificación (sin valor: sin clasificar).
45
48
  archivalSeriesId?: string | null;
@@ -11,6 +11,7 @@ import { SignatureCheckPatterns, type SignatureCheckContract } from './signature
11
11
  import { RepositoryExportPatterns, type RepositoryExportContract } from './repositoryExport.contract';
12
12
  import { RetentionPatterns, type RetentionContract } from './retention.contract';
13
13
  import { AccessRequestPatterns, type AccessRequestContract } from './accessRequest.contract';
14
+ import { TransparencyPatterns, type TransparencyContract } from './transparency.contract';
14
15
  import { ScanPatterns, type ScanContract } from './scan.contract';
15
16
  import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
16
17
  import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
@@ -38,6 +39,7 @@ export * from './signatureCheck.contract';
38
39
  export * from './repositoryExport.contract';
39
40
  export * from './retention.contract';
40
41
  export * from './accessRequest.contract';
42
+ export * from './transparency.contract';
41
43
 
42
44
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
43
45
  export const GestorDocumentalPatterns = {
@@ -60,6 +62,7 @@ export const GestorDocumentalPatterns = {
60
62
  repositoryExport: RepositoryExportPatterns,
61
63
  retention: RetentionPatterns,
62
64
  accessRequest: AccessRequestPatterns,
65
+ transparency: TransparencyPatterns,
63
66
  } as const;
64
67
 
65
68
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -81,4 +84,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
81
84
  SignatureCheckContract &
82
85
  RepositoryExportContract &
83
86
  RetentionContract &
84
- AccessRequestContract;
87
+ AccessRequestContract &
88
+ TransparencyContract;
@@ -0,0 +1,55 @@
1
+ import {
2
+ type DocumentPublicFileResponseEntity,
3
+ type IndicatorsFileEntity,
4
+ type TransparencyItemEntity,
5
+ type TransparencyItemStatus,
6
+ type TransparencyMonthEntity,
7
+ type TransparencyPublicEntity,
8
+ } from '../entities';
9
+
10
+ /** Patrones NATS de `transparency`: Transparencia Activa de los documentos firmados (Ley 20.285, art. 7°). */
11
+ export const TransparencyPatterns = {
12
+ getMonth: 'gestorDocumental.transparency.getMonth',
13
+ update: 'gestorDocumental.transparency.update',
14
+ export: 'gestorDocumental.transparency.export',
15
+ getRedactedFile: 'gestorDocumental.transparency.getRedactedFile',
16
+ getPublic: 'gestorDocumental.transparency.getPublic',
17
+ getPublicFile: 'gestorDocumental.transparency.getPublicFile',
18
+ } as const;
19
+
20
+ type TTransparencyActor = { employeeId: string; fullName: string };
21
+
22
+ /** Lo que se decide sobre un documento en Transparencia Activa. */
23
+ export type TransparencyUpdatePayload =
24
+ /** Publicarlo (o corregir el enlace): si el original no es público, exige antes la versión tarjada. */
25
+ | { action: 'publish'; documentId: string; url?: string | null; note?: string | null; actor: TTransparencyActor }
26
+ /** No se publica, con su motivo (p. ej. reservado por el art. 21 de la Ley 20.285). */
27
+ | { action: 'exclude'; documentId: string; reason: string; actor: TTransparencyActor }
28
+ /** Vuelve a pendiente: se retiró la publicación o se revisó la exclusión. */
29
+ | { action: 'withdraw'; documentId: string; reason: string; actor: TTransparencyActor }
30
+ /** Versión tarjada ya subida al gestor de archivos (PDF). */
31
+ | { action: 'setRedacted'; documentId: string; fileId: string; fileName: string; actor: TTransparencyActor }
32
+ | { action: 'removeRedacted'; documentId: string; actor: TTransparencyActor };
33
+
34
+ export interface TransparencyContract {
35
+ /** Lo firmado en el mes (hora de Chile) de los tipos que se publican, y lo que ya se publicó aunque el tipo cambie. */
36
+ [TransparencyPatterns.getMonth]: {
37
+ payload: { year: number; month: number; status?: TransparencyItemStatus | null };
38
+ response: TransparencyMonthEntity;
39
+ };
40
+ [TransparencyPatterns.update]: { payload: TransparencyUpdatePayload; response: TransparencyItemEntity };
41
+ /** Planilla del mes (Excel) para cargar en el Portal de Transparencia. */
42
+ [TransparencyPatterns.export]: {
43
+ payload: { year: number; month: number; generatedBy: string };
44
+ response: IndicatorsFileEntity;
45
+ };
46
+ /** La versión tarjada cargada, para revisarla antes de publicar. */
47
+ [TransparencyPatterns.getRedactedFile]: {
48
+ payload: { documentId: string };
49
+ response: DocumentPublicFileResponseEntity;
50
+ };
51
+ /** Página pública de un documento publicado, por su código de verificación. No exige sesión. */
52
+ [TransparencyPatterns.getPublic]: { payload: { code: string }; response: TransparencyPublicEntity };
53
+ /** La versión publicada: la tarjada si existe; si no, el original público. Solo de un documento vigente. */
54
+ [TransparencyPatterns.getPublicFile]: { payload: { code: string }; response: DocumentPublicFileResponseEntity };
55
+ }
@@ -26,6 +26,9 @@ export interface DocumentTypeGetAllResponseEntity {
26
26
  resetsYearly: DocumentTypeEntity['resetsYearly'];
27
27
  // Sin numeración, sus documentos solo llevan fecha, código de verificación y QR.
28
28
  numbered: DocumentTypeEntity['numbered'];
29
+ /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
30
+ activeTransparency: DocumentTypeEntity['activeTransparency'];
31
+ transparencySection: DocumentTypeEntity['transparencySection'];
29
32
  directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
30
33
  // Serie documental del Cuadro de Clasificación a la que van sus documentos (MGDDE1_2).
31
34
  archivalSeries: { id: string; code: string; name: string } | null;
@@ -17,3 +17,4 @@ export * from './signatureCheck';
17
17
  export * from './repositoryExport';
18
18
  export * from './retention';
19
19
  export * from './accessRequest';
20
+ export * from './transparency';
@@ -0,0 +1 @@
1
+ export * from './transparency.entity';
@@ -0,0 +1,75 @@
1
+ import { type DocumentAccessLevel, type DocumentStatus } from '../../base/entities';
2
+
3
+ /** En qué quedó un documento en Transparencia Activa: aún sin decidir, publicado o excluido con su motivo. */
4
+ export type TransparencyItemStatus = 'Pending' | 'Published' | 'Excluded';
5
+
6
+ /** Un documento que se publica en Transparencia Activa (Ley 20.285, art. 7°), con lo que se decidió de él. */
7
+ export interface TransparencyItemEntity {
8
+ documentId: string;
9
+ documentStatus: DocumentStatus;
10
+ verificationCode: string | null;
11
+ documentTypeName: string;
12
+ documentTypeAbbreviation: string | null;
13
+ /** Sección del Portal en que se publica, según su tipo documental. */
14
+ section: string | null;
15
+ /** Folio del documento (`Decreto Alcaldicio N° 15/2026`), o el nombre del tipo si no lleva número. */
16
+ reference: string;
17
+ correlative: number | null;
18
+ correlativeYear: number | null;
19
+ subject: string;
20
+ finishedAt: string | null;
21
+ annulledAt: string | null;
22
+ accessLevel: DocumentAccessLevel;
23
+ hasSensitiveData: boolean;
24
+ /** El original se puede publicar tal cual: es público (o su restricción terminó) y no tiene datos sensibles. */
25
+ originalIsPublic: boolean;
26
+ /** Para publicarlo hace falta antes la versión tarjada. */
27
+ needsRedacted: boolean;
28
+ redactedFileName: string | null;
29
+ status: TransparencyItemStatus;
30
+ /** Dirección de la publicación en el Portal de Transparencia, si se anotó. */
31
+ transparencyUrl: string | null;
32
+ /** Motivo de la exclusión, u observación de la publicación. */
33
+ transparencyNote: string | null;
34
+ transparencyAt: string | null;
35
+ transparencyByFullName: string | null;
36
+ /** Enlace público estable a la versión que se publica (`<TRANSPARENCY_URL>/<código>`), si está configurado. */
37
+ publicLink: string | null;
38
+ }
39
+
40
+ export interface TransparencyMonthCountsEntity {
41
+ total: number;
42
+ pending: number;
43
+ published: number;
44
+ excluded: number;
45
+ /** Publicados que después se anularon: hay que retirarlos o actualizarlos en el Portal. */
46
+ annulledPublished: number;
47
+ }
48
+
49
+ /** Lo firmado en un mes de los tipos documentales que se publican, con lo que falta por decidir. */
50
+ export interface TransparencyMonthEntity {
51
+ year: number;
52
+ month: number;
53
+ counts: TransparencyMonthCountsEntity;
54
+ /** Tipos documentales marcados para Transparencia Activa. Sin ninguno, la bandeja queda vacía. */
55
+ documentTypes: { id: string; name: string; section: string | null }[];
56
+ items: TransparencyItemEntity[];
57
+ }
58
+
59
+ /** Lo que muestra la página pública de un documento publicado en Transparencia Activa. No exige sesión. */
60
+ export interface TransparencyPublicEntity {
61
+ verificationCode: string;
62
+ documentTypeName: string;
63
+ issuerName: string;
64
+ section: string | null;
65
+ reference: string;
66
+ /** La materia solo se muestra si el original es público; si se publicó tarjado, se lee en el archivo. */
67
+ subject: string | null;
68
+ finishedAt: string | null;
69
+ /** Anulado después de publicarse: se informa y ya no se descarga. */
70
+ annulled: boolean;
71
+ /** Se publicó una versión tarjada (sin datos personales o reservados). */
72
+ redacted: boolean;
73
+ canDownload: boolean;
74
+ publishedAt: string | null;
75
+ }