@muni-sanfer/types-gestor-documental 0.0.1-beta.1 → 0.0.1-beta.10
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 +435 -1
- package/dist/base/entities.js +98 -1
- package/dist/contracts/caseFile.contract.d.ts +159 -0
- package/dist/contracts/caseFile.contract.js +18 -0
- package/dist/contracts/document.contract.d.ts +141 -3
- package/dist/contracts/document.contract.js +7 -0
- package/dist/contracts/documentType.contract.d.ts +18 -1
- package/dist/contracts/index.d.ts +83 -1
- package/dist/contracts/index.js +18 -0
- package/dist/contracts/partsOffice.contract.d.ts +171 -0
- package/dist/contracts/partsOffice.contract.js +22 -0
- package/dist/contracts/procedure.contract.d.ts +50 -0
- package/dist/contracts/procedure.contract.js +11 -0
- package/dist/contracts/registerBook.contract.d.ts +27 -0
- package/dist/contracts/registerBook.contract.js +8 -0
- package/dist/contracts/signatureBatch.contract.d.ts +109 -0
- package/dist/contracts/signatureBatch.contract.js +12 -0
- package/dist/contracts/workFolder.contract.d.ts +114 -0
- package/dist/contracts/workFolder.contract.js +16 -0
- package/dist/entities/caseFile/caseFile.entity.d.ts +176 -0
- package/dist/entities/caseFile/caseFile.entity.js +2 -0
- package/dist/entities/caseFile/index.d.ts +1 -0
- package/dist/entities/caseFile/index.js +17 -0
- package/dist/entities/document/document.entity.d.ts +201 -1
- package/dist/entities/documentType/documentType.entity.d.ts +18 -1
- package/dist/entities/index.d.ts +6 -0
- package/dist/entities/index.js +6 -0
- package/dist/entities/partsOffice/index.d.ts +1 -0
- package/dist/entities/partsOffice/index.js +17 -0
- package/dist/entities/partsOffice/partsOffice.entity.d.ts +98 -0
- package/dist/entities/partsOffice/partsOffice.entity.js +2 -0
- package/dist/entities/procedure/index.d.ts +1 -0
- package/dist/entities/procedure/index.js +17 -0
- package/dist/entities/procedure/procedure.entity.d.ts +20 -0
- package/dist/entities/procedure/procedure.entity.js +2 -0
- package/dist/entities/registerBook/index.d.ts +1 -0
- package/dist/entities/registerBook/index.js +17 -0
- package/dist/entities/registerBook/registerBook.entity.d.ts +42 -0
- package/dist/entities/registerBook/registerBook.entity.js +2 -0
- package/dist/entities/signatureBatch/index.d.ts +1 -0
- package/dist/entities/signatureBatch/index.js +17 -0
- package/dist/entities/signatureBatch/signatureBatch.entity.d.ts +107 -0
- package/dist/entities/signatureBatch/signatureBatch.entity.js +2 -0
- package/dist/entities/workFolder/index.d.ts +1 -0
- package/dist/entities/workFolder/index.js +17 -0
- package/dist/entities/workFolder/workFolder.entity.d.ts +83 -0
- package/dist/entities/workFolder/workFolder.entity.js +2 -0
- package/package.json +1 -1
- package/src/base/entities.ts +508 -1
- package/src/contracts/caseFile.contract.ts +141 -0
- package/src/contracts/document.contract.ts +130 -0
- package/src/contracts/documentType.contract.ts +14 -1
- package/src/contracts/index.ts +26 -1
- package/src/contracts/partsOffice.contract.ts +120 -0
- package/src/contracts/procedure.contract.ts +53 -0
- package/src/contracts/registerBook.contract.ts +24 -0
- package/src/contracts/signatureBatch.contract.ts +96 -0
- package/src/contracts/workFolder.contract.ts +75 -0
- package/src/entities/caseFile/caseFile.entity.ts +204 -0
- package/src/entities/caseFile/index.ts +1 -0
- package/src/entities/document/document.entity.ts +210 -0
- package/src/entities/documentType/documentType.entity.ts +20 -1
- package/src/entities/index.ts +6 -0
- package/src/entities/partsOffice/index.ts +1 -0
- package/src/entities/partsOffice/partsOffice.entity.ts +103 -0
- package/src/entities/procedure/index.ts +1 -0
- package/src/entities/procedure/procedure.entity.ts +24 -0
- package/src/entities/registerBook/index.ts +1 -0
- package/src/entities/registerBook/registerBook.entity.ts +46 -0
- package/src/entities/signatureBatch/index.ts +1 -0
- package/src/entities/signatureBatch/signatureBatch.entity.ts +110 -0
- package/src/entities/workFolder/index.ts +1 -0
- package/src/entities/workFolder/workFolder.entity.ts +84 -0
- package/tsconfig.json +1 -3
package/src/base/entities.ts
CHANGED
|
@@ -57,7 +57,13 @@ export type DocumentTrackingAction =
|
|
|
57
57
|
| 'Discarded'
|
|
58
58
|
| 'Numbered'
|
|
59
59
|
| 'NumberAnnulled'
|
|
60
|
-
| 'Annulled'
|
|
60
|
+
| 'Annulled'
|
|
61
|
+
| 'Delivered'
|
|
62
|
+
| 'Derived'
|
|
63
|
+
| 'Reassigned'
|
|
64
|
+
| 'Dispatched'
|
|
65
|
+
| 'DispatchReturned'
|
|
66
|
+
| 'Received';
|
|
61
67
|
|
|
62
68
|
export const DocumentTrackingAction = {
|
|
63
69
|
Created: 'Created',
|
|
@@ -71,8 +77,44 @@ export const DocumentTrackingAction = {
|
|
|
71
77
|
Numbered: 'Numbered',
|
|
72
78
|
NumberAnnulled: 'NumberAnnulled',
|
|
73
79
|
Annulled: 'Annulled',
|
|
80
|
+
Delivered: 'Delivered',
|
|
81
|
+
Derived: 'Derived',
|
|
82
|
+
Reassigned: 'Reassigned',
|
|
83
|
+
Dispatched: 'Dispatched',
|
|
84
|
+
DispatchReturned: 'DispatchReturned',
|
|
85
|
+
Received: 'Received',
|
|
74
86
|
} satisfies Record<string, DocumentTrackingAction>;
|
|
75
87
|
|
|
88
|
+
export type DocumentOrigin = 'Internal' | 'DocDigital';
|
|
89
|
+
|
|
90
|
+
export const DocumentOrigin = {
|
|
91
|
+
Internal: 'Internal',
|
|
92
|
+
DocDigital: 'DocDigital',
|
|
93
|
+
} satisfies Record<string, DocumentOrigin>;
|
|
94
|
+
|
|
95
|
+
export type DocumentDispatchStatus = 'Pending' | 'Dispatched' | 'Returned';
|
|
96
|
+
|
|
97
|
+
export const DocumentDispatchStatus = {
|
|
98
|
+
Pending: 'Pending',
|
|
99
|
+
Dispatched: 'Dispatched',
|
|
100
|
+
Returned: 'Returned',
|
|
101
|
+
} satisfies Record<string, DocumentDispatchStatus>;
|
|
102
|
+
|
|
103
|
+
export type DocDigitalInboundStatus = 'Pending' | 'Registered' | 'Returned';
|
|
104
|
+
|
|
105
|
+
export const DocDigitalInboundStatus = {
|
|
106
|
+
Pending: 'Pending',
|
|
107
|
+
Registered: 'Registered',
|
|
108
|
+
Returned: 'Returned',
|
|
109
|
+
} satisfies Record<string, DocDigitalInboundStatus>;
|
|
110
|
+
|
|
111
|
+
export type DocumentFlowStepType = 'Employee' | 'DirectorateHead';
|
|
112
|
+
|
|
113
|
+
export const DocumentFlowStepType = {
|
|
114
|
+
Employee: 'Employee',
|
|
115
|
+
DirectorateHead: 'DirectorateHead',
|
|
116
|
+
} satisfies Record<string, DocumentFlowStepType>;
|
|
117
|
+
|
|
76
118
|
export type DocumentAttachmentType = 'File' | 'Link';
|
|
77
119
|
|
|
78
120
|
export const DocumentAttachmentType = {
|
|
@@ -80,6 +122,132 @@ export const DocumentAttachmentType = {
|
|
|
80
122
|
Link: 'Link',
|
|
81
123
|
} satisfies Record<string, DocumentAttachmentType>;
|
|
82
124
|
|
|
125
|
+
export type DocumentRecipientType = 'Employee' | 'Directorate' | 'Department';
|
|
126
|
+
|
|
127
|
+
export const DocumentRecipientType = {
|
|
128
|
+
Employee: 'Employee',
|
|
129
|
+
Directorate: 'Directorate',
|
|
130
|
+
Department: 'Department',
|
|
131
|
+
} satisfies Record<string, DocumentRecipientType>;
|
|
132
|
+
|
|
133
|
+
export type DocumentDeliveryOrigin = 'Recipient' | 'Derivation';
|
|
134
|
+
|
|
135
|
+
export const DocumentDeliveryOrigin = {
|
|
136
|
+
Recipient: 'Recipient',
|
|
137
|
+
Derivation: 'Derivation',
|
|
138
|
+
} satisfies Record<string, DocumentDeliveryOrigin>;
|
|
139
|
+
|
|
140
|
+
export type DocumentInstruction = 'Knowledge' | 'Inform' | 'Respond' | 'Archive';
|
|
141
|
+
|
|
142
|
+
export const DocumentInstruction = {
|
|
143
|
+
Knowledge: 'Knowledge',
|
|
144
|
+
Inform: 'Inform',
|
|
145
|
+
Respond: 'Respond',
|
|
146
|
+
Archive: 'Archive',
|
|
147
|
+
} satisfies Record<string, DocumentInstruction>;
|
|
148
|
+
|
|
149
|
+
export type CaseFileStatus = 'Open' | 'Closed';
|
|
150
|
+
|
|
151
|
+
export const CaseFileStatus = {
|
|
152
|
+
Open: 'Open',
|
|
153
|
+
Closed: 'Closed',
|
|
154
|
+
} satisfies Record<string, CaseFileStatus>;
|
|
155
|
+
|
|
156
|
+
export type CaseFileIncorporationMechanism =
|
|
157
|
+
'Manual' | 'WebService' | 'Mixed' | 'CitizenRepository' | 'Interoperability';
|
|
158
|
+
|
|
159
|
+
export const CaseFileIncorporationMechanism = {
|
|
160
|
+
Manual: 'Manual',
|
|
161
|
+
WebService: 'WebService',
|
|
162
|
+
Mixed: 'Mixed',
|
|
163
|
+
CitizenRepository: 'CitizenRepository',
|
|
164
|
+
Interoperability: 'Interoperability',
|
|
165
|
+
} satisfies Record<string, CaseFileIncorporationMechanism>;
|
|
166
|
+
|
|
167
|
+
export type CaseFileActuationType =
|
|
168
|
+
| 'AdministrativeAct'
|
|
169
|
+
| 'Notification'
|
|
170
|
+
| 'OfficialCommunication'
|
|
171
|
+
| 'Interoperability'
|
|
172
|
+
| 'RequestReception'
|
|
173
|
+
| 'Subfolder'
|
|
174
|
+
| 'PowerRegistration';
|
|
175
|
+
|
|
176
|
+
export const CaseFileActuationType = {
|
|
177
|
+
AdministrativeAct: 'AdministrativeAct',
|
|
178
|
+
Notification: 'Notification',
|
|
179
|
+
OfficialCommunication: 'OfficialCommunication',
|
|
180
|
+
Interoperability: 'Interoperability',
|
|
181
|
+
RequestReception: 'RequestReception',
|
|
182
|
+
Subfolder: 'Subfolder',
|
|
183
|
+
PowerRegistration: 'PowerRegistration',
|
|
184
|
+
} satisfies Record<string, CaseFileActuationType>;
|
|
185
|
+
|
|
186
|
+
export type CaseFileEntryKind = 'Document' | 'File' | 'CaseFile';
|
|
187
|
+
|
|
188
|
+
export const CaseFileEntryKind = {
|
|
189
|
+
Document: 'Document',
|
|
190
|
+
File: 'File',
|
|
191
|
+
CaseFile: 'CaseFile',
|
|
192
|
+
} satisfies Record<string, CaseFileEntryKind>;
|
|
193
|
+
|
|
194
|
+
export type CaseFileActorRelation =
|
|
195
|
+
'Responsible' | 'Interested' | 'Author' | 'Referred' | 'Recipient' | 'MinisterOfFaith';
|
|
196
|
+
|
|
197
|
+
export const CaseFileActorRelation = {
|
|
198
|
+
Responsible: 'Responsible',
|
|
199
|
+
Interested: 'Interested',
|
|
200
|
+
Author: 'Author',
|
|
201
|
+
Referred: 'Referred',
|
|
202
|
+
Recipient: 'Recipient',
|
|
203
|
+
MinisterOfFaith: 'MinisterOfFaith',
|
|
204
|
+
} satisfies Record<string, CaseFileActorRelation>;
|
|
205
|
+
|
|
206
|
+
export type CaseFileActorType = 'Citizen' | 'Foreigner' | 'PrivateInstitution' | 'Official';
|
|
207
|
+
|
|
208
|
+
export const CaseFileActorType = {
|
|
209
|
+
Citizen: 'Citizen',
|
|
210
|
+
Foreigner: 'Foreigner',
|
|
211
|
+
PrivateInstitution: 'PrivateInstitution',
|
|
212
|
+
Official: 'Official',
|
|
213
|
+
} satisfies Record<string, CaseFileActorType>;
|
|
214
|
+
|
|
215
|
+
export type CaseFileTrackingAction =
|
|
216
|
+
| 'Created'
|
|
217
|
+
| 'Updated'
|
|
218
|
+
| 'EntryAdded'
|
|
219
|
+
| 'EntryVoided'
|
|
220
|
+
| 'ParticipantAdded'
|
|
221
|
+
| 'ParticipantRemoved'
|
|
222
|
+
| 'Closed'
|
|
223
|
+
| 'Exported';
|
|
224
|
+
|
|
225
|
+
export const CaseFileTrackingAction = {
|
|
226
|
+
Created: 'Created',
|
|
227
|
+
Updated: 'Updated',
|
|
228
|
+
EntryAdded: 'EntryAdded',
|
|
229
|
+
EntryVoided: 'EntryVoided',
|
|
230
|
+
ParticipantAdded: 'ParticipantAdded',
|
|
231
|
+
ParticipantRemoved: 'ParticipantRemoved',
|
|
232
|
+
Closed: 'Closed',
|
|
233
|
+
Exported: 'Exported',
|
|
234
|
+
} satisfies Record<string, CaseFileTrackingAction>;
|
|
235
|
+
|
|
236
|
+
export type CaseFileAccessAction = 'Viewed' | 'FileDownloaded' | 'Exported';
|
|
237
|
+
|
|
238
|
+
export const CaseFileAccessAction = {
|
|
239
|
+
Viewed: 'Viewed',
|
|
240
|
+
FileDownloaded: 'FileDownloaded',
|
|
241
|
+
Exported: 'Exported',
|
|
242
|
+
} satisfies Record<string, CaseFileAccessAction>;
|
|
243
|
+
|
|
244
|
+
export type WorkFolderItemKind = 'Document' | 'File';
|
|
245
|
+
|
|
246
|
+
export const WorkFolderItemKind = {
|
|
247
|
+
Document: 'Document',
|
|
248
|
+
File: 'File',
|
|
249
|
+
} satisfies Record<string, WorkFolderItemKind>;
|
|
250
|
+
|
|
83
251
|
export interface DocumentTypeEntity {
|
|
84
252
|
id: string;
|
|
85
253
|
name: string;
|
|
@@ -89,10 +257,13 @@ export interface DocumentTypeEntity {
|
|
|
89
257
|
nextCorrelative: number;
|
|
90
258
|
correlativeYear?: number | null;
|
|
91
259
|
resetsYearly: boolean;
|
|
260
|
+
numbered: boolean;
|
|
92
261
|
directorateCodeReference?: number | null;
|
|
93
262
|
enabled: boolean;
|
|
94
263
|
documents?: DocumentEntity[];
|
|
95
264
|
annulledNumbers?: DocumentAnnulledNumberEntity[];
|
|
265
|
+
flowSteps?: DocumentTypeFlowStepEntity[];
|
|
266
|
+
signatureBatches?: SignatureBatchEntity[];
|
|
96
267
|
deleted: boolean;
|
|
97
268
|
createdAt: string;
|
|
98
269
|
updatedAt: string;
|
|
@@ -112,6 +283,20 @@ export interface DocumentEntity {
|
|
|
112
283
|
signatureSheet: boolean;
|
|
113
284
|
annulledAt?: string | null;
|
|
114
285
|
annulmentReason?: string | null;
|
|
286
|
+
responseDueAt?: string | null;
|
|
287
|
+
origin: DocumentOrigin;
|
|
288
|
+
intakeNumber?: number | null;
|
|
289
|
+
intakeYear?: number | null;
|
|
290
|
+
externalFolio?: string | null;
|
|
291
|
+
externalSender?: string | null;
|
|
292
|
+
externalDate?: string | null;
|
|
293
|
+
contentText?: string | null;
|
|
294
|
+
textExtractedAt?: string | null;
|
|
295
|
+
batch?: SignatureBatchEntity | null;
|
|
296
|
+
batchId?: string | null;
|
|
297
|
+
replyTo?: DocumentEntity | null;
|
|
298
|
+
replyToDocumentId?: string | null;
|
|
299
|
+
replies?: DocumentEntity[];
|
|
115
300
|
directorateCodeReference?: number | null;
|
|
116
301
|
departmentId?: string | null;
|
|
117
302
|
createdByEmployeeId: string;
|
|
@@ -128,6 +313,26 @@ export interface DocumentEntity {
|
|
|
128
313
|
attachments?: DocumentAttachmentEntity[];
|
|
129
314
|
trackings?: DocumentTrackingEntity[];
|
|
130
315
|
annulledNumbers?: DocumentAnnulledNumberEntity[];
|
|
316
|
+
recipients?: DocumentRecipientEntity[];
|
|
317
|
+
deliveries?: DocumentDeliveryEntity[];
|
|
318
|
+
caseFileEntries?: CaseFileEntryEntity[];
|
|
319
|
+
workFolderItems?: WorkFolderItemEntity[];
|
|
320
|
+
externalRecipients?: DocumentExternalRecipientEntity[];
|
|
321
|
+
dispatch?: DocumentDispatchEntity | null;
|
|
322
|
+
docDigitalInbound?: DocDigitalInboundEntity | null;
|
|
323
|
+
deleted: boolean;
|
|
324
|
+
createdAt: string;
|
|
325
|
+
updatedAt: string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface SignatureBatchEntity {
|
|
329
|
+
id: string;
|
|
330
|
+
name: string;
|
|
331
|
+
createdByEmployeeId: string;
|
|
332
|
+
createdByFullName: string;
|
|
333
|
+
documentType?: DocumentTypeEntity;
|
|
334
|
+
documentTypeId: string;
|
|
335
|
+
documents?: DocumentEntity[];
|
|
131
336
|
deleted: boolean;
|
|
132
337
|
createdAt: string;
|
|
133
338
|
updatedAt: string;
|
|
@@ -137,6 +342,7 @@ export interface DocumentParticipantEntity {
|
|
|
137
342
|
id: string;
|
|
138
343
|
role: DocumentParticipantRole;
|
|
139
344
|
order: number;
|
|
345
|
+
stage: number;
|
|
140
346
|
status: DocumentParticipantStatus;
|
|
141
347
|
employeeId: string;
|
|
142
348
|
fullName: string;
|
|
@@ -186,3 +392,304 @@ export interface DocumentAnnulledNumberEntity {
|
|
|
186
392
|
documentId: string;
|
|
187
393
|
createdAt: string;
|
|
188
394
|
}
|
|
395
|
+
|
|
396
|
+
export interface DocumentRecipientEntity {
|
|
397
|
+
id: string;
|
|
398
|
+
type: DocumentRecipientType;
|
|
399
|
+
employeeId?: string | null;
|
|
400
|
+
directorateCodeReference?: number | null;
|
|
401
|
+
departmentId?: string | null;
|
|
402
|
+
name: string;
|
|
403
|
+
position?: string | null;
|
|
404
|
+
document?: DocumentEntity;
|
|
405
|
+
documentId: string;
|
|
406
|
+
createdAt: string;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export interface DocumentDeliveryEntity {
|
|
410
|
+
id: string;
|
|
411
|
+
origin: DocumentDeliveryOrigin;
|
|
412
|
+
employeeId: string;
|
|
413
|
+
fullName: string;
|
|
414
|
+
position?: string | null;
|
|
415
|
+
areaName?: string | null;
|
|
416
|
+
sentByEmployeeId?: string | null;
|
|
417
|
+
sentByFullName?: string | null;
|
|
418
|
+
instruction?: DocumentInstruction | null;
|
|
419
|
+
note?: string | null;
|
|
420
|
+
dueAt?: string | null;
|
|
421
|
+
deliveredAt?: string | null;
|
|
422
|
+
readAt?: string | null;
|
|
423
|
+
closedAt?: string | null;
|
|
424
|
+
closingNote?: string | null;
|
|
425
|
+
document?: DocumentEntity;
|
|
426
|
+
documentId: string;
|
|
427
|
+
createdAt: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export interface DocumentTypeFlowStepEntity {
|
|
431
|
+
id: string;
|
|
432
|
+
role: DocumentParticipantRole;
|
|
433
|
+
order: number;
|
|
434
|
+
type: DocumentFlowStepType;
|
|
435
|
+
employeeId?: string | null;
|
|
436
|
+
directorateCodeReference?: number | null;
|
|
437
|
+
name: string;
|
|
438
|
+
position?: string | null;
|
|
439
|
+
documentType?: DocumentTypeEntity;
|
|
440
|
+
documentTypeId: string;
|
|
441
|
+
createdAt: string;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export interface ProcedureEntity {
|
|
445
|
+
id: string;
|
|
446
|
+
name: string;
|
|
447
|
+
cpatId?: string | null;
|
|
448
|
+
cpatCode?: string | null;
|
|
449
|
+
description?: string | null;
|
|
450
|
+
enabled: boolean;
|
|
451
|
+
caseFiles?: CaseFileEntity[];
|
|
452
|
+
deleted: boolean;
|
|
453
|
+
createdAt: string;
|
|
454
|
+
updatedAt: string;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export interface CaseFileSequenceEntity {
|
|
458
|
+
year: number;
|
|
459
|
+
next: number;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface CaseFileEntity {
|
|
463
|
+
id: string;
|
|
464
|
+
code: string;
|
|
465
|
+
year: number;
|
|
466
|
+
number: number;
|
|
467
|
+
title: string;
|
|
468
|
+
subject: string;
|
|
469
|
+
summary?: string | null;
|
|
470
|
+
status: CaseFileStatus;
|
|
471
|
+
accessLevel: DocumentAccessLevel;
|
|
472
|
+
hasSensitiveData: boolean;
|
|
473
|
+
incorporationMechanism: CaseFileIncorporationMechanism;
|
|
474
|
+
schemaVersion: string;
|
|
475
|
+
procedure?: ProcedureEntity;
|
|
476
|
+
procedureId: string;
|
|
477
|
+
responsibleEmployeeId: string;
|
|
478
|
+
responsibleFullName: string;
|
|
479
|
+
responsiblePosition?: string | null;
|
|
480
|
+
closedAt?: string | null;
|
|
481
|
+
closedByEmployeeId?: string | null;
|
|
482
|
+
closedByFullName?: string | null;
|
|
483
|
+
closingNote?: string | null;
|
|
484
|
+
participants?: CaseFileParticipantEntity[];
|
|
485
|
+
actors?: CaseFileActorEntity[];
|
|
486
|
+
entries?: CaseFileEntryEntity[];
|
|
487
|
+
linkedFrom?: CaseFileEntryEntity[];
|
|
488
|
+
trackings?: CaseFileTrackingEntity[];
|
|
489
|
+
metadataChanges?: CaseFileMetadataChangeEntity[];
|
|
490
|
+
accesses?: CaseFileAccessEntity[];
|
|
491
|
+
createdAt: string;
|
|
492
|
+
updatedAt: string;
|
|
493
|
+
workFolder?: WorkFolderEntity | null;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export interface CaseFileParticipantEntity {
|
|
497
|
+
id: string;
|
|
498
|
+
employeeId: string;
|
|
499
|
+
fullName: string;
|
|
500
|
+
position?: string | null;
|
|
501
|
+
addedByEmployeeId: string;
|
|
502
|
+
addedByFullName: string;
|
|
503
|
+
caseFile?: CaseFileEntity;
|
|
504
|
+
caseFileId: string;
|
|
505
|
+
createdAt: string;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export interface CaseFileActorEntity {
|
|
509
|
+
id: string;
|
|
510
|
+
relation: CaseFileActorRelation;
|
|
511
|
+
actorType: CaseFileActorType;
|
|
512
|
+
identifier?: string | null;
|
|
513
|
+
name: string;
|
|
514
|
+
caseFile?: CaseFileEntity;
|
|
515
|
+
caseFileId: string;
|
|
516
|
+
createdAt: string;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export interface CaseFileEntryEntity {
|
|
520
|
+
id: string;
|
|
521
|
+
sequence: number;
|
|
522
|
+
kind: CaseFileEntryKind;
|
|
523
|
+
actuationType: CaseFileActuationType;
|
|
524
|
+
title: string;
|
|
525
|
+
document?: DocumentEntity | null;
|
|
526
|
+
documentId?: string | null;
|
|
527
|
+
fileId?: string | null;
|
|
528
|
+
fileName?: string | null;
|
|
529
|
+
documentTypeName?: string | null;
|
|
530
|
+
originDate?: string | null;
|
|
531
|
+
author?: string | null;
|
|
532
|
+
keywords: string[];
|
|
533
|
+
accessLevel?: DocumentAccessLevel | null;
|
|
534
|
+
hasSensitiveData?: boolean | null;
|
|
535
|
+
linkedCaseFile?: CaseFileEntity | null;
|
|
536
|
+
linkedCaseFileId?: string | null;
|
|
537
|
+
sha256?: string | null;
|
|
538
|
+
size?: number | null;
|
|
539
|
+
hasAdvancedSignature: boolean;
|
|
540
|
+
incorporatedByEmployeeId: string;
|
|
541
|
+
incorporatedByFullName: string;
|
|
542
|
+
voidedAt?: string | null;
|
|
543
|
+
voidedByEmployeeId?: string | null;
|
|
544
|
+
voidedByFullName?: string | null;
|
|
545
|
+
voidReason?: string | null;
|
|
546
|
+
caseFile?: CaseFileEntity;
|
|
547
|
+
caseFileId: string;
|
|
548
|
+
createdAt: string;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export interface CaseFileTrackingEntity {
|
|
552
|
+
id: string;
|
|
553
|
+
action: CaseFileTrackingAction;
|
|
554
|
+
observation?: string | null;
|
|
555
|
+
employeeId?: string | null;
|
|
556
|
+
employeeFullName?: string | null;
|
|
557
|
+
caseFile?: CaseFileEntity;
|
|
558
|
+
caseFileId: string;
|
|
559
|
+
createdAt: string;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export interface CaseFileMetadataChangeEntity {
|
|
563
|
+
id: string;
|
|
564
|
+
field: string;
|
|
565
|
+
previousValue?: string | null;
|
|
566
|
+
newValue?: string | null;
|
|
567
|
+
employeeId: string;
|
|
568
|
+
employeeFullName: string;
|
|
569
|
+
caseFile?: CaseFileEntity;
|
|
570
|
+
caseFileId: string;
|
|
571
|
+
createdAt: string;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export interface CaseFileAccessEntity {
|
|
575
|
+
id: string;
|
|
576
|
+
action: CaseFileAccessAction;
|
|
577
|
+
entryId?: string | null;
|
|
578
|
+
employeeId: string;
|
|
579
|
+
employeeFullName: string;
|
|
580
|
+
caseFile?: CaseFileEntity;
|
|
581
|
+
caseFileId: string;
|
|
582
|
+
createdAt: string;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export interface DocumentExternalRecipientEntity {
|
|
586
|
+
id: string;
|
|
587
|
+
entityId: number;
|
|
588
|
+
entityName: string;
|
|
589
|
+
userId?: number | null;
|
|
590
|
+
userName?: string | null;
|
|
591
|
+
userPosition?: string | null;
|
|
592
|
+
document?: DocumentEntity;
|
|
593
|
+
documentId: string;
|
|
594
|
+
createdAt: string;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export interface DocumentDispatchEntity {
|
|
598
|
+
id: string;
|
|
599
|
+
status: DocumentDispatchStatus;
|
|
600
|
+
folio?: string | null;
|
|
601
|
+
docDigitalTypeId?: number | null;
|
|
602
|
+
docDigitalTypeName?: string | null;
|
|
603
|
+
docDigitalDocumentId?: string | null;
|
|
604
|
+
docDigitalRequestId?: string | null;
|
|
605
|
+
dispatchedAt?: string | null;
|
|
606
|
+
dispatchedByEmployeeId?: string | null;
|
|
607
|
+
dispatchedByFullName?: string | null;
|
|
608
|
+
returnedAt?: string | null;
|
|
609
|
+
returnedByEmployeeId?: string | null;
|
|
610
|
+
returnedByFullName?: string | null;
|
|
611
|
+
returnReason?: string | null;
|
|
612
|
+
document?: DocumentEntity;
|
|
613
|
+
documentId: string;
|
|
614
|
+
createdAt: string;
|
|
615
|
+
updatedAt: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export interface DocDigitalInboundEntity {
|
|
619
|
+
id: string;
|
|
620
|
+
docDigitalDocumentId: string;
|
|
621
|
+
docDigitalRequestId?: string | null;
|
|
622
|
+
status: DocDigitalInboundStatus;
|
|
623
|
+
subject: string;
|
|
624
|
+
description?: string | null;
|
|
625
|
+
folio?: string | null;
|
|
626
|
+
folioDate?: string | null;
|
|
627
|
+
typeName?: string | null;
|
|
628
|
+
reserved: boolean;
|
|
629
|
+
senderEntityId?: number | null;
|
|
630
|
+
senderEntityName?: string | null;
|
|
631
|
+
senderName?: string | null;
|
|
632
|
+
senderPosition?: string | null;
|
|
633
|
+
fileId?: string | null;
|
|
634
|
+
fileName?: string | null;
|
|
635
|
+
attachments: JsonValue;
|
|
636
|
+
registeredAt?: string | null;
|
|
637
|
+
registeredByEmployeeId?: string | null;
|
|
638
|
+
registeredByFullName?: string | null;
|
|
639
|
+
acknowledgedAt?: string | null;
|
|
640
|
+
acknowledgeError?: string | null;
|
|
641
|
+
returnedAt?: string | null;
|
|
642
|
+
returnedByEmployeeId?: string | null;
|
|
643
|
+
returnedByFullName?: string | null;
|
|
644
|
+
returnReason?: string | null;
|
|
645
|
+
document?: DocumentEntity | null;
|
|
646
|
+
documentId?: string | null;
|
|
647
|
+
createdAt: string;
|
|
648
|
+
updatedAt: string;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export interface IntakeSequenceEntity {
|
|
652
|
+
year: number;
|
|
653
|
+
next: number;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export interface WorkFolderEntity {
|
|
657
|
+
id: string;
|
|
658
|
+
name: string;
|
|
659
|
+
description?: string | null;
|
|
660
|
+
ownerEmployeeId: string;
|
|
661
|
+
ownerFullName: string;
|
|
662
|
+
caseFile?: CaseFileEntity | null;
|
|
663
|
+
caseFileId?: string | null;
|
|
664
|
+
participants?: WorkFolderParticipantEntity[];
|
|
665
|
+
items?: WorkFolderItemEntity[];
|
|
666
|
+
deleted: boolean;
|
|
667
|
+
createdAt: string;
|
|
668
|
+
updatedAt: string;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export interface WorkFolderParticipantEntity {
|
|
672
|
+
id: string;
|
|
673
|
+
employeeId: string;
|
|
674
|
+
fullName: string;
|
|
675
|
+
folder?: WorkFolderEntity;
|
|
676
|
+
folderId: string;
|
|
677
|
+
createdAt: string;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export interface WorkFolderItemEntity {
|
|
681
|
+
id: string;
|
|
682
|
+
kind: WorkFolderItemKind;
|
|
683
|
+
title: string;
|
|
684
|
+
document?: DocumentEntity | null;
|
|
685
|
+
documentId?: string | null;
|
|
686
|
+
fileId?: string | null;
|
|
687
|
+
fileName?: string | null;
|
|
688
|
+
addedByEmployeeId: string;
|
|
689
|
+
addedByFullName: string;
|
|
690
|
+
folder?: WorkFolderEntity;
|
|
691
|
+
folderId: string;
|
|
692
|
+
createdAt: string;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
type JsonValue = string | number | boolean | { [key in string]?: JsonValue } | Array<JsonValue> | null;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CaseFileActorRelation,
|
|
3
|
+
type CaseFileActorType,
|
|
4
|
+
type CaseFileActuationType,
|
|
5
|
+
type CaseFileEntity,
|
|
6
|
+
type CaseFileStatus,
|
|
7
|
+
type DocumentAccessLevel,
|
|
8
|
+
} from '../base/entities';
|
|
9
|
+
import {
|
|
10
|
+
type CaseFileAddBatchResponseEntity,
|
|
11
|
+
type CaseFileAddEntryResponseEntity,
|
|
12
|
+
type CaseFileCreateResponseEntity,
|
|
13
|
+
type CaseFileEntryFileResponseEntity,
|
|
14
|
+
type CaseFileExportResponseEntity,
|
|
15
|
+
type CaseFileGetAllResponseEntity,
|
|
16
|
+
type CaseFileGetByIdResponseEntity,
|
|
17
|
+
type CaseFileUpdateResponseEntity,
|
|
18
|
+
} from '../entities';
|
|
19
|
+
import { type RpcPage } from './contract';
|
|
20
|
+
import { type DocumentActor } from './document.contract';
|
|
21
|
+
|
|
22
|
+
/** Patrones NATS de `caseFile`: `<servicio>.<recurso>.<acción>`. */
|
|
23
|
+
export const CaseFilePatterns = {
|
|
24
|
+
getAll: 'gestorDocumental.caseFile.getAll',
|
|
25
|
+
getById: 'gestorDocumental.caseFile.getById',
|
|
26
|
+
create: 'gestorDocumental.caseFile.create',
|
|
27
|
+
update: 'gestorDocumental.caseFile.update',
|
|
28
|
+
addEntry: 'gestorDocumental.caseFile.addEntry',
|
|
29
|
+
addBatch: 'gestorDocumental.caseFile.addBatch',
|
|
30
|
+
voidEntry: 'gestorDocumental.caseFile.voidEntry',
|
|
31
|
+
share: 'gestorDocumental.caseFile.share',
|
|
32
|
+
unshare: 'gestorDocumental.caseFile.unshare',
|
|
33
|
+
close: 'gestorDocumental.caseFile.close',
|
|
34
|
+
getEntryFile: 'gestorDocumental.caseFile.getEntryFile',
|
|
35
|
+
getExport: 'gestorDocumental.caseFile.getExport',
|
|
36
|
+
} as const;
|
|
37
|
+
|
|
38
|
+
/** Persona u organización relacionada con el expediente (MGDEE54). */
|
|
39
|
+
export interface CaseFileActorInput {
|
|
40
|
+
relation: CaseFileActorRelation;
|
|
41
|
+
actorType: CaseFileActorType;
|
|
42
|
+
identifier?: string | null;
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Metadatos del expediente que se ingresan a mano. */
|
|
47
|
+
export interface CaseFileWritePayload {
|
|
48
|
+
title: string;
|
|
49
|
+
subject: string;
|
|
50
|
+
summary?: string | null;
|
|
51
|
+
procedureId: string;
|
|
52
|
+
accessLevel: DocumentAccessLevel;
|
|
53
|
+
hasSensitiveData: boolean;
|
|
54
|
+
actors?: CaseFileActorInput[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Actuación que se incorpora al índice: un documento del gestor, un archivo subido u otro expediente. */
|
|
58
|
+
export type CaseFileEntryInput =
|
|
59
|
+
| { kind: 'Document'; actuationType: CaseFileActuationType; documentId: string }
|
|
60
|
+
| {
|
|
61
|
+
kind: 'File';
|
|
62
|
+
actuationType: CaseFileActuationType;
|
|
63
|
+
fileId: string;
|
|
64
|
+
fileName: string;
|
|
65
|
+
title: string;
|
|
66
|
+
documentTypeName?: string | null;
|
|
67
|
+
originDate?: string | null;
|
|
68
|
+
author?: string | null;
|
|
69
|
+
keywords: string[];
|
|
70
|
+
accessLevel: DocumentAccessLevel;
|
|
71
|
+
hasSensitiveData: boolean;
|
|
72
|
+
}
|
|
73
|
+
| { kind: 'CaseFile'; actuationType: CaseFileActuationType; linkedCaseFileId: string };
|
|
74
|
+
|
|
75
|
+
/** Quién hace la operación (de la sesión) y si puede ver todos los expedientes. */
|
|
76
|
+
interface CaseFileActorPayload {
|
|
77
|
+
actor: DocumentActor;
|
|
78
|
+
viewAll?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Ámbito del listado: los expedientes del funcionario (responsable o compartidos con él) o todos. */
|
|
82
|
+
export type CaseFileScope = 'mine' | 'all';
|
|
83
|
+
|
|
84
|
+
export interface CaseFileContract {
|
|
85
|
+
[CaseFilePatterns.getAll]: {
|
|
86
|
+
payload: {
|
|
87
|
+
pagination?: { page?: number; limit?: number };
|
|
88
|
+
filters?: { search?: string; status?: CaseFileStatus; procedureId?: string; scope?: CaseFileScope };
|
|
89
|
+
} & CaseFileActorPayload;
|
|
90
|
+
response: RpcPage<CaseFileGetAllResponseEntity[]>;
|
|
91
|
+
};
|
|
92
|
+
/** Por id o por su identificador (`EXP-2026-00001`), que es el del enlace persistente. Queda en el registro de accesos. */
|
|
93
|
+
[CaseFilePatterns.getById]: {
|
|
94
|
+
payload: { id: string } & CaseFileActorPayload;
|
|
95
|
+
response: CaseFileGetByIdResponseEntity;
|
|
96
|
+
};
|
|
97
|
+
[CaseFilePatterns.create]: {
|
|
98
|
+
payload: CaseFileWritePayload & { actor: DocumentActor };
|
|
99
|
+
response: CaseFileCreateResponseEntity;
|
|
100
|
+
};
|
|
101
|
+
[CaseFilePatterns.update]: {
|
|
102
|
+
payload: CaseFileWritePayload & Pick<CaseFileEntity, 'id'> & { actor: DocumentActor };
|
|
103
|
+
response: CaseFileUpdateResponseEntity;
|
|
104
|
+
};
|
|
105
|
+
/** Incorpora los documentos finalizados de un lote de firma, en su orden; omite los que ya están en el expediente. */
|
|
106
|
+
[CaseFilePatterns.addBatch]: {
|
|
107
|
+
payload: { id: string; batchId: string; actuationType: CaseFileActuationType } & CaseFileActorPayload;
|
|
108
|
+
response: CaseFileAddBatchResponseEntity;
|
|
109
|
+
};
|
|
110
|
+
[CaseFilePatterns.addEntry]: {
|
|
111
|
+
payload: Pick<CaseFileEntity, 'id'> & { entry: CaseFileEntryInput } & CaseFileActorPayload;
|
|
112
|
+
response: CaseFileAddEntryResponseEntity;
|
|
113
|
+
};
|
|
114
|
+
/** Deja una actuación sin efecto, con su motivo. No se elimina del índice. */
|
|
115
|
+
[CaseFilePatterns.voidEntry]: {
|
|
116
|
+
payload: Pick<CaseFileEntity, 'id'> & { entryId: string; reason: string; actor: DocumentActor };
|
|
117
|
+
response: CaseFileUpdateResponseEntity;
|
|
118
|
+
};
|
|
119
|
+
[CaseFilePatterns.share]: {
|
|
120
|
+
payload: Pick<CaseFileEntity, 'id'> & { employeeIds: string[]; actor: DocumentActor };
|
|
121
|
+
response: CaseFileUpdateResponseEntity;
|
|
122
|
+
};
|
|
123
|
+
[CaseFilePatterns.unshare]: {
|
|
124
|
+
payload: Pick<CaseFileEntity, 'id'> & { participantId: string; actor: DocumentActor };
|
|
125
|
+
response: CaseFileUpdateResponseEntity;
|
|
126
|
+
};
|
|
127
|
+
[CaseFilePatterns.close]: {
|
|
128
|
+
payload: Pick<CaseFileEntity, 'id'> & { note?: string | null; actor: DocumentActor };
|
|
129
|
+
response: CaseFileUpdateResponseEntity;
|
|
130
|
+
};
|
|
131
|
+
/** Archivo de una actuación del índice. Queda en el registro de accesos. */
|
|
132
|
+
[CaseFilePatterns.getEntryFile]: {
|
|
133
|
+
payload: Pick<CaseFileEntity, 'id'> & { entryId: string } & CaseFileActorPayload;
|
|
134
|
+
response: CaseFileEntryFileResponseEntity;
|
|
135
|
+
};
|
|
136
|
+
/** Metadatos y archivos para exportar el expediente completo. Queda en la trazabilidad y en el registro de accesos. */
|
|
137
|
+
[CaseFilePatterns.getExport]: {
|
|
138
|
+
payload: Pick<CaseFileEntity, 'id'> & CaseFileActorPayload;
|
|
139
|
+
response: CaseFileExportResponseEntity;
|
|
140
|
+
};
|
|
141
|
+
}
|