@muni-sanfer/types-gestor-documental 0.0.1-beta.61 → 0.0.1-beta.63

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.
@@ -463,8 +463,10 @@ export interface DocumentTypeEntity {
463
463
  resetsYearly: boolean;
464
464
  numbered: boolean;
465
465
  numberingScope: DocumentNumberingScope;
466
- allowsExternalNumber: boolean;
467
466
  usesPartsOffice: boolean;
467
+ processingSlaDays?: number | null;
468
+ turnSlaDays?: number | null;
469
+ reviewSlaDays?: number | null;
468
470
  visaMode: DocumentVisaMode;
469
471
  activeTransparency: boolean;
470
472
  transparencySection?: string | null;
@@ -503,8 +505,6 @@ export interface DocumentEntity {
503
505
  correlative?: number | null;
504
506
  correlativeYear?: number | null;
505
507
  numberedAt?: string | null;
506
- externalCorrelative?: number | null;
507
- externalCorrelativeYear?: number | null;
508
508
  verificationCode?: string | null;
509
509
  signatureSheet: boolean;
510
510
  annulledAt?: string | null;
@@ -543,6 +543,7 @@ export interface DocumentEntity {
543
543
  currentFileUrl?: string | null;
544
544
  fileFormat?: string | null;
545
545
  submittedAt?: string | null;
546
+ processingOverdueRemindedAt?: string | null;
546
547
  finishedAt?: string | null;
547
548
  documentType?: DocumentTypeEntity;
548
549
  documentTypeId: string;
@@ -606,6 +607,8 @@ export interface DocumentParticipantEntity {
606
607
  observation?: string | null;
607
608
  resolvedAt?: string | null;
608
609
  initials?: string | null;
610
+ currentSince?: string | null;
611
+ overdueRemindedAt?: string | null;
609
612
  document?: DocumentEntity;
610
613
  documentId: string;
611
614
  createdAt: string;
@@ -697,9 +700,11 @@ export interface DocumentTypeVersionEntity {
697
700
  description?: string | null;
698
701
  numbered: boolean;
699
702
  numberingScope: DocumentNumberingScope;
700
- allowsExternalNumber: boolean;
701
703
  usesPartsOffice: boolean;
702
704
  visaMode: DocumentVisaMode;
705
+ processingSlaDays?: number | null;
706
+ turnSlaDays?: number | null;
707
+ reviewSlaDays?: number | null;
703
708
  activeTransparency: boolean;
704
709
  transparencySection?: string | null;
705
710
  directorateCodeReference?: number | null;
@@ -1060,6 +1065,7 @@ export interface DocumentDraftReviewEntity {
1060
1065
  status: DraftReviewStatus;
1061
1066
  observation?: string | null;
1062
1067
  resolvedAt?: string | null;
1068
+ overdueRemindedAt?: string | null;
1063
1069
  }
1064
1070
  export interface DocumentTemplateVersionEntity {
1065
1071
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { type DocumentAccessAction, type DocumentAccessLevel, type DocumentAttachmentEntity, type DocumentDeliveryEntity, type DocumentEntity, type DocumentInstruction, type DocumentParticipantEntity, type DocumentStatus } from '../base/entities';
2
- import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentEmailCopyIssuedEntity, type DocumentEmailCopyViewEntity, type DocumentReminderEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentComposeResponseEntity, type DocumentComposition, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity, type DocumentCommentResponseEntity, type DocumentCommentsResponseEntity, type DocumentVersionResponseEntity, type DocumentDraftCorrectionResponseEntity, type DocumentStampPlacements, type DocumentDraftReviewResponseEntity } from '../entities';
2
+ import { type DocumentAnnulResponseEntity, type DocumentCloseDeliveryResponseEntity, type DocumentCreateResponseEntity, type DocumentDeriveResponseEntity, type DocumentDiscardResponseEntity, type DocumentEmailCopyIssuedEntity, type DocumentEmailCopyViewEntity, type DocumentReminderEntity, type DocumentSlaReminderEntity, type DocumentGetAllResponseEntity, type DocumentGetByIdResponseEntity, type DocumentGetSummaryResponseEntity, type DocumentInboxItemEntity, type DocumentPublicFileResponseEntity, type DocumentReassignResponseEntity, type DocumentReviewResponseEntity, type DocumentSignManyResponseEntity, type DocumentAgendaResponseEntity, type DocumentComposeResponseEntity, type DocumentComposition, type DocumentTrailExportEntity, type DocumentUpdateResponseEntity, type DocumentVerifyResponseEntity, type DocumentCommentResponseEntity, type DocumentCommentsResponseEntity, type DocumentVersionResponseEntity, type DocumentDraftCorrectionResponseEntity, type DocumentStampPlacements, type DocumentDraftReviewResponseEntity } from '../entities';
3
3
  import { type RpcPage } from './contract';
4
4
  /** Patrones NATS de `document`: `<servicio>.<recurso>.<acción>`. */
5
5
  export declare const DocumentPatterns: {
@@ -34,6 +34,7 @@ export declare const DocumentPatterns: {
34
34
  readonly getEmailCopy: "gestorDocumental.document.getEmailCopy";
35
35
  readonly getEmailCopyFile: "gestorDocumental.document.getEmailCopyFile";
36
36
  readonly claimReminders: "gestorDocumental.document.claimReminders";
37
+ readonly claimSlaReminders: "gestorDocumental.document.claimSlaReminders";
37
38
  };
38
39
  /**
39
40
  * Funcionario que hace la operación y sus áreas (direcciones y departamentos a los que pertenece o que dirige). Lo
@@ -96,8 +97,6 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
96
97
  stampPlacements?: DocumentStampPlacements | null;
97
98
  selfValidated?: boolean;
98
99
  selfValidationNote?: string | null;
99
- externalCorrelative?: number | null;
100
- externalCorrelativeYear?: number | null;
101
100
  file: {
102
101
  fileId: string;
103
102
  name: string;
@@ -455,6 +454,11 @@ export interface DocumentContract {
455
454
  payload: Record<string, never>;
456
455
  response: DocumentReminderEntity[];
457
456
  };
457
+ /** Plazos de servicio vencidos que aún no se avisan: se marcan al entregarlos, así cada uno sale una vez. */
458
+ [DocumentPatterns.claimSlaReminders]: {
459
+ payload: Record<string, never>;
460
+ response: DocumentSlaReminderEntity[];
461
+ };
458
462
  [DocumentPatterns.getEmailCopyFile]: {
459
463
  payload: {
460
464
  token: string;
@@ -34,4 +34,5 @@ exports.DocumentPatterns = {
34
34
  getEmailCopy: 'gestorDocumental.document.getEmailCopy',
35
35
  getEmailCopyFile: 'gestorDocumental.document.getEmailCopyFile',
36
36
  claimReminders: 'gestorDocumental.document.claimReminders',
37
+ claimSlaReminders: 'gestorDocumental.document.claimSlaReminders',
37
38
  };
@@ -38,8 +38,10 @@ export interface DocumentTypeWritePayload {
38
38
  resetsYearly?: boolean;
39
39
  numbered?: boolean;
40
40
  numberingScope?: DocumentNumberingScope;
41
- allowsExternalNumber?: boolean;
42
41
  usesPartsOffice?: boolean;
42
+ processingSlaDays?: number | null;
43
+ turnSlaDays?: number | null;
44
+ reviewSlaDays?: number | null;
43
45
  /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
44
46
  activeTransparency?: boolean;
45
47
  transparencySection?: string | null;
@@ -100,6 +100,7 @@ export declare const GestorDocumentalPatterns: {
100
100
  readonly getEmailCopy: "gestorDocumental.document.getEmailCopy";
101
101
  readonly getEmailCopyFile: "gestorDocumental.document.getEmailCopyFile";
102
102
  readonly claimReminders: "gestorDocumental.document.claimReminders";
103
+ readonly claimSlaReminders: "gestorDocumental.document.claimSlaReminders";
103
104
  };
104
105
  readonly procedure: {
105
106
  readonly getAll: "gestorDocumental.procedure.getAll";
@@ -323,6 +324,7 @@ export declare const GestorDocumentalPatterns: {
323
324
  readonly visaInitials: {
324
325
  readonly get: "gestorDocumental.visaInitials.get";
325
326
  readonly update: "gestorDocumental.visaInitials.update";
327
+ readonly lookup: "gestorDocumental.visaInitials.lookup";
326
328
  };
327
329
  };
328
330
  /** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
@@ -1,4 +1,4 @@
1
- import { type VisaInitialsResponseEntity } from '../entities';
1
+ import { type VisaInitialsLookupEntity, type VisaInitialsResponseEntity } from '../entities';
2
2
  import { type DocumentActor } from './document.contract';
3
3
  /**
4
4
  * Patrones NATS de `visaInitials`: las iniciales con que visa quien tiene la sesión. Salen de su nombre y las puede
@@ -7,6 +7,7 @@ import { type DocumentActor } from './document.contract';
7
7
  export declare const VisaInitialsPatterns: {
8
8
  readonly get: "gestorDocumental.visaInitials.get";
9
9
  readonly update: "gestorDocumental.visaInitials.update";
10
+ readonly lookup: "gestorDocumental.visaInitials.lookup";
10
11
  };
11
12
  export interface VisaInitialsContract {
12
13
  [VisaInitialsPatterns.get]: {
@@ -25,4 +26,14 @@ export interface VisaInitialsContract {
25
26
  };
26
27
  response: VisaInitialsResponseEntity;
27
28
  };
29
+ /** Las iniciales con que visarían ahora unos funcionarios (las propias o las de su nombre), para la vista previa. */
30
+ [VisaInitialsPatterns.lookup]: {
31
+ payload: {
32
+ people: {
33
+ employeeId: string;
34
+ fullName: string;
35
+ }[];
36
+ };
37
+ response: VisaInitialsLookupEntity[];
38
+ };
28
39
  }
@@ -8,4 +8,5 @@ exports.VisaInitialsPatterns = void 0;
8
8
  exports.VisaInitialsPatterns = {
9
9
  get: 'gestorDocumental.visaInitials.get',
10
10
  update: 'gestorDocumental.visaInitials.update',
11
+ lookup: 'gestorDocumental.visaInitials.lookup',
11
12
  };
@@ -21,6 +21,21 @@ export interface DocumentParticipantResponseEntity {
21
21
  position: DocumentParticipantEntity['position'];
22
22
  observation: DocumentParticipantEntity['observation'];
23
23
  resolvedAt: DocumentParticipantEntity['resolvedAt'];
24
+ /** Plazo del turno vigente, si el tipo tiene plazo por turno (si no le toca, `null`). */
25
+ deadline?: DocumentDeadlineEntity | null;
26
+ }
27
+ /**
28
+ * Plazo de servicio (SLA) que corre, en días hábiles: cuándo vence y su semáforo (por vencer con 2 días hábiles o
29
+ * menos). Lo calcula el servicio con los feriados.
30
+ */
31
+ export interface DocumentDeadlineEntity {
32
+ /** Días hábiles del plazo, como los fija el tipo documental. */
33
+ days: number;
34
+ startedAt: string;
35
+ dueAt: string;
36
+ dueStatus: 'OnTime' | 'DueSoon' | 'Overdue';
37
+ /** Días hábiles que quedan, sin contar hoy (vencido: `null`). */
38
+ businessDaysLeft: number | null;
24
39
  }
25
40
  /** Destinatario de un documento, como lo eligió el redactor: una persona o un área completa. */
26
41
  export interface DocumentRecipientResponseEntity {
@@ -118,6 +133,9 @@ export interface DocumentGetAllResponseEntity {
118
133
  total: number;
119
134
  read: number;
120
135
  } | null;
136
+ turnDeadline?: DocumentDeadlineEntity | null;
137
+ processingDeadline?: DocumentDeadlineEntity | null;
138
+ reviewDeadline?: DocumentDeadlineEntity | null;
121
139
  }
122
140
  /** Una entrada de la bandeja de recibidos: la entrega y el documento al que corresponde. */
123
141
  /** Semáforo de un plazo pendiente: a tiempo, por vencer (2 días hábiles o menos) o vencido. */
@@ -169,8 +187,6 @@ export interface DocumentGetByIdResponseEntity {
169
187
  correlative: DocumentEntity['correlative'];
170
188
  correlativeYear: DocumentEntity['correlativeYear'];
171
189
  numberedAt: DocumentEntity['numberedAt'];
172
- externalCorrelative: DocumentEntity['externalCorrelative'];
173
- externalCorrelativeYear: DocumentEntity['externalCorrelativeYear'];
174
190
  directorateCodeReference: DocumentEntity['directorateCodeReference'];
175
191
  departmentId: DocumentEntity['departmentId'];
176
192
  responsibleArea: DocumentResponsibleAreaEntity | null;
@@ -245,6 +261,8 @@ export interface DocumentGetByIdResponseEntity {
245
261
  /** Cómo se visa: con el sello del sistema o con la firma electrónica desatendida de cada visador (sin OTP). */
246
262
  visaMode: DocumentTypeEntity['visaMode'];
247
263
  participants: DocumentParticipantResponseEntity[];
264
+ /** Plazo de la tramitación completa mientras está en tramitación, si el tipo lo tiene. */
265
+ processingDeadline?: DocumentDeadlineEntity | null;
248
266
  attachments: {
249
267
  id: DocumentAttachmentEntity['id'];
250
268
  name: DocumentAttachmentEntity['name'];
@@ -629,6 +647,27 @@ export interface DocumentEmailCopyViewEntity {
629
647
  signedAt: string | null;
630
648
  }[];
631
649
  }
650
+ /**
651
+ * Plazo de servicio vencido de un documento (sale una sola vez): el de un turno (a quien lo tiene), el de la
652
+ * tramitación completa (a quienes tienen el turno vigente) o el de una revisión del borrador o del oficial (a quien
653
+ * revisa). El gateway avisa por correo y push a cada uno y a la jefatura de su dirección.
654
+ */
655
+ export interface DocumentSlaReminderEntity {
656
+ /** Único por aviso: sirve de etiqueta del push. */
657
+ key: string;
658
+ kind: 'Turn' | 'Processing' | 'Review';
659
+ documentId: string;
660
+ /** Cómo se cita: «D.E. N° 590/2026» o el tipo. */
661
+ folio: string;
662
+ subject: string;
663
+ /** Días hábiles del plazo y cuándo venció. */
664
+ days: number;
665
+ dueAt: string;
666
+ employees: {
667
+ employeeId: string;
668
+ fullName: string;
669
+ }[];
670
+ }
632
671
  /** Recordatorio de un plazo: al recibido y, si venció, también a su jefatura (la resuelve el gateway). */
633
672
  export interface DocumentReminderEntity {
634
673
  deliveryId: string;
@@ -706,6 +745,8 @@ export interface DocumentDraftReviewRoundEntity {
706
745
  status: 'Pending' | 'Approved' | 'Rejected' | 'Cancelled';
707
746
  observation: string | null;
708
747
  resolvedAt: string | null;
748
+ /** Plazo de la ronda pendiente, si el tipo tiene plazo de revisión. */
749
+ deadline?: DocumentDeadlineEntity | null;
709
750
  }
710
751
  /** La revisión del borrador que exige el tipo documental. */
711
752
  export interface DocumentDraftReviewInfoEntity {
@@ -10,12 +10,13 @@ export interface StampBox {
10
10
  height: number;
11
11
  }
12
12
  /**
13
- * Dónde van las visaciones y las firmas de un documento, en el orden de sus turnos. Sin ellas (`null`), el sistema las
14
- * ubica solo: al pie de la última página o en una hoja de firmas.
13
+ * Dónde van las visaciones y las firmas de un documento, en el orden de sus turnos. Cada clase se ubica por su lado: la
14
+ * que viene en `null` la ubica el sistema, al pie de la última página. Sin ninguna (todo el objeto `null`), el sistema
15
+ * las ubica todas, al pie o en una hoja de firmas.
15
16
  */
16
17
  export interface DocumentStampPlacements {
17
- visas: StampBox[];
18
- signatures: StampBox[];
18
+ visas: StampBox[] | null;
19
+ signatures: StampBox[] | null;
19
20
  }
20
21
  /**
21
22
  * Tamaños que admite cada sello, en puntos. La firma conserva la proporción de la imagen que dibuja FirmaGob (su alto
@@ -23,8 +23,10 @@ export interface DocumentTypeGetAllResponseEntity {
23
23
  resetsYearly: DocumentTypeEntity['resetsYearly'];
24
24
  numbered: DocumentTypeEntity['numbered'];
25
25
  numberingScope: DocumentTypeEntity['numberingScope'];
26
- allowsExternalNumber: DocumentTypeEntity['allowsExternalNumber'];
27
26
  usesPartsOffice: DocumentTypeEntity['usesPartsOffice'];
27
+ processingSlaDays: DocumentTypeEntity['processingSlaDays'];
28
+ turnSlaDays: DocumentTypeEntity['turnSlaDays'];
29
+ reviewSlaDays: DocumentTypeEntity['reviewSlaDays'];
28
30
  visaMode: DocumentTypeEntity['visaMode'];
29
31
  /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
30
32
  activeTransparency: DocumentTypeEntity['activeTransparency'];
@@ -7,6 +7,11 @@ export interface VisaInitialsResponseEntity {
7
7
  /** Las cambió él: no son las de su nombre. */
8
8
  custom: boolean;
9
9
  }
10
+ /** Las iniciales con que visa un funcionario. */
11
+ export interface VisaInitialsLookupEntity {
12
+ employeeId: string;
13
+ initials: string;
14
+ }
10
15
  /** Límites de las iniciales propias: solo letras, en mayúscula. */
11
16
  export declare const VISA_INITIALS_LIMITS: {
12
17
  readonly maxLength: 6;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muni-sanfer/types-gestor-documental",
3
- "version": "0.0.1-beta.61",
3
+ "version": "0.0.1-beta.63",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -688,8 +688,10 @@ export interface DocumentTypeEntity {
688
688
  resetsYearly: boolean;
689
689
  numbered: boolean;
690
690
  numberingScope: DocumentNumberingScope;
691
- allowsExternalNumber: boolean;
692
691
  usesPartsOffice: boolean;
692
+ processingSlaDays?: number | null;
693
+ turnSlaDays?: number | null;
694
+ reviewSlaDays?: number | null;
693
695
  visaMode: DocumentVisaMode;
694
696
  activeTransparency: boolean;
695
697
  transparencySection?: string | null;
@@ -729,8 +731,6 @@ export interface DocumentEntity {
729
731
  correlative?: number | null;
730
732
  correlativeYear?: number | null;
731
733
  numberedAt?: string | null;
732
- externalCorrelative?: number | null;
733
- externalCorrelativeYear?: number | null;
734
734
  verificationCode?: string | null;
735
735
  signatureSheet: boolean;
736
736
  annulledAt?: string | null;
@@ -769,6 +769,7 @@ export interface DocumentEntity {
769
769
  currentFileUrl?: string | null;
770
770
  fileFormat?: string | null;
771
771
  submittedAt?: string | null;
772
+ processingOverdueRemindedAt?: string | null;
772
773
  finishedAt?: string | null;
773
774
  documentType?: DocumentTypeEntity;
774
775
  documentTypeId: string;
@@ -834,6 +835,8 @@ export interface DocumentParticipantEntity {
834
835
  observation?: string | null;
835
836
  resolvedAt?: string | null;
836
837
  initials?: string | null;
838
+ currentSince?: string | null;
839
+ overdueRemindedAt?: string | null;
837
840
  document?: DocumentEntity;
838
841
  documentId: string;
839
842
  createdAt: string;
@@ -932,9 +935,11 @@ export interface DocumentTypeVersionEntity {
932
935
  description?: string | null;
933
936
  numbered: boolean;
934
937
  numberingScope: DocumentNumberingScope;
935
- allowsExternalNumber: boolean;
936
938
  usesPartsOffice: boolean;
937
939
  visaMode: DocumentVisaMode;
940
+ processingSlaDays?: number | null;
941
+ turnSlaDays?: number | null;
942
+ reviewSlaDays?: number | null;
938
943
  activeTransparency: boolean;
939
944
  transparencySection?: string | null;
940
945
  directorateCodeReference?: number | null;
@@ -1317,6 +1322,7 @@ export interface DocumentDraftReviewEntity {
1317
1322
  status: DraftReviewStatus;
1318
1323
  observation?: string | null;
1319
1324
  resolvedAt?: string | null;
1325
+ overdueRemindedAt?: string | null;
1320
1326
  }
1321
1327
 
1322
1328
  export interface DocumentTemplateVersionEntity {
@@ -17,6 +17,7 @@ import {
17
17
  type DocumentEmailCopyIssuedEntity,
18
18
  type DocumentEmailCopyViewEntity,
19
19
  type DocumentReminderEntity,
20
+ type DocumentSlaReminderEntity,
20
21
  type DocumentGetAllResponseEntity,
21
22
  type DocumentGetByIdResponseEntity,
22
23
  type DocumentGetSummaryResponseEntity,
@@ -73,6 +74,7 @@ export const DocumentPatterns = {
73
74
  getEmailCopy: 'gestorDocumental.document.getEmailCopy',
74
75
  getEmailCopyFile: 'gestorDocumental.document.getEmailCopyFile',
75
76
  claimReminders: 'gestorDocumental.document.claimReminders',
77
+ claimSlaReminders: 'gestorDocumental.document.claimSlaReminders',
76
78
  } as const;
77
79
 
78
80
  /**
@@ -142,9 +144,6 @@ export interface DocumentWritePayload extends Pick<DocumentEntity, 'subject' | '
142
144
  // PDF subido que quien redacta declara validado, con su justificación: no pasa por la revisión que exige el tipo.
143
145
  selfValidated?: boolean;
144
146
  selfValidationNote?: string | null;
145
- // El documento llegó ya numerado (su tipo lo admite): su número y año.
146
- externalCorrelative?: number | null;
147
- externalCorrelativeYear?: number | null;
148
147
  // PDF del documento, ya subido al gestor de archivos.
149
148
  file: { fileId: string; name: string };
150
149
  attachments?: Pick<DocumentAttachmentEntity, 'name' | 'type' | 'fileId' | 'url'>[];
@@ -456,6 +455,11 @@ export interface DocumentContract {
456
455
  payload: Record<string, never>;
457
456
  response: DocumentReminderEntity[];
458
457
  };
458
+ /** Plazos de servicio vencidos que aún no se avisan: se marcan al entregarlos, así cada uno sale una vez. */
459
+ [DocumentPatterns.claimSlaReminders]: {
460
+ payload: Record<string, never>;
461
+ response: DocumentSlaReminderEntity[];
462
+ };
459
463
  [DocumentPatterns.getEmailCopyFile]: {
460
464
  payload: { token: string };
461
465
  response: DocumentPublicFileResponseEntity;
@@ -52,10 +52,12 @@ export interface DocumentTypeWritePayload {
52
52
  numbered?: boolean;
53
53
  // Serie de sus números: la propia (por omisión) o la de su categoría. No con numeración compartida.
54
54
  numberingScope?: DocumentNumberingScope;
55
- // Sus documentos pueden llegar ya numerados (por omisión, no).
56
- allowsExternalNumber?: boolean;
57
55
  // Pasa por Oficina de Partes (por omisión, sí). Sin ella, el documento solo se firma: va solo a funcionarios y áreas.
58
56
  usesPartsOffice?: boolean;
57
+ // Plazos de servicio en días hábiles (sin valor: sin plazo): de la tramitación, de cada turno y de cada revisión.
58
+ processingSlaDays?: number | null;
59
+ turnSlaDays?: number | null;
60
+ reviewSlaDays?: number | null;
59
61
  /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
60
62
  activeTransparency?: boolean;
61
63
  transparencySection?: string | null;
@@ -1,4 +1,4 @@
1
- import { type VisaInitialsResponseEntity } from '../entities';
1
+ import { type VisaInitialsLookupEntity, type VisaInitialsResponseEntity } from '../entities';
2
2
  import { type DocumentActor } from './document.contract';
3
3
 
4
4
  /**
@@ -8,6 +8,7 @@ import { type DocumentActor } from './document.contract';
8
8
  export const VisaInitialsPatterns = {
9
9
  get: 'gestorDocumental.visaInitials.get',
10
10
  update: 'gestorDocumental.visaInitials.update',
11
+ lookup: 'gestorDocumental.visaInitials.lookup',
11
12
  } as const;
12
13
 
13
14
  export interface VisaInitialsContract {
@@ -20,4 +21,9 @@ export interface VisaInitialsContract {
20
21
  payload: { initials: string | null; fullName: string; actor: DocumentActor };
21
22
  response: VisaInitialsResponseEntity;
22
23
  };
24
+ /** Las iniciales con que visarían ahora unos funcionarios (las propias o las de su nombre), para la vista previa. */
25
+ [VisaInitialsPatterns.lookup]: {
26
+ payload: { people: { employeeId: string; fullName: string }[] };
27
+ response: VisaInitialsLookupEntity[];
28
+ };
23
29
  }
@@ -34,6 +34,22 @@ export interface DocumentParticipantResponseEntity {
34
34
  position: DocumentParticipantEntity['position'];
35
35
  observation: DocumentParticipantEntity['observation'];
36
36
  resolvedAt: DocumentParticipantEntity['resolvedAt'];
37
+ /** Plazo del turno vigente, si el tipo tiene plazo por turno (si no le toca, `null`). */
38
+ deadline?: DocumentDeadlineEntity | null;
39
+ }
40
+
41
+ /**
42
+ * Plazo de servicio (SLA) que corre, en días hábiles: cuándo vence y su semáforo (por vencer con 2 días hábiles o
43
+ * menos). Lo calcula el servicio con los feriados.
44
+ */
45
+ export interface DocumentDeadlineEntity {
46
+ /** Días hábiles del plazo, como los fija el tipo documental. */
47
+ days: number;
48
+ startedAt: string;
49
+ dueAt: string;
50
+ dueStatus: 'OnTime' | 'DueSoon' | 'Overdue';
51
+ /** Días hábiles que quedan, sin contar hoy (vencido: `null`). */
52
+ businessDaysLeft: number | null;
37
53
  }
38
54
 
39
55
  /** Destinatario de un documento, como lo eligió el redactor: una persona o un área completa. */
@@ -140,6 +156,11 @@ export interface DocumentGetAllResponseEntity {
140
156
  otherCurrentCount: number;
141
157
  // A cuántos funcionarios llegó y cuántos ya lo abrieron (null si aún no se distribuye a nadie).
142
158
  distribution: { total: number; read: number } | null;
159
+ // Plazos de servicio que corren (sin plazo en el tipo o sin nada pendiente, `null`): el del turno vigente (el más
160
+ // urgente, si visan varios a la vez), el de la tramitación completa y el de la revisión pendiente del borrador u oficial.
161
+ turnDeadline?: DocumentDeadlineEntity | null;
162
+ processingDeadline?: DocumentDeadlineEntity | null;
163
+ reviewDeadline?: DocumentDeadlineEntity | null;
143
164
  }
144
165
 
145
166
  /** Una entrada de la bandeja de recibidos: la entrega y el documento al que corresponde. */
@@ -190,10 +211,6 @@ export interface DocumentGetByIdResponseEntity {
190
211
  correlative: DocumentEntity['correlative'];
191
212
  correlativeYear: DocumentEntity['correlativeYear'];
192
213
  numberedAt: DocumentEntity['numberedAt'];
193
- // Número con que llegó el documento, si ya venía numerado: lo toma con la primera firma (y no se pierde si lo
194
- // rechazan).
195
- externalCorrelative: DocumentEntity['externalCorrelative'];
196
- externalCorrelativeYear: DocumentEntity['externalCorrelativeYear'];
197
214
  directorateCodeReference: DocumentEntity['directorateCodeReference'];
198
215
  departmentId: DocumentEntity['departmentId'];
199
216
  // Área responsable con sus nombres, como estaban al guardarlo (sin valor si no se registraron).
@@ -274,6 +291,8 @@ export interface DocumentGetByIdResponseEntity {
274
291
  /** Cómo se visa: con el sello del sistema o con la firma electrónica desatendida de cada visador (sin OTP). */
275
292
  visaMode: DocumentTypeEntity['visaMode'];
276
293
  participants: DocumentParticipantResponseEntity[];
294
+ /** Plazo de la tramitación completa mientras está en tramitación, si el tipo lo tiene. */
295
+ processingDeadline?: DocumentDeadlineEntity | null;
277
296
  attachments: {
278
297
  id: DocumentAttachmentEntity['id'];
279
298
  name: DocumentAttachmentEntity['name'];
@@ -662,6 +681,25 @@ export interface DocumentEmailCopyViewEntity {
662
681
  signers: { fullName: string; position: string | null; signedAt: string | null }[];
663
682
  }
664
683
 
684
+ /**
685
+ * Plazo de servicio vencido de un documento (sale una sola vez): el de un turno (a quien lo tiene), el de la
686
+ * tramitación completa (a quienes tienen el turno vigente) o el de una revisión del borrador o del oficial (a quien
687
+ * revisa). El gateway avisa por correo y push a cada uno y a la jefatura de su dirección.
688
+ */
689
+ export interface DocumentSlaReminderEntity {
690
+ /** Único por aviso: sirve de etiqueta del push. */
691
+ key: string;
692
+ kind: 'Turn' | 'Processing' | 'Review';
693
+ documentId: string;
694
+ /** Cómo se cita: «D.E. N° 590/2026» o el tipo. */
695
+ folio: string;
696
+ subject: string;
697
+ /** Días hábiles del plazo y cuándo venció. */
698
+ days: number;
699
+ dueAt: string;
700
+ employees: { employeeId: string; fullName: string }[];
701
+ }
702
+
665
703
  /** Recordatorio de un plazo: al recibido y, si venció, también a su jefatura (la resuelve el gateway). */
666
704
  export interface DocumentReminderEntity {
667
705
  deliveryId: string;
@@ -744,6 +782,8 @@ export interface DocumentDraftReviewRoundEntity {
744
782
  status: 'Pending' | 'Approved' | 'Rejected' | 'Cancelled';
745
783
  observation: string | null;
746
784
  resolvedAt: string | null;
785
+ /** Plazo de la ronda pendiente, si el tipo tiene plazo de revisión. */
786
+ deadline?: DocumentDeadlineEntity | null;
747
787
  }
748
788
 
749
789
  /** La revisión del borrador que exige el tipo documental. */
@@ -11,12 +11,13 @@ export interface StampBox {
11
11
  }
12
12
 
13
13
  /**
14
- * Dónde van las visaciones y las firmas de un documento, en el orden de sus turnos. Sin ellas (`null`), el sistema las
15
- * ubica solo: al pie de la última página o en una hoja de firmas.
14
+ * Dónde van las visaciones y las firmas de un documento, en el orden de sus turnos. Cada clase se ubica por su lado: la
15
+ * que viene en `null` la ubica el sistema, al pie de la última página. Sin ninguna (todo el objeto `null`), el sistema
16
+ * las ubica todas, al pie o en una hoja de firmas.
16
17
  */
17
18
  export interface DocumentStampPlacements {
18
- visas: StampBox[];
19
- signatures: StampBox[];
19
+ visas: StampBox[] | null;
20
+ signatures: StampBox[] | null;
20
21
  }
21
22
 
22
23
  /**
@@ -30,11 +30,15 @@ export interface DocumentTypeGetAllResponseEntity {
30
30
  // Serie de sus números: la propia (`Type`) o la de su categoría (`Category`). Con `Category`, `nextCorrelative`,
31
31
  // `correlativeYear` y `resetsYearly` son los de la categoría.
32
32
  numberingScope: DocumentTypeEntity['numberingScope'];
33
- // Sus documentos pueden llegar ya numerados: quien sube el PDF indica su número.
34
- allowsExternalNumber: DocumentTypeEntity['allowsExternalNumber'];
35
33
  // Pasa por Oficina de Partes: sus documentos pueden ir a otras instituciones y con copias por correo. Sin ella,
36
34
  // solo se firman y van a funcionarios y áreas de la municipalidad.
37
35
  usesPartsOffice: DocumentTypeEntity['usesPartsOffice'];
36
+ // Plazos de servicio (SLA) en días hábiles: de la tramitación completa (desde que entra a tramitación o se aprueba
37
+ // el oficial), de cada turno de visación o firma y de cada ronda de revisión del borrador o del oficial. `null`: sin
38
+ // plazo.
39
+ processingSlaDays: DocumentTypeEntity['processingSlaDays'];
40
+ turnSlaDays: DocumentTypeEntity['turnSlaDays'];
41
+ reviewSlaDays: DocumentTypeEntity['reviewSlaDays'];
38
42
  // Cómo visan sus documentos: con la firma electrónica desatendida de cada visador (`Stamp`, solo versiones antiguas).
39
43
  visaMode: DocumentTypeEntity['visaMode'];
40
44
  /** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
@@ -8,5 +8,11 @@ export interface VisaInitialsResponseEntity {
8
8
  custom: boolean;
9
9
  }
10
10
 
11
+ /** Las iniciales con que visa un funcionario. */
12
+ export interface VisaInitialsLookupEntity {
13
+ employeeId: string;
14
+ initials: string;
15
+ }
16
+
11
17
  /** Límites de las iniciales propias: solo letras, en mayúscula. */
12
18
  export const VISA_INITIALS_LIMITS = { maxLength: 6 } as const;