@muni-sanfer/types-gestor-documental 0.0.1-beta.69 → 0.0.1-beta.70
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 +13 -0
- package/dist/base/entities.js +6 -1
- package/dist/contracts/index.d.ts +9 -1
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/notificationPreference.contract.d.ts +45 -0
- package/dist/contracts/notificationPreference.contract.js +13 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/notificationPreference/index.d.ts +1 -0
- package/dist/entities/notificationPreference/index.js +17 -0
- package/dist/entities/notificationPreference/notificationPreference.entity.d.ts +26 -0
- package/dist/entities/notificationPreference/notificationPreference.entity.js +9 -0
- package/package.json +1 -1
- package/src/base/entities.ts +16 -0
- package/src/contracts/index.ts +8 -1
- package/src/contracts/notificationPreference.contract.ts +38 -0
- package/src/entities/index.ts +1 -0
- package/src/entities/notificationPreference/index.ts +1 -0
- package/src/entities/notificationPreference/notificationPreference.entity.ts +26 -0
package/dist/base/entities.d.ts
CHANGED
|
@@ -431,6 +431,12 @@ export declare const MailAuthentication: {
|
|
|
431
431
|
Fail: "Fail";
|
|
432
432
|
Unknown: "Unknown";
|
|
433
433
|
};
|
|
434
|
+
export type NotificationMode = 'All' | 'Actionable' | 'Digest';
|
|
435
|
+
export declare const NotificationMode: {
|
|
436
|
+
All: "All";
|
|
437
|
+
Actionable: "Actionable";
|
|
438
|
+
Digest: "Digest";
|
|
439
|
+
};
|
|
434
440
|
export type DraftingRequestStatus = 'Pending' | 'Taken' | 'Declined' | 'Cancelled';
|
|
435
441
|
export declare const DraftingRequestStatus: {
|
|
436
442
|
Pending: "Pending";
|
|
@@ -1432,6 +1438,13 @@ export interface VisaInitialsEntity {
|
|
|
1432
1438
|
createdAt: string;
|
|
1433
1439
|
updatedAt: string;
|
|
1434
1440
|
}
|
|
1441
|
+
export interface NotificationPreferenceEntity {
|
|
1442
|
+
employeeId: string;
|
|
1443
|
+
mode: NotificationMode;
|
|
1444
|
+
digestSentOn?: string | null;
|
|
1445
|
+
createdAt: string;
|
|
1446
|
+
updatedAt: string;
|
|
1447
|
+
}
|
|
1435
1448
|
export interface PushSubscriptionEntity {
|
|
1436
1449
|
id: string;
|
|
1437
1450
|
employeeId: string;
|
package/dist/base/entities.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file was auto-generated by prisma-generator-typescript-interfaces
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.DataBreachStatus = exports.DataBreachKind = exports.DataRightsEventAction = exports.DataRightsResolution = exports.DataRightsRequestStatus = exports.DataRightsChannel = exports.DataRight = exports.DataLegalBasis = exports.TransparencyStatus = exports.AccessRequestEventAction = exports.AccessRequestResolution = exports.AccessRequestStatus = exports.AccessRequestChannel = exports.DispositionKind = exports.FinalDisposition = exports.AuditAction = exports.AuditEntity = exports.DocumentAccessAction = exports.QualityMetricKey = exports.ServiceOutageKind = exports.WorkFolderItemKind = exports.HolidaySource = exports.TextSnippetSection = exports.ScanSessionStatus = exports.CaseFileAccessAction = exports.CaseFileTrackingAction = exports.CaseFileActorType = exports.CaseFileActorRelation = exports.CaseFileEntryKind = exports.CaseFileActuationType = exports.CaseFileIncorporationMechanism = exports.CaseFileStatus = exports.DocumentInstruction = exports.DocumentDeliveryOrigin = exports.DocumentRecipientType = exports.DocumentAttachmentType = exports.DocumentFlowStepType = exports.DocDigitalInboundStatus = exports.DocumentDispatchStatus = exports.CommunicationMeans = exports.DocumentOrigin = exports.DraftReviewStatus = exports.DraftReviewStage = exports.DocumentTrackingAction = exports.DocumentParticipantStatus = exports.DocumentParticipantRole = exports.DocumentAccessLevel = exports.DocumentStatus = exports.DocumentNumberingScope = exports.DocumentCategory = void 0;
|
|
5
|
-
exports.DraftingRequestEventAction = exports.DraftingRequestStatus = exports.MailAuthentication = exports.MailIntakeStatus = exports.DeskFileTarget = exports.DeskFileSource = exports.DataBreachNoticeMeans = exports.DataBreachEventAction = void 0;
|
|
5
|
+
exports.DraftingRequestEventAction = exports.DraftingRequestStatus = exports.NotificationMode = exports.MailAuthentication = exports.MailIntakeStatus = exports.DeskFileTarget = exports.DeskFileSource = exports.DataBreachNoticeMeans = exports.DataBreachEventAction = void 0;
|
|
6
6
|
exports.DocumentCategory = {
|
|
7
7
|
Letter: 'Letter',
|
|
8
8
|
Circular: 'Circular',
|
|
@@ -380,6 +380,11 @@ exports.MailAuthentication = {
|
|
|
380
380
|
Fail: 'Fail',
|
|
381
381
|
Unknown: 'Unknown',
|
|
382
382
|
};
|
|
383
|
+
exports.NotificationMode = {
|
|
384
|
+
All: 'All',
|
|
385
|
+
Actionable: 'Actionable',
|
|
386
|
+
Digest: 'Digest',
|
|
387
|
+
};
|
|
383
388
|
exports.DraftingRequestStatus = {
|
|
384
389
|
Pending: 'Pending',
|
|
385
390
|
Taken: 'Taken',
|
|
@@ -18,6 +18,7 @@ import { type DeskContract } from './desk.contract';
|
|
|
18
18
|
import { type MailIntakeContract } from './mailIntake.contract';
|
|
19
19
|
import { type PushContract } from './push.contract';
|
|
20
20
|
import { type VisaInitialsContract } from './visaInitials.contract';
|
|
21
|
+
import { type NotificationPreferenceContract } from './notificationPreference.contract';
|
|
21
22
|
import { type ScanContract } from './scan.contract';
|
|
22
23
|
import { type PartsOfficeContract } from './partsOffice.contract';
|
|
23
24
|
import { type ProcedureContract } from './procedure.contract';
|
|
@@ -57,6 +58,7 @@ export * from './draftingRequest.contract';
|
|
|
57
58
|
export * from './internalReview.contract';
|
|
58
59
|
export * from './richImage.contract';
|
|
59
60
|
export * from './visaInitials.contract';
|
|
61
|
+
export * from './notificationPreference.contract';
|
|
60
62
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
61
63
|
export declare const GestorDocumentalPatterns: {
|
|
62
64
|
readonly documentType: {
|
|
@@ -327,6 +329,12 @@ export declare const GestorDocumentalPatterns: {
|
|
|
327
329
|
readonly update: "gestorDocumental.visaInitials.update";
|
|
328
330
|
readonly lookup: "gestorDocumental.visaInitials.lookup";
|
|
329
331
|
};
|
|
332
|
+
readonly notificationPreference: {
|
|
333
|
+
readonly get: "gestorDocumental.notificationPreference.get";
|
|
334
|
+
readonly update: "gestorDocumental.notificationPreference.update";
|
|
335
|
+
readonly getModes: "gestorDocumental.notificationPreference.getModes";
|
|
336
|
+
readonly claimDigests: "gestorDocumental.notificationPreference.claimDigests";
|
|
337
|
+
};
|
|
330
338
|
};
|
|
331
339
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
332
|
-
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & DocumentTemplateContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract & DraftingRequestContract & InternalReviewContract & RichImageContract & VisaInitialsContract;
|
|
340
|
+
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & DocumentTemplateContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract & DraftingRequestContract & InternalReviewContract & RichImageContract & VisaInitialsContract & NotificationPreferenceContract;
|
package/dist/contracts/index.js
CHANGED
|
@@ -35,6 +35,7 @@ const desk_contract_1 = require("./desk.contract");
|
|
|
35
35
|
const mailIntake_contract_1 = require("./mailIntake.contract");
|
|
36
36
|
const push_contract_1 = require("./push.contract");
|
|
37
37
|
const visaInitials_contract_1 = require("./visaInitials.contract");
|
|
38
|
+
const notificationPreference_contract_1 = require("./notificationPreference.contract");
|
|
38
39
|
const scan_contract_1 = require("./scan.contract");
|
|
39
40
|
const partsOffice_contract_1 = require("./partsOffice.contract");
|
|
40
41
|
const procedure_contract_1 = require("./procedure.contract");
|
|
@@ -74,6 +75,7 @@ __exportStar(require("./draftingRequest.contract"), exports);
|
|
|
74
75
|
__exportStar(require("./internalReview.contract"), exports);
|
|
75
76
|
__exportStar(require("./richImage.contract"), exports);
|
|
76
77
|
__exportStar(require("./visaInitials.contract"), exports);
|
|
78
|
+
__exportStar(require("./notificationPreference.contract"), exports);
|
|
77
79
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
78
80
|
exports.GestorDocumentalPatterns = {
|
|
79
81
|
documentType: documentType_contract_1.DocumentTypePatterns,
|
|
@@ -105,4 +107,5 @@ exports.GestorDocumentalPatterns = {
|
|
|
105
107
|
internalReview: internalReview_contract_1.InternalReviewPatterns,
|
|
106
108
|
richImage: richImage_contract_1.RichImagePatterns,
|
|
107
109
|
visaInitials: visaInitials_contract_1.VisaInitialsPatterns,
|
|
110
|
+
notificationPreference: notificationPreference_contract_1.NotificationPreferencePatterns,
|
|
108
111
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type NotificationMode } from '../base/entities';
|
|
2
|
+
import { type NotificationDigestEntity, type NotificationPreferenceResponseEntity } from '../entities';
|
|
3
|
+
import { type DocumentActor } from './document.contract';
|
|
4
|
+
/**
|
|
5
|
+
* Patrones NATS de `notificationPreference`: qué avisos recibe cada funcionario por correo y push (todos, solo lo que le
|
|
6
|
+
* toca hacer, o un resumen diario por correo). El gateway consulta los modos antes de avisar y pide los resúmenes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NotificationPreferencePatterns: {
|
|
9
|
+
readonly get: "gestorDocumental.notificationPreference.get";
|
|
10
|
+
readonly update: "gestorDocumental.notificationPreference.update";
|
|
11
|
+
readonly getModes: "gestorDocumental.notificationPreference.getModes";
|
|
12
|
+
readonly claimDigests: "gestorDocumental.notificationPreference.claimDigests";
|
|
13
|
+
};
|
|
14
|
+
export interface NotificationPreferenceContract {
|
|
15
|
+
[NotificationPreferencePatterns.get]: {
|
|
16
|
+
payload: {
|
|
17
|
+
actor: DocumentActor;
|
|
18
|
+
};
|
|
19
|
+
response: NotificationPreferenceResponseEntity;
|
|
20
|
+
};
|
|
21
|
+
[NotificationPreferencePatterns.update]: {
|
|
22
|
+
payload: {
|
|
23
|
+
mode: NotificationMode;
|
|
24
|
+
actor: DocumentActor;
|
|
25
|
+
};
|
|
26
|
+
response: NotificationPreferenceResponseEntity;
|
|
27
|
+
};
|
|
28
|
+
/** El modo de cada funcionario que no recibe todos los avisos (los que no vienen, todos). */
|
|
29
|
+
[NotificationPreferencePatterns.getModes]: {
|
|
30
|
+
payload: {
|
|
31
|
+
employeeIds: string[];
|
|
32
|
+
};
|
|
33
|
+
response: {
|
|
34
|
+
modes: Record<string, NotificationMode>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Los resúmenes diarios que corresponde enviar ahora (desde la hora del resumen, uno por funcionario y día de Chile):
|
|
39
|
+
* quedan marcados como enviados al entregarlos. Quien no tiene nada pendiente no aparece.
|
|
40
|
+
*/
|
|
41
|
+
[NotificationPreferencePatterns.claimDigests]: {
|
|
42
|
+
payload: Record<string, never>;
|
|
43
|
+
response: NotificationDigestEntity[];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationPreferencePatterns = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Patrones NATS de `notificationPreference`: qué avisos recibe cada funcionario por correo y push (todos, solo lo que le
|
|
6
|
+
* toca hacer, o un resumen diario por correo). El gateway consulta los modos antes de avisar y pide los resúmenes.
|
|
7
|
+
*/
|
|
8
|
+
exports.NotificationPreferencePatterns = {
|
|
9
|
+
get: 'gestorDocumental.notificationPreference.get',
|
|
10
|
+
update: 'gestorDocumental.notificationPreference.update',
|
|
11
|
+
getModes: 'gestorDocumental.notificationPreference.getModes',
|
|
12
|
+
claimDigests: 'gestorDocumental.notificationPreference.claimDigests',
|
|
13
|
+
};
|
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
|
@@ -42,3 +42,4 @@ __exportStar(require("./documentTemplate"), exports);
|
|
|
42
42
|
__exportStar(require("./draftingRequest"), exports);
|
|
43
43
|
__exportStar(require("./internalReview"), exports);
|
|
44
44
|
__exportStar(require("./visaInitials"), exports);
|
|
45
|
+
__exportStar(require("./notificationPreference"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './notificationPreference.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("./notificationPreference.entity"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type NotificationMode } from '../../base/entities';
|
|
2
|
+
/** Qué avisos recibe quien tiene la sesión. Sin elegir, todos. */
|
|
3
|
+
export interface NotificationPreferenceResponseEntity {
|
|
4
|
+
mode: NotificationMode;
|
|
5
|
+
}
|
|
6
|
+
/** Lo que tiene pendiente un funcionario que pidió el resumen diario. */
|
|
7
|
+
export interface NotificationDigestEntity {
|
|
8
|
+
employeeId: string;
|
|
9
|
+
received: {
|
|
10
|
+
pending: number;
|
|
11
|
+
unread: number;
|
|
12
|
+
overdue: number;
|
|
13
|
+
};
|
|
14
|
+
toVisa: number;
|
|
15
|
+
toSign: number;
|
|
16
|
+
/** Borradores u oficiales que esperan su revisión. */
|
|
17
|
+
toReview: number;
|
|
18
|
+
draftingRequests: {
|
|
19
|
+
pending: number;
|
|
20
|
+
taken: number;
|
|
21
|
+
};
|
|
22
|
+
/** Documentos suyos rechazados, por corregir. */
|
|
23
|
+
rejected: number;
|
|
24
|
+
}
|
|
25
|
+
/** Nombres de cada modo, para la interfaz y los correos. */
|
|
26
|
+
export declare const NOTIFICATION_MODE_LABEL: Record<NotificationMode, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NOTIFICATION_MODE_LABEL = void 0;
|
|
4
|
+
/** Nombres de cada modo, para la interfaz y los correos. */
|
|
5
|
+
exports.NOTIFICATION_MODE_LABEL = {
|
|
6
|
+
All: 'Todos los avisos',
|
|
7
|
+
Actionable: 'Solo lo que me toca hacer',
|
|
8
|
+
Digest: 'Un resumen diario',
|
|
9
|
+
};
|
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -650,6 +650,14 @@ export const MailAuthentication = {
|
|
|
650
650
|
Unknown: 'Unknown',
|
|
651
651
|
} satisfies Record<string, MailAuthentication>;
|
|
652
652
|
|
|
653
|
+
export type NotificationMode = 'All' | 'Actionable' | 'Digest';
|
|
654
|
+
|
|
655
|
+
export const NotificationMode = {
|
|
656
|
+
All: 'All',
|
|
657
|
+
Actionable: 'Actionable',
|
|
658
|
+
Digest: 'Digest',
|
|
659
|
+
} satisfies Record<string, NotificationMode>;
|
|
660
|
+
|
|
653
661
|
export type DraftingRequestStatus = 'Pending' | 'Taken' | 'Declined' | 'Cancelled';
|
|
654
662
|
|
|
655
663
|
export const DraftingRequestStatus = {
|
|
@@ -1712,6 +1720,14 @@ export interface VisaInitialsEntity {
|
|
|
1712
1720
|
updatedAt: string;
|
|
1713
1721
|
}
|
|
1714
1722
|
|
|
1723
|
+
export interface NotificationPreferenceEntity {
|
|
1724
|
+
employeeId: string;
|
|
1725
|
+
mode: NotificationMode;
|
|
1726
|
+
digestSentOn?: string | null;
|
|
1727
|
+
createdAt: string;
|
|
1728
|
+
updatedAt: string;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1715
1731
|
export interface PushSubscriptionEntity {
|
|
1716
1732
|
id: string;
|
|
1717
1733
|
employeeId: string;
|
package/src/contracts/index.ts
CHANGED
|
@@ -18,6 +18,10 @@ import { DeskPatterns, type DeskContract } from './desk.contract';
|
|
|
18
18
|
import { MailIntakePatterns, type MailIntakeContract } from './mailIntake.contract';
|
|
19
19
|
import { PushPatterns, type PushContract } from './push.contract';
|
|
20
20
|
import { VisaInitialsPatterns, type VisaInitialsContract } from './visaInitials.contract';
|
|
21
|
+
import {
|
|
22
|
+
NotificationPreferencePatterns,
|
|
23
|
+
type NotificationPreferenceContract,
|
|
24
|
+
} from './notificationPreference.contract';
|
|
21
25
|
import { ScanPatterns, type ScanContract } from './scan.contract';
|
|
22
26
|
import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
|
|
23
27
|
import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
|
|
@@ -58,6 +62,7 @@ export * from './draftingRequest.contract';
|
|
|
58
62
|
export * from './internalReview.contract';
|
|
59
63
|
export * from './richImage.contract';
|
|
60
64
|
export * from './visaInitials.contract';
|
|
65
|
+
export * from './notificationPreference.contract';
|
|
61
66
|
|
|
62
67
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
63
68
|
export const GestorDocumentalPatterns = {
|
|
@@ -90,6 +95,7 @@ export const GestorDocumentalPatterns = {
|
|
|
90
95
|
internalReview: InternalReviewPatterns,
|
|
91
96
|
richImage: RichImagePatterns,
|
|
92
97
|
visaInitials: VisaInitialsPatterns,
|
|
98
|
+
notificationPreference: NotificationPreferencePatterns,
|
|
93
99
|
} as const;
|
|
94
100
|
|
|
95
101
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
@@ -121,4 +127,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
|
|
|
121
127
|
DraftingRequestContract &
|
|
122
128
|
InternalReviewContract &
|
|
123
129
|
RichImageContract &
|
|
124
|
-
VisaInitialsContract
|
|
130
|
+
VisaInitialsContract &
|
|
131
|
+
NotificationPreferenceContract;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type NotificationMode } from '../base/entities';
|
|
2
|
+
import { type NotificationDigestEntity, type NotificationPreferenceResponseEntity } from '../entities';
|
|
3
|
+
import { type DocumentActor } from './document.contract';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Patrones NATS de `notificationPreference`: qué avisos recibe cada funcionario por correo y push (todos, solo lo que le
|
|
7
|
+
* toca hacer, o un resumen diario por correo). El gateway consulta los modos antes de avisar y pide los resúmenes.
|
|
8
|
+
*/
|
|
9
|
+
export const NotificationPreferencePatterns = {
|
|
10
|
+
get: 'gestorDocumental.notificationPreference.get',
|
|
11
|
+
update: 'gestorDocumental.notificationPreference.update',
|
|
12
|
+
getModes: 'gestorDocumental.notificationPreference.getModes',
|
|
13
|
+
claimDigests: 'gestorDocumental.notificationPreference.claimDigests',
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export interface NotificationPreferenceContract {
|
|
17
|
+
[NotificationPreferencePatterns.get]: {
|
|
18
|
+
payload: { actor: DocumentActor };
|
|
19
|
+
response: NotificationPreferenceResponseEntity;
|
|
20
|
+
};
|
|
21
|
+
[NotificationPreferencePatterns.update]: {
|
|
22
|
+
payload: { mode: NotificationMode; actor: DocumentActor };
|
|
23
|
+
response: NotificationPreferenceResponseEntity;
|
|
24
|
+
};
|
|
25
|
+
/** El modo de cada funcionario que no recibe todos los avisos (los que no vienen, todos). */
|
|
26
|
+
[NotificationPreferencePatterns.getModes]: {
|
|
27
|
+
payload: { employeeIds: string[] };
|
|
28
|
+
response: { modes: Record<string, NotificationMode> };
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Los resúmenes diarios que corresponde enviar ahora (desde la hora del resumen, uno por funcionario y día de Chile):
|
|
32
|
+
* quedan marcados como enviados al entregarlos. Quien no tiene nada pendiente no aparece.
|
|
33
|
+
*/
|
|
34
|
+
[NotificationPreferencePatterns.claimDigests]: {
|
|
35
|
+
payload: Record<string, never>;
|
|
36
|
+
response: NotificationDigestEntity[];
|
|
37
|
+
};
|
|
38
|
+
}
|
package/src/entities/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './notificationPreference.entity';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type NotificationMode } from '../../base/entities';
|
|
2
|
+
|
|
3
|
+
/** Qué avisos recibe quien tiene la sesión. Sin elegir, todos. */
|
|
4
|
+
export interface NotificationPreferenceResponseEntity {
|
|
5
|
+
mode: NotificationMode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Lo que tiene pendiente un funcionario que pidió el resumen diario. */
|
|
9
|
+
export interface NotificationDigestEntity {
|
|
10
|
+
employeeId: string;
|
|
11
|
+
received: { pending: number; unread: number; overdue: number };
|
|
12
|
+
toVisa: number;
|
|
13
|
+
toSign: number;
|
|
14
|
+
/** Borradores u oficiales que esperan su revisión. */
|
|
15
|
+
toReview: number;
|
|
16
|
+
draftingRequests: { pending: number; taken: number };
|
|
17
|
+
/** Documentos suyos rechazados, por corregir. */
|
|
18
|
+
rejected: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Nombres de cada modo, para la interfaz y los correos. */
|
|
22
|
+
export const NOTIFICATION_MODE_LABEL: Record<NotificationMode, string> = {
|
|
23
|
+
All: 'Todos los avisos',
|
|
24
|
+
Actionable: 'Solo lo que me toca hacer',
|
|
25
|
+
Digest: 'Un resumen diario',
|
|
26
|
+
};
|