evo360-types 1.3.581 → 1.3.586

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.
@@ -2,6 +2,22 @@ import { z } from "zod";
2
2
  export declare const zAppointmentPaymentStatusSchema: z.ZodEnum<["paid", "partial", "pending", "not_informed"]>;
3
3
  export declare const zAppointmentStatusTypeSchema: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
4
4
  export declare const zAppointmentModeSchema: z.ZodEnum<["telemedicine", "in_person"]>;
5
+ export declare const zTelemedicineProviderSchema: z.ZodEnum<["virtual_care", "other"]>;
6
+ /**
7
+ * Espelho de `IAppointmentTelemedicine`. `| null` em `access_url` porque o
8
+ * editor do FE grava "não escolhido" como `null` explícito e `.passthrough()`
9
+ * não cobre `null` em chave declarada.
10
+ */
11
+ export declare const zAppointmentTelemedicineSchema: z.ZodObject<{
12
+ provider: z.ZodEnum<["virtual_care", "other"]>;
13
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
15
+ provider: z.ZodEnum<["virtual_care", "other"]>;
16
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
18
+ provider: z.ZodEnum<["virtual_care", "other"]>;
19
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ }, z.ZodTypeAny, "passthrough">>;
5
21
  export declare const zAppointmentTypeBaseSchema: z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>;
6
22
  export declare const zAppointmentAddressSchema: z.ZodObject<{
7
23
  address_name: z.ZodOptional<z.ZodString>;
@@ -331,6 +347,16 @@ export declare const zAppointmentSchema: z.ZodObject<{
331
347
  statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
332
348
  notes: z.ZodOptional<z.ZodString>;
333
349
  appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
350
+ telemedicine: z.ZodOptional<z.ZodNullable<z.ZodObject<{
351
+ provider: z.ZodEnum<["virtual_care", "other"]>;
352
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
353
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
354
+ provider: z.ZodEnum<["virtual_care", "other"]>;
355
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
356
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
357
+ provider: z.ZodEnum<["virtual_care", "other"]>;
358
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ }, z.ZodTypeAny, "passthrough">>>>;
334
360
  appointmentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
361
  appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
336
362
  appointmentSource: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -668,6 +694,16 @@ export declare const zAppointmentSchema: z.ZodObject<{
668
694
  statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
669
695
  notes: z.ZodOptional<z.ZodString>;
670
696
  appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
697
+ telemedicine: z.ZodOptional<z.ZodNullable<z.ZodObject<{
698
+ provider: z.ZodEnum<["virtual_care", "other"]>;
699
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
700
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
701
+ provider: z.ZodEnum<["virtual_care", "other"]>;
702
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
703
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
704
+ provider: z.ZodEnum<["virtual_care", "other"]>;
705
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
706
+ }, z.ZodTypeAny, "passthrough">>>>;
671
707
  appointmentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
672
708
  appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
673
709
  appointmentSource: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -1005,6 +1041,16 @@ export declare const zAppointmentSchema: z.ZodObject<{
1005
1041
  statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
1006
1042
  notes: z.ZodOptional<z.ZodString>;
1007
1043
  appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
1044
+ telemedicine: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1045
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1046
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1047
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1048
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1049
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1050
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1051
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1052
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1053
+ }, z.ZodTypeAny, "passthrough">>>>;
1008
1054
  appointmentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1009
1055
  appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
1010
1056
  appointmentSource: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -1336,6 +1382,16 @@ export declare const zPatientAppointmentSchema: z.ZodObject<{
1336
1382
  status: z.ZodString;
1337
1383
  statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
1338
1384
  appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
1385
+ telemedicine: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1386
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1387
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1388
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1389
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1390
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1391
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1392
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1393
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1394
+ }, z.ZodTypeAny, "passthrough">>>>;
1339
1395
  appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
1340
1396
  procedures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1341
1397
  professional: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1420,6 +1476,16 @@ export declare const zPatientAppointmentSchema: z.ZodObject<{
1420
1476
  status: z.ZodString;
1421
1477
  statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
1422
1478
  appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
1479
+ telemedicine: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1480
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1481
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1482
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1483
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1484
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1485
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1486
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1487
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1488
+ }, z.ZodTypeAny, "passthrough">>>>;
1423
1489
  appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
1424
1490
  procedures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1425
1491
  professional: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1504,6 +1570,16 @@ export declare const zPatientAppointmentSchema: z.ZodObject<{
1504
1570
  status: z.ZodString;
1505
1571
  statusBase: z.ZodEnum<["scheduled", "confirmed", "rescheduled", "pre_checkin", "waiting", "in_progress", "completed", "no_show", "cancelled", "cancelled_by_clinic", "cancelled_by_patient", "extra_slot", "awaiting_payment", "paid", "awaiting_documents", "blocked", "waiting_list", "expired"]>;
1506
1572
  appointmentMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["telemedicine", "in_person"]>>>;
1573
+ telemedicine: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1574
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1575
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1576
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1577
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1578
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1579
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1580
+ provider: z.ZodEnum<["virtual_care", "other"]>;
1581
+ access_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1582
+ }, z.ZodTypeAny, "passthrough">>>>;
1507
1583
  appointmentBaseType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>>>;
1508
1584
  procedures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1509
1585
  professional: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zPatientAppointmentSchema = exports.zAppointmentSchema = exports.zAppointmentSpecialtySchema = exports.zAppointmentRescheduleSchema = exports.zAppointmentAppointmentSourceSchema = exports.zAppointmentAppointmentRequestTypeSchema = exports.zAppointmentProcedureSchema = exports.zAppointmentPaymentSchema = exports.zAppointmentPaymentInvoiceRefSchema = exports.zAppointmentInsuranceSchema = exports.zAppointmentProfessionalSchema = exports.zAppointmentPatientSchema = exports.zAppointmentAddressSchema = exports.zAppointmentTypeBaseSchema = exports.zAppointmentModeSchema = exports.zAppointmentStatusTypeSchema = exports.zAppointmentPaymentStatusSchema = void 0;
3
+ exports.zPatientAppointmentSchema = exports.zAppointmentSchema = exports.zAppointmentSpecialtySchema = exports.zAppointmentRescheduleSchema = exports.zAppointmentAppointmentSourceSchema = exports.zAppointmentAppointmentRequestTypeSchema = exports.zAppointmentProcedureSchema = exports.zAppointmentPaymentSchema = exports.zAppointmentPaymentInvoiceRefSchema = exports.zAppointmentInsuranceSchema = exports.zAppointmentProfessionalSchema = exports.zAppointmentPatientSchema = exports.zAppointmentAddressSchema = exports.zAppointmentTypeBaseSchema = exports.zAppointmentTelemedicineSchema = exports.zTelemedicineProviderSchema = exports.zAppointmentModeSchema = exports.zAppointmentStatusTypeSchema = exports.zAppointmentPaymentStatusSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../../shared/zod-schemas");
6
6
  // Enums para validação
@@ -32,6 +32,24 @@ exports.zAppointmentStatusTypeSchema = zod_1.z.enum([
32
32
  "expired",
33
33
  ]);
34
34
  exports.zAppointmentModeSchema = zod_1.z.enum(["telemedicine", "in_person"]);
35
+ // ----- Telemedicina: provider dentro do agendamento (feat-160 R6, D38)
36
+ //
37
+ // `z.enum` À MÃO, espelhando `TelemedicineProviderEnum` do TS — é a armadilha
38
+ // conhecida das duas listas ([[reference_external_object_type_dual_list]]):
39
+ // editar só o TS compila liso e estoura em runtime. Há smoke sobre o `dist/`
40
+ // conferindo que as duas listas batem.
41
+ exports.zTelemedicineProviderSchema = zod_1.z.enum(["virtual_care", "other"]);
42
+ /**
43
+ * Espelho de `IAppointmentTelemedicine`. `| null` em `access_url` porque o
44
+ * editor do FE grava "não escolhido" como `null` explícito e `.passthrough()`
45
+ * não cobre `null` em chave declarada.
46
+ */
47
+ exports.zAppointmentTelemedicineSchema = zod_1.z
48
+ .object({
49
+ provider: exports.zTelemedicineProviderSchema,
50
+ access_url: zod_1.z.string().nullable().optional(),
51
+ })
52
+ .passthrough();
35
53
  // Schema para os tipos base de agendamento (para validação do appointmentBaseType)
36
54
  exports.zAppointmentTypeBaseSchema = zod_1.z.enum([
37
55
  "blocked",
@@ -174,6 +192,7 @@ exports.zAppointmentSchema = zod_schemas_1.zFireDocSchema
174
192
  statusBase: exports.zAppointmentStatusTypeSchema, // Tipo base para lógica
175
193
  notes: zod_1.z.string().optional(),
176
194
  appointmentMode: exports.zAppointmentModeSchema.nullable().optional(),
195
+ telemedicine: exports.zAppointmentTelemedicineSchema.nullable().optional(),
177
196
  appointmentType: zod_1.z.string().nullable().optional(), // Tipo customizado do dicionário
178
197
  appointmentBaseType: exports.zAppointmentTypeBaseSchema.nullable().optional(), // Tipo base para lógica
179
198
  appointmentSource: exports.zAppointmentAppointmentSourceSchema
@@ -224,6 +243,7 @@ exports.zPatientAppointmentSchema = zod_1.z
224
243
  status: zod_1.z.string(), // Status customizado do dicionário
225
244
  statusBase: exports.zAppointmentStatusTypeSchema, // Tipo base para lógica
226
245
  appointmentMode: exports.zAppointmentModeSchema.nullable().optional(),
246
+ telemedicine: exports.zAppointmentTelemedicineSchema.nullable().optional(),
227
247
  appointmentBaseType: exports.zAppointmentTypeBaseSchema.nullable().optional(), // Tipo base para lógica
228
248
  procedures: zod_1.z.array(zod_1.z.string()).nullable().optional(), // Array de strings dos procedimentos
229
249
  professional: zod_1.z.string().nullable().optional(), // String serializada do profissional
@@ -37,6 +37,26 @@ export const zAppointmentStatusTypeSchema = z.enum([
37
37
 
38
38
  export const zAppointmentModeSchema = z.enum(["telemedicine", "in_person"]);
39
39
 
40
+ // ----- Telemedicina: provider dentro do agendamento (feat-160 R6, D38)
41
+ //
42
+ // `z.enum` À MÃO, espelhando `TelemedicineProviderEnum` do TS — é a armadilha
43
+ // conhecida das duas listas ([[reference_external_object_type_dual_list]]):
44
+ // editar só o TS compila liso e estoura em runtime. Há smoke sobre o `dist/`
45
+ // conferindo que as duas listas batem.
46
+ export const zTelemedicineProviderSchema = z.enum(["virtual_care", "other"]);
47
+
48
+ /**
49
+ * Espelho de `IAppointmentTelemedicine`. `| null` em `access_url` porque o
50
+ * editor do FE grava "não escolhido" como `null` explícito e `.passthrough()`
51
+ * não cobre `null` em chave declarada.
52
+ */
53
+ export const zAppointmentTelemedicineSchema = z
54
+ .object({
55
+ provider: zTelemedicineProviderSchema,
56
+ access_url: z.string().nullable().optional(),
57
+ })
58
+ .passthrough();
59
+
40
60
  // Schema para os tipos base de agendamento (para validação do appointmentBaseType)
41
61
  export const zAppointmentTypeBaseSchema = z.enum([
42
62
  "blocked",
@@ -191,6 +211,7 @@ export const zAppointmentSchema = zFireDocSchema
191
211
  statusBase: zAppointmentStatusTypeSchema, // Tipo base para lógica
192
212
  notes: z.string().optional(),
193
213
  appointmentMode: zAppointmentModeSchema.nullable().optional(),
214
+ telemedicine: zAppointmentTelemedicineSchema.nullable().optional(),
194
215
  appointmentType: z.string().nullable().optional(), // Tipo customizado do dicionário
195
216
  appointmentBaseType: zAppointmentTypeBaseSchema.nullable().optional(), // Tipo base para lógica
196
217
  appointmentSource: zAppointmentAppointmentSourceSchema
@@ -247,6 +268,7 @@ export const zPatientAppointmentSchema = z
247
268
  status: z.string(), // Status customizado do dicionário
248
269
  statusBase: zAppointmentStatusTypeSchema, // Tipo base para lógica
249
270
  appointmentMode: zAppointmentModeSchema.nullable().optional(),
271
+ telemedicine: zAppointmentTelemedicineSchema.nullable().optional(),
250
272
  appointmentBaseType: zAppointmentTypeBaseSchema.nullable().optional(), // Tipo base para lógica
251
273
  procedures: z.array(z.string()).nullable().optional(), // Array de strings dos procedimentos
252
274
  professional: z.string().nullable().optional(), // String serializada do profissional
@@ -1361,6 +1361,7 @@ export declare const zMedCalendarVirtualCareConfigSchema: z.ZodObject<{
1361
1361
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1362
1362
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1363
1363
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1364
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
1364
1365
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1365
1366
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1366
1367
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -1402,6 +1403,7 @@ export declare const zMedCalendarVirtualCareConfigSchema: z.ZodObject<{
1402
1403
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1403
1404
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1404
1405
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1406
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
1405
1407
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1406
1408
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1407
1409
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -1443,6 +1445,7 @@ export declare const zMedCalendarVirtualCareConfigSchema: z.ZodObject<{
1443
1445
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1444
1446
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1445
1447
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1448
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
1446
1449
  }, z.ZodTypeAny, "passthrough">>;
1447
1450
  export declare const zMedCalendarSchema: z.ZodObject<{
1448
1451
  id: z.ZodString;
@@ -3108,6 +3111,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
3108
3111
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
3109
3112
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3110
3113
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3114
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
3111
3115
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3112
3116
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
3113
3117
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -3149,6 +3153,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
3149
3153
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
3150
3154
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3151
3155
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3156
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
3152
3157
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3153
3158
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
3154
3159
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -3190,6 +3195,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
3190
3195
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
3191
3196
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3192
3197
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3198
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
3193
3199
  }, z.ZodTypeAny, "passthrough">>>>;
3194
3200
  default_professional_ref: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
3195
3201
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -4856,6 +4862,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
4856
4862
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
4857
4863
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4858
4864
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4865
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
4859
4866
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4860
4867
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
4861
4868
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -4897,6 +4904,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
4897
4904
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
4898
4905
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4899
4906
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4907
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
4900
4908
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4901
4909
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
4902
4910
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -4938,6 +4946,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
4938
4946
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
4939
4947
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4940
4948
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4949
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
4941
4950
  }, z.ZodTypeAny, "passthrough">>>>;
4942
4951
  default_professional_ref: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
4943
4952
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -6604,6 +6613,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
6604
6613
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
6605
6614
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6606
6615
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6616
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
6607
6617
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6608
6618
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
6609
6619
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -6645,6 +6655,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
6645
6655
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
6646
6656
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6647
6657
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6658
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
6648
6659
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6649
6660
  auto_admit: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
6650
6661
  recording: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -6686,6 +6697,7 @@ export declare const zMedCalendarSchema: z.ZodObject<{
6686
6697
  allow_late_end: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
6687
6698
  max_duration_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6688
6699
  end_warning_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6700
+ default_provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["virtual_care", "other"]>>>;
6689
6701
  }, z.ZodTypeAny, "passthrough">>>>;
6690
6702
  default_professional_ref: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
6691
6703
  }, z.ZodTypeAny, "passthrough">>;
@@ -139,6 +139,9 @@ exports.zMedCalendarVirtualCareConfigSchema = zod_1.z
139
139
  allow_late_end: zod_1.z.boolean().nullable().optional(),
140
140
  max_duration_minutes: zod_1.z.number().int().min(15).max(480).nullable().optional(),
141
141
  end_warning_minutes: zod_1.z.number().int().min(0).max(1440).nullable().optional(),
142
+ // feat-160 R6 (D38): provider sugerido ao agendar telemedicina nesta agenda.
143
+ // `z.enum` à mão, espelho de `TelemedicineProviderEnum`.
144
+ default_provider: zod_1.z.enum(["virtual_care", "other"]).nullable().optional(),
142
145
  })
143
146
  .passthrough();
144
147
  exports.zMedCalendarSchema = zod_schemas_1.zFireDocSchema
@@ -146,6 +146,9 @@ export const zMedCalendarVirtualCareConfigSchema = z
146
146
  allow_late_end: z.boolean().nullable().optional(),
147
147
  max_duration_minutes: z.number().int().min(15).max(480).nullable().optional(),
148
148
  end_warning_minutes: z.number().int().min(0).max(1440).nullable().optional(),
149
+ // feat-160 R6 (D38): provider sugerido ao agendar telemedicina nesta agenda.
150
+ // `z.enum` à mão, espelho de `TelemedicineProviderEnum`.
151
+ default_provider: z.enum(["virtual_care", "other"]).nullable().optional(),
149
152
  })
150
153
  .passthrough();
151
154
 
@@ -634,6 +634,20 @@ export declare const zNotificationDirectSendSchema: z.ZodObject<{
634
634
  category: "utility";
635
635
  ttl_seconds?: number | undefined;
636
636
  }>;
637
+ export declare const NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES = 65536;
638
+ export declare const zNotificationAttachmentSchema: z.ZodObject<{
639
+ filename: z.ZodString;
640
+ content_type: z.ZodString;
641
+ content_base64: z.ZodString;
642
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
643
+ filename: z.ZodString;
644
+ content_type: z.ZodString;
645
+ content_base64: z.ZodString;
646
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
647
+ filename: z.ZodString;
648
+ content_type: z.ZodString;
649
+ content_base64: z.ZodString;
650
+ }, z.ZodTypeAny, "passthrough">>;
637
651
  export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
638
652
  tenant: z.ZodString;
639
653
  kind: z.ZodLiteral<"notification.send">;
@@ -752,6 +766,19 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
752
766
  expires_at: z.ZodOptional<z.ZodDate>;
753
767
  url_secret: z.ZodOptional<z.ZodString>;
754
768
  }, z.ZodTypeAny, "passthrough">>, "many">>;
769
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
770
+ filename: z.ZodString;
771
+ content_type: z.ZodString;
772
+ content_base64: z.ZodString;
773
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
774
+ filename: z.ZodString;
775
+ content_type: z.ZodString;
776
+ content_base64: z.ZodString;
777
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
778
+ filename: z.ZodString;
779
+ content_type: z.ZodString;
780
+ content_base64: z.ZodString;
781
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
755
782
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
756
783
  tenant: z.ZodString;
757
784
  kind: z.ZodLiteral<"notification.send">;
@@ -870,6 +897,19 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
870
897
  expires_at: z.ZodOptional<z.ZodDate>;
871
898
  url_secret: z.ZodOptional<z.ZodString>;
872
899
  }, z.ZodTypeAny, "passthrough">>, "many">>;
900
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
901
+ filename: z.ZodString;
902
+ content_type: z.ZodString;
903
+ content_base64: z.ZodString;
904
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
905
+ filename: z.ZodString;
906
+ content_type: z.ZodString;
907
+ content_base64: z.ZodString;
908
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
909
+ filename: z.ZodString;
910
+ content_type: z.ZodString;
911
+ content_base64: z.ZodString;
912
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
873
913
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
874
914
  tenant: z.ZodString;
875
915
  kind: z.ZodLiteral<"notification.send">;
@@ -988,6 +1028,19 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
988
1028
  expires_at: z.ZodOptional<z.ZodDate>;
989
1029
  url_secret: z.ZodOptional<z.ZodString>;
990
1030
  }, z.ZodTypeAny, "passthrough">>, "many">>;
1031
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1032
+ filename: z.ZodString;
1033
+ content_type: z.ZodString;
1034
+ content_base64: z.ZodString;
1035
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1036
+ filename: z.ZodString;
1037
+ content_type: z.ZodString;
1038
+ content_base64: z.ZodString;
1039
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1040
+ filename: z.ZodString;
1041
+ content_type: z.ZodString;
1042
+ content_base64: z.ZodString;
1043
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
991
1044
  }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
992
1045
  tenant: z.ZodString;
993
1046
  kind: z.ZodLiteral<"notification.send">;
@@ -1106,6 +1159,19 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1106
1159
  expires_at: z.ZodOptional<z.ZodDate>;
1107
1160
  url_secret: z.ZodOptional<z.ZodString>;
1108
1161
  }, z.ZodTypeAny, "passthrough">>, "many">>;
1162
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1163
+ filename: z.ZodString;
1164
+ content_type: z.ZodString;
1165
+ content_base64: z.ZodString;
1166
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1167
+ filename: z.ZodString;
1168
+ content_type: z.ZodString;
1169
+ content_base64: z.ZodString;
1170
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1171
+ filename: z.ZodString;
1172
+ content_type: z.ZodString;
1173
+ content_base64: z.ZodString;
1174
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
1109
1175
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1110
1176
  tenant: z.ZodString;
1111
1177
  kind: z.ZodLiteral<"notification.send">;
@@ -1224,6 +1290,19 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1224
1290
  expires_at: z.ZodOptional<z.ZodDate>;
1225
1291
  url_secret: z.ZodOptional<z.ZodString>;
1226
1292
  }, z.ZodTypeAny, "passthrough">>, "many">>;
1293
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1294
+ filename: z.ZodString;
1295
+ content_type: z.ZodString;
1296
+ content_base64: z.ZodString;
1297
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1298
+ filename: z.ZodString;
1299
+ content_type: z.ZodString;
1300
+ content_base64: z.ZodString;
1301
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1302
+ filename: z.ZodString;
1303
+ content_type: z.ZodString;
1304
+ content_base64: z.ZodString;
1305
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
1227
1306
  }, z.ZodTypeAny, "passthrough">>;
1228
1307
  export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1229
1308
  kind: z.ZodLiteral<"notification.send">;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zNexusDirectSendPayloadSchema = exports.zDirectSendPayloadSchema = exports.zNotificationDirectSendSchema = exports.zNotificationLogSchema = exports.zNotificationAttemptSchema = exports.zNotificationMessageSchema = exports.zNotificationErrorSchema = exports.zNotificationProviderMetaSchema = exports.zNotificationTemplateRefSchema = exports.zNotificationChannelRefSchema = exports.zNotificationRecipientSchema = exports.zNotificationLogLevelSchema = exports.zNotificationRecipientKindSchema = exports.zNotificationAttemptStatusSchema = exports.zNotificationMessageStatusSchema = exports.zNotificationChannelTypeSchema = void 0;
3
+ exports.zNexusDirectSendPayloadSchema = exports.zDirectSendPayloadSchema = exports.zNotificationAttachmentSchema = exports.NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES = exports.zNotificationDirectSendSchema = exports.zNotificationLogSchema = exports.zNotificationAttemptSchema = exports.zNotificationMessageSchema = exports.zNotificationErrorSchema = exports.zNotificationProviderMetaSchema = exports.zNotificationTemplateRefSchema = exports.zNotificationChannelRefSchema = exports.zNotificationRecipientSchema = exports.zNotificationLogLevelSchema = exports.zNotificationRecipientKindSchema = exports.zNotificationAttemptStatusSchema = exports.zNotificationMessageStatusSchema = exports.zNotificationChannelTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../shared/zod-schemas");
6
6
  const zod_schemas_2 = require("../evo-task/zod-schemas");
@@ -137,6 +137,19 @@ exports.zNotificationDirectSendSchema = zod_1.z.object({
137
137
  category: zod_1.z.literal("utility"),
138
138
  ttl_seconds: zod_1.z.number().int().min(30).max(43200).optional(),
139
139
  });
140
+ // ---- feat-160 R6 / F31: anexo de notificação (INotificationAttachment) ----
141
+ //
142
+ // 64 KB é o teto DEPOIS do base64 (65536 chars). Declarado aqui para que o
143
+ // direct-send recuse na borda, e não no provider — o payload vive no doc da
144
+ // task e no doc da mensagem, e o Firestore corta em 1 MB.
145
+ exports.NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES = 65536;
146
+ exports.zNotificationAttachmentSchema = zod_1.z
147
+ .object({
148
+ filename: zod_1.z.string().min(1).max(200),
149
+ content_type: zod_1.z.string().min(1).max(200),
150
+ content_base64: zod_1.z.string().min(1).max(exports.NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES),
151
+ })
152
+ .passthrough();
140
153
  // ---- HTTP direct send (INotificationSendPayload + tenant + externalLinks) ----
141
154
  exports.zDirectSendPayloadSchema = zod_1.z
142
155
  .object({
@@ -166,6 +179,8 @@ exports.zDirectSendPayloadSchema = zod_1.z
166
179
  force_send: zod_1.z.boolean().optional(),
167
180
  externalLinks: zod_1.z.array(zod_schemas_2.zExternalLinkSchema).optional(),
168
181
  quick_reply_actions: zod_1.z.array(zod_schemas_3.zQuickReplyActionIntentSchema).optional(),
182
+ // feat-160 R6 / F31 — só o canal de e-mail honra; 1 anexo por mensagem.
183
+ attachments: zod_1.z.array(exports.zNotificationAttachmentSchema).max(1).optional(),
169
184
  })
170
185
  .passthrough()
171
186
  .superRefine((data, ctx) => {
@@ -153,6 +153,21 @@ export const zNotificationDirectSendSchema = z.object({
153
153
  ttl_seconds: z.number().int().min(30).max(43200).optional(),
154
154
  });
155
155
 
156
+ // ---- feat-160 R6 / F31: anexo de notificação (INotificationAttachment) ----
157
+ //
158
+ // 64 KB é o teto DEPOIS do base64 (65536 chars). Declarado aqui para que o
159
+ // direct-send recuse na borda, e não no provider — o payload vive no doc da
160
+ // task e no doc da mensagem, e o Firestore corta em 1 MB.
161
+ export const NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES = 65536;
162
+
163
+ export const zNotificationAttachmentSchema = z
164
+ .object({
165
+ filename: z.string().min(1).max(200),
166
+ content_type: z.string().min(1).max(200),
167
+ content_base64: z.string().min(1).max(NOTIFICATION_ATTACHMENT_MAX_BASE64_BYTES),
168
+ })
169
+ .passthrough();
170
+
156
171
  // ---- HTTP direct send (INotificationSendPayload + tenant + externalLinks) ----
157
172
 
158
173
  export const zDirectSendPayloadSchema = z
@@ -183,6 +198,8 @@ export const zDirectSendPayloadSchema = z
183
198
  force_send: z.boolean().optional(),
184
199
  externalLinks: z.array(zExternalLinkSchema).optional(),
185
200
  quick_reply_actions: z.array(zQuickReplyActionIntentSchema).optional(),
201
+ // feat-160 R6 / F31 — só o canal de e-mail honra; 1 anexo por mensagem.
202
+ attachments: z.array(zNotificationAttachmentSchema).max(1).optional(),
186
203
  })
187
204
  .passthrough()
188
205
  .superRefine((data, ctx) => {
@@ -123,6 +123,22 @@ export declare const zAutomationDateWindowSchema: z.ZodObject<{
123
123
  offset_mode: "calendar" | "business";
124
124
  }>;
125
125
  export declare const zAutomationTimeOfDaySchema: z.ZodString;
126
+ export declare const zAutomationTimeOfDayRangeSchema: z.ZodEffects<z.ZodObject<{
127
+ start: z.ZodString;
128
+ end: z.ZodString;
129
+ }, "strip", z.ZodTypeAny, {
130
+ start: string;
131
+ end: string;
132
+ }, {
133
+ start: string;
134
+ end: string;
135
+ }>, {
136
+ start: string;
137
+ end: string;
138
+ }, {
139
+ start: string;
140
+ end: string;
141
+ }>;
126
142
  export declare const zAutomationAppointmentModeSchema: z.ZodEnum<["telemedicine", "in_person"]>;
127
143
  export declare const zAutomationAppointmentSelectionSchema: z.ZodObject<{
128
144
  target: z.ZodLiteral<"appointment">;
@@ -588,17 +604,25 @@ export declare const zAutomationSelectionSchema: z.ZodDiscriminatedUnion<"target
588
604
  };
589
605
  target: "patient";
590
606
  }>]>;
591
- export declare const zAutomationOperatorSchema: z.ZodEnum<["eq", "neq", "in", "not_in", "exists", "not_exists", "is_true", "is_false"]>;
592
- export declare const zAutomationConditionSchema: z.ZodObject<{
607
+ export declare const zAutomationOperatorSchema: z.ZodEnum<["eq", "neq", "in", "not_in", "exists", "not_exists", "is_true", "is_false", "between", "not_between"]>;
608
+ export declare const zAutomationConditionSchema: z.ZodEffects<z.ZodObject<{
593
609
  fact: z.ZodString;
594
- operator: z.ZodEnum<["eq", "neq", "in", "not_in", "exists", "not_exists", "is_true", "is_false"]>;
610
+ operator: z.ZodEnum<["eq", "neq", "in", "not_in", "exists", "not_exists", "is_true", "is_false", "between", "not_between"]>;
595
611
  value: z.ZodOptional<z.ZodUnknown>;
596
612
  }, "strip", z.ZodTypeAny, {
597
- operator: "in" | "eq" | "neq" | "not_in" | "exists" | "not_exists" | "is_true" | "is_false";
613
+ operator: "in" | "eq" | "neq" | "not_in" | "exists" | "not_exists" | "is_true" | "is_false" | "between" | "not_between";
614
+ fact: string;
615
+ value?: unknown;
616
+ }, {
617
+ operator: "in" | "eq" | "neq" | "not_in" | "exists" | "not_exists" | "is_true" | "is_false" | "between" | "not_between";
618
+ fact: string;
619
+ value?: unknown;
620
+ }>, {
621
+ operator: "in" | "eq" | "neq" | "not_in" | "exists" | "not_exists" | "is_true" | "is_false" | "between" | "not_between";
598
622
  fact: string;
599
623
  value?: unknown;
600
624
  }, {
601
- operator: "in" | "eq" | "neq" | "not_in" | "exists" | "not_exists" | "is_true" | "is_false";
625
+ operator: "in" | "eq" | "neq" | "not_in" | "exists" | "not_exists" | "is_true" | "is_false" | "between" | "not_between";
602
626
  fact: string;
603
627
  value?: unknown;
604
628
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zAutomationTriggerRequestSchema = exports.zAutomationDryRunRequestSchema = exports.zHubAutomationConfigSchema = exports.zAutomationRoutineUpdateRequestSchema = exports.zAutomationRoutineWriteSchema = exports.zAutomationRoutineSchema = exports.zAutomationBranchModeSchema = exports.zAutomationBranchSchema = exports.zAutomationOutputSchema = exports.zAutomationActionOutputSchema = exports.zAutomationHumanTaskOutputSchema = exports.zAutomationAutoTaskOutputSchema = exports.zAutomationExecuteAtSchema = exports.zAutomationConditionGroupSchema = exports.zAutomationConditionSchema = exports.zAutomationOperatorSchema = exports.zAutomationSelectionSchema = exports.zAutomationPatientSelectionSchema = exports.zAutomationLeadSelectionSchema = exports.zAutomationAppointmentSelectionSchema = exports.zAutomationAppointmentModeSchema = exports.zAutomationTimeOfDaySchema = exports.zAutomationDateWindowSchema = exports.zAutomationDateOffsetModeSchema = exports.zAutomationTriggerSchema = exports.zAutomationEventTriggerSchema = exports.zAutomationWebhookTriggerSchema = exports.zAutomationCronTriggerSchema = void 0;
3
+ exports.zAutomationTriggerRequestSchema = exports.zAutomationDryRunRequestSchema = exports.zHubAutomationConfigSchema = exports.zAutomationRoutineUpdateRequestSchema = exports.zAutomationRoutineWriteSchema = exports.zAutomationRoutineSchema = exports.zAutomationBranchModeSchema = exports.zAutomationBranchSchema = exports.zAutomationOutputSchema = exports.zAutomationActionOutputSchema = exports.zAutomationHumanTaskOutputSchema = exports.zAutomationAutoTaskOutputSchema = exports.zAutomationExecuteAtSchema = exports.zAutomationConditionGroupSchema = exports.zAutomationConditionSchema = exports.zAutomationOperatorSchema = exports.zAutomationSelectionSchema = exports.zAutomationPatientSelectionSchema = exports.zAutomationLeadSelectionSchema = exports.zAutomationAppointmentSelectionSchema = exports.zAutomationAppointmentModeSchema = exports.zAutomationTimeOfDayRangeSchema = exports.zAutomationTimeOfDaySchema = exports.zAutomationDateWindowSchema = exports.zAutomationDateOffsetModeSchema = exports.zAutomationTriggerSchema = exports.zAutomationEventTriggerSchema = exports.zAutomationWebhookTriggerSchema = exports.zAutomationCronTriggerSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../evo-task/zod-schemas");
6
6
  // ------------------------------------------------------
@@ -45,6 +45,14 @@ exports.zAutomationDateWindowSchema = zod_1.z.object({
45
45
  exports.zAutomationTimeOfDaySchema = zod_1.z
46
46
  .string()
47
47
  .regex(/^([01]\d|2[0-3]):[0-5]\d$/, "expected HH:mm");
48
+ // feat-167: value of the between/not_between branch operators. Kept separate
49
+ // from selection.time_range (inline below), which does not change.
50
+ exports.zAutomationTimeOfDayRangeSchema = zod_1.z
51
+ .object({ start: exports.zAutomationTimeOfDaySchema, end: exports.zAutomationTimeOfDaySchema })
52
+ .refine((r) => r.start !== r.end, {
53
+ message: "start and end must differ",
54
+ path: ["end"],
55
+ });
48
56
  // feat-147: appointment modality (IAppointment.appointmentMode). Fixed enum —
49
57
  // the selection matches it exactly (no wildcard glob).
50
58
  exports.zAutomationAppointmentModeSchema = zod_1.z.enum([
@@ -131,11 +139,29 @@ exports.zAutomationOperatorSchema = zod_1.z.enum([
131
139
  "not_exists",
132
140
  "is_true",
133
141
  "is_false",
142
+ // feat-167
143
+ "between",
144
+ "not_between",
134
145
  ]);
135
- exports.zAutomationConditionSchema = zod_1.z.object({
146
+ // feat-167: between/not_between validate `value` as a time-of-day range. The
147
+ // operator is NOT tied to `appointment.start_time` here (`fact` stays a free
148
+ // string for forward compat); the evaluator returns false on any other fact and
149
+ // the builder only offers these operators for the time fact.
150
+ exports.zAutomationConditionSchema = zod_1.z
151
+ .object({
136
152
  fact: zod_1.z.string().min(1),
137
153
  operator: exports.zAutomationOperatorSchema,
138
154
  value: zod_1.z.unknown().optional(),
155
+ })
156
+ .superRefine((c, ctx) => {
157
+ if (c.operator !== "between" && c.operator !== "not_between")
158
+ return;
159
+ const r = exports.zAutomationTimeOfDayRangeSchema.safeParse(c.value);
160
+ if (!r.success) {
161
+ for (const issue of r.error.issues) {
162
+ ctx.addIssue({ ...issue, path: ["value", ...issue.path] });
163
+ }
164
+ }
139
165
  });
140
166
  exports.zAutomationConditionGroupSchema = zod_1.z.lazy(() => zod_1.z.object({
141
167
  combinator: zod_1.z.enum(["and", "or"]),
@@ -54,6 +54,15 @@ export const zAutomationTimeOfDaySchema = z
54
54
  .string()
55
55
  .regex(/^([01]\d|2[0-3]):[0-5]\d$/, "expected HH:mm");
56
56
 
57
+ // feat-167: value of the between/not_between branch operators. Kept separate
58
+ // from selection.time_range (inline below), which does not change.
59
+ export const zAutomationTimeOfDayRangeSchema = z
60
+ .object({ start: zAutomationTimeOfDaySchema, end: zAutomationTimeOfDaySchema })
61
+ .refine((r) => r.start !== r.end, {
62
+ message: "start and end must differ",
63
+ path: ["end"],
64
+ });
65
+
57
66
  // feat-147: appointment modality (IAppointment.appointmentMode). Fixed enum —
58
67
  // the selection matches it exactly (no wildcard glob).
59
68
  export const zAutomationAppointmentModeSchema = z.enum([
@@ -146,13 +155,30 @@ export const zAutomationOperatorSchema = z.enum([
146
155
  "not_exists",
147
156
  "is_true",
148
157
  "is_false",
158
+ // feat-167
159
+ "between",
160
+ "not_between",
149
161
  ]);
150
162
 
151
- export const zAutomationConditionSchema = z.object({
152
- fact: z.string().min(1),
153
- operator: zAutomationOperatorSchema,
154
- value: z.unknown().optional(),
155
- });
163
+ // feat-167: between/not_between validate `value` as a time-of-day range. The
164
+ // operator is NOT tied to `appointment.start_time` here (`fact` stays a free
165
+ // string for forward compat); the evaluator returns false on any other fact and
166
+ // the builder only offers these operators for the time fact.
167
+ export const zAutomationConditionSchema = z
168
+ .object({
169
+ fact: z.string().min(1),
170
+ operator: zAutomationOperatorSchema,
171
+ value: z.unknown().optional(),
172
+ })
173
+ .superRefine((c, ctx) => {
174
+ if (c.operator !== "between" && c.operator !== "not_between") return;
175
+ const r = zAutomationTimeOfDayRangeSchema.safeParse(c.value);
176
+ if (!r.success) {
177
+ for (const issue of r.error.issues) {
178
+ ctx.addIssue({ ...issue, path: ["value", ...issue.path] });
179
+ }
180
+ }
181
+ });
156
182
 
157
183
  // z.lazy needs an explicit type annotation for the recursive reference.
158
184
  type ZAutomationConditionGroup = {
@@ -20,6 +20,32 @@ export declare const AppointmentModeEnum: {
20
20
  readonly InPerson: "in_person";
21
21
  };
22
22
  export type AppointmentMode = (typeof AppointmentModeEnum)[keyof typeof AppointmentModeEnum];
23
+ export declare const TelemedicineProviderEnum: {
24
+ /** Hub Médica Virtual Care — o único provider que aciona o nosso domínio de telemedicina (sala, gravação, transcrição, bilhetagem). */
25
+ readonly VirtualCare: "virtual_care";
26
+ /** Ferramenta de terceiro (Meet, Zoom, iClinic…). Guarda o link em `access_url`; NUNCA cria sala nossa. */
27
+ readonly Other: "other";
28
+ };
29
+ export type TelemedicineProvider = (typeof TelemedicineProviderEnum)[keyof typeof TelemedicineProviderEnum];
30
+ /**
31
+ * Bloco de telemedicina do agendamento (feat-160 R6, D38).
32
+ *
33
+ * Só é lido quando `appointmentMode === 'telemedicine'`. Em agendamento
34
+ * PRESENCIAL o bloco é ignorado por invariante (o form do FE o limpa; o
35
+ * backend nunca o consulta) — ver `isVirtualCareAppointment` em `@evo/model`.
36
+ *
37
+ * Ausência de bloco (ou de `provider`) em telemedicina = telemedicina genérica
38
+ * legada: nenhuma sala é criada e nenhuma teleconsulta existente é cancelada.
39
+ */
40
+ export interface IAppointmentTelemedicine {
41
+ provider: TelemedicineProvider;
42
+ /**
43
+ * Link de acesso do terceiro. Só tem significado com `provider: 'other'`;
44
+ * com `virtual_care` o acesso é sempre o nosso `/qr` com capability.
45
+ * Só http(s) é aceito pelos leitores (`telemedicineAccessUrl`).
46
+ */
47
+ access_url?: string | null;
48
+ }
23
49
  export interface IAppointmentAddress {
24
50
  address_name?: string;
25
51
  address_line1?: string;
@@ -146,6 +172,11 @@ export interface IAppointment extends IFireDoc {
146
172
  statusBase: AppointmentStatusType;
147
173
  notes?: string;
148
174
  appointmentMode?: AppointmentMode | null;
175
+ /**
176
+ * Provider de telemedicina (feat-160 R6, D38). Lido SÓ quando
177
+ * `appointmentMode === 'telemedicine'`. Ver `IAppointmentTelemedicine`.
178
+ */
179
+ telemedicine?: IAppointmentTelemedicine | null;
149
180
  appointmentType?: string | null;
150
181
  appointmentBaseType?: AppointmentType | null;
151
182
  appointmentSource?: IAppointmentAppointmentSource | null;
@@ -183,6 +214,8 @@ export interface IPatientAppointment {
183
214
  status: string;
184
215
  statusBase: AppointmentStatusType;
185
216
  appointmentMode?: AppointmentMode | null;
217
+ /** Espelho do provider de telemedicina do agendamento (feat-160 R6, D38). */
218
+ telemedicine?: IAppointmentTelemedicine | null;
186
219
  appointmentBaseType?: AppointmentType | null;
187
220
  procedures?: string[];
188
221
  professional?: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PaymentTypeEnum = exports.AppointmentModeEnum = exports.AppointmentPaymentStatusEnum = exports.EvoMedAppointmentPermissions = void 0;
3
+ exports.PaymentTypeEnum = exports.TelemedicineProviderEnum = exports.AppointmentModeEnum = exports.AppointmentPaymentStatusEnum = exports.EvoMedAppointmentPermissions = void 0;
4
4
  // Permissões para o agendamento
5
5
  exports.EvoMedAppointmentPermissions = {
6
6
  List: "evo_med_appointment_read",
@@ -21,6 +21,24 @@ exports.AppointmentModeEnum = {
21
21
  Telemedicine: "telemedicine",
22
22
  InPerson: "in_person",
23
23
  };
24
+ // ----- Telemedicina: PROVIDER dentro do agendamento (feat-160 R6, D38)
25
+ //
26
+ // A modalidade (`appointmentMode`) continua canônica `in_person | telemedicine`.
27
+ // Quem distingue "consulta na NOSSA sala" de "consulta remota em ferramenta de
28
+ // terceiro" é este bloco, e só ele.
29
+ //
30
+ // ⚠️ HOMÔNIMO: `TelemedicineProviderEnum.VirtualCare` ('virtual_care') é o
31
+ // PROVIDER do agendamento. `IMedCalendar.virtual_care`
32
+ // (`IMedCalendarVirtualCareConfig`, D32) é OUTRA coisa: a configuração de
33
+ // gravação/retenção/identidade da agenda. São escopos diferentes; o único
34
+ // ponto em que se cruzam é `virtual_care.default_provider` (qual provider a
35
+ // agenda sugere ao agendar telemedicina).
36
+ exports.TelemedicineProviderEnum = {
37
+ /** Hub Médica Virtual Care — o único provider que aciona o nosso domínio de telemedicina (sala, gravação, transcrição, bilhetagem). */
38
+ VirtualCare: "virtual_care",
39
+ /** Ferramenta de terceiro (Meet, Zoom, iClinic…). Guarda o link em `access_url`; NUNCA cria sala nossa. */
40
+ Other: "other",
41
+ };
24
42
  exports.PaymentTypeEnum = {
25
43
  Patient: "patient",
26
44
  Insurance: "insurance",
@@ -38,6 +38,48 @@ export const AppointmentModeEnum = {
38
38
  export type AppointmentMode =
39
39
  (typeof AppointmentModeEnum)[keyof typeof AppointmentModeEnum];
40
40
 
41
+ // ----- Telemedicina: PROVIDER dentro do agendamento (feat-160 R6, D38)
42
+ //
43
+ // A modalidade (`appointmentMode`) continua canônica `in_person | telemedicine`.
44
+ // Quem distingue "consulta na NOSSA sala" de "consulta remota em ferramenta de
45
+ // terceiro" é este bloco, e só ele.
46
+ //
47
+ // ⚠️ HOMÔNIMO: `TelemedicineProviderEnum.VirtualCare` ('virtual_care') é o
48
+ // PROVIDER do agendamento. `IMedCalendar.virtual_care`
49
+ // (`IMedCalendarVirtualCareConfig`, D32) é OUTRA coisa: a configuração de
50
+ // gravação/retenção/identidade da agenda. São escopos diferentes; o único
51
+ // ponto em que se cruzam é `virtual_care.default_provider` (qual provider a
52
+ // agenda sugere ao agendar telemedicina).
53
+ export const TelemedicineProviderEnum = {
54
+ /** Hub Médica Virtual Care — o único provider que aciona o nosso domínio de telemedicina (sala, gravação, transcrição, bilhetagem). */
55
+ VirtualCare: "virtual_care",
56
+ /** Ferramenta de terceiro (Meet, Zoom, iClinic…). Guarda o link em `access_url`; NUNCA cria sala nossa. */
57
+ Other: "other",
58
+ } as const;
59
+
60
+ export type TelemedicineProvider =
61
+ (typeof TelemedicineProviderEnum)[keyof typeof TelemedicineProviderEnum];
62
+
63
+ /**
64
+ * Bloco de telemedicina do agendamento (feat-160 R6, D38).
65
+ *
66
+ * Só é lido quando `appointmentMode === 'telemedicine'`. Em agendamento
67
+ * PRESENCIAL o bloco é ignorado por invariante (o form do FE o limpa; o
68
+ * backend nunca o consulta) — ver `isVirtualCareAppointment` em `@evo/model`.
69
+ *
70
+ * Ausência de bloco (ou de `provider`) em telemedicina = telemedicina genérica
71
+ * legada: nenhuma sala é criada e nenhuma teleconsulta existente é cancelada.
72
+ */
73
+ export interface IAppointmentTelemedicine {
74
+ provider: TelemedicineProvider;
75
+ /**
76
+ * Link de acesso do terceiro. Só tem significado com `provider: 'other'`;
77
+ * com `virtual_care` o acesso é sempre o nosso `/qr` com capability.
78
+ * Só http(s) é aceito pelos leitores (`telemedicineAccessUrl`).
79
+ */
80
+ access_url?: string | null;
81
+ }
82
+
41
83
  // Interface para endereço
42
84
  export interface IAppointmentAddress {
43
85
  address_name?: string;
@@ -187,6 +229,11 @@ export interface IAppointment extends IFireDoc {
187
229
  statusBase: AppointmentStatusType;
188
230
  notes?: string;
189
231
  appointmentMode?: AppointmentMode | null;
232
+ /**
233
+ * Provider de telemedicina (feat-160 R6, D38). Lido SÓ quando
234
+ * `appointmentMode === 'telemedicine'`. Ver `IAppointmentTelemedicine`.
235
+ */
236
+ telemedicine?: IAppointmentTelemedicine | null;
190
237
  appointmentType?: string | null;
191
238
  appointmentBaseType?: AppointmentType | null;
192
239
  appointmentSource?: IAppointmentAppointmentSource | null;
@@ -229,6 +276,8 @@ export interface IPatientAppointment {
229
276
  status: string;
230
277
  statusBase: AppointmentStatusType;
231
278
  appointmentMode?: AppointmentMode | null;
279
+ /** Espelho do provider de telemedicina do agendamento (feat-160 R6, D38). */
280
+ telemedicine?: IAppointmentTelemedicine | null;
232
281
  appointmentBaseType?: AppointmentType | null;
233
282
  procedures?: string[];
234
283
  professional?: string;
@@ -1,6 +1,7 @@
1
1
  export * from "../../evo-people/fb_collections";
2
2
  import type { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
3
3
  import type { IAppointmentCounters } from "../people";
4
+ import type { TelemedicineProvider } from "../appointment";
4
5
  import type { IMedCalendarIntegration } from "../../evo-integrations";
5
6
  export declare const EvoMedCalendarPermissions: {
6
7
  readonly List: "evo_med_calendar_read";
@@ -212,6 +213,14 @@ export interface IMedCalendarVirtualCareConfig {
212
213
  max_duration_minutes?: number | null;
213
214
  /** Aviso ao médico no SPA quando faltar N min para o fim. 0 = sem aviso. */
214
215
  end_warning_minutes?: number | null;
216
+ /**
217
+ * Provider sugerido ao agendar TELEMEDICINA nesta agenda (feat-160 R6, D38).
218
+ * Ausente = `virtual_care`. Não confundir o bloco `virtual_care` da agenda
219
+ * (esta config) com o provider `'virtual_care'` do agendamento
220
+ * (`IAppointmentTelemedicine.provider`): são coisas diferentes, e este campo
221
+ * é o ÚNICO ponto em que se cruzam.
222
+ */
223
+ default_provider?: TelemedicineProvider | null;
215
224
  }
216
225
  /** Config já RESOLVIDA (doc + defaults) — é com isto que o backend decide. */
217
226
  export interface IMedCalendarVirtualCareSettings {
@@ -233,6 +242,13 @@ export interface IMedCalendarVirtualCareSettings {
233
242
  allow_late_end: boolean;
234
243
  max_duration_minutes: number;
235
244
  end_warning_minutes: number;
245
+ /**
246
+ * Provider sugerido ao agendar telemedicina (feat-160 R6, D38).
247
+ * Opcional mesmo no tipo RESOLVIDO: quem lê aplica
248
+ * `?? TelemedicineProviderEnum.VirtualCare`, e declarar obrigatório aqui
249
+ * quebraria todo resolvedor já compilado contra os defaults congelados.
250
+ */
251
+ default_provider?: TelemedicineProvider;
236
252
  }
237
253
  /**
238
254
  * Defaults da spec (plan §12 / D13 / D32). Agenda sem `virtual_care` vale
@@ -1,6 +1,7 @@
1
1
  export * from "../../evo-people/fb_collections";
2
2
  import type { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
3
3
  import type { IAppointmentCounters } from "../people";
4
+ import type { TelemedicineProvider } from "../appointment";
4
5
  import type { IMedCalendarIntegration } from "../../evo-integrations";
5
6
 
6
7
  // Permissões para o calendário
@@ -254,6 +255,14 @@ export interface IMedCalendarVirtualCareConfig {
254
255
  max_duration_minutes?: number | null;
255
256
  /** Aviso ao médico no SPA quando faltar N min para o fim. 0 = sem aviso. */
256
257
  end_warning_minutes?: number | null;
258
+ /**
259
+ * Provider sugerido ao agendar TELEMEDICINA nesta agenda (feat-160 R6, D38).
260
+ * Ausente = `virtual_care`. Não confundir o bloco `virtual_care` da agenda
261
+ * (esta config) com o provider `'virtual_care'` do agendamento
262
+ * (`IAppointmentTelemedicine.provider`): são coisas diferentes, e este campo
263
+ * é o ÚNICO ponto em que se cruzam.
264
+ */
265
+ default_provider?: TelemedicineProvider | null;
257
266
  }
258
267
 
259
268
  /** Config já RESOLVIDA (doc + defaults) — é com isto que o backend decide. */
@@ -276,6 +285,13 @@ export interface IMedCalendarVirtualCareSettings {
276
285
  allow_late_end: boolean;
277
286
  max_duration_minutes: number;
278
287
  end_warning_minutes: number;
288
+ /**
289
+ * Provider sugerido ao agendar telemedicina (feat-160 R6, D38).
290
+ * Opcional mesmo no tipo RESOLVIDO: quem lê aplica
291
+ * `?? TelemedicineProviderEnum.VirtualCare`, e declarar obrigatório aqui
292
+ * quebraria todo resolvedor já compilado contra os defaults congelados.
293
+ */
294
+ default_provider?: TelemedicineProvider;
279
295
  }
280
296
 
281
297
  /**
@@ -118,6 +118,25 @@ export interface INotificationDirectSend {
118
118
  category: 'utility';
119
119
  ttl_seconds?: number;
120
120
  }
121
+ /**
122
+ * Anexo de notificação (feat-160 R6 / F31 — ICS no e-mail).
123
+ *
124
+ * Só o canal de E-MAIL entende anexo. Provider que não conhece anexo
125
+ * (WhatsApp) **ignora** o campo — de propósito: anexo NÃO é mídia de HSM, e
126
+ * "consertar" mandando o ICS como documento de template quebra o envio.
127
+ *
128
+ * Teto de 64 KB por anexo DEPOIS do base64, 1 anexo por mensagem. O payload
129
+ * vive no doc da task E no doc da mensagem, e o Firestore corta em 1 MB — por
130
+ * isso o limite é validado no usecase, não só no provider.
131
+ */
132
+ export interface INotificationAttachment {
133
+ /** Nome do arquivo apresentado ao destinatário. Ex.: 'consulta.ics'. */
134
+ filename: string;
135
+ /** Ex.: 'text/calendar; charset=utf-8; method=PUBLISH'. */
136
+ content_type: string;
137
+ /** Conteúdo em base64. <= 64 KB já codificado. */
138
+ content_base64: string;
139
+ }
121
140
  export interface INotificationSendPayload {
122
141
  kind: "notification.send";
123
142
  classification?: string;
@@ -143,6 +162,11 @@ export interface INotificationSendPayload {
143
162
  * The send path creates one quick-reply-actions/{actionId} doc per intent.
144
163
  */
145
164
  quick_reply_actions?: IQuickReplyActionIntent[];
165
+ /**
166
+ * Anexos (feat-160 R6 / F31). Honrado SÓ no canal de e-mail; ignorado pelos
167
+ * demais providers. 1 anexo, <= 64 KB em base64 — ver `INotificationAttachment`.
168
+ */
169
+ attachments?: INotificationAttachment[];
146
170
  routine?: {
147
171
  id: string;
148
172
  version?: number | string;
@@ -202,6 +202,26 @@ export interface INotificationDirectSend {
202
202
  ttl_seconds?: number;
203
203
  }
204
204
 
205
+ /**
206
+ * Anexo de notificação (feat-160 R6 / F31 — ICS no e-mail).
207
+ *
208
+ * Só o canal de E-MAIL entende anexo. Provider que não conhece anexo
209
+ * (WhatsApp) **ignora** o campo — de propósito: anexo NÃO é mídia de HSM, e
210
+ * "consertar" mandando o ICS como documento de template quebra o envio.
211
+ *
212
+ * Teto de 64 KB por anexo DEPOIS do base64, 1 anexo por mensagem. O payload
213
+ * vive no doc da task E no doc da mensagem, e o Firestore corta em 1 MB — por
214
+ * isso o limite é validado no usecase, não só no provider.
215
+ */
216
+ export interface INotificationAttachment {
217
+ /** Nome do arquivo apresentado ao destinatário. Ex.: 'consulta.ics'. */
218
+ filename: string;
219
+ /** Ex.: 'text/calendar; charset=utf-8; method=PUBLISH'. */
220
+ content_type: string;
221
+ /** Conteúdo em base64. <= 64 KB já codificado. */
222
+ content_base64: string;
223
+ }
224
+
205
225
  export interface INotificationSendPayload {
206
226
  kind: "notification.send";
207
227
 
@@ -237,6 +257,12 @@ export interface INotificationSendPayload {
237
257
  */
238
258
  quick_reply_actions?: IQuickReplyActionIntent[];
239
259
 
260
+ /**
261
+ * Anexos (feat-160 R6 / F31). Honrado SÓ no canal de e-mail; ignorado pelos
262
+ * demais providers. 1 anexo, <= 64 KB em base64 — ver `INotificationAttachment`.
263
+ */
264
+ attachments?: INotificationAttachment[];
265
+
240
266
  // Optional business context
241
267
  routine?: {
242
268
  id: string;
@@ -84,7 +84,7 @@ export interface IAutomationFilterValues {
84
84
  status_bases: string[];
85
85
  appointment_types: string[];
86
86
  }
87
- export declare const AUTOMATION_APPOINTMENT_FACTS: readonly ["appointment.status", "appointment.status_base", "appointment.appointment_type", "appointment.appointment_base_type", "appointment.appointment_mode", "appointment.professional_id", "appointment.procedure_ids", "appointment.professional_name", "appointment.procedure_names", "appointment.insurance_name", "appointment.address_name", "appointment.payment_status", "appointment.calendar_id"];
87
+ export declare const AUTOMATION_APPOINTMENT_FACTS: readonly ["appointment.status", "appointment.status_base", "appointment.appointment_type", "appointment.appointment_base_type", "appointment.appointment_mode", "appointment.professional_id", "appointment.procedure_ids", "appointment.professional_name", "appointment.procedure_names", "appointment.insurance_name", "appointment.address_name", "appointment.payment_status", "appointment.calendar_id", "appointment.start_time"];
88
88
  export type AutomationAppointmentFact = (typeof AUTOMATION_APPOINTMENT_FACTS)[number];
89
89
  export declare const AUTOMATION_LEAD_FACTS: readonly ["lead.status", "lead.qualification_code", "lead.qualification_name", "lead.qualification_funnel_level", "lead.dist_channel_code", "lead.dist_channel_name", "lead.tags"];
90
90
  export type AutomationLeadFact = (typeof AUTOMATION_LEAD_FACTS)[number];
@@ -100,8 +100,16 @@ export declare const AutomationOperatorEnum: {
100
100
  readonly NotExists: "not_exists";
101
101
  readonly IsTrue: "is_true";
102
102
  readonly IsFalse: "is_false";
103
+ readonly Between: "between";
104
+ readonly NotBetween: "not_between";
103
105
  };
104
106
  export type AutomationOperator = (typeof AutomationOperatorEnum)[keyof typeof AutomationOperatorEnum];
107
+ /** feat-167: value of between/not_between. start <= hh:mm < end; start > end = overnight. */
108
+ export interface IAutomationTimeOfDayRange {
109
+ start: string;
110
+ end: string;
111
+ }
112
+ export declare const AUTOMATION_TIME_RANGE_OPERATORS: readonly ["between", "not_between"];
105
113
  export interface IAutomationCondition {
106
114
  fact: string;
107
115
  operator: AutomationOperator;
@@ -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.AutomationRunStatusEnum = exports.AutomationOutputTypeEnum = exports.AutomationOperatorEnum = exports.AUTOMATION_PATIENT_FACTS = exports.AUTOMATION_LEAD_FACTS = exports.AUTOMATION_APPOINTMENT_FACTS = exports.HubAutomationPermissions = void 0;
17
+ exports.AutomationRunStatusEnum = exports.AutomationOutputTypeEnum = exports.AUTOMATION_TIME_RANGE_OPERATORS = exports.AutomationOperatorEnum = exports.AUTOMATION_PATIENT_FACTS = exports.AUTOMATION_LEAD_FACTS = exports.AUTOMATION_APPOINTMENT_FACTS = exports.HubAutomationPermissions = void 0;
18
18
  __exportStar(require("./fb_collections"), exports);
19
19
  // ======================================================
20
20
  // hub-automation
@@ -59,6 +59,9 @@ exports.AUTOMATION_APPOINTMENT_FACTS = [
59
59
  "appointment.address_name",
60
60
  "appointment.payment_status",
61
61
  "appointment.calendar_id",
62
+ // feat-167: "HH:mm" local of startDate in the TENANT timezone (same clock as
63
+ // selection.time_range). Meant for the between/not_between operators.
64
+ "appointment.start_time",
62
65
  ];
63
66
  // feat-085 (F3): lead domain facts (derived from the fields ILead exposes;
64
67
  // resolved from the event-preloaded lead). Mirror of the appointment catalog.
@@ -95,7 +98,11 @@ exports.AutomationOperatorEnum = {
95
98
  NotExists: "not_exists",
96
99
  IsTrue: "is_true",
97
100
  IsFalse: "is_false",
101
+ // feat-167: time-of-day range over appointment.start_time.
102
+ Between: "between",
103
+ NotBetween: "not_between",
98
104
  };
105
+ exports.AUTOMATION_TIME_RANGE_OPERATORS = ["between", "not_between"];
99
106
  // ------------------------------------------------------
100
107
  // Outputs (auto Task | human Task | inline Action)
101
108
  // ------------------------------------------------------
@@ -207,6 +207,9 @@ export const AUTOMATION_APPOINTMENT_FACTS = [
207
207
  "appointment.address_name",
208
208
  "appointment.payment_status",
209
209
  "appointment.calendar_id",
210
+ // feat-167: "HH:mm" local of startDate in the TENANT timezone (same clock as
211
+ // selection.time_range). Meant for the between/not_between operators.
212
+ "appointment.start_time",
210
213
  ] as const;
211
214
 
212
215
  export type AutomationAppointmentFact =
@@ -258,17 +261,29 @@ export const AutomationOperatorEnum = {
258
261
  NotExists: "not_exists",
259
262
  IsTrue: "is_true",
260
263
  IsFalse: "is_false",
264
+ // feat-167: time-of-day range over appointment.start_time.
265
+ Between: "between",
266
+ NotBetween: "not_between",
261
267
  } as const;
262
268
 
263
269
  export type AutomationOperator =
264
270
  (typeof AutomationOperatorEnum)[keyof typeof AutomationOperatorEnum];
265
271
 
272
+ /** feat-167: value of between/not_between. start <= hh:mm < end; start > end = overnight. */
273
+ export interface IAutomationTimeOfDayRange {
274
+ start: string;
275
+ end: string;
276
+ }
277
+
278
+ export const AUTOMATION_TIME_RANGE_OPERATORS = ["between", "not_between"] as const;
279
+
266
280
  export interface IAutomationCondition {
267
281
  // A fact key from the catalog (AutomationFact); kept as string for forward
268
282
  // compatibility with facts added in later slices.
269
283
  fact: string;
270
284
  operator: AutomationOperator;
271
285
  // Not required for unary operators (exists/not_exists/is_true/is_false).
286
+ // between/not_between require an IAutomationTimeOfDayRange (feat-167).
272
287
  value?: unknown;
273
288
  }
274
289
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.581",
3
+ "version": "1.3.586",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",