@muni-sanfer/types-gestor-documental 0.0.1-beta.21 → 0.0.1-beta.22

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.
@@ -119,6 +119,7 @@ export declare const GestorDocumentalPatterns: {
119
119
  readonly acknowledgeInbound: "gestorDocumental.partsOffice.acknowledgeInbound";
120
120
  readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
121
121
  readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
122
+ readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
122
123
  };
123
124
  readonly registerBook: {
124
125
  readonly get: "gestorDocumental.registerBook.get";
@@ -1,5 +1,5 @@
1
1
  import { type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
2
- import { type DocDigitalDocumentTypeEntity, type DocDigitalEntityEntity, type PartsOfficeInboundEntity, type DocDigitalUserEntity, type PartsOfficeDispatchEntity, type PartsOfficeFileEntity, type PartsOfficeOkResponseEntity, type PartsOfficeRegisterResponseEntity, type PartsOfficeStatusEntity, type PartsOfficeSummaryEntity, type PartsOfficeSyncResponseEntity } from '../entities';
2
+ import { type DocDigitalDocumentTypeEntity, type DocDigitalEntityEntity, type PartsOfficeInboundEntity, type DocDigitalUserEntity, type EnablementPersonInput, type PartsOfficeEnablementEntity, type PartsOfficeDispatchEntity, type PartsOfficeFileEntity, type PartsOfficeOkResponseEntity, type PartsOfficeRegisterResponseEntity, type PartsOfficeStatusEntity, type PartsOfficeSummaryEntity, type PartsOfficeSyncResponseEntity } from '../entities';
3
3
  import { type RpcPage } from './contract';
4
4
  import { type DocumentActor, type DocumentExternalRecipientInput } from './document.contract';
5
5
  /** Patrones NATS de `partsOffice` (Oficina de Partes y DocDigital): `<servicio>.<recurso>.<acción>`. */
@@ -21,6 +21,7 @@ export declare const PartsOfficePatterns: {
21
21
  readonly acknowledgeInbound: "gestorDocumental.partsOffice.acknowledgeInbound";
22
22
  readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
23
23
  readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
24
+ readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
24
25
  };
25
26
  /** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
26
27
  export type PartsOfficeRecipientInput = {
@@ -173,5 +174,15 @@ export interface PartsOfficeContract {
173
174
  };
174
175
  response: PartsOfficeFileEntity;
175
176
  };
177
+ /**
178
+ * Quiénes de `people` están habilitados como usuarios de DocDigital en la municipalidad o en sus entidades emisoras
179
+ * (por RUN). El directorio de cada entidad se guarda 10 minutos.
180
+ */
181
+ [PartsOfficePatterns.checkEnablement]: {
182
+ payload: {
183
+ people: EnablementPersonInput[];
184
+ };
185
+ response: PartsOfficeEnablementEntity;
186
+ };
176
187
  }
177
188
  export {};
@@ -20,4 +20,5 @@ exports.PartsOfficePatterns = {
20
20
  acknowledgeInbound: 'gestorDocumental.partsOffice.acknowledgeInbound',
21
21
  returnInbound: 'gestorDocumental.partsOffice.returnInbound',
22
22
  getInboundFile: 'gestorDocumental.partsOffice.getInboundFile',
23
+ checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
23
24
  };
@@ -103,3 +103,35 @@ export interface PartsOfficeFileEntity {
103
103
  fileId: string;
104
104
  fileName: string;
105
105
  }
106
+ /** Por qué una persona tiene que estar habilitada en DocDigital. */
107
+ export type EnablementRole = 'PartsOffice' | 'Signer';
108
+ /** Persona que se revisa: la arma el gateway con organizacion-ms (permisos de Partes y firmantes por cargo). */
109
+ export interface EnablementPersonInput {
110
+ employeeId: string;
111
+ fullName: string;
112
+ /** RUN del funcionario; sin él no se puede buscar en DocDigital. */
113
+ rut: string | null;
114
+ position: string | null;
115
+ roles: EnablementRole[];
116
+ }
117
+ /** Resultado de una persona: en qué entidades de DocDigital está habilitada. */
118
+ export interface EnablementPersonEntity extends EnablementPersonInput {
119
+ status: 'Enabled' | 'NotEnabled' | 'NoRut';
120
+ enabledIn: {
121
+ entityId: number;
122
+ entityName: string;
123
+ docDigitalPosition: string | null;
124
+ }[];
125
+ }
126
+ export interface PartsOfficeEnablementEntity {
127
+ checkedAt: string;
128
+ /** DocDigital configurado en el gestor; sin él no se revisa nada. */
129
+ configured: boolean;
130
+ /** Entidades revisadas: la municipalidad y las entidades emisoras con DocDigital. */
131
+ entities: {
132
+ entityId: number;
133
+ entityName: string;
134
+ userCount: number;
135
+ }[];
136
+ people: EnablementPersonEntity[];
137
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.21",
3
+ "version": "0.0.1-beta.22",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -4,6 +4,8 @@ import {
4
4
  type DocDigitalEntityEntity,
5
5
  type PartsOfficeInboundEntity,
6
6
  type DocDigitalUserEntity,
7
+ type EnablementPersonInput,
8
+ type PartsOfficeEnablementEntity,
7
9
  type PartsOfficeDispatchEntity,
8
10
  type PartsOfficeFileEntity,
9
11
  type PartsOfficeOkResponseEntity,
@@ -34,6 +36,7 @@ export const PartsOfficePatterns = {
34
36
  acknowledgeInbound: 'gestorDocumental.partsOffice.acknowledgeInbound',
35
37
  returnInbound: 'gestorDocumental.partsOffice.returnInbound',
36
38
  getInboundFile: 'gestorDocumental.partsOffice.getInboundFile',
39
+ checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
37
40
  } as const;
38
41
 
39
42
  /** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
@@ -120,4 +123,12 @@ export interface PartsOfficeContract {
120
123
  payload: { id: string; attachment?: number };
121
124
  response: PartsOfficeFileEntity;
122
125
  };
126
+ /**
127
+ * Quiénes de `people` están habilitados como usuarios de DocDigital en la municipalidad o en sus entidades emisoras
128
+ * (por RUN). El directorio de cada entidad se guarda 10 minutos.
129
+ */
130
+ [PartsOfficePatterns.checkEnablement]: {
131
+ payload: { people: EnablementPersonInput[] };
132
+ response: PartsOfficeEnablementEntity;
133
+ };
123
134
  }
@@ -108,3 +108,31 @@ export interface PartsOfficeFileEntity {
108
108
  fileId: string;
109
109
  fileName: string;
110
110
  }
111
+
112
+ /** Por qué una persona tiene que estar habilitada en DocDigital. */
113
+ export type EnablementRole = 'PartsOffice' | 'Signer';
114
+
115
+ /** Persona que se revisa: la arma el gateway con organizacion-ms (permisos de Partes y firmantes por cargo). */
116
+ export interface EnablementPersonInput {
117
+ employeeId: string;
118
+ fullName: string;
119
+ /** RUN del funcionario; sin él no se puede buscar en DocDigital. */
120
+ rut: string | null;
121
+ position: string | null;
122
+ roles: EnablementRole[];
123
+ }
124
+
125
+ /** Resultado de una persona: en qué entidades de DocDigital está habilitada. */
126
+ export interface EnablementPersonEntity extends EnablementPersonInput {
127
+ status: 'Enabled' | 'NotEnabled' | 'NoRut';
128
+ enabledIn: { entityId: number; entityName: string; docDigitalPosition: string | null }[];
129
+ }
130
+
131
+ export interface PartsOfficeEnablementEntity {
132
+ checkedAt: string;
133
+ /** DocDigital configurado en el gestor; sin él no se revisa nada. */
134
+ configured: boolean;
135
+ /** Entidades revisadas: la municipalidad y las entidades emisoras con DocDigital. */
136
+ entities: { entityId: number; entityName: string; userCount: number }[];
137
+ people: EnablementPersonEntity[];
138
+ }