@muni-sanfer/types-gestor-documental 0.0.1-beta.37 → 0.0.1-beta.38
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 +25 -1
- package/dist/base/entities.js +1 -0
- package/dist/contracts/documentTemplate.contract.d.ts +58 -0
- package/dist/contracts/documentTemplate.contract.js +12 -0
- package/dist/contracts/index.d.ts +11 -1
- package/dist/contracts/index.js +3 -0
- package/dist/entities/documentTemplate/documentTemplate.entity.d.ts +51 -0
- package/dist/entities/documentTemplate/documentTemplate.entity.js +2 -0
- package/dist/entities/documentTemplate/index.d.ts +1 -0
- package/dist/entities/documentTemplate/index.js +17 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/package.json +1 -1
- package/src/base/entities.ts +28 -1
- package/src/contracts/documentTemplate.contract.ts +61 -0
- package/src/contracts/index.ts +4 -0
- package/src/entities/documentTemplate/documentTemplate.entity.ts +58 -0
- package/src/entities/documentTemplate/index.ts +1 -0
- package/src/entities/index.ts +1 -0
package/dist/base/entities.d.ts
CHANGED
|
@@ -220,7 +220,7 @@ export declare const DocumentAccessAction: {
|
|
|
220
220
|
FileDownloaded: "FileDownloaded";
|
|
221
221
|
TrailExported: "TrailExported";
|
|
222
222
|
};
|
|
223
|
-
export type AuditEntity = 'DocumentType' | 'IssuingEntity' | 'ArchivalSeries' | 'TextSnippet' | 'Holiday' | 'Procedure' | 'QualityMetric' | 'ServiceOutage' | 'Repository' | 'DataTreatment';
|
|
223
|
+
export type AuditEntity = 'DocumentType' | 'IssuingEntity' | 'ArchivalSeries' | 'TextSnippet' | 'Holiday' | 'Procedure' | 'QualityMetric' | 'ServiceOutage' | 'Repository' | 'DataTreatment' | 'DocumentTemplate';
|
|
224
224
|
export declare const AuditEntity: {
|
|
225
225
|
DocumentType: "DocumentType";
|
|
226
226
|
IssuingEntity: "IssuingEntity";
|
|
@@ -232,6 +232,7 @@ export declare const AuditEntity: {
|
|
|
232
232
|
ServiceOutage: "ServiceOutage";
|
|
233
233
|
Repository: "Repository";
|
|
234
234
|
DataTreatment: "DataTreatment";
|
|
235
|
+
DocumentTemplate: "DocumentTemplate";
|
|
235
236
|
};
|
|
236
237
|
export type AuditAction = 'Created' | 'Updated' | 'Enabled' | 'Disabled' | 'Removed' | 'Exported';
|
|
237
238
|
export declare const AuditAction: {
|
|
@@ -887,6 +888,29 @@ export interface TextSnippetEntity {
|
|
|
887
888
|
createdAt: string;
|
|
888
889
|
updatedAt: string;
|
|
889
890
|
}
|
|
891
|
+
export interface DocumentTemplateEntity {
|
|
892
|
+
id: string;
|
|
893
|
+
name: string;
|
|
894
|
+
description?: string | null;
|
|
895
|
+
documentTypeIds: string[];
|
|
896
|
+
content: JsonValue;
|
|
897
|
+
version: number;
|
|
898
|
+
enabled: boolean;
|
|
899
|
+
updatedByFullName?: string | null;
|
|
900
|
+
versions?: DocumentTemplateVersionEntity[];
|
|
901
|
+
deleted: boolean;
|
|
902
|
+
createdAt: string;
|
|
903
|
+
updatedAt: string;
|
|
904
|
+
}
|
|
905
|
+
export interface DocumentTemplateVersionEntity {
|
|
906
|
+
id: string;
|
|
907
|
+
templateId: string;
|
|
908
|
+
template?: DocumentTemplateEntity;
|
|
909
|
+
version: number;
|
|
910
|
+
content: JsonValue;
|
|
911
|
+
createdByFullName?: string | null;
|
|
912
|
+
createdAt: string;
|
|
913
|
+
}
|
|
890
914
|
export interface ArchivalSeriesEntity {
|
|
891
915
|
id: string;
|
|
892
916
|
code: string;
|
package/dist/base/entities.js
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../base/entities';
|
|
2
|
+
import { type DocumentTemplateAvailableResponseEntity, type DocumentTemplateContent, type DocumentTemplateCreateResponseEntity, type DocumentTemplateGetAllResponseEntity, type DocumentTemplateGetByIdResponseEntity, type DocumentTemplateUpdateResponseEntity } from '../entities';
|
|
3
|
+
import { type RpcPage } from './contract';
|
|
4
|
+
/** Patrones NATS de `documentTemplate` (plantillas propias del editor): `<servicio>.<recurso>.<acción>`. */
|
|
5
|
+
export declare const DocumentTemplatePatterns: {
|
|
6
|
+
readonly getAll: "gestorDocumental.documentTemplate.getAll";
|
|
7
|
+
readonly getById: "gestorDocumental.documentTemplate.getById";
|
|
8
|
+
readonly create: "gestorDocumental.documentTemplate.create";
|
|
9
|
+
readonly update: "gestorDocumental.documentTemplate.update";
|
|
10
|
+
readonly setEnabled: "gestorDocumental.documentTemplate.setEnabled";
|
|
11
|
+
readonly getAvailable: "gestorDocumental.documentTemplate.getAvailable";
|
|
12
|
+
};
|
|
13
|
+
/** Datos de una plantilla propia al crearla o editarla. */
|
|
14
|
+
export interface DocumentTemplateWritePayload {
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string | null;
|
|
17
|
+
documentTypeIds?: string[];
|
|
18
|
+
content: DocumentTemplateContent;
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface DocumentTemplateContract {
|
|
22
|
+
[DocumentTemplatePatterns.getAll]: {
|
|
23
|
+
payload: {
|
|
24
|
+
pagination?: {
|
|
25
|
+
page?: number;
|
|
26
|
+
limit?: number;
|
|
27
|
+
};
|
|
28
|
+
filters?: {
|
|
29
|
+
search?: string;
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
response: RpcPage<DocumentTemplateGetAllResponseEntity[]>;
|
|
34
|
+
};
|
|
35
|
+
[DocumentTemplatePatterns.getById]: {
|
|
36
|
+
payload: Pick<DocumentTemplateEntity, 'id'>;
|
|
37
|
+
response: DocumentTemplateGetByIdResponseEntity;
|
|
38
|
+
};
|
|
39
|
+
[DocumentTemplatePatterns.create]: {
|
|
40
|
+
payload: DocumentTemplateWritePayload;
|
|
41
|
+
response: DocumentTemplateCreateResponseEntity;
|
|
42
|
+
};
|
|
43
|
+
[DocumentTemplatePatterns.update]: {
|
|
44
|
+
payload: DocumentTemplateWritePayload & Pick<DocumentTemplateEntity, 'id'>;
|
|
45
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
46
|
+
};
|
|
47
|
+
[DocumentTemplatePatterns.setEnabled]: {
|
|
48
|
+
payload: Pick<DocumentTemplateEntity, 'id' | 'enabled'>;
|
|
49
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
50
|
+
};
|
|
51
|
+
/** Las habilitadas que se ofrecen al redactar un documento del tipo (las de todos los tipos y las suyas). */
|
|
52
|
+
[DocumentTemplatePatterns.getAvailable]: {
|
|
53
|
+
payload: {
|
|
54
|
+
documentTypeId: string;
|
|
55
|
+
};
|
|
56
|
+
response: DocumentTemplateAvailableResponseEntity[];
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentTemplatePatterns = void 0;
|
|
4
|
+
/** Patrones NATS de `documentTemplate` (plantillas propias del editor): `<servicio>.<recurso>.<acción>`. */
|
|
5
|
+
exports.DocumentTemplatePatterns = {
|
|
6
|
+
getAll: 'gestorDocumental.documentTemplate.getAll',
|
|
7
|
+
getById: 'gestorDocumental.documentTemplate.getById',
|
|
8
|
+
create: 'gestorDocumental.documentTemplate.create',
|
|
9
|
+
update: 'gestorDocumental.documentTemplate.update',
|
|
10
|
+
setEnabled: 'gestorDocumental.documentTemplate.setEnabled',
|
|
11
|
+
getAvailable: 'gestorDocumental.documentTemplate.getAvailable',
|
|
12
|
+
};
|
|
@@ -4,6 +4,7 @@ import { type DocumentTypeContract } from './documentType.contract';
|
|
|
4
4
|
import { type IssuingEntityContract } from './issuingEntity.contract';
|
|
5
5
|
import { type ArchivalSeriesContract } from './archivalSeries.contract';
|
|
6
6
|
import { type TextSnippetContract } from './textSnippet.contract';
|
|
7
|
+
import { type DocumentTemplateContract } from './documentTemplate.contract';
|
|
7
8
|
import { type HolidayContract } from './holiday.contract';
|
|
8
9
|
import { type IndicatorsContract } from './indicators.contract';
|
|
9
10
|
import { type AuditContract } from './audit.contract';
|
|
@@ -35,6 +36,7 @@ export * from './workFolder.contract';
|
|
|
35
36
|
export * from './scan.contract';
|
|
36
37
|
export * from './archivalSeries.contract';
|
|
37
38
|
export * from './textSnippet.contract';
|
|
39
|
+
export * from './documentTemplate.contract';
|
|
38
40
|
export * from './holiday.contract';
|
|
39
41
|
export * from './indicators.contract';
|
|
40
42
|
export * from './audit.contract';
|
|
@@ -192,6 +194,14 @@ export declare const GestorDocumentalPatterns: {
|
|
|
192
194
|
readonly update: "gestorDocumental.textSnippet.update";
|
|
193
195
|
readonly setEnabled: "gestorDocumental.textSnippet.setEnabled";
|
|
194
196
|
};
|
|
197
|
+
readonly documentTemplate: {
|
|
198
|
+
readonly getAll: "gestorDocumental.documentTemplate.getAll";
|
|
199
|
+
readonly getById: "gestorDocumental.documentTemplate.getById";
|
|
200
|
+
readonly create: "gestorDocumental.documentTemplate.create";
|
|
201
|
+
readonly update: "gestorDocumental.documentTemplate.update";
|
|
202
|
+
readonly setEnabled: "gestorDocumental.documentTemplate.setEnabled";
|
|
203
|
+
readonly getAvailable: "gestorDocumental.documentTemplate.getAvailable";
|
|
204
|
+
};
|
|
195
205
|
readonly holiday: {
|
|
196
206
|
readonly getAll: "gestorDocumental.holiday.getAll";
|
|
197
207
|
readonly create: "gestorDocumental.holiday.create";
|
|
@@ -288,4 +298,4 @@ export declare const GestorDocumentalPatterns: {
|
|
|
288
298
|
};
|
|
289
299
|
};
|
|
290
300
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
291
|
-
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract;
|
|
301
|
+
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;
|
package/dist/contracts/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const documentType_contract_1 = require("./documentType.contract");
|
|
|
21
21
|
const issuingEntity_contract_1 = require("./issuingEntity.contract");
|
|
22
22
|
const archivalSeries_contract_1 = require("./archivalSeries.contract");
|
|
23
23
|
const textSnippet_contract_1 = require("./textSnippet.contract");
|
|
24
|
+
const documentTemplate_contract_1 = require("./documentTemplate.contract");
|
|
24
25
|
const holiday_contract_1 = require("./holiday.contract");
|
|
25
26
|
const indicators_contract_1 = require("./indicators.contract");
|
|
26
27
|
const audit_contract_1 = require("./audit.contract");
|
|
@@ -52,6 +53,7 @@ __exportStar(require("./workFolder.contract"), exports);
|
|
|
52
53
|
__exportStar(require("./scan.contract"), exports);
|
|
53
54
|
__exportStar(require("./archivalSeries.contract"), exports);
|
|
54
55
|
__exportStar(require("./textSnippet.contract"), exports);
|
|
56
|
+
__exportStar(require("./documentTemplate.contract"), exports);
|
|
55
57
|
__exportStar(require("./holiday.contract"), exports);
|
|
56
58
|
__exportStar(require("./indicators.contract"), exports);
|
|
57
59
|
__exportStar(require("./audit.contract"), exports);
|
|
@@ -78,6 +80,7 @@ exports.GestorDocumentalPatterns = {
|
|
|
78
80
|
scan: scan_contract_1.ScanPatterns,
|
|
79
81
|
archivalSeries: archivalSeries_contract_1.ArchivalSeriesPatterns,
|
|
80
82
|
textSnippet: textSnippet_contract_1.TextSnippetPatterns,
|
|
83
|
+
documentTemplate: documentTemplate_contract_1.DocumentTemplatePatterns,
|
|
81
84
|
holiday: holiday_contract_1.HolidayPatterns,
|
|
82
85
|
indicators: indicators_contract_1.IndicatorsPatterns,
|
|
83
86
|
audit: audit_contract_1.AuditPatterns,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../../base/entities';
|
|
2
|
+
import { type RichBlock, type RichField } from '../document/document.entity';
|
|
3
|
+
/**
|
|
4
|
+
* Contenido de una plantilla propia: los bloques del editor (con sus partes fijas) y los campos que completa quien
|
|
5
|
+
* redacta (en la plantilla, sin valor).
|
|
6
|
+
*/
|
|
7
|
+
export interface DocumentTemplateContent {
|
|
8
|
+
blocks: RichBlock[];
|
|
9
|
+
fields: RichField[];
|
|
10
|
+
}
|
|
11
|
+
/** Plantilla propia en el listado de quien las administra. */
|
|
12
|
+
export interface DocumentTemplateGetAllResponseEntity {
|
|
13
|
+
id: DocumentTemplateEntity['id'];
|
|
14
|
+
name: DocumentTemplateEntity['name'];
|
|
15
|
+
description: string | null;
|
|
16
|
+
/** Tipos documentales donde se ofrece; vacío, en todos. */
|
|
17
|
+
documentTypeIds: DocumentTemplateEntity['documentTypeIds'];
|
|
18
|
+
documentTypeNames: string[];
|
|
19
|
+
version: DocumentTemplateEntity['version'];
|
|
20
|
+
enabled: DocumentTemplateEntity['enabled'];
|
|
21
|
+
updatedAt: DocumentTemplateEntity['updatedAt'];
|
|
22
|
+
updatedByFullName: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** Una versión del contenido de una plantilla. */
|
|
25
|
+
export interface DocumentTemplateVersionResponseEntity {
|
|
26
|
+
version: number;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
createdByFullName: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface DocumentTemplateGetByIdResponseEntity extends DocumentTemplateGetAllResponseEntity {
|
|
31
|
+
content: DocumentTemplateContent;
|
|
32
|
+
versions: DocumentTemplateVersionResponseEntity[];
|
|
33
|
+
}
|
|
34
|
+
/** Plantilla que se ofrece al redactar un documento de un tipo: con su contenido, lista para usar. */
|
|
35
|
+
export interface DocumentTemplateAvailableResponseEntity {
|
|
36
|
+
id: DocumentTemplateEntity['id'];
|
|
37
|
+
name: DocumentTemplateEntity['name'];
|
|
38
|
+
description: string | null;
|
|
39
|
+
version: DocumentTemplateEntity['version'];
|
|
40
|
+
content: DocumentTemplateContent;
|
|
41
|
+
}
|
|
42
|
+
export interface DocumentTemplateCreateResponseEntity {
|
|
43
|
+
id: DocumentTemplateEntity['id'];
|
|
44
|
+
ok: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface DocumentTemplateUpdateResponseEntity {
|
|
47
|
+
id: DocumentTemplateEntity['id'];
|
|
48
|
+
ok: boolean;
|
|
49
|
+
/** Versión vigente: sube solo si cambió el contenido. */
|
|
50
|
+
version: number;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './documentTemplate.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("./documentTemplate.entity"), exports);
|
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -344,7 +344,8 @@ export type AuditEntity =
|
|
|
344
344
|
| 'QualityMetric'
|
|
345
345
|
| 'ServiceOutage'
|
|
346
346
|
| 'Repository'
|
|
347
|
-
| 'DataTreatment'
|
|
347
|
+
| 'DataTreatment'
|
|
348
|
+
| 'DocumentTemplate';
|
|
348
349
|
|
|
349
350
|
export const AuditEntity = {
|
|
350
351
|
DocumentType: 'DocumentType',
|
|
@@ -357,6 +358,7 @@ export const AuditEntity = {
|
|
|
357
358
|
ServiceOutage: 'ServiceOutage',
|
|
358
359
|
Repository: 'Repository',
|
|
359
360
|
DataTreatment: 'DataTreatment',
|
|
361
|
+
DocumentTemplate: 'DocumentTemplate',
|
|
360
362
|
} satisfies Record<string, AuditEntity>;
|
|
361
363
|
|
|
362
364
|
export type AuditAction = 'Created' | 'Updated' | 'Enabled' | 'Disabled' | 'Removed' | 'Exported';
|
|
@@ -1106,6 +1108,31 @@ export interface TextSnippetEntity {
|
|
|
1106
1108
|
updatedAt: string;
|
|
1107
1109
|
}
|
|
1108
1110
|
|
|
1111
|
+
export interface DocumentTemplateEntity {
|
|
1112
|
+
id: string;
|
|
1113
|
+
name: string;
|
|
1114
|
+
description?: string | null;
|
|
1115
|
+
documentTypeIds: string[];
|
|
1116
|
+
content: JsonValue;
|
|
1117
|
+
version: number;
|
|
1118
|
+
enabled: boolean;
|
|
1119
|
+
updatedByFullName?: string | null;
|
|
1120
|
+
versions?: DocumentTemplateVersionEntity[];
|
|
1121
|
+
deleted: boolean;
|
|
1122
|
+
createdAt: string;
|
|
1123
|
+
updatedAt: string;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
export interface DocumentTemplateVersionEntity {
|
|
1127
|
+
id: string;
|
|
1128
|
+
templateId: string;
|
|
1129
|
+
template?: DocumentTemplateEntity;
|
|
1130
|
+
version: number;
|
|
1131
|
+
content: JsonValue;
|
|
1132
|
+
createdByFullName?: string | null;
|
|
1133
|
+
createdAt: string;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1109
1136
|
export interface ArchivalSeriesEntity {
|
|
1110
1137
|
id: string;
|
|
1111
1138
|
code: string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../base/entities';
|
|
2
|
+
import {
|
|
3
|
+
type DocumentTemplateAvailableResponseEntity,
|
|
4
|
+
type DocumentTemplateContent,
|
|
5
|
+
type DocumentTemplateCreateResponseEntity,
|
|
6
|
+
type DocumentTemplateGetAllResponseEntity,
|
|
7
|
+
type DocumentTemplateGetByIdResponseEntity,
|
|
8
|
+
type DocumentTemplateUpdateResponseEntity,
|
|
9
|
+
} from '../entities';
|
|
10
|
+
import { type RpcPage } from './contract';
|
|
11
|
+
|
|
12
|
+
/** Patrones NATS de `documentTemplate` (plantillas propias del editor): `<servicio>.<recurso>.<acción>`. */
|
|
13
|
+
export const DocumentTemplatePatterns = {
|
|
14
|
+
getAll: 'gestorDocumental.documentTemplate.getAll',
|
|
15
|
+
getById: 'gestorDocumental.documentTemplate.getById',
|
|
16
|
+
create: 'gestorDocumental.documentTemplate.create',
|
|
17
|
+
update: 'gestorDocumental.documentTemplate.update',
|
|
18
|
+
setEnabled: 'gestorDocumental.documentTemplate.setEnabled',
|
|
19
|
+
getAvailable: 'gestorDocumental.documentTemplate.getAvailable',
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
/** Datos de una plantilla propia al crearla o editarla. */
|
|
23
|
+
export interface DocumentTemplateWritePayload {
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string | null;
|
|
26
|
+
documentTypeIds?: string[];
|
|
27
|
+
content: DocumentTemplateContent;
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface DocumentTemplateContract {
|
|
32
|
+
[DocumentTemplatePatterns.getAll]: {
|
|
33
|
+
// sin `page` y `limit` responde todas en una sola página
|
|
34
|
+
payload: {
|
|
35
|
+
pagination?: { page?: number; limit?: number };
|
|
36
|
+
filters?: { search?: string; enabled?: boolean };
|
|
37
|
+
};
|
|
38
|
+
response: RpcPage<DocumentTemplateGetAllResponseEntity[]>;
|
|
39
|
+
};
|
|
40
|
+
[DocumentTemplatePatterns.getById]: {
|
|
41
|
+
payload: Pick<DocumentTemplateEntity, 'id'>;
|
|
42
|
+
response: DocumentTemplateGetByIdResponseEntity;
|
|
43
|
+
};
|
|
44
|
+
[DocumentTemplatePatterns.create]: {
|
|
45
|
+
payload: DocumentTemplateWritePayload;
|
|
46
|
+
response: DocumentTemplateCreateResponseEntity;
|
|
47
|
+
};
|
|
48
|
+
[DocumentTemplatePatterns.update]: {
|
|
49
|
+
payload: DocumentTemplateWritePayload & Pick<DocumentTemplateEntity, 'id'>;
|
|
50
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
51
|
+
};
|
|
52
|
+
[DocumentTemplatePatterns.setEnabled]: {
|
|
53
|
+
payload: Pick<DocumentTemplateEntity, 'id' | 'enabled'>;
|
|
54
|
+
response: DocumentTemplateUpdateResponseEntity;
|
|
55
|
+
};
|
|
56
|
+
/** Las habilitadas que se ofrecen al redactar un documento del tipo (las de todos los tipos y las suyas). */
|
|
57
|
+
[DocumentTemplatePatterns.getAvailable]: {
|
|
58
|
+
payload: { documentTypeId: string };
|
|
59
|
+
response: DocumentTemplateAvailableResponseEntity[];
|
|
60
|
+
};
|
|
61
|
+
}
|
package/src/contracts/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { DocumentTypePatterns, type DocumentTypeContract } from './documentType.
|
|
|
4
4
|
import { IssuingEntityPatterns, type IssuingEntityContract } from './issuingEntity.contract';
|
|
5
5
|
import { ArchivalSeriesPatterns, type ArchivalSeriesContract } from './archivalSeries.contract';
|
|
6
6
|
import { TextSnippetPatterns, type TextSnippetContract } from './textSnippet.contract';
|
|
7
|
+
import { DocumentTemplatePatterns, type DocumentTemplateContract } from './documentTemplate.contract';
|
|
7
8
|
import { HolidayPatterns, type HolidayContract } from './holiday.contract';
|
|
8
9
|
import { IndicatorsPatterns, type IndicatorsContract } from './indicators.contract';
|
|
9
10
|
import { AuditPatterns, type AuditContract } from './audit.contract';
|
|
@@ -36,6 +37,7 @@ export * from './workFolder.contract';
|
|
|
36
37
|
export * from './scan.contract';
|
|
37
38
|
export * from './archivalSeries.contract';
|
|
38
39
|
export * from './textSnippet.contract';
|
|
40
|
+
export * from './documentTemplate.contract';
|
|
39
41
|
export * from './holiday.contract';
|
|
40
42
|
export * from './indicators.contract';
|
|
41
43
|
export * from './audit.contract';
|
|
@@ -63,6 +65,7 @@ export const GestorDocumentalPatterns = {
|
|
|
63
65
|
scan: ScanPatterns,
|
|
64
66
|
archivalSeries: ArchivalSeriesPatterns,
|
|
65
67
|
textSnippet: TextSnippetPatterns,
|
|
68
|
+
documentTemplate: DocumentTemplatePatterns,
|
|
66
69
|
holiday: HolidayPatterns,
|
|
67
70
|
indicators: IndicatorsPatterns,
|
|
68
71
|
audit: AuditPatterns,
|
|
@@ -90,6 +93,7 @@ export type GestorDocumentalContract = DocumentTypeContract &
|
|
|
90
93
|
ScanContract &
|
|
91
94
|
ArchivalSeriesContract &
|
|
92
95
|
TextSnippetContract &
|
|
96
|
+
DocumentTemplateContract &
|
|
93
97
|
HolidayContract &
|
|
94
98
|
IndicatorsContract &
|
|
95
99
|
AuditContract &
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type DocumentTemplateEntity } from '../../base/entities';
|
|
2
|
+
import { type RichBlock, type RichField } from '../document/document.entity';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Contenido de una plantilla propia: los bloques del editor (con sus partes fijas) y los campos que completa quien
|
|
6
|
+
* redacta (en la plantilla, sin valor).
|
|
7
|
+
*/
|
|
8
|
+
export interface DocumentTemplateContent {
|
|
9
|
+
blocks: RichBlock[];
|
|
10
|
+
fields: RichField[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Plantilla propia en el listado de quien las administra. */
|
|
14
|
+
export interface DocumentTemplateGetAllResponseEntity {
|
|
15
|
+
id: DocumentTemplateEntity['id'];
|
|
16
|
+
name: DocumentTemplateEntity['name'];
|
|
17
|
+
description: string | null;
|
|
18
|
+
/** Tipos documentales donde se ofrece; vacío, en todos. */
|
|
19
|
+
documentTypeIds: DocumentTemplateEntity['documentTypeIds'];
|
|
20
|
+
documentTypeNames: string[];
|
|
21
|
+
version: DocumentTemplateEntity['version'];
|
|
22
|
+
enabled: DocumentTemplateEntity['enabled'];
|
|
23
|
+
updatedAt: DocumentTemplateEntity['updatedAt'];
|
|
24
|
+
updatedByFullName: string | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Una versión del contenido de una plantilla. */
|
|
28
|
+
export interface DocumentTemplateVersionResponseEntity {
|
|
29
|
+
version: number;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
createdByFullName: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface DocumentTemplateGetByIdResponseEntity extends DocumentTemplateGetAllResponseEntity {
|
|
35
|
+
content: DocumentTemplateContent;
|
|
36
|
+
versions: DocumentTemplateVersionResponseEntity[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Plantilla que se ofrece al redactar un documento de un tipo: con su contenido, lista para usar. */
|
|
40
|
+
export interface DocumentTemplateAvailableResponseEntity {
|
|
41
|
+
id: DocumentTemplateEntity['id'];
|
|
42
|
+
name: DocumentTemplateEntity['name'];
|
|
43
|
+
description: string | null;
|
|
44
|
+
version: DocumentTemplateEntity['version'];
|
|
45
|
+
content: DocumentTemplateContent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DocumentTemplateCreateResponseEntity {
|
|
49
|
+
id: DocumentTemplateEntity['id'];
|
|
50
|
+
ok: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface DocumentTemplateUpdateResponseEntity {
|
|
54
|
+
id: DocumentTemplateEntity['id'];
|
|
55
|
+
ok: boolean;
|
|
56
|
+
/** Versión vigente: sube solo si cambió el contenido. */
|
|
57
|
+
version: number;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './documentTemplate.entity';
|
package/src/entities/index.ts
CHANGED