@muni-sanfer/types-gestor-documental 0.0.1-beta.42 → 0.0.1-beta.44

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.
@@ -450,6 +450,7 @@ export interface DocumentTypeEntity {
450
450
  annulledNumbers?: DocumentAnnulledNumberEntity[];
451
451
  flowSteps?: DocumentTypeFlowStepEntity[];
452
452
  signatureBatches?: SignatureBatchEntity[];
453
+ template?: DocumentTemplateEntity | null;
453
454
  deleted: boolean;
454
455
  createdAt: string;
455
456
  updatedAt: string;
@@ -457,6 +458,7 @@ export interface DocumentTypeEntity {
457
458
  export interface DocumentEntity {
458
459
  id: string;
459
460
  subject: string;
461
+ description?: string | null;
460
462
  keywords: string[];
461
463
  accessLevel: DocumentAccessLevel;
462
464
  hasSensitiveData: boolean;
@@ -470,6 +472,9 @@ export interface DocumentEntity {
470
472
  annulledAt?: string | null;
471
473
  annulmentReason?: string | null;
472
474
  responseDueAt?: string | null;
475
+ responseDueBusinessDays?: number | null;
476
+ procedure?: ProcedureEntity | null;
477
+ procedureId?: string | null;
473
478
  origin: DocumentOrigin;
474
479
  intakeNumber?: number | null;
475
480
  intakeYear?: number | null;
@@ -652,6 +657,7 @@ export interface ProcedureEntity {
652
657
  description?: string | null;
653
658
  enabled: boolean;
654
659
  caseFiles?: CaseFileEntity[];
660
+ documents?: DocumentEntity[];
655
661
  deleted: boolean;
656
662
  createdAt: string;
657
663
  updatedAt: string;
@@ -927,6 +933,8 @@ export interface DocumentTemplateEntity {
927
933
  name: string;
928
934
  description?: string | null;
929
935
  documentTypeIds: string[];
936
+ documentType?: DocumentTypeEntity | null;
937
+ documentTypeId?: string | null;
930
938
  content: JsonValue;
931
939
  version: number;
932
940
  enabled: boolean;
@@ -78,6 +78,10 @@ export type DocumentReviewAction = 'Visa' | 'Sign' | 'Reject';
78
78
  */
79
79
  export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | 'documentTypeId'> {
80
80
  keywords: string[];
81
+ /** Resumen breve (hasta 250 caracteres): va a DocDigital como «descripcion» al despacharlo. */
82
+ description?: string | null;
83
+ /** Procedimiento administrativo del catálogo propio. */
84
+ procedureId?: string | null;
81
85
  /** Qué cambió, si el guardado crea una versión nueva (otro PDF, otro texto u otro asunto). */
82
86
  versionNote?: string | null;
83
87
  /** Al crearlo: solicitud de redacción que atiende (la tomó quien redacta). */
@@ -99,6 +103,7 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
99
103
  signatureSheet?: boolean;
100
104
  recipients?: DocumentRecipientInput[];
101
105
  responseDueAt?: string | null;
106
+ responseDueBusinessDays?: number | null;
102
107
  replyToDocumentId?: string | null;
103
108
  externalRecipients?: DocumentExternalRecipientInput[];
104
109
  restrictionEndsAt?: string | null;
@@ -1,5 +1,5 @@
1
1
  import { type DocumentCategory, type DocumentParticipantRole, type DocumentTypeEntity } from '../base/entities';
2
- import { type DocumentTypeCreateResponseEntity, type DocumentTypeGetAllResponseEntity, type DocumentTypeGetByIdResponseEntity, type DocumentTypeUpdateResponseEntity } from '../entities';
2
+ import { type DocumentTemplateContent, type DocumentTypeCreateResponseEntity, type DocumentTypeGetAllResponseEntity, type DocumentTypeGetByIdResponseEntity, type DocumentTypeUpdateResponseEntity } from '../entities';
3
3
  import { type RpcPage } from './contract';
4
4
  /** Patrones NATS de `documentType`: `<servicio>.<recurso>.<acción>`. */
5
5
  export declare const DocumentTypePatterns: {
@@ -46,6 +46,7 @@ export interface DocumentTypeWritePayload {
46
46
  sharesNumberingWithId?: string | null;
47
47
  enabled?: boolean;
48
48
  flowSteps?: DocumentFlowStepInput[];
49
+ template?: DocumentTemplateContent | null;
49
50
  }
50
51
  /**
51
52
  * Qué se envía y qué se responde en cada patrón. Generado desde los handlers y los DTO del microservicio.
@@ -138,6 +138,14 @@ export interface DocumentGetByIdResponseEntity {
138
138
  } | null;
139
139
  restrictionEndsAt: string | null;
140
140
  subject: DocumentEntity['subject'];
141
+ /** Resumen breve; va a DocDigital como «descripcion» al despacharlo. */
142
+ description: string | null;
143
+ /** Procedimiento administrativo al que corresponde. */
144
+ procedure: {
145
+ id: string;
146
+ name: string;
147
+ cpatCode: string | null;
148
+ } | null;
141
149
  keywords: DocumentEntity['keywords'];
142
150
  accessLevel: DocumentEntity['accessLevel'];
143
151
  hasSensitiveData: DocumentEntity['hasSensitiveData'];
@@ -173,6 +181,7 @@ export interface DocumentGetByIdResponseEntity {
173
181
  createdAt: DocumentAnnulledNumberEntity['createdAt'];
174
182
  }[];
175
183
  responseDueAt: DocumentEntity['responseDueAt'];
184
+ responseDueBusinessDays: number | null;
176
185
  recipients: DocumentRecipientResponseEntity[];
177
186
  deliveries: DocumentDeliveryResponseEntity[];
178
187
  replyTo: DocumentLinkEntity | null;
@@ -43,6 +43,8 @@ export interface DocumentTemplateAvailableResponseEntity {
43
43
  description: string | null;
44
44
  version: DocumentTemplateEntity['version'];
45
45
  content: DocumentTemplateContent;
46
+ /** Es la plantilla del tipo documental pedido: se aplica sola al redactar. */
47
+ ownedByType: boolean;
46
48
  }
47
49
  export interface DocumentTemplateCreateResponseEntity {
48
50
  id: DocumentTemplateEntity['id'];
@@ -1,4 +1,5 @@
1
1
  import { DocumentTypeEntity, DocumentTypeFlowStepEntity } from '../../base/entities';
2
+ import { type DocumentTemplateContent } from '../documentTemplate/documentTemplate.entity';
2
3
  /** Paso del flujo sugerido de un tipo documental: quién visa o firma, en su orden. */
3
4
  export interface DocumentTypeFlowStepResponseEntity {
4
5
  id: DocumentTypeFlowStepEntity['id'];
@@ -50,10 +51,18 @@ export interface DocumentTypeGetAllResponseEntity {
50
51
  visa: number;
51
52
  signature: number;
52
53
  };
54
+ hasTemplate: boolean;
55
+ }
56
+ /** Plantilla propia de un tipo documental: la versión vigente de su contenido. */
57
+ export interface DocumentTypeTemplateResponseEntity {
58
+ id: string;
59
+ version: number;
60
+ content: DocumentTemplateContent;
53
61
  }
54
62
  export interface DocumentTypeGetByIdResponseEntity extends DocumentTypeGetAllResponseEntity {
55
63
  lastCorrelative: number | null;
56
64
  flowSteps: DocumentTypeFlowStepResponseEntity[];
65
+ template: DocumentTypeTemplateResponseEntity | null;
57
66
  }
58
67
  export interface DocumentTypeCreateResponseEntity {
59
68
  id: DocumentTypeEntity['id'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.42",
3
+ "version": "0.0.1-beta.44",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -654,6 +654,7 @@ export interface DocumentTypeEntity {
654
654
  annulledNumbers?: DocumentAnnulledNumberEntity[];
655
655
  flowSteps?: DocumentTypeFlowStepEntity[];
656
656
  signatureBatches?: SignatureBatchEntity[];
657
+ template?: DocumentTemplateEntity | null;
657
658
  deleted: boolean;
658
659
  createdAt: string;
659
660
  updatedAt: string;
@@ -662,6 +663,7 @@ export interface DocumentTypeEntity {
662
663
  export interface DocumentEntity {
663
664
  id: string;
664
665
  subject: string;
666
+ description?: string | null;
665
667
  keywords: string[];
666
668
  accessLevel: DocumentAccessLevel;
667
669
  hasSensitiveData: boolean;
@@ -675,6 +677,9 @@ export interface DocumentEntity {
675
677
  annulledAt?: string | null;
676
678
  annulmentReason?: string | null;
677
679
  responseDueAt?: string | null;
680
+ responseDueBusinessDays?: number | null;
681
+ procedure?: ProcedureEntity | null;
682
+ procedureId?: string | null;
678
683
  origin: DocumentOrigin;
679
684
  intakeNumber?: number | null;
680
685
  intakeYear?: number | null;
@@ -866,6 +871,7 @@ export interface ProcedureEntity {
866
871
  description?: string | null;
867
872
  enabled: boolean;
868
873
  caseFiles?: CaseFileEntity[];
874
+ documents?: DocumentEntity[];
869
875
  deleted: boolean;
870
876
  createdAt: string;
871
877
  updatedAt: string;
@@ -1158,6 +1164,8 @@ export interface DocumentTemplateEntity {
1158
1164
  name: string;
1159
1165
  description?: string | null;
1160
1166
  documentTypeIds: string[];
1167
+ documentType?: DocumentTypeEntity | null;
1168
+ documentTypeId?: string | null;
1161
1169
  content: JsonValue;
1162
1170
  version: number;
1163
1171
  enabled: boolean;
@@ -118,6 +118,10 @@ export type DocumentReviewAction = 'Visa' | 'Sign' | 'Reject';
118
118
  */
119
119
  export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | 'documentTypeId'> {
120
120
  keywords: string[];
121
+ /** Resumen breve (hasta 250 caracteres): va a DocDigital como «descripcion» al despacharlo. */
122
+ description?: string | null;
123
+ /** Procedimiento administrativo del catálogo propio. */
124
+ procedureId?: string | null;
121
125
  /** Qué cambió, si el guardado crea una versión nueva (otro PDF, otro texto u otro asunto). */
122
126
  versionNote?: string | null;
123
127
  /** Al crearlo: solicitud de redacción que atiende (la tomó quien redacta). */
@@ -142,8 +146,9 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
142
146
  signatureSheet?: boolean;
143
147
  // A quién va dirigido: le llega a su bandeja cuando el documento termina su tramitación.
144
148
  recipients?: DocumentRecipientInput[];
145
- // Plazo en que se espera respuesta de los destinatarios (ISO 8601).
149
+ // Plazo en que se espera respuesta de los destinatarios (ISO 8601), o en días hábiles desde que lo reciben (uno u otro).
146
150
  responseDueAt?: string | null;
151
+ responseDueBusinessDays?: number | null;
147
152
  // Documento al que este responde.
148
153
  replyToDocumentId?: string | null;
149
154
  // Instituciones (y usuarios) de DocDigital a quienes va: al terminar la firma pasa a Oficina de Partes.
@@ -1,5 +1,6 @@
1
1
  import { type DocumentCategory, type DocumentParticipantRole, type DocumentTypeEntity } from '../base/entities';
2
2
  import {
3
+ type DocumentTemplateContent,
3
4
  type DocumentTypeCreateResponseEntity,
4
5
  type DocumentTypeGetAllResponseEntity,
5
6
  type DocumentTypeGetByIdResponseEntity,
@@ -57,6 +58,8 @@ export interface DocumentTypeWritePayload {
57
58
  enabled?: boolean;
58
59
  // Flujo sugerido, en el orden en que les toca dentro de cada rol. Al editar, si no viene, el flujo no cambia.
59
60
  flowSteps?: DocumentFlowStepInput[];
61
+ // Plantilla propia del tipo: se aplica sola al redactar. `null` la quita; al editar, si no viene, no cambia.
62
+ template?: DocumentTemplateContent | null;
60
63
  }
61
64
 
62
65
  /**
@@ -162,6 +162,10 @@ export interface DocumentGetByIdResponseEntity {
162
162
  // Fin de la restricción de acceso: desde entonces se consulta como público si no tiene datos sensibles.
163
163
  restrictionEndsAt: string | null;
164
164
  subject: DocumentEntity['subject'];
165
+ /** Resumen breve; va a DocDigital como «descripcion» al despacharlo. */
166
+ description: string | null;
167
+ /** Procedimiento administrativo al que corresponde. */
168
+ procedure: { id: string; name: string; cpatCode: string | null } | null;
165
169
  keywords: DocumentEntity['keywords'];
166
170
  accessLevel: DocumentEntity['accessLevel'];
167
171
  hasSensitiveData: DocumentEntity['hasSensitiveData'];
@@ -202,8 +206,10 @@ export interface DocumentGetByIdResponseEntity {
202
206
  employeeFullName: DocumentAnnulledNumberEntity['employeeFullName'];
203
207
  createdAt: DocumentAnnulledNumberEntity['createdAt'];
204
208
  }[];
205
- // Plazo en que el redactor espera respuesta de los destinatarios.
209
+ // Plazo en que el redactor espera respuesta de los destinatarios: una fecha o, mientras no se finaliza, N días
210
+ // hábiles desde que lo reciban (al finalizar queda la fecha en `responseDueAt`).
206
211
  responseDueAt: DocumentEntity['responseDueAt'];
212
+ responseDueBusinessDays: number | null;
207
213
  // A quién va dirigido, como lo indicó el redactor (personas y áreas).
208
214
  recipients: DocumentRecipientResponseEntity[];
209
215
  // En la bandeja de quién está: destinatarios y derivaciones, con su lectura y atención.
@@ -48,6 +48,8 @@ export interface DocumentTemplateAvailableResponseEntity {
48
48
  description: string | null;
49
49
  version: DocumentTemplateEntity['version'];
50
50
  content: DocumentTemplateContent;
51
+ /** Es la plantilla del tipo documental pedido: se aplica sola al redactar. */
52
+ ownedByType: boolean;
51
53
  }
52
54
 
53
55
  export interface DocumentTemplateCreateResponseEntity {
@@ -1,4 +1,5 @@
1
1
  import { DocumentTypeEntity, DocumentTypeFlowStepEntity } from '../../base/entities';
2
+ import { type DocumentTemplateContent } from '../documentTemplate/documentTemplate.entity';
2
3
 
3
4
  /** Paso del flujo sugerido de un tipo documental: quién visa o firma, en su orden. */
4
5
  export interface DocumentTypeFlowStepResponseEntity {
@@ -45,6 +46,15 @@ export interface DocumentTypeGetAllResponseEntity {
45
46
  enabled: DocumentTypeEntity['enabled'];
46
47
  // Cuántos visadores y firmantes tiene su flujo sugerido.
47
48
  flow: { visa: number; signature: number };
49
+ // Tiene plantilla propia: se aplica sola al redactar.
50
+ hasTemplate: boolean;
51
+ }
52
+
53
+ /** Plantilla propia de un tipo documental: la versión vigente de su contenido. */
54
+ export interface DocumentTypeTemplateResponseEntity {
55
+ id: string;
56
+ version: number;
57
+ content: DocumentTemplateContent;
48
58
  }
49
59
 
50
60
  export interface DocumentTypeGetByIdResponseEntity extends DocumentTypeGetAllResponseEntity {
@@ -53,6 +63,8 @@ export interface DocumentTypeGetByIdResponseEntity extends DocumentTypeGetAllRes
53
63
  lastCorrelative: number | null;
54
64
  // Flujo sugerido: primero los visadores y después los firmantes, cada grupo en su orden.
55
65
  flowSteps: DocumentTypeFlowStepResponseEntity[];
66
+ // Plantilla propia del tipo (sin valor: no la tiene).
67
+ template: DocumentTypeTemplateResponseEntity | null;
56
68
  }
57
69
 
58
70
  export interface DocumentTypeCreateResponseEntity {