@muni-sanfer/types-gestor-documental 0.0.1-beta.56 → 0.0.1-beta.58

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.
@@ -518,6 +518,7 @@ export interface DocumentEntity {
518
518
  departmentId?: string | null;
519
519
  issuingUnitName?: string | null;
520
520
  issuingDirectorateName?: string | null;
521
+ stampPlacements?: JsonValue | null;
521
522
  selfValidated: boolean;
522
523
  selfValidationNote?: string | null;
523
524
  createdByEmployeeId: string;
@@ -590,6 +591,7 @@ export interface DocumentParticipantEntity {
590
591
  position?: string | null;
591
592
  observation?: string | null;
592
593
  resolvedAt?: string | null;
594
+ initials?: string | null;
593
595
  document?: DocumentEntity;
594
596
  documentId: string;
595
597
  createdAt: string;
@@ -1415,6 +1417,12 @@ export interface MailIntakeEntity {
1415
1417
  createdAt: string;
1416
1418
  updatedAt: string;
1417
1419
  }
1420
+ export interface VisaInitialsEntity {
1421
+ employeeId: string;
1422
+ initials: string;
1423
+ createdAt: string;
1424
+ updatedAt: string;
1425
+ }
1418
1426
  export interface PushSubscriptionEntity {
1419
1427
  id: string;
1420
1428
  employeeId: string;
@@ -1,5 +1,5 @@
1
1
  import { type DocumentAccessAction, type DocumentAccessLevel, type DocumentAttachmentEntity, type DocumentDeliveryEntity, type DocumentEntity, type DocumentInstruction, type DocumentParticipantEntity, type DocumentStatus } from '../base/entities';
2
- import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentEmailCopyIssuedEntity, type DocumentEmailCopyViewEntity, type DocumentReminderEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentComposeResponseEntity, type DocumentComposition, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity, type DocumentCommentResponseEntity, type DocumentCommentsResponseEntity, type DocumentVersionResponseEntity, type DocumentDraftCorrectionResponseEntity, type DocumentDraftReviewResponseEntity } from '../entities';
2
+ import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentEmailCopyIssuedEntity, type DocumentEmailCopyViewEntity, type DocumentReminderEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentComposeResponseEntity, type DocumentComposition, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity, type DocumentCommentResponseEntity, type DocumentCommentsResponseEntity, type DocumentVersionResponseEntity, type DocumentDraftCorrectionResponseEntity, type DocumentStampPlacements, type DocumentDraftReviewResponseEntity } from '../entities';
3
3
  import { type RpcPage } from './contract';
4
4
  /** Patrones NATS de `document`: `<servicio>.<recurso>.<acción>`. */
5
5
  export declare const DocumentPatterns: {
@@ -93,6 +93,7 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
93
93
  departmentId?: string | null;
94
94
  issuingUnitName?: string | null;
95
95
  issuingDirectorateName?: string | null;
96
+ stampPlacements?: DocumentStampPlacements | null;
96
97
  selfValidated?: boolean;
97
98
  selfValidationNote?: string | null;
98
99
  externalCorrelative?: number | null;
@@ -17,6 +17,7 @@ import { type DataProtectionContract } from './dataProtection.contract';
17
17
  import { type DeskContract } from './desk.contract';
18
18
  import { type MailIntakeContract } from './mailIntake.contract';
19
19
  import { type PushContract } from './push.contract';
20
+ import { type VisaInitialsContract } from './visaInitials.contract';
20
21
  import { type ScanContract } from './scan.contract';
21
22
  import { type PartsOfficeContract } from './partsOffice.contract';
22
23
  import { type ProcedureContract } from './procedure.contract';
@@ -55,6 +56,7 @@ export * from './push.contract';
55
56
  export * from './draftingRequest.contract';
56
57
  export * from './internalReview.contract';
57
58
  export * from './richImage.contract';
59
+ export * from './visaInitials.contract';
58
60
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
59
61
  export declare const GestorDocumentalPatterns: {
60
62
  readonly documentType: {
@@ -318,6 +320,10 @@ export declare const GestorDocumentalPatterns: {
318
320
  readonly register: "gestorDocumental.richImage.register";
319
321
  readonly getFile: "gestorDocumental.richImage.getFile";
320
322
  };
323
+ readonly visaInitials: {
324
+ readonly get: "gestorDocumental.visaInitials.get";
325
+ readonly update: "gestorDocumental.visaInitials.update";
326
+ };
321
327
  };
322
328
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
323
- export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & DocumentTemplateContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract & DraftingRequestContract & InternalReviewContract & RichImageContract;
329
+ export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & DocumentTemplateContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract & DraftingRequestContract & InternalReviewContract & RichImageContract & VisaInitialsContract;
@@ -34,6 +34,7 @@ const dataProtection_contract_1 = require("./dataProtection.contract");
34
34
  const desk_contract_1 = require("./desk.contract");
35
35
  const mailIntake_contract_1 = require("./mailIntake.contract");
36
36
  const push_contract_1 = require("./push.contract");
37
+ const visaInitials_contract_1 = require("./visaInitials.contract");
37
38
  const scan_contract_1 = require("./scan.contract");
38
39
  const partsOffice_contract_1 = require("./partsOffice.contract");
39
40
  const procedure_contract_1 = require("./procedure.contract");
@@ -72,6 +73,7 @@ __exportStar(require("./push.contract"), exports);
72
73
  __exportStar(require("./draftingRequest.contract"), exports);
73
74
  __exportStar(require("./internalReview.contract"), exports);
74
75
  __exportStar(require("./richImage.contract"), exports);
76
+ __exportStar(require("./visaInitials.contract"), exports);
75
77
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
76
78
  exports.GestorDocumentalPatterns = {
77
79
  documentType: documentType_contract_1.DocumentTypePatterns,
@@ -102,4 +104,5 @@ exports.GestorDocumentalPatterns = {
102
104
  draftingRequest: draftingRequest_contract_1.DraftingRequestPatterns,
103
105
  internalReview: internalReview_contract_1.InternalReviewPatterns,
104
106
  richImage: richImage_contract_1.RichImagePatterns,
107
+ visaInitials: visaInitials_contract_1.VisaInitialsPatterns,
105
108
  };
@@ -0,0 +1,28 @@
1
+ import { type VisaInitialsResponseEntity } from '../entities';
2
+ import { type DocumentActor } from './document.contract';
3
+ /**
4
+ * Patrones NATS de `visaInitials`: las iniciales con que visa quien tiene la sesión. Salen de su nombre y las puede
5
+ * cambiar; el sello de cada visación lleva las que tenía al visar. `fullName` lo pone el gateway desde la sesión.
6
+ */
7
+ export declare const VisaInitialsPatterns: {
8
+ readonly get: "gestorDocumental.visaInitials.get";
9
+ readonly update: "gestorDocumental.visaInitials.update";
10
+ };
11
+ export interface VisaInitialsContract {
12
+ [VisaInitialsPatterns.get]: {
13
+ payload: {
14
+ fullName: string;
15
+ actor: DocumentActor;
16
+ };
17
+ response: VisaInitialsResponseEntity;
18
+ };
19
+ /** Guarda las iniciales propias; `null` vuelve a las de su nombre. */
20
+ [VisaInitialsPatterns.update]: {
21
+ payload: {
22
+ initials: string | null;
23
+ fullName: string;
24
+ actor: DocumentActor;
25
+ };
26
+ response: VisaInitialsResponseEntity;
27
+ };
28
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VisaInitialsPatterns = void 0;
4
+ /**
5
+ * Patrones NATS de `visaInitials`: las iniciales con que visa quien tiene la sesión. Salen de su nombre y las puede
6
+ * cambiar; el sello de cada visación lleva las que tenía al visar. `fullName` lo pone el gateway desde la sesión.
7
+ */
8
+ exports.VisaInitialsPatterns = {
9
+ get: 'gestorDocumental.visaInitials.get',
10
+ update: 'gestorDocumental.visaInitials.update',
11
+ };
@@ -1,6 +1,7 @@
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
5
  /** Tipo documental de un documento, con lo necesario para citarlo. */
5
6
  export interface DocumentTypeSummaryEntity {
6
7
  id: DocumentTypeEntity['id'];
@@ -213,6 +214,8 @@ export interface DocumentGetByIdResponseEntity {
213
214
  draftReview: DocumentDraftReviewInfoEntity | null;
214
215
  /** Se subió como validado: no pasó por la revisión del tipo. */
215
216
  selfValidation: DocumentSelfValidationEntity | null;
217
+ /** Dónde van las visaciones y las firmas, si quien redacta las ubicó; `null`, las ubica el sistema. */
218
+ stampPlacements: DocumentStampPlacements | null;
216
219
  /** Solicitud de redacción que atiende, si se redactó a pedido de otra área. */
217
220
  draftingRequest: DocumentDraftingRequestEntity | null;
218
221
  replies: DocumentLinkEntity[];
@@ -1,2 +1,3 @@
1
1
  export * from './document.entity';
2
2
  export * from './richStyle';
3
+ export * from './stampPlacement';
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./document.entity"), exports);
18
18
  __exportStar(require("./richStyle"), exports);
19
+ __exportStar(require("./stampPlacement"), exports);
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Ubicación de un sello (una visación o una firma) que quien redacta fijó sobre el PDF: la página (desde 1) y el
3
+ * recuadro, en puntos PDF desde la esquina superior izquierda de esa página.
4
+ */
5
+ export interface StampBox {
6
+ page: number;
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ }
12
+ /**
13
+ * Dónde van las visaciones y las firmas de un documento, en el orden de sus turnos. Sin ellas (`null`), el sistema las
14
+ * ubica solo: al pie de la última página o en una hoja de firmas.
15
+ */
16
+ export interface DocumentStampPlacements {
17
+ visas: StampBox[];
18
+ signatures: StampBox[];
19
+ }
20
+ /**
21
+ * Tamaños que admite cada sello, en puntos. La firma conserva la proporción de la imagen que dibuja FirmaGob (su alto
22
+ * sale del ancho); la visación lleva sus cuatro líneas de texto.
23
+ */
24
+ export declare const STAMP_PLACEMENT_LIMITS: {
25
+ /** Ancho sobre alto del sello de firma (la imagen de firmas-ms mide ~2084x835 px). */
26
+ readonly signatureAspect: number;
27
+ readonly signature: {
28
+ readonly minWidth: 90;
29
+ readonly maxWidth: 260;
30
+ readonly defaultWidth: 130;
31
+ };
32
+ readonly visa: {
33
+ readonly minWidth: 80;
34
+ readonly maxWidth: 220;
35
+ readonly minHeight: 34;
36
+ readonly maxHeight: 70;
37
+ readonly defaultWidth: 130;
38
+ readonly defaultHeight: 34;
39
+ };
40
+ };
41
+ /** Alto del sello de firma para un ancho dado: el de su proporción. */
42
+ export declare const signatureHeightFor: (width: number) => number;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.signatureHeightFor = exports.STAMP_PLACEMENT_LIMITS = void 0;
4
+ /**
5
+ * Tamaños que admite cada sello, en puntos. La firma conserva la proporción de la imagen que dibuja FirmaGob (su alto
6
+ * sale del ancho); la visación lleva sus cuatro líneas de texto.
7
+ */
8
+ exports.STAMP_PLACEMENT_LIMITS = {
9
+ /** Ancho sobre alto del sello de firma (la imagen de firmas-ms mide ~2084x835 px). */
10
+ signatureAspect: 2084 / 835,
11
+ signature: { minWidth: 90, maxWidth: 260, defaultWidth: 130 },
12
+ visa: { minWidth: 80, maxWidth: 220, minHeight: 34, maxHeight: 70, defaultWidth: 130, defaultHeight: 34 },
13
+ };
14
+ /** Alto del sello de firma para un ancho dado: el de su proporción. */
15
+ const signatureHeightFor = (width) => Math.round((width / exports.STAMP_PLACEMENT_LIMITS.signatureAspect) * 100) / 100;
16
+ exports.signatureHeightFor = signatureHeightFor;
@@ -25,3 +25,4 @@ export * from './push';
25
25
  export * from './documentTemplate';
26
26
  export * from './draftingRequest';
27
27
  export * from './internalReview';
28
+ export * from './visaInitials';
@@ -41,3 +41,4 @@ __exportStar(require("./push"), exports);
41
41
  __exportStar(require("./documentTemplate"), exports);
42
42
  __exportStar(require("./draftingRequest"), exports);
43
43
  __exportStar(require("./internalReview"), exports);
44
+ __exportStar(require("./visaInitials"), exports);
@@ -0,0 +1 @@
1
+ export * from './visaInitials.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("./visaInitials.entity"), exports);
@@ -0,0 +1,13 @@
1
+ /** Iniciales con que visa un funcionario: van en el sello de cada visación. */
2
+ export interface VisaInitialsResponseEntity {
3
+ /** Las que usa hoy: las suyas, si las cambió, o las que salen de su nombre. */
4
+ initials: string;
5
+ /** Las que salen de su nombre. */
6
+ suggested: string;
7
+ /** Las cambió él: no son las de su nombre. */
8
+ custom: boolean;
9
+ }
10
+ /** Límites de las iniciales propias: solo letras, en mayúscula. */
11
+ export declare const VISA_INITIALS_LIMITS: {
12
+ readonly maxLength: 6;
13
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VISA_INITIALS_LIMITS = void 0;
4
+ /** Límites de las iniciales propias: solo letras, en mayúscula. */
5
+ exports.VISA_INITIALS_LIMITS = { maxLength: 6 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.56",
3
+ "version": "0.0.1-beta.58",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -731,6 +731,7 @@ export interface DocumentEntity {
731
731
  departmentId?: string | null;
732
732
  issuingUnitName?: string | null;
733
733
  issuingDirectorateName?: string | null;
734
+ stampPlacements?: JsonValue | null;
734
735
  selfValidated: boolean;
735
736
  selfValidationNote?: string | null;
736
737
  createdByEmployeeId: string;
@@ -805,6 +806,7 @@ export interface DocumentParticipantEntity {
805
806
  position?: string | null;
806
807
  observation?: string | null;
807
808
  resolvedAt?: string | null;
809
+ initials?: string | null;
808
810
  document?: DocumentEntity;
809
811
  documentId: string;
810
812
  createdAt: string;
@@ -1683,6 +1685,13 @@ export interface MailIntakeEntity {
1683
1685
  updatedAt: string;
1684
1686
  }
1685
1687
 
1688
+ export interface VisaInitialsEntity {
1689
+ employeeId: string;
1690
+ initials: string;
1691
+ createdAt: string;
1692
+ updatedAt: string;
1693
+ }
1694
+
1686
1695
  export interface PushSubscriptionEntity {
1687
1696
  id: string;
1688
1697
  employeeId: string;
@@ -35,6 +35,7 @@ import {
35
35
  type DocumentCommentsResponseEntity,
36
36
  type DocumentVersionResponseEntity,
37
37
  type DocumentDraftCorrectionResponseEntity,
38
+ type DocumentStampPlacements,
38
39
  type DocumentDraftReviewResponseEntity,
39
40
  } from '../entities';
40
41
  import { type RpcPage } from './contract';
@@ -136,6 +137,8 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
136
137
  // Nombres del área responsable y de su dirección: los pone el gateway, no el navegador.
137
138
  issuingUnitName?: string | null;
138
139
  issuingDirectorateName?: string | null;
140
+ // Dónde van las visaciones y las firmas sobre el PDF, en el orden de sus turnos; sin valor, las ubica el sistema.
141
+ stampPlacements?: DocumentStampPlacements | null;
139
142
  // PDF subido que quien redacta declara validado, con su justificación: no pasa por la revisión que exige el tipo.
140
143
  selfValidated?: boolean;
141
144
  selfValidationNote?: string | null;
@@ -17,6 +17,7 @@ import { DataProtectionPatterns, type DataProtectionContract } from './dataProte
17
17
  import { DeskPatterns, type DeskContract } from './desk.contract';
18
18
  import { MailIntakePatterns, type MailIntakeContract } from './mailIntake.contract';
19
19
  import { PushPatterns, type PushContract } from './push.contract';
20
+ import { VisaInitialsPatterns, type VisaInitialsContract } from './visaInitials.contract';
20
21
  import { ScanPatterns, type ScanContract } from './scan.contract';
21
22
  import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
22
23
  import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
@@ -56,6 +57,7 @@ export * from './push.contract';
56
57
  export * from './draftingRequest.contract';
57
58
  export * from './internalReview.contract';
58
59
  export * from './richImage.contract';
60
+ export * from './visaInitials.contract';
59
61
 
60
62
  /** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
61
63
  export const GestorDocumentalPatterns = {
@@ -87,6 +89,7 @@ export const GestorDocumentalPatterns = {
87
89
  draftingRequest: DraftingRequestPatterns,
88
90
  internalReview: InternalReviewPatterns,
89
91
  richImage: RichImagePatterns,
92
+ visaInitials: VisaInitialsPatterns,
90
93
  } as const;
91
94
 
92
95
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -117,4 +120,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
117
120
  PushContract &
118
121
  DraftingRequestContract &
119
122
  InternalReviewContract &
120
- RichImageContract;
123
+ RichImageContract &
124
+ VisaInitialsContract;
@@ -0,0 +1,23 @@
1
+ import { type VisaInitialsResponseEntity } from '../entities';
2
+ import { type DocumentActor } from './document.contract';
3
+
4
+ /**
5
+ * Patrones NATS de `visaInitials`: las iniciales con que visa quien tiene la sesión. Salen de su nombre y las puede
6
+ * cambiar; el sello de cada visación lleva las que tenía al visar. `fullName` lo pone el gateway desde la sesión.
7
+ */
8
+ export const VisaInitialsPatterns = {
9
+ get: 'gestorDocumental.visaInitials.get',
10
+ update: 'gestorDocumental.visaInitials.update',
11
+ } as const;
12
+
13
+ export interface VisaInitialsContract {
14
+ [VisaInitialsPatterns.get]: {
15
+ payload: { fullName: string; actor: DocumentActor };
16
+ response: VisaInitialsResponseEntity;
17
+ };
18
+ /** Guarda las iniciales propias; `null` vuelve a las de su nombre. */
19
+ [VisaInitialsPatterns.update]: {
20
+ payload: { initials: string | null; fullName: string; actor: DocumentActor };
21
+ response: VisaInitialsResponseEntity;
22
+ };
23
+ }
@@ -12,6 +12,7 @@ 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
16
 
16
17
  /** Tipo documental de un documento, con lo necesario para citarlo. */
17
18
  export interface DocumentTypeSummaryEntity {
@@ -246,6 +247,8 @@ export interface DocumentGetByIdResponseEntity {
246
247
  draftReview: DocumentDraftReviewInfoEntity | null;
247
248
  /** Se subió como validado: no pasó por la revisión del tipo. */
248
249
  selfValidation: DocumentSelfValidationEntity | null;
250
+ /** Dónde van las visaciones y las firmas, si quien redacta las ubicó; `null`, las ubica el sistema. */
251
+ stampPlacements: DocumentStampPlacements | null;
249
252
  /** Solicitud de redacción que atiende, si se redactó a pedido de otra área. */
250
253
  draftingRequest: DocumentDraftingRequestEntity | null;
251
254
  replies: DocumentLinkEntity[];
@@ -1,2 +1,3 @@
1
1
  export * from './document.entity';
2
2
  export * from './richStyle';
3
+ export * from './stampPlacement';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Ubicación de un sello (una visación o una firma) que quien redacta fijó sobre el PDF: la página (desde 1) y el
3
+ * recuadro, en puntos PDF desde la esquina superior izquierda de esa página.
4
+ */
5
+ export interface StampBox {
6
+ page: number;
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ }
12
+
13
+ /**
14
+ * Dónde van las visaciones y las firmas de un documento, en el orden de sus turnos. Sin ellas (`null`), el sistema las
15
+ * ubica solo: al pie de la última página o en una hoja de firmas.
16
+ */
17
+ export interface DocumentStampPlacements {
18
+ visas: StampBox[];
19
+ signatures: StampBox[];
20
+ }
21
+
22
+ /**
23
+ * Tamaños que admite cada sello, en puntos. La firma conserva la proporción de la imagen que dibuja FirmaGob (su alto
24
+ * sale del ancho); la visación lleva sus cuatro líneas de texto.
25
+ */
26
+ export const STAMP_PLACEMENT_LIMITS = {
27
+ /** Ancho sobre alto del sello de firma (la imagen de firmas-ms mide ~2084x835 px). */
28
+ signatureAspect: 2084 / 835,
29
+ signature: { minWidth: 90, maxWidth: 260, defaultWidth: 130 },
30
+ visa: { minWidth: 80, maxWidth: 220, minHeight: 34, maxHeight: 70, defaultWidth: 130, defaultHeight: 34 },
31
+ } as const;
32
+
33
+ /** Alto del sello de firma para un ancho dado: el de su proporción. */
34
+ export const signatureHeightFor = (width: number): number =>
35
+ Math.round((width / STAMP_PLACEMENT_LIMITS.signatureAspect) * 100) / 100;
@@ -25,3 +25,4 @@ export * from './push';
25
25
  export * from './documentTemplate';
26
26
  export * from './draftingRequest';
27
27
  export * from './internalReview';
28
+ export * from './visaInitials';
@@ -0,0 +1 @@
1
+ export * from './visaInitials.entity';
@@ -0,0 +1,12 @@
1
+ /** Iniciales con que visa un funcionario: van en el sello de cada visación. */
2
+ export interface VisaInitialsResponseEntity {
3
+ /** Las que usa hoy: las suyas, si las cambió, o las que salen de su nombre. */
4
+ initials: string;
5
+ /** Las que salen de su nombre. */
6
+ suggested: string;
7
+ /** Las cambió él: no son las de su nombre. */
8
+ custom: boolean;
9
+ }
10
+
11
+ /** Límites de las iniciales propias: solo letras, en mayúscula. */
12
+ export const VISA_INITIALS_LIMITS = { maxLength: 6 } as const;