evo360-types 1.3.438 → 1.3.442
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/apps/evo-med/calendar/zod-schemas.d.ts +2172 -0
- package/dist/apps/evo-med/calendar/zod-schemas.js +28 -0
- package/dist/apps/evo-med/calendar/zod-schemas.ts +31 -0
- package/dist/types/evo-med/calendar/index.d.ts +56 -0
- package/dist/types/evo-med/calendar/index.js +12 -1
- package/dist/types/evo-med/calendar/index.ts +59 -0
- package/package.json +1 -1
|
@@ -26,10 +26,38 @@ const zNotificationEmailConfigSchema = zod_1.z
|
|
|
26
26
|
on_reschedule_template_id: zod_1.z.string().min(1).max(120).optional(),
|
|
27
27
|
})
|
|
28
28
|
.passthrough();
|
|
29
|
+
// feat-092: mapa GENÉRICO de configs de notificação (config × canal × template).
|
|
30
|
+
// Tudo opcional + `.passthrough()`; SEM `.default()` (o data-validator grava só as
|
|
31
|
+
// chaves do input → um default não persistiria). Chave/canal são strings abertas
|
|
32
|
+
// (z.record) ⇒ extensível a novos eventos/canais sem republish.
|
|
33
|
+
const zNotificationCtaSchema = zod_1.z
|
|
34
|
+
.object({
|
|
35
|
+
key: zod_1.z.string().min(1).max(60),
|
|
36
|
+
template_id: zod_1.z.string().min(1).max(120),
|
|
37
|
+
template_type: zod_1.z.string().min(1).max(40).optional(),
|
|
38
|
+
})
|
|
39
|
+
.passthrough();
|
|
40
|
+
const zNotificationChannelEntrySchema = zod_1.z
|
|
41
|
+
.object({
|
|
42
|
+
enabled: zod_1.z.boolean().optional(),
|
|
43
|
+
channel_id: zod_1.z.string().min(1).max(60).optional(),
|
|
44
|
+
department_id: zod_1.z.string().min(1).max(60).optional(),
|
|
45
|
+
template_id: zod_1.z.string().min(1).max(120).optional(),
|
|
46
|
+
template_type: zod_1.z.string().min(1).max(40).optional(),
|
|
47
|
+
ctas: zod_1.z.array(zNotificationCtaSchema).optional(),
|
|
48
|
+
})
|
|
49
|
+
.passthrough();
|
|
50
|
+
const zNotificationEntrySchema = zod_1.z
|
|
51
|
+
.object({
|
|
52
|
+
enabled: zod_1.z.boolean().optional(),
|
|
53
|
+
channels: zod_1.z.record(zod_1.z.string(), zNotificationChannelEntrySchema).optional(),
|
|
54
|
+
})
|
|
55
|
+
.passthrough();
|
|
29
56
|
exports.zMedCalendarNotificationConfigSchema = zod_1.z
|
|
30
57
|
.object({
|
|
31
58
|
whatsapp: zNotificationWhatsappConfigSchema.optional(),
|
|
32
59
|
email: zNotificationEmailConfigSchema.optional(),
|
|
60
|
+
configs: zod_1.z.record(zod_1.z.string(), zNotificationEntrySchema).optional(),
|
|
33
61
|
})
|
|
34
62
|
.passthrough();
|
|
35
63
|
exports.zMedCalendarSchema = zod_schemas_1.zFireDocSchema
|
|
@@ -26,10 +26,41 @@ const zNotificationEmailConfigSchema = z
|
|
|
26
26
|
})
|
|
27
27
|
.passthrough();
|
|
28
28
|
|
|
29
|
+
// feat-092: mapa GENÉRICO de configs de notificação (config × canal × template).
|
|
30
|
+
// Tudo opcional + `.passthrough()`; SEM `.default()` (o data-validator grava só as
|
|
31
|
+
// chaves do input → um default não persistiria). Chave/canal são strings abertas
|
|
32
|
+
// (z.record) ⇒ extensível a novos eventos/canais sem republish.
|
|
33
|
+
const zNotificationCtaSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
key: z.string().min(1).max(60),
|
|
36
|
+
template_id: z.string().min(1).max(120),
|
|
37
|
+
template_type: z.string().min(1).max(40).optional(),
|
|
38
|
+
})
|
|
39
|
+
.passthrough();
|
|
40
|
+
|
|
41
|
+
const zNotificationChannelEntrySchema = z
|
|
42
|
+
.object({
|
|
43
|
+
enabled: z.boolean().optional(),
|
|
44
|
+
channel_id: z.string().min(1).max(60).optional(),
|
|
45
|
+
department_id: z.string().min(1).max(60).optional(),
|
|
46
|
+
template_id: z.string().min(1).max(120).optional(),
|
|
47
|
+
template_type: z.string().min(1).max(40).optional(),
|
|
48
|
+
ctas: z.array(zNotificationCtaSchema).optional(),
|
|
49
|
+
})
|
|
50
|
+
.passthrough();
|
|
51
|
+
|
|
52
|
+
const zNotificationEntrySchema = z
|
|
53
|
+
.object({
|
|
54
|
+
enabled: z.boolean().optional(),
|
|
55
|
+
channels: z.record(z.string(), zNotificationChannelEntrySchema).optional(),
|
|
56
|
+
})
|
|
57
|
+
.passthrough();
|
|
58
|
+
|
|
29
59
|
export const zMedCalendarNotificationConfigSchema = z
|
|
30
60
|
.object({
|
|
31
61
|
whatsapp: zNotificationWhatsappConfigSchema.optional(),
|
|
32
62
|
email: zNotificationEmailConfigSchema.optional(),
|
|
63
|
+
configs: z.record(z.string(), zNotificationEntrySchema).optional(),
|
|
33
64
|
})
|
|
34
65
|
.passthrough();
|
|
35
66
|
|
|
@@ -36,7 +36,63 @@ export interface IMedCalendarNotificationConfig {
|
|
|
36
36
|
/** Template do e-mail enviado após pedido de remarcação (feat-056). */
|
|
37
37
|
on_reschedule_template_id?: string;
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Mapa GENÉRICO de configs de notificação (feat-092). A chave (`configKey`) é
|
|
41
|
+
* livre; o SIGNIFICADO (`appointment_reminder` | `appointment_created` | …) mora
|
|
42
|
+
* em quem CONSULTA, não no schema. Não envia nada por si só — é referência para
|
|
43
|
+
* agentes que, conforme suas políticas de execução, decidem enviar. Ausência ou
|
|
44
|
+
* config incompleta ⇒ o leitor não faz nada. Coexiste com os blocos `whatsapp`/
|
|
45
|
+
* `email` legados (que os consumidores atuais ainda leem).
|
|
46
|
+
*/
|
|
47
|
+
configs?: {
|
|
48
|
+
[configKey: string]: IMedCalendarNotificationEntry;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** Uma config de notificação (feat-092): um evento/momento × seus canais. */
|
|
52
|
+
export interface IMedCalendarNotificationEntry {
|
|
53
|
+
/** Opt-in do config inteiro. Ausente/false ⇒ leitor ignora. */
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
/** Canais habilitados, keyed por tipo ('whatsapp' | 'email' | futuro). */
|
|
56
|
+
channels?: {
|
|
57
|
+
[channelKind: string]: IMedCalendarNotificationChannelEntry;
|
|
58
|
+
};
|
|
39
59
|
}
|
|
60
|
+
/** Config de um canal dentro de um config de notificação (feat-092). */
|
|
61
|
+
export interface IMedCalendarNotificationChannelEntry {
|
|
62
|
+
/** Opt-in do canal. Ausente/false ⇒ leitor ignora este canal. */
|
|
63
|
+
enabled?: boolean;
|
|
64
|
+
/** Doc id do canal por onde a mensagem sai. Sem herança — usa o que estiver aqui. */
|
|
65
|
+
channel_id?: string;
|
|
66
|
+
/** Departamento que recebe/roteia (opcional). */
|
|
67
|
+
department_id?: string;
|
|
68
|
+
/** Template principal da mensagem (HSM name no WA / template_id lógico no email). */
|
|
69
|
+
template_id?: string;
|
|
70
|
+
/** Tipo do template principal: 'hsm' | 'email' | … O leitor pode inferir pelo canal. */
|
|
71
|
+
template_type?: string;
|
|
72
|
+
/** Botões/ações da mensagem → artefato de resposta de cada um. */
|
|
73
|
+
ctas?: IMedCalendarNotificationCta[];
|
|
74
|
+
}
|
|
75
|
+
/** Um CTA (botão/ação) e o artefato enviado quando o paciente o aciona (feat-092). */
|
|
76
|
+
export interface IMedCalendarNotificationCta {
|
|
77
|
+
/** Identificador livre da ação: 'confirm' | 'reschedule' | 'cancel' | … */
|
|
78
|
+
key: string;
|
|
79
|
+
/** Template/quick-reply de resposta ao acionar o CTA. */
|
|
80
|
+
template_id: string;
|
|
81
|
+
/** Tipo do artefato: 'quick_reply' | 'hsm' | 'email' | … */
|
|
82
|
+
template_type?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Chaves canônicas conhecidas de `configs` (feat-092) — SÓ referência para
|
|
86
|
+
* autocomplete/UI. O schema NÃO restringe (a chave é string aberta) e os leitores
|
|
87
|
+
* ignoram chaves desconhecidas.
|
|
88
|
+
*/
|
|
89
|
+
export declare const MedCalendarNotificationConfigKeys: {
|
|
90
|
+
readonly AppointmentReminder: "appointment_reminder";
|
|
91
|
+
readonly AppointmentCreated: "appointment_created";
|
|
92
|
+
readonly AppointmentRescheduled: "appointment_rescheduled";
|
|
93
|
+
readonly AppointmentCancelled: "appointment_cancelled";
|
|
94
|
+
};
|
|
95
|
+
export type MedCalendarNotificationConfigKey = (typeof MedCalendarNotificationConfigKeys)[keyof typeof MedCalendarNotificationConfigKeys];
|
|
40
96
|
export interface IMedCalendar extends IFireDoc {
|
|
41
97
|
calendarId: string;
|
|
42
98
|
color?: string;
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.EvoMedCalendarPermissions = void 0;
|
|
17
|
+
exports.MedCalendarNotificationConfigKeys = exports.EvoMedCalendarPermissions = void 0;
|
|
18
18
|
__exportStar(require("../../evo-people/fb_collections"), exports);
|
|
19
19
|
// Permissões para o calendário
|
|
20
20
|
exports.EvoMedCalendarPermissions = {
|
|
@@ -24,3 +24,14 @@ exports.EvoMedCalendarPermissions = {
|
|
|
24
24
|
Update: "evo_med_calendar_write",
|
|
25
25
|
Delete: "evo_med_calendar_write",
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Chaves canônicas conhecidas de `configs` (feat-092) — SÓ referência para
|
|
29
|
+
* autocomplete/UI. O schema NÃO restringe (a chave é string aberta) e os leitores
|
|
30
|
+
* ignoram chaves desconhecidas.
|
|
31
|
+
*/
|
|
32
|
+
exports.MedCalendarNotificationConfigKeys = {
|
|
33
|
+
AppointmentReminder: "appointment_reminder",
|
|
34
|
+
AppointmentCreated: "appointment_created",
|
|
35
|
+
AppointmentRescheduled: "appointment_rescheduled",
|
|
36
|
+
AppointmentCancelled: "appointment_cancelled",
|
|
37
|
+
};
|
|
@@ -46,8 +46,67 @@ export interface IMedCalendarNotificationConfig {
|
|
|
46
46
|
/** Template do e-mail enviado após pedido de remarcação (feat-056). */
|
|
47
47
|
on_reschedule_template_id?: string;
|
|
48
48
|
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Mapa GENÉRICO de configs de notificação (feat-092). A chave (`configKey`) é
|
|
52
|
+
* livre; o SIGNIFICADO (`appointment_reminder` | `appointment_created` | …) mora
|
|
53
|
+
* em quem CONSULTA, não no schema. Não envia nada por si só — é referência para
|
|
54
|
+
* agentes que, conforme suas políticas de execução, decidem enviar. Ausência ou
|
|
55
|
+
* config incompleta ⇒ o leitor não faz nada. Coexiste com os blocos `whatsapp`/
|
|
56
|
+
* `email` legados (que os consumidores atuais ainda leem).
|
|
57
|
+
*/
|
|
58
|
+
configs?: { [configKey: string]: IMedCalendarNotificationEntry };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Uma config de notificação (feat-092): um evento/momento × seus canais. */
|
|
62
|
+
export interface IMedCalendarNotificationEntry {
|
|
63
|
+
/** Opt-in do config inteiro. Ausente/false ⇒ leitor ignora. */
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
/** Canais habilitados, keyed por tipo ('whatsapp' | 'email' | futuro). */
|
|
66
|
+
channels?: { [channelKind: string]: IMedCalendarNotificationChannelEntry };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Config de um canal dentro de um config de notificação (feat-092). */
|
|
70
|
+
export interface IMedCalendarNotificationChannelEntry {
|
|
71
|
+
/** Opt-in do canal. Ausente/false ⇒ leitor ignora este canal. */
|
|
72
|
+
enabled?: boolean;
|
|
73
|
+
/** Doc id do canal por onde a mensagem sai. Sem herança — usa o que estiver aqui. */
|
|
74
|
+
channel_id?: string;
|
|
75
|
+
/** Departamento que recebe/roteia (opcional). */
|
|
76
|
+
department_id?: string;
|
|
77
|
+
/** Template principal da mensagem (HSM name no WA / template_id lógico no email). */
|
|
78
|
+
template_id?: string;
|
|
79
|
+
/** Tipo do template principal: 'hsm' | 'email' | … O leitor pode inferir pelo canal. */
|
|
80
|
+
template_type?: string;
|
|
81
|
+
/** Botões/ações da mensagem → artefato de resposta de cada um. */
|
|
82
|
+
ctas?: IMedCalendarNotificationCta[];
|
|
49
83
|
}
|
|
50
84
|
|
|
85
|
+
/** Um CTA (botão/ação) e o artefato enviado quando o paciente o aciona (feat-092). */
|
|
86
|
+
export interface IMedCalendarNotificationCta {
|
|
87
|
+
/** Identificador livre da ação: 'confirm' | 'reschedule' | 'cancel' | … */
|
|
88
|
+
key: string;
|
|
89
|
+
/** Template/quick-reply de resposta ao acionar o CTA. */
|
|
90
|
+
template_id: string;
|
|
91
|
+
/** Tipo do artefato: 'quick_reply' | 'hsm' | 'email' | … */
|
|
92
|
+
template_type?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Chaves canônicas conhecidas de `configs` (feat-092) — SÓ referência para
|
|
97
|
+
* autocomplete/UI. O schema NÃO restringe (a chave é string aberta) e os leitores
|
|
98
|
+
* ignoram chaves desconhecidas.
|
|
99
|
+
*/
|
|
100
|
+
export const MedCalendarNotificationConfigKeys = {
|
|
101
|
+
AppointmentReminder: "appointment_reminder",
|
|
102
|
+
AppointmentCreated: "appointment_created",
|
|
103
|
+
AppointmentRescheduled: "appointment_rescheduled",
|
|
104
|
+
AppointmentCancelled: "appointment_cancelled",
|
|
105
|
+
} as const;
|
|
106
|
+
|
|
107
|
+
export type MedCalendarNotificationConfigKey =
|
|
108
|
+
(typeof MedCalendarNotificationConfigKeys)[keyof typeof MedCalendarNotificationConfigKeys];
|
|
109
|
+
|
|
51
110
|
// ----- MedCalendarTypes
|
|
52
111
|
export interface IMedCalendar extends IFireDoc {
|
|
53
112
|
calendarId: string;
|