evo360-types 1.3.127 → 1.3.129

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.
@@ -83,6 +83,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
83
83
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
84
84
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
85
85
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
86
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
86
87
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
87
88
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
88
89
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -94,6 +95,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
94
95
  country: string;
95
96
  line1: string;
96
97
  line2: string;
98
+ neighborhood: string;
97
99
  city: string;
98
100
  state: string;
99
101
  zip: string;
@@ -104,6 +106,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
104
106
  country?: string | undefined;
105
107
  line1?: string | undefined;
106
108
  line2?: string | undefined;
109
+ neighborhood?: string | undefined;
107
110
  city?: string | undefined;
108
111
  state?: string | undefined;
109
112
  zip?: string | undefined;
@@ -197,6 +200,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
197
200
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
198
201
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
199
202
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
203
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
200
204
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
201
205
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
202
206
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -208,6 +212,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
208
212
  country: string;
209
213
  line1: string;
210
214
  line2: string;
215
+ neighborhood: string;
211
216
  city: string;
212
217
  state: string;
213
218
  zip: string;
@@ -218,6 +223,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
218
223
  country?: string | undefined;
219
224
  line1?: string | undefined;
220
225
  line2?: string | undefined;
226
+ neighborhood?: string | undefined;
221
227
  city?: string | undefined;
222
228
  state?: string | undefined;
223
229
  zip?: string | undefined;
@@ -311,6 +317,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
311
317
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
312
318
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
313
319
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
320
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
314
321
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
315
322
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
316
323
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -322,6 +329,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
322
329
  country: string;
323
330
  line1: string;
324
331
  line2: string;
332
+ neighborhood: string;
325
333
  city: string;
326
334
  state: string;
327
335
  zip: string;
@@ -332,6 +340,7 @@ export declare const zLeadSchema: z.ZodObject<z.objectUtil.extendShape<z.objectU
332
340
  country?: string | undefined;
333
341
  line1?: string | undefined;
334
342
  line2?: string | undefined;
343
+ neighborhood?: string | undefined;
335
344
  city?: string | undefined;
336
345
  state?: string | undefined;
337
346
  zip?: string | undefined;
@@ -188,11 +188,11 @@ export declare const zAppointmentRescheduleSchema: z.ZodObject<{
188
188
  reason: z.ZodOptional<z.ZodString>;
189
189
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
190
190
  userRef: z.ZodOptional<z.ZodAny>;
191
- created_at: z.ZodDate;
192
- oldStartDate: z.ZodOptional<z.ZodDate>;
193
- oldEndDate: z.ZodOptional<z.ZodDate>;
194
- newStartDate: z.ZodOptional<z.ZodDate>;
195
- newEndDate: z.ZodOptional<z.ZodDate>;
191
+ created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
192
+ oldStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
193
+ oldEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
194
+ newStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
195
+ newEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
196
196
  }, "strip", z.ZodTypeAny, {
197
197
  created_at: Date;
198
198
  userRef?: any;
@@ -209,7 +209,7 @@ export declare const zAppointmentRescheduleSchema: z.ZodObject<{
209
209
  newStartDate?: Date | undefined;
210
210
  newEndDate?: Date | undefined;
211
211
  }, {
212
- created_at: Date;
212
+ created_at?: unknown;
213
213
  userRef?: any;
214
214
  external_id?: string | null | undefined;
215
215
  user_name?: string | undefined;
@@ -219,10 +219,10 @@ export declare const zAppointmentRescheduleSchema: z.ZodObject<{
219
219
  external_id?: string | null | undefined;
220
220
  } | undefined;
221
221
  reason?: string | undefined;
222
- oldStartDate?: Date | undefined;
223
- oldEndDate?: Date | undefined;
224
- newStartDate?: Date | undefined;
225
- newEndDate?: Date | undefined;
222
+ oldStartDate?: unknown;
223
+ oldEndDate?: unknown;
224
+ newStartDate?: unknown;
225
+ newEndDate?: unknown;
226
226
  }>;
227
227
  export declare const zAppointmentSpecialtySchema: z.ZodObject<{
228
228
  code: z.ZodString;
@@ -261,8 +261,8 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
261
261
  updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
262
262
  deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
263
263
  }, {
264
- startDate: z.ZodDate;
265
- endDate: z.ZodDate;
264
+ startDate: z.ZodEffects<z.ZodDate, Date, unknown>;
265
+ endDate: z.ZodEffects<z.ZodDate, Date, unknown>;
266
266
  status: z.ZodString;
267
267
  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"]>;
268
268
  notes: z.ZodOptional<z.ZodString>;
@@ -482,11 +482,11 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
482
482
  reason: z.ZodOptional<z.ZodString>;
483
483
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
484
484
  userRef: z.ZodOptional<z.ZodAny>;
485
- created_at: z.ZodDate;
486
- oldStartDate: z.ZodOptional<z.ZodDate>;
487
- oldEndDate: z.ZodOptional<z.ZodDate>;
488
- newStartDate: z.ZodOptional<z.ZodDate>;
489
- newEndDate: z.ZodOptional<z.ZodDate>;
485
+ created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
486
+ oldStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
487
+ oldEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
488
+ newStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
489
+ newEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
490
490
  }, "strip", z.ZodTypeAny, {
491
491
  created_at: Date;
492
492
  userRef?: any;
@@ -503,7 +503,7 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
503
503
  newStartDate?: Date | undefined;
504
504
  newEndDate?: Date | undefined;
505
505
  }, {
506
- created_at: Date;
506
+ created_at?: unknown;
507
507
  userRef?: any;
508
508
  external_id?: string | null | undefined;
509
509
  user_name?: string | undefined;
@@ -513,10 +513,10 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
513
513
  external_id?: string | null | undefined;
514
514
  } | undefined;
515
515
  reason?: string | undefined;
516
- oldStartDate?: Date | undefined;
517
- oldEndDate?: Date | undefined;
518
- newStartDate?: Date | undefined;
519
- newEndDate?: Date | undefined;
516
+ oldStartDate?: unknown;
517
+ oldEndDate?: unknown;
518
+ newStartDate?: unknown;
519
+ newEndDate?: unknown;
520
520
  }>, "many">>>;
521
521
  isDraft: z.ZodBoolean;
522
522
  draftExpirationMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -549,8 +549,8 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
549
549
  updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
550
550
  deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
551
551
  }, {
552
- startDate: z.ZodDate;
553
- endDate: z.ZodDate;
552
+ startDate: z.ZodEffects<z.ZodDate, Date, unknown>;
553
+ endDate: z.ZodEffects<z.ZodDate, Date, unknown>;
554
554
  status: z.ZodString;
555
555
  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"]>;
556
556
  notes: z.ZodOptional<z.ZodString>;
@@ -770,11 +770,11 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
770
770
  reason: z.ZodOptional<z.ZodString>;
771
771
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
772
772
  userRef: z.ZodOptional<z.ZodAny>;
773
- created_at: z.ZodDate;
774
- oldStartDate: z.ZodOptional<z.ZodDate>;
775
- oldEndDate: z.ZodOptional<z.ZodDate>;
776
- newStartDate: z.ZodOptional<z.ZodDate>;
777
- newEndDate: z.ZodOptional<z.ZodDate>;
773
+ created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
774
+ oldStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
775
+ oldEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
776
+ newStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
777
+ newEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
778
778
  }, "strip", z.ZodTypeAny, {
779
779
  created_at: Date;
780
780
  userRef?: any;
@@ -791,7 +791,7 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
791
791
  newStartDate?: Date | undefined;
792
792
  newEndDate?: Date | undefined;
793
793
  }, {
794
- created_at: Date;
794
+ created_at?: unknown;
795
795
  userRef?: any;
796
796
  external_id?: string | null | undefined;
797
797
  user_name?: string | undefined;
@@ -801,10 +801,10 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
801
801
  external_id?: string | null | undefined;
802
802
  } | undefined;
803
803
  reason?: string | undefined;
804
- oldStartDate?: Date | undefined;
805
- oldEndDate?: Date | undefined;
806
- newStartDate?: Date | undefined;
807
- newEndDate?: Date | undefined;
804
+ oldStartDate?: unknown;
805
+ oldEndDate?: unknown;
806
+ newStartDate?: unknown;
807
+ newEndDate?: unknown;
808
808
  }>, "many">>>;
809
809
  isDraft: z.ZodBoolean;
810
810
  draftExpirationMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -837,8 +837,8 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
837
837
  updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
838
838
  deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
839
839
  }, {
840
- startDate: z.ZodDate;
841
- endDate: z.ZodDate;
840
+ startDate: z.ZodEffects<z.ZodDate, Date, unknown>;
841
+ endDate: z.ZodEffects<z.ZodDate, Date, unknown>;
842
842
  status: z.ZodString;
843
843
  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"]>;
844
844
  notes: z.ZodOptional<z.ZodString>;
@@ -1058,11 +1058,11 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
1058
1058
  reason: z.ZodOptional<z.ZodString>;
1059
1059
  external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1060
1060
  userRef: z.ZodOptional<z.ZodAny>;
1061
- created_at: z.ZodDate;
1062
- oldStartDate: z.ZodOptional<z.ZodDate>;
1063
- oldEndDate: z.ZodOptional<z.ZodDate>;
1064
- newStartDate: z.ZodOptional<z.ZodDate>;
1065
- newEndDate: z.ZodOptional<z.ZodDate>;
1061
+ created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
1062
+ oldStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
1063
+ oldEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
1064
+ newStartDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
1065
+ newEndDate: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
1066
1066
  }, "strip", z.ZodTypeAny, {
1067
1067
  created_at: Date;
1068
1068
  userRef?: any;
@@ -1079,7 +1079,7 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
1079
1079
  newStartDate?: Date | undefined;
1080
1080
  newEndDate?: Date | undefined;
1081
1081
  }, {
1082
- created_at: Date;
1082
+ created_at?: unknown;
1083
1083
  userRef?: any;
1084
1084
  external_id?: string | null | undefined;
1085
1085
  user_name?: string | undefined;
@@ -1089,10 +1089,10 @@ export declare const zAppointmentSchema: z.ZodObject<z.objectUtil.extendShape<{
1089
1089
  external_id?: string | null | undefined;
1090
1090
  } | undefined;
1091
1091
  reason?: string | undefined;
1092
- oldStartDate?: Date | undefined;
1093
- oldEndDate?: Date | undefined;
1094
- newStartDate?: Date | undefined;
1095
- newEndDate?: Date | undefined;
1092
+ oldStartDate?: unknown;
1093
+ oldEndDate?: unknown;
1094
+ newStartDate?: unknown;
1095
+ newEndDate?: unknown;
1096
1096
  }>, "many">>>;
1097
1097
  isDraft: z.ZodBoolean;
1098
1098
  draftExpirationMinutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -134,11 +134,11 @@ exports.zAppointmentRescheduleSchema = zod_1.z.object({
134
134
  reason: zod_1.z.string().optional(), // Motivo do reagendamento (livre)
135
135
  external_id: zod_1.z.string().nullable().optional(), // ID externo do reagendamento
136
136
  userRef: zod_1.z.any().optional(), // Referência ao documento do usuário no Firestore
137
- created_at: zod_1.z.coerce.date(), // Data e hora em que o reagendamento foi realizado
138
- oldStartDate: zod_1.z.coerce.date().optional(), // Data/hora de início anterior do agendamento
139
- oldEndDate: zod_1.z.coerce.date().optional(), // Data/hora de término anterior do agendamento
140
- newStartDate: zod_1.z.coerce.date().optional(), // Data/hora de início nova do agendamento
141
- newEndDate: zod_1.z.coerce.date().optional(), // Data/hora de término nova do agendamento
137
+ created_at: zod_schemas_1.zFirestoreDateSchema, // Data e hora em que o reagendamento foi realizado
138
+ oldStartDate: zod_schemas_1.zFirestoreDateSchema.optional(), // Data/hora de início anterior do agendamento
139
+ oldEndDate: zod_schemas_1.zFirestoreDateSchema.optional(), // Data/hora de término anterior do agendamento
140
+ newStartDate: zod_schemas_1.zFirestoreDateSchema.optional(), // Data/hora de início nova do agendamento
141
+ newEndDate: zod_schemas_1.zFirestoreDateSchema.optional(), // Data/hora de término nova do agendamento
142
142
  });
143
143
  // Schema para especialidade no contexto de agendamento
144
144
  exports.zAppointmentSpecialtySchema = zod_1.z
@@ -156,8 +156,8 @@ exports.zAppointmentSpecialtySchema = zod_1.z
156
156
  // Schema principal do Appointment
157
157
  exports.zAppointmentSchema = zod_schemas_1.zFireDocSchema
158
158
  .extend({
159
- startDate: zod_1.z.coerce.date(),
160
- endDate: zod_1.z.coerce.date(),
159
+ startDate: zod_schemas_1.zFirestoreDateSchema,
160
+ endDate: zod_schemas_1.zFirestoreDateSchema,
161
161
  status: zod_1.z.string(), // Status customizado do dicionário
162
162
  statusBase: exports.zAppointmentStatusTypeSchema, // Tipo base para lógica
163
163
  notes: zod_1.z.string().optional(),
@@ -1,5 +1,9 @@
1
1
  import { z } from "zod";
2
- import { zFireDocSchema, zTagSchema } from "../../shared/zod-schemas";
2
+ import {
3
+ zFireDocSchema,
4
+ zTagSchema,
5
+ zFirestoreDateSchema,
6
+ } from "../../shared/zod-schemas";
3
7
 
4
8
  // Enums para validação
5
9
  export const zAppointmentPaymentStatusSchema = z.enum([
@@ -144,11 +148,11 @@ export const zAppointmentRescheduleSchema = z.object({
144
148
  reason: z.string().optional(), // Motivo do reagendamento (livre)
145
149
  external_id: z.string().nullable().optional(), // ID externo do reagendamento
146
150
  userRef: z.any().optional(), // Referência ao documento do usuário no Firestore
147
- created_at: z.coerce.date(), // Data e hora em que o reagendamento foi realizado
148
- oldStartDate: z.coerce.date().optional(), // Data/hora de início anterior do agendamento
149
- oldEndDate: z.coerce.date().optional(), // Data/hora de término anterior do agendamento
150
- newStartDate: z.coerce.date().optional(), // Data/hora de início nova do agendamento
151
- newEndDate: z.coerce.date().optional(), // Data/hora de término nova do agendamento
151
+ created_at: zFirestoreDateSchema, // Data e hora em que o reagendamento foi realizado
152
+ oldStartDate: zFirestoreDateSchema.optional(), // Data/hora de início anterior do agendamento
153
+ oldEndDate: zFirestoreDateSchema.optional(), // Data/hora de término anterior do agendamento
154
+ newStartDate: zFirestoreDateSchema.optional(), // Data/hora de início nova do agendamento
155
+ newEndDate: zFirestoreDateSchema.optional(), // Data/hora de término nova do agendamento
152
156
  });
153
157
 
154
158
  // Schema para especialidade no contexto de agendamento
@@ -168,8 +172,8 @@ export const zAppointmentSpecialtySchema = z
168
172
  // Schema principal do Appointment
169
173
  export const zAppointmentSchema = zFireDocSchema
170
174
  .extend({
171
- startDate: z.coerce.date(),
172
- endDate: z.coerce.date(),
175
+ startDate: zFirestoreDateSchema,
176
+ endDate: zFirestoreDateSchema,
173
177
  status: z.string(), // Status customizado do dicionário
174
178
  statusBase: zAppointmentStatusTypeSchema, // Tipo base para lógica
175
179
  notes: z.string().optional(),
@@ -130,6 +130,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
130
130
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
131
131
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
132
132
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
133
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
133
134
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
134
135
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
135
136
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -141,6 +142,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
141
142
  country: string;
142
143
  line1: string;
143
144
  line2: string;
145
+ neighborhood: string;
144
146
  city: string;
145
147
  state: string;
146
148
  zip: string;
@@ -151,6 +153,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
151
153
  country?: string | undefined;
152
154
  line1?: string | undefined;
153
155
  line2?: string | undefined;
156
+ neighborhood?: string | undefined;
154
157
  city?: string | undefined;
155
158
  state?: string | undefined;
156
159
  zip?: string | undefined;
@@ -254,6 +257,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
254
257
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
255
258
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
256
259
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
260
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
257
261
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
258
262
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
259
263
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -265,6 +269,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
265
269
  country: string;
266
270
  line1: string;
267
271
  line2: string;
272
+ neighborhood: string;
268
273
  city: string;
269
274
  state: string;
270
275
  zip: string;
@@ -275,6 +280,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
275
280
  country?: string | undefined;
276
281
  line1?: string | undefined;
277
282
  line2?: string | undefined;
283
+ neighborhood?: string | undefined;
278
284
  city?: string | undefined;
279
285
  state?: string | undefined;
280
286
  zip?: string | undefined;
@@ -378,6 +384,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
378
384
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
379
385
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
380
386
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
387
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
381
388
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
382
389
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
383
390
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -389,6 +396,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
389
396
  country: string;
390
397
  line1: string;
391
398
  line2: string;
399
+ neighborhood: string;
392
400
  city: string;
393
401
  state: string;
394
402
  zip: string;
@@ -399,6 +407,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<z.objectUtil.extendSha
399
407
  country?: string | undefined;
400
408
  line1?: string | undefined;
401
409
  line2?: string | undefined;
410
+ neighborhood?: string | undefined;
402
411
  city?: string | undefined;
403
412
  state?: string | undefined;
404
413
  zip?: string | undefined;
@@ -125,6 +125,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
125
125
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
126
126
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
127
127
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
128
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
128
129
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
129
130
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
130
131
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -136,6 +137,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
136
137
  country: string;
137
138
  line1: string;
138
139
  line2: string;
140
+ neighborhood: string;
139
141
  city: string;
140
142
  state: string;
141
143
  zip: string;
@@ -146,6 +148,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
146
148
  country?: string | undefined;
147
149
  line1?: string | undefined;
148
150
  line2?: string | undefined;
151
+ neighborhood?: string | undefined;
149
152
  city?: string | undefined;
150
153
  state?: string | undefined;
151
154
  zip?: string | undefined;
@@ -264,6 +267,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
264
267
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
265
268
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
266
269
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
270
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
267
271
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
268
272
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
269
273
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -275,6 +279,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
275
279
  country: string;
276
280
  line1: string;
277
281
  line2: string;
282
+ neighborhood: string;
278
283
  city: string;
279
284
  state: string;
280
285
  zip: string;
@@ -285,6 +290,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
285
290
  country?: string | undefined;
286
291
  line1?: string | undefined;
287
292
  line2?: string | undefined;
293
+ neighborhood?: string | undefined;
288
294
  city?: string | undefined;
289
295
  state?: string | undefined;
290
296
  zip?: string | undefined;
@@ -403,6 +409,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
403
409
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
404
410
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
405
411
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
412
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
406
413
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
407
414
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
408
415
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -414,6 +421,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
414
421
  country: string;
415
422
  line1: string;
416
423
  line2: string;
424
+ neighborhood: string;
417
425
  city: string;
418
426
  state: string;
419
427
  zip: string;
@@ -424,6 +432,7 @@ export declare const zProfessionalSchema: z.ZodObject<z.objectUtil.extendShape<z
424
432
  country?: string | undefined;
425
433
  line1?: string | undefined;
426
434
  line2?: string | undefined;
435
+ neighborhood?: string | undefined;
427
436
  city?: string | undefined;
428
437
  state?: string | undefined;
429
438
  zip?: string | undefined;
@@ -560,6 +569,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
560
569
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
561
570
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
562
571
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
572
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
563
573
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
564
574
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
565
575
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -571,6 +581,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
571
581
  country: string;
572
582
  line1: string;
573
583
  line2: string;
584
+ neighborhood: string;
574
585
  city: string;
575
586
  state: string;
576
587
  zip: string;
@@ -581,6 +592,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
581
592
  country?: string | undefined;
582
593
  line1?: string | undefined;
583
594
  line2?: string | undefined;
595
+ neighborhood?: string | undefined;
584
596
  city?: string | undefined;
585
597
  state?: string | undefined;
586
598
  zip?: string | undefined;
@@ -719,6 +731,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
719
731
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
720
732
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
721
733
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
734
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
722
735
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
723
736
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
724
737
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -730,6 +743,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
730
743
  country: string;
731
744
  line1: string;
732
745
  line2: string;
746
+ neighborhood: string;
733
747
  city: string;
734
748
  state: string;
735
749
  zip: string;
@@ -740,6 +754,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
740
754
  country?: string | undefined;
741
755
  line1?: string | undefined;
742
756
  line2?: string | undefined;
757
+ neighborhood?: string | undefined;
743
758
  city?: string | undefined;
744
759
  state?: string | undefined;
745
760
  zip?: string | undefined;
@@ -878,6 +893,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
878
893
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
879
894
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
880
895
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
896
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
881
897
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
882
898
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
883
899
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -889,6 +905,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
889
905
  country: string;
890
906
  line1: string;
891
907
  line2: string;
908
+ neighborhood: string;
892
909
  city: string;
893
910
  state: string;
894
911
  zip: string;
@@ -899,6 +916,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
899
916
  country?: string | undefined;
900
917
  line1?: string | undefined;
901
918
  line2?: string | undefined;
919
+ neighborhood?: string | undefined;
902
920
  city?: string | undefined;
903
921
  state?: string | undefined;
904
922
  zip?: string | undefined;
@@ -2,7 +2,18 @@ import { z } from "zod";
2
2
  export declare const zTaskActionSchema: z.ZodEnum<["CREATE_TASK", "DELETE_TASK", "UPDATE_TASK"]>;
3
3
  export declare const zTaskStatusSchema: z.ZodEnum<["not_started", "in_progress", "completed", "cancelled", "on_hold"]>;
4
4
  export declare const zTaskPrioritySchema: z.ZodEnum<["low", "medium", "high"]>;
5
+ export declare const zTaskExternalObjectTypeSchema: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact"]>;
5
6
  export declare const zIATaskTypeSchema: z.ZodEnum<["data_analysis", "content_generation", "classification", "extraction", "summarization", "translation", "sentiment_analysis", "question_answering", "send_reminder", "request_contact_info", "request_operator_info", "confirm_appointment", "send_documents", "create_appointment", "reschedule_appointment", "cancel_appointment", "financial_charge", "custom"]>;
7
+ export declare const zTaskExternalLinkSchema: z.ZodObject<{
8
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact"]>;
9
+ id: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ id: string;
12
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
13
+ }, {
14
+ id: string;
15
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
16
+ }>;
6
17
  export declare const zTaskSchema: z.ZodObject<z.objectUtil.extendShape<{
7
18
  id: z.ZodString;
8
19
  ref: z.ZodAny;
@@ -55,6 +66,16 @@ export declare const zTaskSchema: z.ZodObject<z.objectUtil.extendShape<{
55
66
  ia_prompt: z.ZodOptional<z.ZodString>;
56
67
  ia_model: z.ZodOptional<z.ZodString>;
57
68
  ia_progress: z.ZodOptional<z.ZodNumber>;
69
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact"]>;
71
+ id: z.ZodString;
72
+ }, "strip", z.ZodTypeAny, {
73
+ id: string;
74
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
75
+ }, {
76
+ id: string;
77
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
78
+ }>, "many">>;
58
79
  }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
59
80
  id: z.ZodString;
60
81
  ref: z.ZodAny;
@@ -107,6 +128,16 @@ export declare const zTaskSchema: z.ZodObject<z.objectUtil.extendShape<{
107
128
  ia_prompt: z.ZodOptional<z.ZodString>;
108
129
  ia_model: z.ZodOptional<z.ZodString>;
109
130
  ia_progress: z.ZodOptional<z.ZodNumber>;
131
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
132
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact"]>;
133
+ id: z.ZodString;
134
+ }, "strip", z.ZodTypeAny, {
135
+ id: string;
136
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
137
+ }, {
138
+ id: string;
139
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
140
+ }>, "many">>;
110
141
  }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
111
142
  id: z.ZodString;
112
143
  ref: z.ZodAny;
@@ -159,6 +190,16 @@ export declare const zTaskSchema: z.ZodObject<z.objectUtil.extendShape<{
159
190
  ia_prompt: z.ZodOptional<z.ZodString>;
160
191
  ia_model: z.ZodOptional<z.ZodString>;
161
192
  ia_progress: z.ZodOptional<z.ZodNumber>;
193
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
194
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact"]>;
195
+ id: z.ZodString;
196
+ }, "strip", z.ZodTypeAny, {
197
+ id: string;
198
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
199
+ }, {
200
+ id: string;
201
+ type: "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
202
+ }>, "many">>;
162
203
  }>, z.ZodTypeAny, "passthrough">>;
163
204
  export declare const zTaskCommentSchema: z.ZodObject<z.objectUtil.extendShape<{
164
205
  id: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zTaskCommentSchema = exports.zTaskSchema = exports.zIATaskTypeSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
3
+ exports.zTaskCommentSchema = exports.zTaskSchema = exports.zTaskExternalLinkSchema = exports.zIATaskTypeSchema = exports.zTaskExternalObjectTypeSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../shared/zod-schemas");
6
6
  exports.zTaskActionSchema = zod_1.z.enum([
@@ -16,6 +16,13 @@ exports.zTaskStatusSchema = zod_1.z.enum([
16
16
  "on_hold",
17
17
  ]);
18
18
  exports.zTaskPrioritySchema = zod_1.z.enum(["low", "medium", "high"]);
19
+ exports.zTaskExternalObjectTypeSchema = zod_1.z.enum([
20
+ "crm_lead",
21
+ "med_patient",
22
+ "med_professional",
23
+ "med_appointment",
24
+ "chat_contact",
25
+ ]);
19
26
  exports.zIATaskTypeSchema = zod_1.z.enum([
20
27
  "data_analysis",
21
28
  "content_generation",
@@ -36,6 +43,11 @@ exports.zIATaskTypeSchema = zod_1.z.enum([
36
43
  "financial_charge",
37
44
  "custom",
38
45
  ]);
46
+ // Schema para a interface ITaskExternalLink
47
+ exports.zTaskExternalLinkSchema = zod_1.z.object({
48
+ type: exports.zTaskExternalObjectTypeSchema,
49
+ id: zod_1.z.string(),
50
+ });
39
51
  // Schema para a interface ITask
40
52
  exports.zTaskSchema = zod_schemas_1.zFireDocSchema
41
53
  .extend({
@@ -65,6 +77,8 @@ exports.zTaskSchema = zod_schemas_1.zFireDocSchema
65
77
  ia_prompt: zod_1.z.string().optional(),
66
78
  ia_model: zod_1.z.string().optional(),
67
79
  ia_progress: zod_1.z.number().min(0).max(100).optional(),
80
+ // External object links
81
+ externalLinks: zod_1.z.array(exports.zTaskExternalLinkSchema).optional(),
68
82
  })
69
83
  .passthrough();
70
84
  // Schema para a interface ITaskComment
@@ -17,6 +17,14 @@ export const zTaskStatusSchema = z.enum([
17
17
 
18
18
  export const zTaskPrioritySchema = z.enum(["low", "medium", "high"]);
19
19
 
20
+ export const zTaskExternalObjectTypeSchema = z.enum([
21
+ "crm_lead",
22
+ "med_patient",
23
+ "med_professional",
24
+ "med_appointment",
25
+ "chat_contact",
26
+ ]);
27
+
20
28
  export const zIATaskTypeSchema = z.enum([
21
29
  "data_analysis",
22
30
  "content_generation",
@@ -38,6 +46,12 @@ export const zIATaskTypeSchema = z.enum([
38
46
  "custom",
39
47
  ]);
40
48
 
49
+ // Schema para a interface ITaskExternalLink
50
+ export const zTaskExternalLinkSchema = z.object({
51
+ type: zTaskExternalObjectTypeSchema,
52
+ id: z.string(),
53
+ });
54
+
41
55
  // Schema para a interface ITask
42
56
  export const zTaskSchema = zFireDocSchema
43
57
  .extend({
@@ -67,6 +81,8 @@ export const zTaskSchema = zFireDocSchema
67
81
  ia_prompt: z.string().optional(),
68
82
  ia_model: z.string().optional(),
69
83
  ia_progress: z.number().min(0).max(100).optional(),
84
+ // External object links
85
+ externalLinks: z.array(zTaskExternalLinkSchema).optional(),
70
86
  })
71
87
  .passthrough();
72
88
 
@@ -1,5 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export declare const zEvoAppSchema: z.ZodEnum<["evo-activity", "evo-core", "evo-crm", "evo-med", "evo-messages", "evo-people", "evo-survey", "evo-tags", "evo-task", "evo-tenant"]>;
3
+ /**
4
+ * Schema Zod que aceita datas de várias fontes, incluindo Timestamps do Firestore.
5
+ * Pode ser usado com .optional() ou .nullable().optional()
6
+ */
7
+ export declare const zFirestoreDateSchema: z.ZodEffects<z.ZodDate, Date, unknown>;
3
8
  export declare const zFireDocSchema: z.ZodObject<{
4
9
  id: z.ZodString;
5
10
  ref: z.ZodAny;
@@ -49,6 +54,7 @@ export declare const zAddressSchema: z.ZodObject<{
49
54
  kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
50
55
  line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
51
56
  line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
57
+ neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
52
58
  city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
53
59
  state: z.ZodDefault<z.ZodOptional<z.ZodString>>;
54
60
  zip: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -60,6 +66,7 @@ export declare const zAddressSchema: z.ZodObject<{
60
66
  country: string;
61
67
  line1: string;
62
68
  line2: string;
69
+ neighborhood: string;
63
70
  city: string;
64
71
  state: string;
65
72
  zip: string;
@@ -70,6 +77,7 @@ export declare const zAddressSchema: z.ZodObject<{
70
77
  country?: string | undefined;
71
78
  line1?: string | undefined;
72
79
  line2?: string | undefined;
80
+ neighborhood?: string | undefined;
73
81
  city?: string | undefined;
74
82
  state?: string | undefined;
75
83
  zip?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zContactSchema = exports.zAddressSchema = exports.zTagSchema = exports.zFireDocSchema = exports.zEvoAppSchema = void 0;
3
+ exports.zContactSchema = exports.zAddressSchema = exports.zTagSchema = exports.zFireDocSchema = exports.zFirestoreDateSchema = exports.zEvoAppSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  // Enum for activity read status
6
6
  exports.zEvoAppSchema = zod_1.z.enum([
@@ -15,6 +15,42 @@ exports.zEvoAppSchema = zod_1.z.enum([
15
15
  "evo-task",
16
16
  "evo-tenant",
17
17
  ]);
18
+ /**
19
+ * Schema helper para converter Timestamps do Firestore para Date.
20
+ * Aceita: Date, string ISO, número (timestamp), Timestamp do Firestore, null/undefined
21
+ */
22
+ function convertFirestoreTimestamp(value) {
23
+ if (value === null || value === undefined) {
24
+ return value;
25
+ }
26
+ // Se já é uma Date, retorna direto
27
+ if (value instanceof Date) {
28
+ return value;
29
+ }
30
+ // Se é um objeto Timestamp do Firestore (tem método toDate)
31
+ if (typeof value === "object" &&
32
+ value !== null &&
33
+ "toDate" in value &&
34
+ typeof value.toDate === "function") {
35
+ return value.toDate();
36
+ }
37
+ // Se é um objeto com seconds e nanoseconds (estrutura do Firestore Timestamp)
38
+ if (typeof value === "object" &&
39
+ value !== null &&
40
+ "seconds" in value &&
41
+ typeof value.seconds === "number") {
42
+ const seconds = value.seconds;
43
+ const nanoseconds = value.nanoseconds || 0;
44
+ return new Date(seconds * 1000 + nanoseconds / 1000000);
45
+ }
46
+ // Para outros casos, deixa o z.coerce.date() fazer o trabalho
47
+ return value;
48
+ }
49
+ /**
50
+ * Schema Zod que aceita datas de várias fontes, incluindo Timestamps do Firestore.
51
+ * Pode ser usado com .optional() ou .nullable().optional()
52
+ */
53
+ exports.zFirestoreDateSchema = zod_1.z.preprocess(convertFirestoreTimestamp, zod_1.z.coerce.date());
18
54
  // Custom validation for FirestoreDocumentReference
19
55
  exports.zFireDocSchema = zod_1.z.object({
20
56
  id: zod_1.z.string(),
@@ -38,6 +74,7 @@ exports.zAddressSchema = zod_1.z.object({
38
74
  kind: zod_1.z.string().max(255).optional().default(""),
39
75
  line1: zod_1.z.string().max(255).optional().default(""),
40
76
  line2: zod_1.z.string().max(255).optional().default(""),
77
+ neighborhood: zod_1.z.string().max(255).optional().default(""),
41
78
  city: zod_1.z.string().max(255).optional().default(""),
42
79
  state: zod_1.z.string().max(255).optional().default(""),
43
80
  zip: zod_1.z.string().max(255).optional().default(""),
@@ -14,6 +14,55 @@ export const zEvoAppSchema = z.enum([
14
14
  "evo-tenant",
15
15
  ]);
16
16
 
17
+ /**
18
+ * Schema helper para converter Timestamps do Firestore para Date.
19
+ * Aceita: Date, string ISO, número (timestamp), Timestamp do Firestore, null/undefined
20
+ */
21
+ function convertFirestoreTimestamp(value: unknown): Date | null | undefined {
22
+ if (value === null || value === undefined) {
23
+ return value as null | undefined;
24
+ }
25
+
26
+ // Se já é uma Date, retorna direto
27
+ if (value instanceof Date) {
28
+ return value;
29
+ }
30
+
31
+ // Se é um objeto Timestamp do Firestore (tem método toDate)
32
+ if (
33
+ typeof value === "object" &&
34
+ value !== null &&
35
+ "toDate" in value &&
36
+ typeof (value as any).toDate === "function"
37
+ ) {
38
+ return (value as any).toDate();
39
+ }
40
+
41
+ // Se é um objeto com seconds e nanoseconds (estrutura do Firestore Timestamp)
42
+ if (
43
+ typeof value === "object" &&
44
+ value !== null &&
45
+ "seconds" in value &&
46
+ typeof (value as any).seconds === "number"
47
+ ) {
48
+ const seconds = (value as any).seconds;
49
+ const nanoseconds = (value as any).nanoseconds || 0;
50
+ return new Date(seconds * 1000 + nanoseconds / 1000000);
51
+ }
52
+
53
+ // Para outros casos, deixa o z.coerce.date() fazer o trabalho
54
+ return value as any;
55
+ }
56
+
57
+ /**
58
+ * Schema Zod que aceita datas de várias fontes, incluindo Timestamps do Firestore.
59
+ * Pode ser usado com .optional() ou .nullable().optional()
60
+ */
61
+ export const zFirestoreDateSchema = z.preprocess(
62
+ convertFirestoreTimestamp,
63
+ z.coerce.date()
64
+ );
65
+
17
66
  // Custom validation for FirestoreDocumentReference
18
67
  export const zFireDocSchema = z.object({
19
68
  id: z.string(),
@@ -39,6 +88,7 @@ export const zAddressSchema = z.object({
39
88
  kind: z.string().max(255).optional().default(""),
40
89
  line1: z.string().max(255).optional().default(""),
41
90
  line2: z.string().max(255).optional().default(""),
91
+ neighborhood: z.string().max(255).optional().default(""),
42
92
  city: z.string().max(255).optional().default(""),
43
93
  state: z.string().max(255).optional().default(""),
44
94
  zip: z.string().max(255).optional().default(""),
@@ -41,6 +41,19 @@ export declare enum IIATaskType {
41
41
  FinancialCharge = "financial_charge",
42
42
  Custom = "custom"
43
43
  }
44
+ export type TaskExternalObjectType = "crm_lead" | "med_patient" | "med_professional" | "med_appointment" | "chat_contact";
45
+ export declare enum ITaskExternalObjectType {
46
+ CrmLead = "crm_lead",
47
+ MedPatient = "med_patient",
48
+ MedProfessional = "med_professional",
49
+ MedAppointment = "med_appointment",
50
+ ChatContact = "chat_contact"
51
+ }
52
+ export interface ITaskExternalLink {
53
+ type: TaskExternalObjectType;
54
+ id: string;
55
+ [key: string]: unknown;
56
+ }
44
57
  export interface ITask extends IFireDoc {
45
58
  title: string;
46
59
  description?: string;
@@ -67,6 +80,7 @@ export interface ITask extends IFireDoc {
67
80
  ia_prompt?: string;
68
81
  ia_model?: string;
69
82
  ia_progress?: number;
83
+ externalLinks?: ITaskExternalLink[];
70
84
  [key: string]: unknown;
71
85
  }
72
86
  export interface ITaskComment extends IFireDoc {
@@ -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.IIATaskType = exports.ITaskPriority = exports.ITaskStatus = exports.ITaskAction = void 0;
17
+ exports.ITaskExternalObjectType = exports.IIATaskType = exports.ITaskPriority = exports.ITaskStatus = exports.ITaskAction = void 0;
18
18
  __exportStar(require("./fb_collections"), exports);
19
19
  var ITaskAction;
20
20
  (function (ITaskAction) {
@@ -57,3 +57,11 @@ var IIATaskType;
57
57
  IIATaskType["FinancialCharge"] = "financial_charge";
58
58
  IIATaskType["Custom"] = "custom";
59
59
  })(IIATaskType || (exports.IIATaskType = IIATaskType = {}));
60
+ var ITaskExternalObjectType;
61
+ (function (ITaskExternalObjectType) {
62
+ ITaskExternalObjectType["CrmLead"] = "crm_lead";
63
+ ITaskExternalObjectType["MedPatient"] = "med_patient";
64
+ ITaskExternalObjectType["MedProfessional"] = "med_professional";
65
+ ITaskExternalObjectType["MedAppointment"] = "med_appointment";
66
+ ITaskExternalObjectType["ChatContact"] = "chat_contact";
67
+ })(ITaskExternalObjectType || (exports.ITaskExternalObjectType = ITaskExternalObjectType = {}));
@@ -77,6 +77,29 @@ export enum IIATaskType {
77
77
  Custom = "custom",
78
78
  }
79
79
 
80
+ // Enum for External Object Type (for task links)
81
+ export type TaskExternalObjectType =
82
+ | "crm_lead"
83
+ | "med_patient"
84
+ | "med_professional"
85
+ | "med_appointment"
86
+ | "chat_contact";
87
+
88
+ export enum ITaskExternalObjectType {
89
+ CrmLead = "crm_lead",
90
+ MedPatient = "med_patient",
91
+ MedProfessional = "med_professional",
92
+ MedAppointment = "med_appointment",
93
+ ChatContact = "chat_contact",
94
+ }
95
+
96
+ // Interface for External Object Link
97
+ export interface ITaskExternalLink {
98
+ type: TaskExternalObjectType; // Type of external object
99
+ id: string; // ID of the linked object
100
+ [key: string]: unknown; // index signature
101
+ }
102
+
80
103
  // Interface for Task Instances (taskInstances)
81
104
  export interface ITask extends IFireDoc {
82
105
  title: string; // Title of the task
@@ -105,6 +128,8 @@ export interface ITask extends IFireDoc {
105
128
  ia_prompt?: string; // Prompt used for AI task execution
106
129
  ia_model?: string; // AI model used for task execution
107
130
  ia_progress?: number; // Progress percentage (0-100) of AI task execution
131
+ // External object links
132
+ externalLinks?: ITaskExternalLink[]; // Array of links to external objects
108
133
  [key: string]: unknown; // index signature
109
134
  }
110
135
 
@@ -34,6 +34,7 @@ export interface IAddress {
34
34
  kind?: string;
35
35
  line1?: string;
36
36
  line2?: string;
37
+ neighborhood?: string;
37
38
  city?: string;
38
39
  state?: string;
39
40
  zip?: string;
@@ -44,6 +44,7 @@ export interface IAddress {
44
44
  kind?: string;
45
45
  line1?: string;
46
46
  line2?: string;
47
+ neighborhood?: string;
47
48
  city?: string;
48
49
  state?: string;
49
50
  zip?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.127",
3
+ "version": "1.3.129",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",