@muni-sanfer/types-gestor-documental 0.0.1-beta.5 → 0.0.1-beta.6

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.
@@ -199,6 +199,8 @@ export interface DocumentEntity {
199
199
  externalFolio?: string | null;
200
200
  externalSender?: string | null;
201
201
  externalDate?: string | null;
202
+ contentText?: string | null;
203
+ textExtractedAt?: string | null;
202
204
  replyTo?: DocumentEntity | null;
203
205
  replyToDocumentId?: string | null;
204
206
  replies?: DocumentEntity[];
@@ -99,6 +99,12 @@ export interface DocumentContract {
99
99
  documentTypeId?: string;
100
100
  dateFrom?: string;
101
101
  dateTo?: string;
102
+ number?: number;
103
+ year?: number;
104
+ signerEmployeeId?: string;
105
+ authorEmployeeId?: string;
106
+ directorateCodeReference?: number;
107
+ text?: string;
102
108
  };
103
109
  actor?: DocumentActor;
104
110
  };
@@ -3,12 +3,14 @@ import { type DocumentContract } from './document.contract';
3
3
  import { type DocumentTypeContract } from './documentType.contract';
4
4
  import { type PartsOfficeContract } from './partsOffice.contract';
5
5
  import { type ProcedureContract } from './procedure.contract';
6
+ import { type RegisterBookContract } from './registerBook.contract';
6
7
  export * from './contract';
7
8
  export * from './document.contract';
8
9
  export * from './documentType.contract';
9
10
  export * from './procedure.contract';
10
11
  export * from './caseFile.contract';
11
12
  export * from './partsOffice.contract';
13
+ export * from './registerBook.contract';
12
14
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
13
15
  export declare const GestorDocumentalPatterns: {
14
16
  readonly documentType: {
@@ -73,6 +75,10 @@ export declare const GestorDocumentalPatterns: {
73
75
  readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
74
76
  readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
75
77
  };
78
+ readonly registerBook: {
79
+ readonly get: "gestorDocumental.registerBook.get";
80
+ readonly export: "gestorDocumental.registerBook.export";
81
+ };
76
82
  };
77
83
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
78
- export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & CaseFileContract & PartsOfficeContract;
84
+ export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & CaseFileContract & PartsOfficeContract & RegisterBookContract;
@@ -20,12 +20,14 @@ const document_contract_1 = require("./document.contract");
20
20
  const documentType_contract_1 = require("./documentType.contract");
21
21
  const partsOffice_contract_1 = require("./partsOffice.contract");
22
22
  const procedure_contract_1 = require("./procedure.contract");
23
+ const registerBook_contract_1 = require("./registerBook.contract");
23
24
  __exportStar(require("./contract"), exports);
24
25
  __exportStar(require("./document.contract"), exports);
25
26
  __exportStar(require("./documentType.contract"), exports);
26
27
  __exportStar(require("./procedure.contract"), exports);
27
28
  __exportStar(require("./caseFile.contract"), exports);
28
29
  __exportStar(require("./partsOffice.contract"), exports);
30
+ __exportStar(require("./registerBook.contract"), exports);
29
31
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
30
32
  exports.GestorDocumentalPatterns = {
31
33
  documentType: documentType_contract_1.DocumentTypePatterns,
@@ -33,4 +35,5 @@ exports.GestorDocumentalPatterns = {
33
35
  procedure: procedure_contract_1.ProcedurePatterns,
34
36
  caseFile: caseFile_contract_1.CaseFilePatterns,
35
37
  partsOffice: partsOffice_contract_1.PartsOfficePatterns,
38
+ registerBook: registerBook_contract_1.RegisterBookPatterns,
36
39
  };
@@ -0,0 +1,27 @@
1
+ import { type RegisterBookEntity, type RegisterBookExportEntity, type RegisterBookKind } from '../entities';
2
+ /** Patrones NATS de `registerBook` (libros de registro): `<servicio>.<recurso>.<acción>`. */
3
+ export declare const RegisterBookPatterns: {
4
+ readonly get: "gestorDocumental.registerBook.get";
5
+ readonly export: "gestorDocumental.registerBook.export";
6
+ };
7
+ /** Qué libro y qué período: un año y, si se indica, un mes. El de un tipo documental exige el tipo. */
8
+ export interface RegisterBookQuery {
9
+ kind: RegisterBookKind;
10
+ documentTypeId?: string;
11
+ year: number;
12
+ month?: number | null;
13
+ }
14
+ export interface RegisterBookContract {
15
+ [RegisterBookPatterns.get]: {
16
+ payload: RegisterBookQuery;
17
+ response: RegisterBookEntity;
18
+ };
19
+ /** El libro en Excel o PDF. `generatedBy`: quién lo descarga (va en el encabezado). */
20
+ [RegisterBookPatterns.export]: {
21
+ payload: RegisterBookQuery & {
22
+ format: 'xlsx' | 'pdf';
23
+ generatedBy: string;
24
+ };
25
+ response: RegisterBookExportEntity;
26
+ };
27
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterBookPatterns = void 0;
4
+ /** Patrones NATS de `registerBook` (libros de registro): `<servicio>.<recurso>.<acción>`. */
5
+ exports.RegisterBookPatterns = {
6
+ get: 'gestorDocumental.registerBook.get',
7
+ export: 'gestorDocumental.registerBook.export',
8
+ };
@@ -97,6 +97,8 @@ export interface DocumentGetAllResponseEntity {
97
97
  intakeNumber: DocumentEntity['intakeNumber'];
98
98
  intakeYear: DocumentEntity['intakeYear'];
99
99
  origin: DocumentEntity['origin'];
100
+ /** Con búsqueda de texto completo: el fragmento donde aparece lo buscado, con lo encontrado entre ⟦ y ⟧. */
101
+ snippet?: string | null;
100
102
  currentParticipant: Pick<DocumentParticipantResponseEntity, 'role' | 'employeeId' | 'fullName'> | null;
101
103
  distribution: {
102
104
  total: number;
@@ -3,3 +3,4 @@ export * from './document';
3
3
  export * from './procedure';
4
4
  export * from './caseFile';
5
5
  export * from './partsOffice';
6
+ export * from './registerBook';
@@ -19,3 +19,4 @@ __exportStar(require("./document"), exports);
19
19
  __exportStar(require("./procedure"), exports);
20
20
  __exportStar(require("./caseFile"), exports);
21
21
  __exportStar(require("./partsOffice"), exports);
22
+ __exportStar(require("./registerBook"), exports);
@@ -0,0 +1 @@
1
+ export * from './registerBook.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("./registerBook.entity"), exports);
@@ -0,0 +1,42 @@
1
+ /** Libro de registro: el de un tipo documental (sus números) o el de ingresos de Oficina de Partes. */
2
+ export type RegisterBookKind = 'documentType' | 'intake';
3
+ /**
4
+ * Estado de un número en el libro: vigente, en tramitación (numerado con la primera firma, aún sin todas las firmas),
5
+ * documento anulado, número anulado por un rechazo, o número sin registro en el gestor (un salto en la numeración).
6
+ */
7
+ export type RegisterBookRowState = 'Valid' | 'InProgress' | 'Annulled' | 'NumberAnnulled' | 'Unused';
8
+ export interface RegisterBookRowEntity {
9
+ number: number;
10
+ /** Fecha del número (o del ingreso), en ISO 8601. `null` en un salto. */
11
+ date: string | null;
12
+ state: RegisterBookRowState;
13
+ documentId: string | null;
14
+ subject: string | null;
15
+ /** Quién redactó el documento (o, en el libro de ingresos, quién lo ingresó). */
16
+ author: string | null;
17
+ signers: string[];
18
+ /** Libro de ingresos: institución que lo envió y su folio. */
19
+ sender: string | null;
20
+ externalFolio: string | null;
21
+ /** Libro de ingresos: a quiénes se derivó. */
22
+ recipients: string[];
23
+ /** Despacho por DocDigital: «DocDigital N° 777001 · 14-10-2026». */
24
+ dispatch: string | null;
25
+ /** Motivo de la anulación (del documento o del número). */
26
+ observation: string | null;
27
+ }
28
+ export interface RegisterBookEntity {
29
+ kind: RegisterBookKind;
30
+ /** «Decreto alcaldicio exento» o «Ingresos de Oficina de Partes». */
31
+ title: string;
32
+ year: number;
33
+ month: number | null;
34
+ rows: RegisterBookRowEntity[];
35
+ totals: Record<RegisterBookRowState, number>;
36
+ }
37
+ /** Libro exportado, listo para descargar. */
38
+ export interface RegisterBookExportEntity {
39
+ fileName: string;
40
+ contentType: string;
41
+ contentBase64: string;
42
+ }
@@ -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.5",
3
+ "version": "0.0.1-beta.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -281,6 +281,8 @@ export interface DocumentEntity {
281
281
  externalFolio?: string | null;
282
282
  externalSender?: string | null;
283
283
  externalDate?: string | null;
284
+ contentText?: string | null;
285
+ textExtractedAt?: string | null;
284
286
  replyTo?: DocumentEntity | null;
285
287
  replyToDocumentId?: string | null;
286
288
  replies?: DocumentEntity[];
@@ -129,6 +129,14 @@ export interface DocumentContract {
129
129
  // Rango de fechas de creación (ISO 8601).
130
130
  dateFrom?: string;
131
131
  dateTo?: string;
132
+ // Búsqueda avanzada: número (del documento o folio de ingreso) y año, firmante, redactor y unidad emisora.
133
+ number?: number;
134
+ year?: number;
135
+ signerEmployeeId?: string;
136
+ authorEmployeeId?: string;
137
+ directorateCodeReference?: number;
138
+ // Texto completo, en el asunto y en el contenido del PDF.
139
+ text?: string;
132
140
  };
133
141
  // Obligatorio en todas las bandejas salvo `all`.
134
142
  actor?: DocumentActor;
@@ -3,6 +3,7 @@ import { DocumentPatterns, type DocumentContract } from './document.contract';
3
3
  import { DocumentTypePatterns, type DocumentTypeContract } from './documentType.contract';
4
4
  import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
5
5
  import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
6
+ import { RegisterBookPatterns, type RegisterBookContract } from './registerBook.contract';
6
7
 
7
8
  export * from './contract';
8
9
  export * from './document.contract';
@@ -10,6 +11,7 @@ export * from './documentType.contract';
10
11
  export * from './procedure.contract';
11
12
  export * from './caseFile.contract';
12
13
  export * from './partsOffice.contract';
14
+ export * from './registerBook.contract';
13
15
 
14
16
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
15
17
  export const GestorDocumentalPatterns = {
@@ -18,6 +20,7 @@ export const GestorDocumentalPatterns = {
18
20
  procedure: ProcedurePatterns,
19
21
  caseFile: CaseFilePatterns,
20
22
  partsOffice: PartsOfficePatterns,
23
+ registerBook: RegisterBookPatterns,
21
24
  } as const;
22
25
 
23
26
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -25,4 +28,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
25
28
  DocumentContract &
26
29
  ProcedureContract &
27
30
  CaseFileContract &
28
- PartsOfficeContract;
31
+ PartsOfficeContract &
32
+ RegisterBookContract;
@@ -0,0 +1,24 @@
1
+ import { type RegisterBookEntity, type RegisterBookExportEntity, type RegisterBookKind } from '../entities';
2
+
3
+ /** Patrones NATS de `registerBook` (libros de registro): `<servicio>.<recurso>.<acción>`. */
4
+ export const RegisterBookPatterns = {
5
+ get: 'gestorDocumental.registerBook.get',
6
+ export: 'gestorDocumental.registerBook.export',
7
+ } as const;
8
+
9
+ /** Qué libro y qué período: un año y, si se indica, un mes. El de un tipo documental exige el tipo. */
10
+ export interface RegisterBookQuery {
11
+ kind: RegisterBookKind;
12
+ documentTypeId?: string;
13
+ year: number;
14
+ month?: number | null;
15
+ }
16
+
17
+ export interface RegisterBookContract {
18
+ [RegisterBookPatterns.get]: { payload: RegisterBookQuery; response: RegisterBookEntity };
19
+ /** El libro en Excel o PDF. `generatedBy`: quién lo descarga (va en el encabezado). */
20
+ [RegisterBookPatterns.export]: {
21
+ payload: RegisterBookQuery & { format: 'xlsx' | 'pdf'; generatedBy: string };
22
+ response: RegisterBookExportEntity;
23
+ };
24
+ }
@@ -117,6 +117,8 @@ export interface DocumentGetAllResponseEntity {
117
117
  intakeNumber: DocumentEntity['intakeNumber'];
118
118
  intakeYear: DocumentEntity['intakeYear'];
119
119
  origin: DocumentEntity['origin'];
120
+ /** Con búsqueda de texto completo: el fragmento donde aparece lo buscado, con lo encontrado entre ⟦ y ⟧. */
121
+ snippet?: string | null;
120
122
  // A quién le toca visar o firmar (null si el documento no está en tramitación).
121
123
  currentParticipant: Pick<DocumentParticipantResponseEntity, 'role' | 'employeeId' | 'fullName'> | null;
122
124
  // A cuántos funcionarios llegó y cuántos ya lo abrieron (null si aún no se distribuye a nadie).
@@ -3,3 +3,4 @@ export * from './document';
3
3
  export * from './procedure';
4
4
  export * from './caseFile';
5
5
  export * from './partsOffice';
6
+ export * from './registerBook';
@@ -0,0 +1 @@
1
+ export * from './registerBook.entity';
@@ -0,0 +1,46 @@
1
+ /** Libro de registro: el de un tipo documental (sus números) o el de ingresos de Oficina de Partes. */
2
+ export type RegisterBookKind = 'documentType' | 'intake';
3
+
4
+ /**
5
+ * Estado de un número en el libro: vigente, en tramitación (numerado con la primera firma, aún sin todas las firmas),
6
+ * documento anulado, número anulado por un rechazo, o número sin registro en el gestor (un salto en la numeración).
7
+ */
8
+ export type RegisterBookRowState = 'Valid' | 'InProgress' | 'Annulled' | 'NumberAnnulled' | 'Unused';
9
+
10
+ export interface RegisterBookRowEntity {
11
+ number: number;
12
+ /** Fecha del número (o del ingreso), en ISO 8601. `null` en un salto. */
13
+ date: string | null;
14
+ state: RegisterBookRowState;
15
+ documentId: string | null;
16
+ subject: string | null;
17
+ /** Quién redactó el documento (o, en el libro de ingresos, quién lo ingresó). */
18
+ author: string | null;
19
+ signers: string[];
20
+ /** Libro de ingresos: institución que lo envió y su folio. */
21
+ sender: string | null;
22
+ externalFolio: string | null;
23
+ /** Libro de ingresos: a quiénes se derivó. */
24
+ recipients: string[];
25
+ /** Despacho por DocDigital: «DocDigital N° 777001 · 14-10-2026». */
26
+ dispatch: string | null;
27
+ /** Motivo de la anulación (del documento o del número). */
28
+ observation: string | null;
29
+ }
30
+
31
+ export interface RegisterBookEntity {
32
+ kind: RegisterBookKind;
33
+ /** «Decreto alcaldicio exento» o «Ingresos de Oficina de Partes». */
34
+ title: string;
35
+ year: number;
36
+ month: number | null;
37
+ rows: RegisterBookRowEntity[];
38
+ totals: Record<RegisterBookRowState, number>;
39
+ }
40
+
41
+ /** Libro exportado, listo para descargar. */
42
+ export interface RegisterBookExportEntity {
43
+ fileName: string;
44
+ contentType: string;
45
+ contentBase64: string;
46
+ }