@muni-sanfer/types-gestor-documental 0.0.1-beta.73 → 0.0.1-beta.75

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.
@@ -51,6 +51,11 @@ export interface DocumentActor {
51
51
  * solo donde hace falta (el detalle y el PDF).
52
52
  */
53
53
  reviewFor?: string[];
54
+ /**
55
+ * Departamentos de las direcciones que dirige o integra: también son de su área (quien está en una dirección ve los
56
+ * documentos de sus departamentos; quien está solo en un departamento, solo los de ese). Lo resuelve el gateway.
57
+ */
58
+ areaDepartmentIds?: string[];
54
59
  }
55
60
  /** Bandeja desde la que se lista. Todas son del funcionario (`actor`), salvo `all`. */
56
61
  export type DocumentBucket = 'created' | 'area' | 'sent' | 'toVisa' | 'toSign' | 'participated' | 'visaed' | 'signed' | 'reviewed' | 'toReview' | 'visaAll' | 'signAll' | 'reviewAll' | 'all';
@@ -198,6 +203,8 @@ export interface DocumentContract {
198
203
  authorEmployeeId?: string;
199
204
  directorateCodeReference?: number;
200
205
  reviewDirectorateCode?: number;
206
+ responsibleDirectorateCodes?: number[];
207
+ responsibleDepartmentIds?: string[];
201
208
  text?: string;
202
209
  };
203
210
  actor?: DocumentActor;
@@ -1,7 +1,8 @@
1
1
  import { type CommunicationMeans, DocumentAnnulledNumberEntity, DocumentAttachmentEntity, DocumentDeliveryEntity, DocumentEntity, DocumentParticipantEntity, DocumentRecipientEntity, type DocumentStatus, DocumentTrackingEntity, DocumentTypeEntity } from '../../base/entities';
2
2
  import { type RichLetterhead, type RichPage, type RichSpacing, type RichTextStyle } from './richStyle';
3
3
  import { type DocumentDraftingRequestEntity } from '../draftingRequest/draftingRequest.entity';
4
- import { type DocumentStampPlacements } from './stampPlacement';
4
+ import { type DocumentStampPlacements, type StampBox } from './stampPlacement';
5
+ import { type RichDistributionEntry } from './richDistribution';
5
6
  /** Tipo documental de un documento, con lo necesario para citarlo. */
6
7
  export interface DocumentTypeSummaryEntity {
7
8
  id: DocumentTypeEntity['id'];
@@ -606,7 +607,12 @@ export type DocumentComposition = {
606
607
  templateVersion?: number | null;
607
608
  blocks: RichBlock[];
608
609
  fields: RichField[];
609
- distribution: string[];
610
+ /** Destinos de la distribución, en orden: áreas de la municipalidad o texto libre. */
611
+ distribution: RichDistributionEntry[];
612
+ /** El tipo lleva distribución (lo dice su plantilla): el PDF muestra «Distribución:» aunque aún no tenga destinos. */
613
+ hasDistribution?: boolean;
614
+ /** Alto del espacio para firmas y visaciones entre el texto y la distribución, en puntos (sin valor: sin espacio). */
615
+ signatureSpace?: number;
610
616
  /** Página y membrete. En una plantilla propia los pone su versión: lo que mande el navegador no cuenta. */
611
617
  page?: RichPage;
612
618
  letterhead?: RichLetterhead;
@@ -616,6 +622,11 @@ export interface DocumentComposeResponseEntity {
616
622
  fileName: string;
617
623
  fileId?: string;
618
624
  contentBase64?: string;
625
+ /**
626
+ * Dónde quedó el espacio para firmas y visaciones (página y recuadro, en puntos desde la esquina superior izquierda):
627
+ * ahí parten los sellos al ubicarlos. Sin valor: el documento no deja ese espacio.
628
+ */
629
+ signatureArea?: StampBox | null;
619
630
  }
620
631
  /** Copia por correo de un documento, como la ve quien lo consulta en el gestor. */
621
632
  export interface DocumentEmailCopyResponseEntity {
@@ -1,3 +1,4 @@
1
1
  export * from './document.entity';
2
2
  export * from './richStyle';
3
3
  export * from './stampPlacement';
4
+ export * from './richDistribution';
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./document.entity"), exports);
18
18
  __exportStar(require("./richStyle"), exports);
19
19
  __exportStar(require("./stampPlacement"), exports);
20
+ __exportStar(require("./richDistribution"), exports);
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Un destino de la distribución de un documento redactado con el editor: un área de la municipalidad (con el nombre
3
+ * que tenía al redactar) o un texto libre (por ejemplo, «Archivo» o «Interesado»). Lo redactado antes solo tiene texto.
4
+ */
5
+ export type RichDistributionEntry = string | {
6
+ type: 'Directorate';
7
+ directorateCodeReference: number;
8
+ name: string;
9
+ } | {
10
+ type: 'Department';
11
+ departmentId: string;
12
+ name: string;
13
+ };
14
+ /** Lo que se imprime de un destino: el texto o el nombre del área. */
15
+ export declare const distributionText: (entry: RichDistributionEntry) => string;
16
+ /**
17
+ * Espacio para firmas y visaciones que quien redacta deja entre el término del texto y la distribución, en puntos:
18
+ * hasta 20 cm. Va entero en una página (si no cabe, pasa a la siguiente con lo que sigue).
19
+ */
20
+ export declare const RICH_SIGNATURE_SPACE_LIMITS: {
21
+ readonly max: number;
22
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RICH_SIGNATURE_SPACE_LIMITS = exports.distributionText = void 0;
4
+ /** Lo que se imprime de un destino: el texto o el nombre del área. */
5
+ const distributionText = (entry) => typeof entry === 'string' ? entry : entry.name;
6
+ exports.distributionText = distributionText;
7
+ /**
8
+ * Espacio para firmas y visaciones que quien redacta deja entre el término del texto y la distribución, en puntos:
9
+ * hasta 20 cm. Va entero en una página (si no cabe, pasa a la siguiente con lo que sigue).
10
+ */
11
+ exports.RICH_SIGNATURE_SPACE_LIMITS = { max: Math.round((20 / 2.54) * 72) };
@@ -87,7 +87,7 @@ export interface RichSpacing {
87
87
  /** Límites del espaciado, en puntos. */
88
88
  export declare const RICH_SPACING_LIMITS: {
89
89
  readonly maxSpace: 72;
90
- readonly maxIndent: 216;
90
+ readonly maxIndent: 360;
91
91
  readonly minLineHeight: 0.8;
92
92
  readonly maxLineHeight: 3;
93
93
  };
@@ -35,7 +35,8 @@ exports.RICH_HIGHLIGHTS = {
35
35
  gray: { label: 'Gris', hex: '#E5E7EB' },
36
36
  };
37
37
  /** Límites del espaciado, en puntos. */
38
- exports.RICH_SPACING_LIMITS = { maxSpace: 72, maxIndent: 216, minLineHeight: 0.8, maxLineHeight: 3 };
38
+ // la sangría llega a 12,7 cm: en el editor, «Aumentar sangría» (y Tab al comienzo de un párrafo) corre hasta 12,5 cm
39
+ exports.RICH_SPACING_LIMITS = { maxSpace: 72, maxIndent: 360, minLineHeight: 0.8, maxLineHeight: 3 };
39
40
  /** Tamaños de hoja, en puntos. Oficio es el chileno: 216 x 330 mm. */
40
41
  exports.RICH_PAGE_SIZES = {
41
42
  letter: { label: 'Carta (216 x 279 mm)', width: 612, height: 792 },
@@ -12,6 +12,8 @@ export interface DocumentTemplateContent {
12
12
  page?: RichPage;
13
13
  /** Membrete con logo. Sin valor, el nombre de la municipalidad y de la unidad. */
14
14
  letterhead?: RichLetterhead;
15
+ /** Los documentos del tipo llevan distribución: quien redacta la arma (con áreas o texto libre). */
16
+ hasDistribution?: boolean;
15
17
  }
16
18
  /** La plantilla de un tipo documental, que se aplica al redactar uno de sus documentos: lista para usar. */
17
19
  export interface DocumentTemplateAvailableResponseEntity {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.73",
3
+ "version": "0.0.1-beta.75",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -93,6 +93,11 @@ export interface DocumentActor {
93
93
  * solo donde hace falta (el detalle y el PDF).
94
94
  */
95
95
  reviewFor?: string[];
96
+ /**
97
+ * Departamentos de las direcciones que dirige o integra: también son de su área (quien está en una dirección ve los
98
+ * documentos de sus departamentos; quien está solo en un departamento, solo los de ese). Lo resuelve el gateway.
99
+ */
100
+ areaDepartmentIds?: string[];
96
101
  }
97
102
 
98
103
  /** Bandeja desde la que se lista. Todas son del funcionario (`actor`), salvo `all`. */
@@ -256,6 +261,9 @@ export interface DocumentContract {
256
261
  directorateCodeReference?: number;
257
262
  // «Revisar»: solo las rondas de revisión de esa dirección revisora (si el funcionario revisa para más de una).
258
263
  reviewDirectorateCode?: number;
264
+ // «Mis documentos»: solo los de esa área responsable (una dirección con sus departamentos, o un departamento).
265
+ responsibleDirectorateCodes?: number[];
266
+ responsibleDepartmentIds?: string[];
259
267
  // Texto completo, en el asunto y en el contenido del PDF.
260
268
  text?: string;
261
269
  };
@@ -12,7 +12,8 @@ import {
12
12
  } from '../../base/entities';
13
13
  import { type RichLetterhead, type RichPage, type RichSpacing, type RichTextStyle } from './richStyle';
14
14
  import { type DocumentDraftingRequestEntity } from '../draftingRequest/draftingRequest.entity';
15
- import { type DocumentStampPlacements } from './stampPlacement';
15
+ import { type DocumentStampPlacements, type StampBox } from './stampPlacement';
16
+ import { type RichDistributionEntry } from './richDistribution';
16
17
 
17
18
  /** Tipo documental de un documento, con lo necesario para citarlo. */
18
19
  export interface DocumentTypeSummaryEntity {
@@ -636,7 +637,12 @@ export type DocumentComposition =
636
637
  templateVersion?: number | null;
637
638
  blocks: RichBlock[];
638
639
  fields: RichField[];
639
- distribution: string[];
640
+ /** Destinos de la distribución, en orden: áreas de la municipalidad o texto libre. */
641
+ distribution: RichDistributionEntry[];
642
+ /** El tipo lleva distribución (lo dice su plantilla): el PDF muestra «Distribución:» aunque aún no tenga destinos. */
643
+ hasDistribution?: boolean;
644
+ /** Alto del espacio para firmas y visaciones entre el texto y la distribución, en puntos (sin valor: sin espacio). */
645
+ signatureSpace?: number;
640
646
  /** Página y membrete. En una plantilla propia los pone su versión: lo que mande el navegador no cuenta. */
641
647
  page?: RichPage;
642
648
  letterhead?: RichLetterhead;
@@ -647,6 +653,11 @@ export interface DocumentComposeResponseEntity {
647
653
  fileName: string;
648
654
  fileId?: string;
649
655
  contentBase64?: string;
656
+ /**
657
+ * Dónde quedó el espacio para firmas y visaciones (página y recuadro, en puntos desde la esquina superior izquierda):
658
+ * ahí parten los sellos al ubicarlos. Sin valor: el documento no deja ese espacio.
659
+ */
660
+ signatureArea?: StampBox | null;
650
661
  }
651
662
 
652
663
  /** Copia por correo de un documento, como la ve quien lo consulta en el gestor. */
@@ -1,3 +1,4 @@
1
1
  export * from './document.entity';
2
2
  export * from './richStyle';
3
3
  export * from './stampPlacement';
4
+ export * from './richDistribution';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Un destino de la distribución de un documento redactado con el editor: un área de la municipalidad (con el nombre
3
+ * que tenía al redactar) o un texto libre (por ejemplo, «Archivo» o «Interesado»). Lo redactado antes solo tiene texto.
4
+ */
5
+ export type RichDistributionEntry =
6
+ | string
7
+ | { type: 'Directorate'; directorateCodeReference: number; name: string }
8
+ | { type: 'Department'; departmentId: string; name: string };
9
+
10
+ /** Lo que se imprime de un destino: el texto o el nombre del área. */
11
+ export const distributionText = (entry: RichDistributionEntry): string =>
12
+ typeof entry === 'string' ? entry : entry.name;
13
+
14
+ /**
15
+ * Espacio para firmas y visaciones que quien redacta deja entre el término del texto y la distribución, en puntos:
16
+ * hasta 20 cm. Va entero en una página (si no cabe, pasa a la siguiente con lo que sigue).
17
+ */
18
+ export const RICH_SIGNATURE_SPACE_LIMITS = { max: Math.round((20 / 2.54) * 72) } as const;
@@ -62,7 +62,8 @@ export interface RichSpacing {
62
62
  }
63
63
 
64
64
  /** Límites del espaciado, en puntos. */
65
- export const RICH_SPACING_LIMITS = { maxSpace: 72, maxIndent: 216, minLineHeight: 0.8, maxLineHeight: 3 } as const;
65
+ // la sangría llega a 12,7 cm: en el editor, «Aumentar sangría» (y Tab al comienzo de un párrafo) corre hasta 12,5 cm
66
+ export const RICH_SPACING_LIMITS = { maxSpace: 72, maxIndent: 360, minLineHeight: 0.8, maxLineHeight: 3 } as const;
66
67
 
67
68
  /** Tamaños de hoja, en puntos. Oficio es el chileno: 216 x 330 mm. */
68
69
  export const RICH_PAGE_SIZES = {
@@ -13,6 +13,8 @@ export interface DocumentTemplateContent {
13
13
  page?: RichPage;
14
14
  /** Membrete con logo. Sin valor, el nombre de la municipalidad y de la unidad. */
15
15
  letterhead?: RichLetterhead;
16
+ /** Los documentos del tipo llevan distribución: quien redacta la arma (con áreas o texto libre). */
17
+ hasDistribution?: boolean;
16
18
  }
17
19
 
18
20
  /** La plantilla de un tipo documental, que se aplica al redactar uno de sus documentos: lista para usar. */