@muni-sanfer/types-gestor-documental 0.0.1-beta.57 → 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.
- package/dist/base/entities.d.ts +1 -0
- package/dist/contracts/document.contract.d.ts +2 -1
- package/dist/entities/document/document.entity.d.ts +3 -0
- package/dist/entities/document/index.d.ts +1 -0
- package/dist/entities/document/index.js +1 -0
- package/dist/entities/document/stampPlacement.d.ts +42 -0
- package/dist/entities/document/stampPlacement.js +16 -0
- package/package.json +1 -1
- package/src/base/entities.ts +1 -0
- package/src/contracts/document.contract.ts +3 -0
- package/src/entities/document/document.entity.ts +3 -0
- package/src/entities/document/index.ts +1 -0
- package/src/entities/document/stampPlacement.ts +35 -0
package/dist/base/entities.d.ts
CHANGED
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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[];
|
|
@@ -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;
|
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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[];
|
|
@@ -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;
|