@muni-sanfer/types-gestor-documental 0.0.1-beta.13 → 0.0.1-beta.15
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 +61 -3
- package/dist/base/entities.js +4 -0
- package/dist/contracts/caseFile.contract.d.ts +59 -1
- package/dist/contracts/caseFile.contract.js +6 -0
- package/dist/contracts/document.contract.d.ts +33 -1
- package/dist/contracts/document.contract.js +3 -0
- package/dist/contracts/documentType.contract.d.ts +2 -0
- package/dist/contracts/index.d.ts +20 -1
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/issuingEntity.contract.d.ts +52 -0
- package/dist/contracts/issuingEntity.contract.js +11 -0
- package/dist/contracts/partsOffice.contract.d.ts +6 -0
- package/dist/contracts/partsOffice.contract.js +1 -0
- package/dist/entities/caseFile/caseFile.entity.d.ts +77 -0
- package/dist/entities/document/document.entity.d.ts +43 -0
- package/dist/entities/documentType/documentType.entity.d.ts +13 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/issuingEntity/index.d.ts +1 -0
- package/dist/entities/issuingEntity/index.js +17 -0
- package/dist/entities/issuingEntity/issuingEntity.entity.d.ts +20 -0
- package/dist/entities/issuingEntity/issuingEntity.entity.js +2 -0
- package/dist/entities/partsOffice/partsOffice.entity.d.ts +4 -0
- package/dist/entities/registerBook/registerBook.entity.d.ts +6 -0
- package/package.json +1 -1
- package/src/base/entities.ts +68 -3
- package/src/contracts/caseFile.contract.ts +50 -0
- package/src/contracts/document.contract.ts +30 -0
- package/src/contracts/documentType.contract.ts +6 -1
- package/src/contracts/index.ts +4 -0
- package/src/contracts/issuingEntity.contract.ts +55 -0
- package/src/contracts/partsOffice.contract.ts +3 -0
- package/src/entities/caseFile/caseFile.entity.ts +79 -0
- package/src/entities/document/document.entity.ts +45 -0
- package/src/entities/documentType/documentType.entity.ts +7 -0
- package/src/entities/index.ts +1 -0
- package/src/entities/issuingEntity/index.ts +1 -0
- package/src/entities/issuingEntity/issuingEntity.entity.ts +24 -0
- package/src/entities/partsOffice/partsOffice.entity.ts +4 -0
- package/src/entities/registerBook/registerBook.entity.ts +6 -0
|
@@ -22,6 +22,19 @@ export interface DocumentTypeGetAllResponseEntity {
|
|
|
22
22
|
resetsYearly: DocumentTypeEntity['resetsYearly'];
|
|
23
23
|
numbered: DocumentTypeEntity['numbered'];
|
|
24
24
|
directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
|
|
25
|
+
issuingEntity: {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
shortName: string | null;
|
|
29
|
+
} | null;
|
|
30
|
+
sharesNumberingWith: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
} | null;
|
|
34
|
+
numberingMembers: {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}[];
|
|
25
38
|
enabled: DocumentTypeEntity['enabled'];
|
|
26
39
|
flow: {
|
|
27
40
|
visa: number;
|
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./documentType"), exports);
|
|
18
18
|
__exportStar(require("./document"), exports);
|
|
19
19
|
__exportStar(require("./procedure"), exports);
|
|
20
|
+
__exportStar(require("./issuingEntity"), exports);
|
|
20
21
|
__exportStar(require("./caseFile"), exports);
|
|
21
22
|
__exportStar(require("./partsOffice"), exports);
|
|
22
23
|
__exportStar(require("./registerBook"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './issuingEntity.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("./issuingEntity.entity"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IssuingEntityEntity } from '../../base/entities';
|
|
2
|
+
export interface IssuingEntityGetAllResponseEntity {
|
|
3
|
+
id: IssuingEntityEntity['id'];
|
|
4
|
+
name: IssuingEntityEntity['name'];
|
|
5
|
+
shortName: IssuingEntityEntity['shortName'];
|
|
6
|
+
directorateCodeReferences: IssuingEntityEntity['directorateCodeReferences'];
|
|
7
|
+
docDigitalEntityId: IssuingEntityEntity['docDigitalEntityId'];
|
|
8
|
+
enabled: IssuingEntityEntity['enabled'];
|
|
9
|
+
/** Cuántos tipos documentales emite. */
|
|
10
|
+
documentTypes: number;
|
|
11
|
+
}
|
|
12
|
+
export type IssuingEntityGetByIdResponseEntity = IssuingEntityGetAllResponseEntity;
|
|
13
|
+
export interface IssuingEntityCreateResponseEntity {
|
|
14
|
+
id: IssuingEntityEntity['id'];
|
|
15
|
+
ok: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface IssuingEntityUpdateResponseEntity {
|
|
18
|
+
id: IssuingEntityEntity['id'];
|
|
19
|
+
ok: boolean;
|
|
20
|
+
}
|
|
@@ -32,6 +32,8 @@ export interface PartsOfficeDispatchEntity extends DocumentDispatchResponseEntit
|
|
|
32
32
|
accessLevel: string;
|
|
33
33
|
};
|
|
34
34
|
externalRecipients: DocumentExternalRecipientResponseEntity[];
|
|
35
|
+
/** A nombre de quién sale: la entidad emisora del tipo documental o la municipalidad. */
|
|
36
|
+
issuerName: string;
|
|
35
37
|
createdAt: string;
|
|
36
38
|
}
|
|
37
39
|
/** Documento que llegó por DocDigital. */
|
|
@@ -45,6 +47,8 @@ export interface PartsOfficeInboundEntity {
|
|
|
45
47
|
folioDate: string | null;
|
|
46
48
|
typeName: string | null;
|
|
47
49
|
reserved: boolean;
|
|
50
|
+
/** Entidad propia a la que llegó (la municipalidad o una entidad emisora). */
|
|
51
|
+
recipientEntityName: string | null;
|
|
48
52
|
senderEntityName: string | null;
|
|
49
53
|
senderName: string | null;
|
|
50
54
|
senderPosition: string | null;
|
|
@@ -24,11 +24,17 @@ export interface RegisterBookRowEntity {
|
|
|
24
24
|
dispatch: string | null;
|
|
25
25
|
/** Motivo de la anulación (del documento o del número). */
|
|
26
26
|
observation: string | null;
|
|
27
|
+
/** Numeración compartida: tipo documental del número (`null` en un salto o si el libro es de un solo tipo). */
|
|
28
|
+
documentTypeName: string | null;
|
|
27
29
|
}
|
|
28
30
|
export interface RegisterBookEntity {
|
|
29
31
|
kind: RegisterBookKind;
|
|
30
32
|
/** «Decreto alcaldicio exento» o «Ingresos de Oficina de Partes». */
|
|
31
33
|
title: string;
|
|
34
|
+
/** Quién lleva el libro: la entidad emisora del tipo o la municipalidad. */
|
|
35
|
+
issuerName: string;
|
|
36
|
+
/** Numeración compartida: los tipos que numeran en la serie del libro (vacío si es de un solo tipo). */
|
|
37
|
+
series: string[];
|
|
32
38
|
year: number;
|
|
33
39
|
month: number | null;
|
|
34
40
|
rows: RegisterBookRowEntity[];
|
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -63,7 +63,9 @@ export type DocumentTrackingAction =
|
|
|
63
63
|
| 'Reassigned'
|
|
64
64
|
| 'Dispatched'
|
|
65
65
|
| 'DispatchReturned'
|
|
66
|
-
| 'Received'
|
|
66
|
+
| 'Received'
|
|
67
|
+
| 'EmailCopySent'
|
|
68
|
+
| 'EmailCopyOpened';
|
|
67
69
|
|
|
68
70
|
export const DocumentTrackingAction = {
|
|
69
71
|
Created: 'Created',
|
|
@@ -83,6 +85,8 @@ export const DocumentTrackingAction = {
|
|
|
83
85
|
Dispatched: 'Dispatched',
|
|
84
86
|
DispatchReturned: 'DispatchReturned',
|
|
85
87
|
Received: 'Received',
|
|
88
|
+
EmailCopySent: 'EmailCopySent',
|
|
89
|
+
EmailCopyOpened: 'EmailCopyOpened',
|
|
86
90
|
} satisfies Record<string, DocumentTrackingAction>;
|
|
87
91
|
|
|
88
92
|
export type DocumentOrigin = 'Internal' | 'DocDigital';
|
|
@@ -222,7 +226,9 @@ export type CaseFileTrackingAction =
|
|
|
222
226
|
| 'ParticipantAdded'
|
|
223
227
|
| 'ParticipantRemoved'
|
|
224
228
|
| 'Closed'
|
|
225
|
-
| 'Exported'
|
|
229
|
+
| 'Exported'
|
|
230
|
+
| 'ShareLinkCreated'
|
|
231
|
+
| 'ShareLinkRevoked';
|
|
226
232
|
|
|
227
233
|
export const CaseFileTrackingAction = {
|
|
228
234
|
Created: 'Created',
|
|
@@ -234,6 +240,8 @@ export const CaseFileTrackingAction = {
|
|
|
234
240
|
ParticipantRemoved: 'ParticipantRemoved',
|
|
235
241
|
Closed: 'Closed',
|
|
236
242
|
Exported: 'Exported',
|
|
243
|
+
ShareLinkCreated: 'ShareLinkCreated',
|
|
244
|
+
ShareLinkRevoked: 'ShareLinkRevoked',
|
|
237
245
|
} satisfies Record<string, CaseFileTrackingAction>;
|
|
238
246
|
|
|
239
247
|
export type CaseFileAccessAction = 'Viewed' | 'FileDownloaded' | 'Exported';
|
|
@@ -262,6 +270,11 @@ export interface DocumentTypeEntity {
|
|
|
262
270
|
resetsYearly: boolean;
|
|
263
271
|
numbered: boolean;
|
|
264
272
|
directorateCodeReference?: number | null;
|
|
273
|
+
issuingEntity?: IssuingEntityEntity | null;
|
|
274
|
+
issuingEntityId?: string | null;
|
|
275
|
+
sharesNumberingWith?: DocumentTypeEntity | null;
|
|
276
|
+
sharesNumberingWithId?: string | null;
|
|
277
|
+
numberingMembers?: DocumentTypeEntity[];
|
|
265
278
|
enabled: boolean;
|
|
266
279
|
documents?: DocumentEntity[];
|
|
267
280
|
annulledNumbers?: DocumentAnnulledNumberEntity[];
|
|
@@ -322,6 +335,7 @@ export interface DocumentEntity {
|
|
|
322
335
|
caseFileEntries?: CaseFileEntryEntity[];
|
|
323
336
|
workFolderItems?: WorkFolderItemEntity[];
|
|
324
337
|
externalRecipients?: DocumentExternalRecipientEntity[];
|
|
338
|
+
emailCopies?: DocumentEmailCopyEntity[];
|
|
325
339
|
dispatch?: DocumentDispatchEntity | null;
|
|
326
340
|
docDigitalInbound?: DocDigitalInboundEntity | null;
|
|
327
341
|
deleted: boolean;
|
|
@@ -494,6 +508,7 @@ export interface CaseFileEntity {
|
|
|
494
508
|
trackings?: CaseFileTrackingEntity[];
|
|
495
509
|
metadataChanges?: CaseFileMetadataChangeEntity[];
|
|
496
510
|
accesses?: CaseFileAccessEntity[];
|
|
511
|
+
shareLinks?: CaseFileShareLinkEntity[];
|
|
497
512
|
createdAt: string;
|
|
498
513
|
updatedAt: string;
|
|
499
514
|
workFolder?: WorkFolderEntity | null;
|
|
@@ -585,13 +600,48 @@ export interface CaseFileAccessEntity {
|
|
|
585
600
|
id: string;
|
|
586
601
|
action: CaseFileAccessAction;
|
|
587
602
|
entryId?: string | null;
|
|
588
|
-
employeeId
|
|
603
|
+
employeeId?: string | null;
|
|
589
604
|
employeeFullName: string;
|
|
605
|
+
shareLink?: CaseFileShareLinkEntity | null;
|
|
606
|
+
shareLinkId?: string | null;
|
|
590
607
|
caseFile?: CaseFileEntity;
|
|
591
608
|
caseFileId: string;
|
|
592
609
|
createdAt: string;
|
|
593
610
|
}
|
|
594
611
|
|
|
612
|
+
export interface CaseFileShareLinkEntity {
|
|
613
|
+
id: string;
|
|
614
|
+
tokenHash: string;
|
|
615
|
+
recipient: string;
|
|
616
|
+
recipientEmail?: string | null;
|
|
617
|
+
purpose?: string | null;
|
|
618
|
+
allowExport: boolean;
|
|
619
|
+
expiresAt: string;
|
|
620
|
+
createdByEmployeeId: string;
|
|
621
|
+
createdByFullName: string;
|
|
622
|
+
revokedAt?: string | null;
|
|
623
|
+
revokedByEmployeeId?: string | null;
|
|
624
|
+
revokedByFullName?: string | null;
|
|
625
|
+
caseFile?: CaseFileEntity;
|
|
626
|
+
caseFileId: string;
|
|
627
|
+
accesses?: CaseFileAccessEntity[];
|
|
628
|
+
createdAt: string;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
export interface DocumentEmailCopyEntity {
|
|
632
|
+
id: string;
|
|
633
|
+
name: string;
|
|
634
|
+
email: string;
|
|
635
|
+
tokenHash?: string | null;
|
|
636
|
+
expiresAt?: string | null;
|
|
637
|
+
issuedAt?: string | null;
|
|
638
|
+
openedAt?: string | null;
|
|
639
|
+
downloadCount: number;
|
|
640
|
+
document?: DocumentEntity;
|
|
641
|
+
documentId: string;
|
|
642
|
+
createdAt: string;
|
|
643
|
+
}
|
|
644
|
+
|
|
595
645
|
export interface DocumentExternalRecipientEntity {
|
|
596
646
|
id: string;
|
|
597
647
|
entityId: number;
|
|
@@ -640,6 +690,8 @@ export interface DocDigitalInboundEntity {
|
|
|
640
690
|
senderEntityName?: string | null;
|
|
641
691
|
senderName?: string | null;
|
|
642
692
|
senderPosition?: string | null;
|
|
693
|
+
recipientEntityId?: number | null;
|
|
694
|
+
recipientEntityName?: string | null;
|
|
643
695
|
fileId?: string | null;
|
|
644
696
|
fileName?: string | null;
|
|
645
697
|
attachments: JsonValue;
|
|
@@ -658,6 +710,19 @@ export interface DocDigitalInboundEntity {
|
|
|
658
710
|
updatedAt: string;
|
|
659
711
|
}
|
|
660
712
|
|
|
713
|
+
export interface IssuingEntityEntity {
|
|
714
|
+
id: string;
|
|
715
|
+
name: string;
|
|
716
|
+
shortName?: string | null;
|
|
717
|
+
directorateCodeReferences: number[];
|
|
718
|
+
docDigitalEntityId?: number | null;
|
|
719
|
+
enabled: boolean;
|
|
720
|
+
documentTypes?: DocumentTypeEntity[];
|
|
721
|
+
deleted: boolean;
|
|
722
|
+
createdAt: string;
|
|
723
|
+
updatedAt: string;
|
|
724
|
+
}
|
|
725
|
+
|
|
661
726
|
export interface IntakeSequenceEntity {
|
|
662
727
|
year: number;
|
|
663
728
|
next: number;
|
|
@@ -14,6 +14,9 @@ import {
|
|
|
14
14
|
type CaseFileExportResponseEntity,
|
|
15
15
|
type CaseFileGetAllResponseEntity,
|
|
16
16
|
type CaseFileGetByIdResponseEntity,
|
|
17
|
+
type CaseFileShareLinkCreateResponseEntity,
|
|
18
|
+
type CaseFileShareLinkResponseEntity,
|
|
19
|
+
type CaseFileSharedResponseEntity,
|
|
17
20
|
type CaseFileUpdateResponseEntity,
|
|
18
21
|
} from '../entities';
|
|
19
22
|
import { type RpcPage } from './contract';
|
|
@@ -34,8 +37,27 @@ export const CaseFilePatterns = {
|
|
|
34
37
|
close: 'gestorDocumental.caseFile.close',
|
|
35
38
|
getEntryFile: 'gestorDocumental.caseFile.getEntryFile',
|
|
36
39
|
getExport: 'gestorDocumental.caseFile.getExport',
|
|
40
|
+
createShareLink: 'gestorDocumental.caseFile.createShareLink',
|
|
41
|
+
getShareLinks: 'gestorDocumental.caseFile.getShareLinks',
|
|
42
|
+
revokeShareLink: 'gestorDocumental.caseFile.revokeShareLink',
|
|
43
|
+
getShared: 'gestorDocumental.caseFile.getShared',
|
|
44
|
+
getSharedEntryFile: 'gestorDocumental.caseFile.getSharedEntryFile',
|
|
45
|
+
getSharedExport: 'gestorDocumental.caseFile.getSharedExport',
|
|
37
46
|
} as const;
|
|
38
47
|
|
|
48
|
+
/** Enlace temporal para que alguien de fuera consulte el expediente sin sesión. */
|
|
49
|
+
export interface CaseFileShareLinkPayload {
|
|
50
|
+
/** A quién se entrega. Ej: «Contraloría Regional». */
|
|
51
|
+
recipient: string;
|
|
52
|
+
/** Si se indica, el gateway le envía el enlace por correo. */
|
|
53
|
+
recipientEmail?: string | null;
|
|
54
|
+
purpose?: string | null;
|
|
55
|
+
/** Cuántos días dura: de 1 a 30. */
|
|
56
|
+
days: number;
|
|
57
|
+
/** Puede descargar el expediente completo (ZIP). Por omisión, sí. */
|
|
58
|
+
allowExport?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
39
61
|
/** Persona u organización relacionada con el expediente (MGDEE54). */
|
|
40
62
|
export interface CaseFileActorInput {
|
|
41
63
|
relation: CaseFileActorRelation;
|
|
@@ -161,4 +183,32 @@ export interface CaseFileContract {
|
|
|
161
183
|
payload: Pick<CaseFileEntity, 'id'> & CaseFileActorPayload;
|
|
162
184
|
response: CaseFileExportResponseEntity;
|
|
163
185
|
};
|
|
186
|
+
/** Crea un enlace temporal: solo su responsable. El token viaja solo en esta respuesta. */
|
|
187
|
+
[CaseFilePatterns.createShareLink]: {
|
|
188
|
+
payload: Pick<CaseFileEntity, 'id'> & CaseFileShareLinkPayload & { actor: DocumentActor };
|
|
189
|
+
response: CaseFileShareLinkCreateResponseEntity;
|
|
190
|
+
};
|
|
191
|
+
/** Enlaces del expediente, vigentes o no, con cuántas veces se usaron: su responsable o quien ve todos. */
|
|
192
|
+
[CaseFilePatterns.getShareLinks]: {
|
|
193
|
+
payload: Pick<CaseFileEntity, 'id'> & CaseFileActorPayload;
|
|
194
|
+
response: CaseFileShareLinkResponseEntity[];
|
|
195
|
+
};
|
|
196
|
+
[CaseFilePatterns.revokeShareLink]: {
|
|
197
|
+
payload: Pick<CaseFileEntity, 'id'> & { linkId: string; actor: DocumentActor };
|
|
198
|
+
response: CaseFileUpdateResponseEntity;
|
|
199
|
+
};
|
|
200
|
+
/** Sin sesión, con el token del enlace: metadatos e índice. Queda en el registro de accesos. */
|
|
201
|
+
[CaseFilePatterns.getShared]: {
|
|
202
|
+
payload: { token: string };
|
|
203
|
+
response: CaseFileSharedResponseEntity;
|
|
204
|
+
};
|
|
205
|
+
[CaseFilePatterns.getSharedEntryFile]: {
|
|
206
|
+
payload: { token: string; entryId: string };
|
|
207
|
+
response: CaseFileEntryFileResponseEntity;
|
|
208
|
+
};
|
|
209
|
+
/** El expediente completo, si el enlace lo permite. Queda en la trazabilidad y en el registro de accesos. */
|
|
210
|
+
[CaseFilePatterns.getSharedExport]: {
|
|
211
|
+
payload: { token: string };
|
|
212
|
+
response: CaseFileExportResponseEntity;
|
|
213
|
+
};
|
|
164
214
|
}
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
type DocumentCreateResponseEntity,
|
|
14
14
|
type DocumentDeriveResponseEntity,
|
|
15
15
|
type DocumentDiscardResponseEntity,
|
|
16
|
+
type DocumentEmailCopyIssuedEntity,
|
|
17
|
+
type DocumentEmailCopyViewEntity,
|
|
16
18
|
type DocumentGetAllResponseEntity,
|
|
17
19
|
type DocumentGetByIdResponseEntity,
|
|
18
20
|
type DocumentGetSummaryResponseEntity,
|
|
@@ -51,6 +53,9 @@ export const DocumentPatterns = {
|
|
|
51
53
|
getAgenda: 'gestorDocumental.document.getAgenda',
|
|
52
54
|
exportTrail: 'gestorDocumental.document.exportTrail',
|
|
53
55
|
compose: 'gestorDocumental.document.compose',
|
|
56
|
+
issueEmailCopies: 'gestorDocumental.document.issueEmailCopies',
|
|
57
|
+
getEmailCopy: 'gestorDocumental.document.getEmailCopy',
|
|
58
|
+
getEmailCopyFile: 'gestorDocumental.document.getEmailCopyFile',
|
|
54
59
|
} as const;
|
|
55
60
|
|
|
56
61
|
/**
|
|
@@ -119,10 +124,18 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
|
|
|
119
124
|
replyToDocumentId?: string | null;
|
|
120
125
|
// Instituciones (y usuarios) de DocDigital a quienes va: al terminar la firma pasa a Oficina de Partes.
|
|
121
126
|
externalRecipients?: DocumentExternalRecipientInput[];
|
|
127
|
+
// Copia por correo a quienes están fuera del Estado: sale al finalizar o, si también va por DocDigital, al despacharlo.
|
|
128
|
+
emailCopies?: DocumentEmailCopyInput[];
|
|
122
129
|
action?: 'Submit';
|
|
123
130
|
actor: DocumentActor;
|
|
124
131
|
}
|
|
125
132
|
|
|
133
|
+
/** Persona u organización fuera del Estado que recibe una copia por correo. */
|
|
134
|
+
export interface DocumentEmailCopyInput {
|
|
135
|
+
name: string;
|
|
136
|
+
email: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
126
139
|
/** Destinatario externo: una institución de DocDigital y, si se indica, uno de sus usuarios. */
|
|
127
140
|
export interface DocumentExternalRecipientInput {
|
|
128
141
|
entityId: number;
|
|
@@ -303,6 +316,23 @@ export interface DocumentContract {
|
|
|
303
316
|
payload: { code: string };
|
|
304
317
|
response: DocumentPublicFileResponseEntity;
|
|
305
318
|
};
|
|
319
|
+
/**
|
|
320
|
+
* Emite las copias por correo pendientes de estos documentos, si ya corresponde (finalizado y, si va por DocDigital,
|
|
321
|
+
* despachado): genera el enlace de cada una. Se puede pedir de más: lo ya emitido no se repite.
|
|
322
|
+
*/
|
|
323
|
+
[DocumentPatterns.issueEmailCopies]: {
|
|
324
|
+
payload: { documentIds: string[] };
|
|
325
|
+
response: DocumentEmailCopyIssuedEntity[];
|
|
326
|
+
};
|
|
327
|
+
/** Sin sesión, con el token de la copia: el documento y quién lo emitió. */
|
|
328
|
+
[DocumentPatterns.getEmailCopy]: {
|
|
329
|
+
payload: { token: string };
|
|
330
|
+
response: DocumentEmailCopyViewEntity;
|
|
331
|
+
};
|
|
332
|
+
[DocumentPatterns.getEmailCopyFile]: {
|
|
333
|
+
payload: { token: string };
|
|
334
|
+
response: DocumentPublicFileResponseEntity;
|
|
335
|
+
};
|
|
306
336
|
/** Carpeta de Drive de los documentos y sus anexos: el gateway la pide antes de subir cada archivo. */
|
|
307
337
|
[DocumentPatterns.getFilesFolder]: {
|
|
308
338
|
payload: Record<string, never>;
|
|
@@ -41,6 +41,10 @@ export interface DocumentTypeWritePayload {
|
|
|
41
41
|
// Sus documentos llevan número (por omisión, sí).
|
|
42
42
|
numbered?: boolean;
|
|
43
43
|
directorateCodeReference?: number | null;
|
|
44
|
+
// Entidad emisora (sin valor: la municipalidad).
|
|
45
|
+
issuingEntityId?: string | null;
|
|
46
|
+
// Tipo cuyo correlativo comparte (sin valor: el suyo propio).
|
|
47
|
+
sharesNumberingWithId?: string | null;
|
|
44
48
|
enabled?: boolean;
|
|
45
49
|
// Flujo sugerido, en el orden en que les toca dentro de cada rol. Al editar, si no viene, el flujo no cambia.
|
|
46
50
|
flowSteps?: DocumentFlowStepInput[];
|
|
@@ -58,7 +62,8 @@ export interface DocumentTypeContract {
|
|
|
58
62
|
search?: string;
|
|
59
63
|
enabled?: boolean;
|
|
60
64
|
category?: DocumentCategory;
|
|
61
|
-
// Solo los que puede usar quien redacta: los de toda la municipalidad y los de estas direcciones
|
|
65
|
+
// Solo los que puede usar quien redacta: los de toda la municipalidad y los de estas direcciones (o de una
|
|
66
|
+
// entidad emisora por la que actúan).
|
|
62
67
|
usableByDirectorates?: number[];
|
|
63
68
|
};
|
|
64
69
|
};
|
package/src/contracts/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CaseFilePatterns, type CaseFileContract } from './caseFile.contract';
|
|
2
2
|
import { DocumentPatterns, type DocumentContract } from './document.contract';
|
|
3
3
|
import { DocumentTypePatterns, type DocumentTypeContract } from './documentType.contract';
|
|
4
|
+
import { IssuingEntityPatterns, type IssuingEntityContract } from './issuingEntity.contract';
|
|
4
5
|
import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
|
|
5
6
|
import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
|
|
6
7
|
import { RegisterBookPatterns, type RegisterBookContract } from './registerBook.contract';
|
|
@@ -11,6 +12,7 @@ export * from './contract';
|
|
|
11
12
|
export * from './document.contract';
|
|
12
13
|
export * from './documentType.contract';
|
|
13
14
|
export * from './procedure.contract';
|
|
15
|
+
export * from './issuingEntity.contract';
|
|
14
16
|
export * from './caseFile.contract';
|
|
15
17
|
export * from './partsOffice.contract';
|
|
16
18
|
export * from './registerBook.contract';
|
|
@@ -22,6 +24,7 @@ export const GestorDocumentalPatterns = {
|
|
|
22
24
|
documentType: DocumentTypePatterns,
|
|
23
25
|
document: DocumentPatterns,
|
|
24
26
|
procedure: ProcedurePatterns,
|
|
27
|
+
issuingEntity: IssuingEntityPatterns,
|
|
25
28
|
caseFile: CaseFilePatterns,
|
|
26
29
|
partsOffice: PartsOfficePatterns,
|
|
27
30
|
registerBook: RegisterBookPatterns,
|
|
@@ -33,6 +36,7 @@ export const GestorDocumentalPatterns = {
|
|
|
33
36
|
export type GestorDocumentalContract = DocumentTypeContract &
|
|
34
37
|
DocumentContract &
|
|
35
38
|
ProcedureContract &
|
|
39
|
+
IssuingEntityContract &
|
|
36
40
|
CaseFileContract &
|
|
37
41
|
PartsOfficeContract &
|
|
38
42
|
RegisterBookContract &
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type IssuingEntityEntity } from '../base/entities';
|
|
2
|
+
import {
|
|
3
|
+
type IssuingEntityCreateResponseEntity,
|
|
4
|
+
type IssuingEntityGetAllResponseEntity,
|
|
5
|
+
type IssuingEntityGetByIdResponseEntity,
|
|
6
|
+
type IssuingEntityUpdateResponseEntity,
|
|
7
|
+
} from '../entities';
|
|
8
|
+
import { type RpcPage } from './contract';
|
|
9
|
+
|
|
10
|
+
/** Patrones NATS de `issuingEntity`: `<servicio>.<recurso>.<acción>`. */
|
|
11
|
+
export const IssuingEntityPatterns = {
|
|
12
|
+
getAll: 'gestorDocumental.issuingEntity.getAll',
|
|
13
|
+
getById: 'gestorDocumental.issuingEntity.getById',
|
|
14
|
+
create: 'gestorDocumental.issuingEntity.create',
|
|
15
|
+
update: 'gestorDocumental.issuingEntity.update',
|
|
16
|
+
setEnabled: 'gestorDocumental.issuingEntity.setEnabled',
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
/** Datos de una entidad emisora al crearla o editarla. */
|
|
20
|
+
export interface IssuingEntityWritePayload {
|
|
21
|
+
name: string;
|
|
22
|
+
shortName?: string | null;
|
|
23
|
+
/** Direcciones (código de caschile) cuyos funcionarios actúan por la entidad. */
|
|
24
|
+
directorateCodeReferences: number[];
|
|
25
|
+
/** Su entidad en DocDigital, entre las asociadas a las credenciales del gestor. */
|
|
26
|
+
docDigitalEntityId?: number | null;
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IssuingEntityContract {
|
|
31
|
+
[IssuingEntityPatterns.getAll]: {
|
|
32
|
+
// sin `page` y `limit` responde todas en una sola página
|
|
33
|
+
payload: {
|
|
34
|
+
pagination?: { page?: number; limit?: number };
|
|
35
|
+
filters?: { search?: string; enabled?: boolean };
|
|
36
|
+
};
|
|
37
|
+
response: RpcPage<IssuingEntityGetAllResponseEntity[]>;
|
|
38
|
+
};
|
|
39
|
+
[IssuingEntityPatterns.getById]: {
|
|
40
|
+
payload: Pick<IssuingEntityEntity, 'id'>;
|
|
41
|
+
response: IssuingEntityGetByIdResponseEntity;
|
|
42
|
+
};
|
|
43
|
+
[IssuingEntityPatterns.create]: {
|
|
44
|
+
payload: IssuingEntityWritePayload;
|
|
45
|
+
response: IssuingEntityCreateResponseEntity;
|
|
46
|
+
};
|
|
47
|
+
[IssuingEntityPatterns.update]: {
|
|
48
|
+
payload: IssuingEntityWritePayload & Pick<IssuingEntityEntity, 'id'>;
|
|
49
|
+
response: IssuingEntityUpdateResponseEntity;
|
|
50
|
+
};
|
|
51
|
+
[IssuingEntityPatterns.setEnabled]: {
|
|
52
|
+
payload: Pick<IssuingEntityEntity, 'id' | 'enabled'>;
|
|
53
|
+
response: IssuingEntityUpdateResponseEntity;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -20,6 +20,7 @@ export const PartsOfficePatterns = {
|
|
|
20
20
|
getStatus: 'gestorDocumental.partsOffice.getStatus',
|
|
21
21
|
getSummary: 'gestorDocumental.partsOffice.getSummary',
|
|
22
22
|
getEntities: 'gestorDocumental.partsOffice.getEntities',
|
|
23
|
+
getOwnEntities: 'gestorDocumental.partsOffice.getOwnEntities',
|
|
23
24
|
getUsers: 'gestorDocumental.partsOffice.getUsers',
|
|
24
25
|
getDocumentTypes: 'gestorDocumental.partsOffice.getDocumentTypes',
|
|
25
26
|
getDispatches: 'gestorDocumental.partsOffice.getDispatches',
|
|
@@ -51,6 +52,8 @@ export interface PartsOfficeContract {
|
|
|
51
52
|
[PartsOfficePatterns.getSummary]: { payload: Record<string, never>; response: PartsOfficeSummaryEntity };
|
|
52
53
|
/** Directorio de DocDigital: instituciones por nombre. */
|
|
53
54
|
[PartsOfficePatterns.getEntities]: { payload: { search?: string }; response: DocDigitalEntityEntity[] };
|
|
55
|
+
/** Entidades asociadas a las credenciales del gestor: la del municipio y las de sus entidades emisoras. */
|
|
56
|
+
[PartsOfficePatterns.getOwnEntities]: { payload: Record<string, never>; response: DocDigitalEntityEntity[] };
|
|
54
57
|
[PartsOfficePatterns.getUsers]: {
|
|
55
58
|
payload: { entityId: number; search?: string };
|
|
56
59
|
response: DocDigitalUserEntity[];
|
|
@@ -121,7 +121,10 @@ export interface CaseFileAccessResponseEntity {
|
|
|
121
121
|
entryId: CaseFileAccessEntity['entryId'];
|
|
122
122
|
/** Título del documento que se abrió, si el acceso fue a uno. */
|
|
123
123
|
entryTitle: string | null;
|
|
124
|
+
/** El funcionario o, si fue por un enlace temporal, su destinatario externo. */
|
|
124
125
|
employeeFullName: CaseFileAccessEntity['employeeFullName'];
|
|
126
|
+
/** Fue por un enlace temporal, sin sesión. */
|
|
127
|
+
external: boolean;
|
|
125
128
|
createdAt: CaseFileAccessEntity['createdAt'];
|
|
126
129
|
}
|
|
127
130
|
|
|
@@ -210,3 +213,79 @@ export interface CaseFileExportResponseEntity {
|
|
|
210
213
|
|
|
211
214
|
/** Expediente en que está incorporado un documento, visto desde el documento. */
|
|
212
215
|
export type DocumentCaseFileEntity = CaseFileLinkEntity;
|
|
216
|
+
|
|
217
|
+
/** Estado de un enlace temporal: vigente, vencido o revocado. */
|
|
218
|
+
export type CaseFileShareLinkStatus = 'Active' | 'Expired' | 'Revoked';
|
|
219
|
+
|
|
220
|
+
/** Enlace temporal de un expediente, como lo ve su responsable. El token no se vuelve a mostrar. */
|
|
221
|
+
export interface CaseFileShareLinkResponseEntity {
|
|
222
|
+
id: string;
|
|
223
|
+
recipient: string;
|
|
224
|
+
recipientEmail: string | null;
|
|
225
|
+
purpose: string | null;
|
|
226
|
+
allowExport: boolean;
|
|
227
|
+
expiresAt: string;
|
|
228
|
+
status: CaseFileShareLinkStatus;
|
|
229
|
+
createdByFullName: string;
|
|
230
|
+
createdAt: string;
|
|
231
|
+
revokedAt: string | null;
|
|
232
|
+
revokedByFullName: string | null;
|
|
233
|
+
/** Cuántas consultas, descargas y exportaciones se hicieron con él. */
|
|
234
|
+
accessCount: number;
|
|
235
|
+
lastAccessAt: string | null;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** Enlace recién creado: el token va solo aquí; la dirección la arma quien lo muestra. */
|
|
239
|
+
export interface CaseFileShareLinkCreateResponseEntity {
|
|
240
|
+
id: string;
|
|
241
|
+
token: string;
|
|
242
|
+
recipient: string;
|
|
243
|
+
recipientEmail: string | null;
|
|
244
|
+
purpose: string | null;
|
|
245
|
+
expiresAt: string;
|
|
246
|
+
/** Para avisarle al destinatario: qué expediente, de qué órgano y quién se lo comparte. */
|
|
247
|
+
caseFile: { code: string; title: string };
|
|
248
|
+
organName: string;
|
|
249
|
+
createdByFullName: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Actuación del índice como la ve el destinatario externo. */
|
|
253
|
+
export interface CaseFileSharedEntryEntity {
|
|
254
|
+
id: string;
|
|
255
|
+
sequence: number;
|
|
256
|
+
folder: string | null;
|
|
257
|
+
kind: CaseFileEntryEntity['kind'];
|
|
258
|
+
actuationType: CaseFileEntryEntity['actuationType'];
|
|
259
|
+
title: string;
|
|
260
|
+
/** Tipo y número del documento («D.E. N° 590/2026») o el tipo declarado del archivo. */
|
|
261
|
+
reference: string | null;
|
|
262
|
+
originDate: string | null;
|
|
263
|
+
createdAt: string;
|
|
264
|
+
hasFile: boolean;
|
|
265
|
+
sha256: string | null;
|
|
266
|
+
hasAdvancedSignature: boolean;
|
|
267
|
+
physicalLocation: string | null;
|
|
268
|
+
pageCount: number | null;
|
|
269
|
+
voidedAt: string | null;
|
|
270
|
+
voidReason: string | null;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Expediente abierto con un enlace temporal: metadatos e índice, sin participantes ni registros internos. */
|
|
274
|
+
export interface CaseFileSharedResponseEntity {
|
|
275
|
+
code: string;
|
|
276
|
+
title: string;
|
|
277
|
+
subject: string;
|
|
278
|
+
summary: string | null;
|
|
279
|
+
procedureName: string;
|
|
280
|
+
status: CaseFileEntity['status'];
|
|
281
|
+
organName: string;
|
|
282
|
+
responsibleFullName: string;
|
|
283
|
+
responsiblePosition: string | null;
|
|
284
|
+
createdAt: string;
|
|
285
|
+
closedAt: string | null;
|
|
286
|
+
recipient: string;
|
|
287
|
+
purpose: string | null;
|
|
288
|
+
expiresAt: string;
|
|
289
|
+
allowExport: boolean;
|
|
290
|
+
entries: CaseFileSharedEntryEntity[];
|
|
291
|
+
}
|