evo360-types 1.3.602 → 1.3.604

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.
@@ -519,16 +519,16 @@ export declare const zSendTextMessageRequestSchema: z.ZodObject<{
519
519
  text: z.ZodString;
520
520
  }, "strip", z.ZodTypeAny, {
521
521
  type: "text";
522
- tenant: string;
523
522
  text: string;
523
+ tenant: string;
524
524
  channel_id: string;
525
525
  contact_address: string;
526
526
  department_id: string;
527
527
  contact_custom_name?: string | undefined;
528
528
  }, {
529
529
  type: "text";
530
- tenant: string;
531
530
  text: string;
531
+ tenant: string;
532
532
  channel_id: string;
533
533
  contact_address: string;
534
534
  department_id: string;
@@ -680,16 +680,16 @@ export declare const zSendMessageRequestSchema: z.ZodDiscriminatedUnion<"type",
680
680
  text: z.ZodString;
681
681
  }, "strip", z.ZodTypeAny, {
682
682
  type: "text";
683
- tenant: string;
684
683
  text: string;
684
+ tenant: string;
685
685
  channel_id: string;
686
686
  contact_address: string;
687
687
  department_id: string;
688
688
  contact_custom_name?: string | undefined;
689
689
  }, {
690
690
  type: "text";
691
- tenant: string;
692
691
  text: string;
692
+ tenant: string;
693
693
  channel_id: string;
694
694
  contact_address: string;
695
695
  department_id: string;
@@ -211,6 +211,7 @@ export declare const zLeadSchema: z.ZodObject<{
211
211
  color?: string | undefined;
212
212
  category?: string | null | undefined;
213
213
  }>, "many">>>;
214
+ capture_data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
214
215
  userRef: z.ZodAny;
215
216
  reactivation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
216
217
  no_interaction_streak: z.ZodOptional<z.ZodNumber>;
@@ -388,6 +389,7 @@ export declare const zLeadSchema: z.ZodObject<{
388
389
  color?: string | undefined;
389
390
  category?: string | null | undefined;
390
391
  }>, "many">>>;
392
+ capture_data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
391
393
  userRef: z.ZodAny;
392
394
  reactivation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
393
395
  no_interaction_streak: z.ZodOptional<z.ZodNumber>;
@@ -565,6 +567,7 @@ export declare const zLeadSchema: z.ZodObject<{
565
567
  color?: string | undefined;
566
568
  category?: string | null | undefined;
567
569
  }>, "many">>>;
570
+ capture_data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
568
571
  userRef: z.ZodAny;
569
572
  reactivation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
570
573
  no_interaction_streak: z.ZodOptional<z.ZodNumber>;
@@ -50,6 +50,7 @@ exports.zLeadSchema = zod_schemas_2.zProfileSchema // Extend from ProfileSchema
50
50
  /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
51
51
  externalLinkKeys: zod_1.z.array(zod_1.z.string()).optional(),
52
52
  tags: zod_1.z.array(zod_schemas_1.zTagSchema).nullable().optional(),
53
+ capture_data: zod_schemas_1.zCaptureDataMapSchema.nullable().optional(),
53
54
  userRef: zod_1.z.any(),
54
55
  reactivation: exports.zLeadReactivationSchema.nullable().optional(),
55
56
  })
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import {
3
3
  zAddressSchema,
4
+ zCaptureDataMapSchema,
4
5
  zContactSchema,
5
6
  zTagSchema,
6
7
  } from "../../shared/zod-schemas";
@@ -56,6 +57,7 @@ export const zLeadSchema = zProfileSchema // Extend from ProfileSchema
56
57
  /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
57
58
  externalLinkKeys: z.array(z.string()).optional(),
58
59
  tags: z.array(zTagSchema).nullable().optional(),
60
+ capture_data: zCaptureDataMapSchema.nullable().optional(),
59
61
  userRef: z.any(),
60
62
  reactivation: zLeadReactivationSchema.nullable().optional(),
61
63
  })
@@ -2220,8 +2220,8 @@ export declare const zCsqTranscriptMessageSchema: z.ZodObject<{
2220
2220
  unattributed: z.ZodOptional<z.ZodBoolean>;
2221
2221
  }, "strip", z.ZodTypeAny, {
2222
2222
  type: string;
2223
- message_id: string;
2224
2223
  text: string;
2224
+ message_id: string;
2225
2225
  ticket_id: string;
2226
2226
  ts: Date;
2227
2227
  author_kind: "human" | "automation" | "lead" | "hubia" | "event" | "note";
@@ -2229,8 +2229,8 @@ export declare const zCsqTranscriptMessageSchema: z.ZodObject<{
2229
2229
  unattributed?: boolean | undefined;
2230
2230
  }, {
2231
2231
  type: string;
2232
- message_id: string;
2233
2232
  text: string;
2233
+ message_id: string;
2234
2234
  ticket_id: string;
2235
2235
  author_kind: "human" | "automation" | "lead" | "hubia" | "event" | "note";
2236
2236
  author_label: string;
@@ -4119,6 +4119,7 @@ export declare const zCsqSystemFactsSchema: z.ZodObject<{
4119
4119
  professional_name?: string | undefined;
4120
4120
  }[];
4121
4121
  tags: string[];
4122
+ capture_data: Record<string, unknown> | null;
4122
4123
  invoices: {
4123
4124
  id: string;
4124
4125
  kind: "invoice" | "payment_link";
@@ -4143,7 +4144,6 @@ export declare const zCsqSystemFactsSchema: z.ZodObject<{
4143
4144
  professional_name?: string | undefined;
4144
4145
  }[];
4145
4146
  dist_channel: string | null;
4146
- capture_data: Record<string, unknown> | null;
4147
4147
  previous_tickets: {
4148
4148
  ticket_id: string;
4149
4149
  close_code?: string | undefined;
@@ -4166,6 +4166,7 @@ export declare const zCsqSystemFactsSchema: z.ZodObject<{
4166
4166
  professional_name?: string | undefined;
4167
4167
  }[];
4168
4168
  tags: string[];
4169
+ capture_data: Record<string, unknown> | null;
4169
4170
  invoices: {
4170
4171
  id: string;
4171
4172
  kind: "invoice" | "payment_link";
@@ -4190,7 +4191,6 @@ export declare const zCsqSystemFactsSchema: z.ZodObject<{
4190
4191
  professional_name?: string | undefined;
4191
4192
  }[];
4192
4193
  dist_channel: string | null;
4193
- capture_data: Record<string, unknown> | null;
4194
4194
  previous_tickets: {
4195
4195
  ticket_id: string;
4196
4196
  close_code?: string | undefined;
@@ -4991,6 +4991,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
4991
4991
  professional_name?: string | undefined;
4992
4992
  }[];
4993
4993
  tags: string[];
4994
+ capture_data: Record<string, unknown> | null;
4994
4995
  invoices: {
4995
4996
  id: string;
4996
4997
  kind: "invoice" | "payment_link";
@@ -5015,7 +5016,6 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
5015
5016
  professional_name?: string | undefined;
5016
5017
  }[];
5017
5018
  dist_channel: string | null;
5018
- capture_data: Record<string, unknown> | null;
5019
5019
  previous_tickets: {
5020
5020
  ticket_id: string;
5021
5021
  close_code?: string | undefined;
@@ -5038,6 +5038,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
5038
5038
  professional_name?: string | undefined;
5039
5039
  }[];
5040
5040
  tags: string[];
5041
+ capture_data: Record<string, unknown> | null;
5041
5042
  invoices: {
5042
5043
  id: string;
5043
5044
  kind: "invoice" | "payment_link";
@@ -5062,7 +5063,6 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
5062
5063
  professional_name?: string | undefined;
5063
5064
  }[];
5064
5065
  dist_channel: string | null;
5065
- capture_data: Record<string, unknown> | null;
5066
5066
  previous_tickets: {
5067
5067
  ticket_id: string;
5068
5068
  close_code?: string | undefined;
@@ -7012,6 +7012,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7012
7012
  professional_name?: string | undefined;
7013
7013
  }[];
7014
7014
  tags: string[];
7015
+ capture_data: Record<string, unknown> | null;
7015
7016
  invoices: {
7016
7017
  id: string;
7017
7018
  kind: "invoice" | "payment_link";
@@ -7036,7 +7037,6 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7036
7037
  professional_name?: string | undefined;
7037
7038
  }[];
7038
7039
  dist_channel: string | null;
7039
- capture_data: Record<string, unknown> | null;
7040
7040
  previous_tickets: {
7041
7041
  ticket_id: string;
7042
7042
  close_code?: string | undefined;
@@ -7059,6 +7059,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7059
7059
  professional_name?: string | undefined;
7060
7060
  }[];
7061
7061
  tags: string[];
7062
+ capture_data: Record<string, unknown> | null;
7062
7063
  invoices: {
7063
7064
  id: string;
7064
7065
  kind: "invoice" | "payment_link";
@@ -7083,7 +7084,6 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
7083
7084
  professional_name?: string | undefined;
7084
7085
  }[];
7085
7086
  dist_channel: string | null;
7086
- capture_data: Record<string, unknown> | null;
7087
7087
  previous_tickets: {
7088
7088
  ticket_id: string;
7089
7089
  close_code?: string | undefined;
@@ -9033,6 +9033,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
9033
9033
  professional_name?: string | undefined;
9034
9034
  }[];
9035
9035
  tags: string[];
9036
+ capture_data: Record<string, unknown> | null;
9036
9037
  invoices: {
9037
9038
  id: string;
9038
9039
  kind: "invoice" | "payment_link";
@@ -9057,7 +9058,6 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
9057
9058
  professional_name?: string | undefined;
9058
9059
  }[];
9059
9060
  dist_channel: string | null;
9060
- capture_data: Record<string, unknown> | null;
9061
9061
  previous_tickets: {
9062
9062
  ticket_id: string;
9063
9063
  close_code?: string | undefined;
@@ -9080,6 +9080,7 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
9080
9080
  professional_name?: string | undefined;
9081
9081
  }[];
9082
9082
  tags: string[];
9083
+ capture_data: Record<string, unknown> | null;
9083
9084
  invoices: {
9084
9085
  id: string;
9085
9086
  kind: "invoice" | "payment_link";
@@ -9104,7 +9105,6 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
9104
9105
  professional_name?: string | undefined;
9105
9106
  }[];
9106
9107
  dist_channel: string | null;
9107
- capture_data: Record<string, unknown> | null;
9108
9108
  previous_tickets: {
9109
9109
  ticket_id: string;
9110
9110
  close_code?: string | undefined;
@@ -29,71 +29,71 @@ export declare const zHubiaV1ChannelConfigSchema: z.ZodObject<{
29
29
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
30
30
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
31
31
  }, "strip", z.ZodTypeAny, {
32
+ text?: string | undefined;
32
33
  version?: number | undefined;
33
34
  updated_at?: any;
34
- text?: string | undefined;
35
35
  }, {
36
+ text?: string | undefined;
36
37
  version?: number | undefined;
37
38
  updated_at?: any;
38
- text?: string | undefined;
39
39
  }>>;
40
40
  safety: z.ZodOptional<z.ZodObject<{
41
41
  text: z.ZodOptional<z.ZodDefault<z.ZodString>>;
42
42
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
43
43
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
44
44
  }, "strip", z.ZodTypeAny, {
45
+ text?: string | undefined;
45
46
  version?: number | undefined;
46
47
  updated_at?: any;
47
- text?: string | undefined;
48
48
  }, {
49
+ text?: string | undefined;
49
50
  version?: number | undefined;
50
51
  updated_at?: any;
51
- text?: string | undefined;
52
52
  }>>;
53
53
  channel_custom: z.ZodOptional<z.ZodObject<{
54
54
  text: z.ZodOptional<z.ZodDefault<z.ZodString>>;
55
55
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
56
56
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
57
57
  }, "strip", z.ZodTypeAny, {
58
+ text?: string | undefined;
58
59
  version?: number | undefined;
59
60
  updated_at?: any;
60
- text?: string | undefined;
61
61
  }, {
62
+ text?: string | undefined;
62
63
  version?: number | undefined;
63
64
  updated_at?: any;
64
- text?: string | undefined;
65
65
  }>>;
66
66
  }, "strip", z.ZodTypeAny, {
67
67
  identity?: {
68
+ text?: string | undefined;
68
69
  version?: number | undefined;
69
70
  updated_at?: any;
70
- text?: string | undefined;
71
71
  } | undefined;
72
72
  safety?: {
73
+ text?: string | undefined;
73
74
  version?: number | undefined;
74
75
  updated_at?: any;
75
- text?: string | undefined;
76
76
  } | undefined;
77
77
  channel_custom?: {
78
+ text?: string | undefined;
78
79
  version?: number | undefined;
79
80
  updated_at?: any;
80
- text?: string | undefined;
81
81
  } | undefined;
82
82
  }, {
83
83
  identity?: {
84
+ text?: string | undefined;
84
85
  version?: number | undefined;
85
86
  updated_at?: any;
86
- text?: string | undefined;
87
87
  } | undefined;
88
88
  safety?: {
89
+ text?: string | undefined;
89
90
  version?: number | undefined;
90
91
  updated_at?: any;
91
- text?: string | undefined;
92
92
  } | undefined;
93
93
  channel_custom?: {
94
+ text?: string | undefined;
94
95
  version?: number | undefined;
95
96
  updated_at?: any;
96
- text?: string | undefined;
97
97
  } | undefined;
98
98
  }>>;
99
99
  toolkit_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -159,71 +159,71 @@ export declare const zHubiaV1ChannelConfigSchema: z.ZodObject<{
159
159
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
160
160
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
161
161
  }, "strip", z.ZodTypeAny, {
162
+ text?: string | undefined;
162
163
  version?: number | undefined;
163
164
  updated_at?: any;
164
- text?: string | undefined;
165
165
  }, {
166
+ text?: string | undefined;
166
167
  version?: number | undefined;
167
168
  updated_at?: any;
168
- text?: string | undefined;
169
169
  }>>;
170
170
  safety: z.ZodOptional<z.ZodObject<{
171
171
  text: z.ZodOptional<z.ZodDefault<z.ZodString>>;
172
172
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
173
173
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
174
174
  }, "strip", z.ZodTypeAny, {
175
+ text?: string | undefined;
175
176
  version?: number | undefined;
176
177
  updated_at?: any;
177
- text?: string | undefined;
178
178
  }, {
179
+ text?: string | undefined;
179
180
  version?: number | undefined;
180
181
  updated_at?: any;
181
- text?: string | undefined;
182
182
  }>>;
183
183
  channel_custom: z.ZodOptional<z.ZodObject<{
184
184
  text: z.ZodOptional<z.ZodDefault<z.ZodString>>;
185
185
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
186
186
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
187
187
  }, "strip", z.ZodTypeAny, {
188
+ text?: string | undefined;
188
189
  version?: number | undefined;
189
190
  updated_at?: any;
190
- text?: string | undefined;
191
191
  }, {
192
+ text?: string | undefined;
192
193
  version?: number | undefined;
193
194
  updated_at?: any;
194
- text?: string | undefined;
195
195
  }>>;
196
196
  }, "strip", z.ZodTypeAny, {
197
197
  identity?: {
198
+ text?: string | undefined;
198
199
  version?: number | undefined;
199
200
  updated_at?: any;
200
- text?: string | undefined;
201
201
  } | undefined;
202
202
  safety?: {
203
+ text?: string | undefined;
203
204
  version?: number | undefined;
204
205
  updated_at?: any;
205
- text?: string | undefined;
206
206
  } | undefined;
207
207
  channel_custom?: {
208
+ text?: string | undefined;
208
209
  version?: number | undefined;
209
210
  updated_at?: any;
210
- text?: string | undefined;
211
211
  } | undefined;
212
212
  }, {
213
213
  identity?: {
214
+ text?: string | undefined;
214
215
  version?: number | undefined;
215
216
  updated_at?: any;
216
- text?: string | undefined;
217
217
  } | undefined;
218
218
  safety?: {
219
+ text?: string | undefined;
219
220
  version?: number | undefined;
220
221
  updated_at?: any;
221
- text?: string | undefined;
222
222
  } | undefined;
223
223
  channel_custom?: {
224
+ text?: string | undefined;
224
225
  version?: number | undefined;
225
226
  updated_at?: any;
226
- text?: string | undefined;
227
227
  } | undefined;
228
228
  }>>;
229
229
  toolkit_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -289,71 +289,71 @@ export declare const zHubiaV1ChannelConfigSchema: z.ZodObject<{
289
289
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
290
290
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
291
291
  }, "strip", z.ZodTypeAny, {
292
+ text?: string | undefined;
292
293
  version?: number | undefined;
293
294
  updated_at?: any;
294
- text?: string | undefined;
295
295
  }, {
296
+ text?: string | undefined;
296
297
  version?: number | undefined;
297
298
  updated_at?: any;
298
- text?: string | undefined;
299
299
  }>>;
300
300
  safety: z.ZodOptional<z.ZodObject<{
301
301
  text: z.ZodOptional<z.ZodDefault<z.ZodString>>;
302
302
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
303
303
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
304
304
  }, "strip", z.ZodTypeAny, {
305
+ text?: string | undefined;
305
306
  version?: number | undefined;
306
307
  updated_at?: any;
307
- text?: string | undefined;
308
308
  }, {
309
+ text?: string | undefined;
309
310
  version?: number | undefined;
310
311
  updated_at?: any;
311
- text?: string | undefined;
312
312
  }>>;
313
313
  channel_custom: z.ZodOptional<z.ZodObject<{
314
314
  text: z.ZodOptional<z.ZodDefault<z.ZodString>>;
315
315
  version: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
316
316
  updated_at: z.ZodOptional<z.ZodOptional<z.ZodAny>>;
317
317
  }, "strip", z.ZodTypeAny, {
318
+ text?: string | undefined;
318
319
  version?: number | undefined;
319
320
  updated_at?: any;
320
- text?: string | undefined;
321
321
  }, {
322
+ text?: string | undefined;
322
323
  version?: number | undefined;
323
324
  updated_at?: any;
324
- text?: string | undefined;
325
325
  }>>;
326
326
  }, "strip", z.ZodTypeAny, {
327
327
  identity?: {
328
+ text?: string | undefined;
328
329
  version?: number | undefined;
329
330
  updated_at?: any;
330
- text?: string | undefined;
331
331
  } | undefined;
332
332
  safety?: {
333
+ text?: string | undefined;
333
334
  version?: number | undefined;
334
335
  updated_at?: any;
335
- text?: string | undefined;
336
336
  } | undefined;
337
337
  channel_custom?: {
338
+ text?: string | undefined;
338
339
  version?: number | undefined;
339
340
  updated_at?: any;
340
- text?: string | undefined;
341
341
  } | undefined;
342
342
  }, {
343
343
  identity?: {
344
+ text?: string | undefined;
344
345
  version?: number | undefined;
345
346
  updated_at?: any;
346
- text?: string | undefined;
347
347
  } | undefined;
348
348
  safety?: {
349
+ text?: string | undefined;
349
350
  version?: number | undefined;
350
351
  updated_at?: any;
351
- text?: string | undefined;
352
352
  } | undefined;
353
353
  channel_custom?: {
354
+ text?: string | undefined;
354
355
  version?: number | undefined;
355
356
  updated_at?: any;
356
- text?: string | undefined;
357
357
  } | undefined;
358
358
  }>>;
359
359
  toolkit_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -280,9 +280,9 @@ export declare const zAppointmentStatusSchema: z.ZodObject<{
280
280
  }, "strip", z.ZodTypeAny, {
281
281
  name: string;
282
282
  id: string;
283
+ order: number;
283
284
  tenant: string;
284
285
  model_ver: number;
285
- order: number;
286
286
  base_type: "cancelled" | "scheduled" | "confirmed" | "rescheduled" | "pre_checkin" | "waiting" | "in_progress" | "completed" | "no_show" | "cancelled_by_clinic" | "cancelled_by_patient" | "extra_slot" | "awaiting_payment" | "paid" | "awaiting_documents" | "blocked" | "waiting_list" | "expired";
287
287
  ref?: any;
288
288
  created_at?: Date | null | undefined;
@@ -292,8 +292,8 @@ export declare const zAppointmentStatusSchema: z.ZodObject<{
292
292
  }, {
293
293
  name: string;
294
294
  id: string;
295
- tenant: string;
296
295
  order: number;
296
+ tenant: string;
297
297
  base_type: "cancelled" | "scheduled" | "confirmed" | "rescheduled" | "pre_checkin" | "waiting" | "in_progress" | "completed" | "no_show" | "cancelled_by_clinic" | "cancelled_by_patient" | "extra_slot" | "awaiting_payment" | "paid" | "awaiting_documents" | "blocked" | "waiting_list" | "expired";
298
298
  ref?: any;
299
299
  model_ver?: number | undefined;
@@ -318,9 +318,9 @@ export declare const zAppointmentTypeSchema: z.ZodObject<{
318
318
  }, "strip", z.ZodTypeAny, {
319
319
  name: string;
320
320
  id: string;
321
+ order: number;
321
322
  tenant: string;
322
323
  model_ver: number;
323
- order: number;
324
324
  base_type: "blocked" | "consultation" | "follow_up" | "procedure" | "surgery" | "exam" | "evaluation" | "emergency" | "check_up" | "vaccination" | "fit_test" | "therapy" | "meeting";
325
325
  ref?: any;
326
326
  created_at?: Date | null | undefined;
@@ -330,8 +330,8 @@ export declare const zAppointmentTypeSchema: z.ZodObject<{
330
330
  }, {
331
331
  name: string;
332
332
  id: string;
333
- tenant: string;
334
333
  order: number;
334
+ tenant: string;
335
335
  base_type: "blocked" | "consultation" | "follow_up" | "procedure" | "surgery" | "exam" | "evaluation" | "emergency" | "check_up" | "vaccination" | "fit_test" | "therapy" | "meeting";
336
336
  ref?: any;
337
337
  model_ver?: number | undefined;
@@ -1082,6 +1082,7 @@ export declare const zPatientSchema: z.ZodObject<{
1082
1082
  color?: string | undefined;
1083
1083
  category?: string | null | undefined;
1084
1084
  }>, "many">>>;
1085
+ capture_data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
1085
1086
  userRef: z.ZodAny;
1086
1087
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1087
1088
  id: z.ZodString;
@@ -1435,6 +1436,7 @@ export declare const zPatientSchema: z.ZodObject<{
1435
1436
  color?: string | undefined;
1436
1437
  category?: string | null | undefined;
1437
1438
  }>, "many">>>;
1439
+ capture_data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
1438
1440
  userRef: z.ZodAny;
1439
1441
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1440
1442
  id: z.ZodString;
@@ -1788,5 +1790,6 @@ export declare const zPatientSchema: z.ZodObject<{
1788
1790
  color?: string | undefined;
1789
1791
  category?: string | null | undefined;
1790
1792
  }>, "many">>>;
1793
+ capture_data: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
1791
1794
  userRef: z.ZodAny;
1792
1795
  }, z.ZodTypeAny, "passthrough">>;
@@ -156,6 +156,7 @@ exports.zPatientSchema = zod_schemas_4.zProfileSchema // Extend from ProfileSche
156
156
  attachments: zod_1.z.array(exports.zPatientAttachmentSchema).nullable().optional(),
157
157
  attachmentExternalLinkKeys: zod_1.z.array(zod_1.z.string()).nullable().optional(),
158
158
  tags: zod_1.z.array(zod_schemas_2.zTagSchema).nullable().optional(),
159
+ capture_data: zod_schemas_2.zCaptureDataMapSchema.nullable().optional(),
159
160
  userRef: zod_1.z.any(),
160
161
  })
161
162
  .passthrough();
@@ -8,6 +8,7 @@ import {
8
8
  } from "../dic/zod-schemas";
9
9
  import {
10
10
  zAddressSchema,
11
+ zCaptureDataMapSchema,
11
12
  zContactSchema,
12
13
  zTagSchema,
13
14
  } from "../../shared/zod-schemas";
@@ -177,6 +178,7 @@ export const zPatientSchema = zProfileSchema // Extend from ProfileSchema
177
178
  attachments: z.array(zPatientAttachmentSchema).nullable().optional(),
178
179
  attachmentExternalLinkKeys: z.array(z.string()).nullable().optional(),
179
180
  tags: z.array(zTagSchema).nullable().optional(),
181
+ capture_data: zCaptureDataMapSchema.nullable().optional(),
180
182
  userRef: z.any(),
181
183
  })
182
184
  .passthrough();
@@ -108,3 +108,103 @@ export declare const zContactSchema: z.ZodObject<{
108
108
  instagram_username: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
109
  bsuid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
110
  }, z.ZodTypeAny, "passthrough">>;
111
+ export declare const zCaptureDataFieldTypeSchema: z.ZodEnum<["text", "number", "date", "select", "boolean"]>;
112
+ export declare const zCaptureDataFieldOptionSchema: z.ZodObject<{
113
+ value: z.ZodString;
114
+ label: z.ZodString;
115
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
116
+ value: z.ZodString;
117
+ label: z.ZodString;
118
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
119
+ value: z.ZodString;
120
+ label: z.ZodString;
121
+ }, z.ZodTypeAny, "passthrough">>;
122
+ /**
123
+ * Campo do dicionário (qualquer entidade). O `code` aceita o legado (1–64);
124
+ * o slug `^[a-z][a-z0-9_]{0,63}$` é regra de CRIAÇÃO, aplicada no backend.
125
+ */
126
+ export declare const zCaptureDataFieldSchema: z.ZodObject<{
127
+ id: z.ZodString;
128
+ ref: z.ZodAny;
129
+ tenant: z.ZodString;
130
+ model_ver: z.ZodDefault<z.ZodNumber>;
131
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
132
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
133
+ deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
134
+ } & {
135
+ code: z.ZodString;
136
+ name: z.ZodString;
137
+ type: z.ZodOptional<z.ZodEnum<["text", "number", "date", "select", "boolean"]>>;
138
+ options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
139
+ value: z.ZodString;
140
+ label: z.ZodString;
141
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
142
+ value: z.ZodString;
143
+ label: z.ZodString;
144
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
145
+ value: z.ZodString;
146
+ label: z.ZodString;
147
+ }, z.ZodTypeAny, "passthrough">>, "many">>>;
148
+ required: z.ZodOptional<z.ZodBoolean>;
149
+ order: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
150
+ searchable: z.ZodOptional<z.ZodBoolean>;
151
+ mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
152
+ mcp_enabled: z.ZodOptional<z.ZodBoolean>;
153
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
154
+ id: z.ZodString;
155
+ ref: z.ZodAny;
156
+ tenant: z.ZodString;
157
+ model_ver: z.ZodDefault<z.ZodNumber>;
158
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
159
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
160
+ deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
161
+ } & {
162
+ code: z.ZodString;
163
+ name: z.ZodString;
164
+ type: z.ZodOptional<z.ZodEnum<["text", "number", "date", "select", "boolean"]>>;
165
+ options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
166
+ value: z.ZodString;
167
+ label: z.ZodString;
168
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
169
+ value: z.ZodString;
170
+ label: z.ZodString;
171
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
172
+ value: z.ZodString;
173
+ label: z.ZodString;
174
+ }, z.ZodTypeAny, "passthrough">>, "many">>>;
175
+ required: z.ZodOptional<z.ZodBoolean>;
176
+ order: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
177
+ searchable: z.ZodOptional<z.ZodBoolean>;
178
+ mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
+ mcp_enabled: z.ZodOptional<z.ZodBoolean>;
180
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
181
+ id: z.ZodString;
182
+ ref: z.ZodAny;
183
+ tenant: z.ZodString;
184
+ model_ver: z.ZodDefault<z.ZodNumber>;
185
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
186
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
187
+ deleted_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
188
+ } & {
189
+ code: z.ZodString;
190
+ name: z.ZodString;
191
+ type: z.ZodOptional<z.ZodEnum<["text", "number", "date", "select", "boolean"]>>;
192
+ options: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
193
+ value: z.ZodString;
194
+ label: z.ZodString;
195
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
196
+ value: z.ZodString;
197
+ label: z.ZodString;
198
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
199
+ value: z.ZodString;
200
+ label: z.ZodString;
201
+ }, z.ZodTypeAny, "passthrough">>, "many">>>;
202
+ required: z.ZodOptional<z.ZodBoolean>;
203
+ order: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
204
+ searchable: z.ZodOptional<z.ZodBoolean>;
205
+ mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
206
+ mcp_enabled: z.ZodOptional<z.ZodBoolean>;
207
+ }, z.ZodTypeAny, "passthrough">>;
208
+ export declare const zCaptureDataValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
209
+ /** Mapa `capture_data` gravado na entidade. */
210
+ export declare const zCaptureDataMapSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
@@ -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.zFirestoreDateSchema = exports.zEvoAppSchema = void 0;
3
+ exports.zCaptureDataMapSchema = exports.zCaptureDataValueSchema = exports.zCaptureDataFieldSchema = exports.zCaptureDataFieldOptionSchema = exports.zCaptureDataFieldTypeSchema = 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([
@@ -92,3 +92,41 @@ exports.zContactSchema = zod_1.z.object({
92
92
  // WhatsApp BSUID (Business-Scoped User ID) — contato que a Meta entrega sem telefone
93
93
  bsuid: zod_1.z.string().nullable().optional(),
94
94
  }).passthrough();
95
+ // ----- Campos complementares (capture-data) — feat-196
96
+ exports.zCaptureDataFieldTypeSchema = zod_1.z.enum([
97
+ "text",
98
+ "number",
99
+ "date",
100
+ "select",
101
+ "boolean",
102
+ ]);
103
+ exports.zCaptureDataFieldOptionSchema = zod_1.z
104
+ .object({
105
+ value: zod_1.z.string().min(1).max(255),
106
+ label: zod_1.z.string().min(1).max(255),
107
+ })
108
+ .passthrough();
109
+ /**
110
+ * Campo do dicionário (qualquer entidade). O `code` aceita o legado (1–64);
111
+ * o slug `^[a-z][a-z0-9_]{0,63}$` é regra de CRIAÇÃO, aplicada no backend.
112
+ */
113
+ exports.zCaptureDataFieldSchema = exports.zFireDocSchema
114
+ .extend({
115
+ code: zod_1.z.string().min(1).max(64),
116
+ name: zod_1.z.string().min(1).max(255),
117
+ type: exports.zCaptureDataFieldTypeSchema.optional(),
118
+ options: zod_1.z.array(exports.zCaptureDataFieldOptionSchema).nullable().optional(),
119
+ required: zod_1.z.boolean().optional(),
120
+ order: zod_1.z.number().int().nullable().optional(),
121
+ searchable: zod_1.z.boolean().optional(),
122
+ mcp_description: zod_1.z.string().max(2000).nullable().optional(),
123
+ mcp_enabled: zod_1.z.boolean().optional(),
124
+ })
125
+ .passthrough();
126
+ exports.zCaptureDataValueSchema = zod_1.z.union([
127
+ zod_1.z.string(),
128
+ zod_1.z.number(),
129
+ zod_1.z.boolean(),
130
+ ]);
131
+ /** Mapa `capture_data` gravado na entidade. */
132
+ exports.zCaptureDataMapSchema = zod_1.z.record(exports.zCaptureDataValueSchema);
@@ -107,3 +107,47 @@ export const zContactSchema = z.object({
107
107
  // WhatsApp BSUID (Business-Scoped User ID) — contato que a Meta entrega sem telefone
108
108
  bsuid: z.string().nullable().optional(),
109
109
  }).passthrough();
110
+
111
+ // ----- Campos complementares (capture-data) — feat-196
112
+
113
+ export const zCaptureDataFieldTypeSchema = z.enum([
114
+ "text",
115
+ "number",
116
+ "date",
117
+ "select",
118
+ "boolean",
119
+ ]);
120
+
121
+ export const zCaptureDataFieldOptionSchema = z
122
+ .object({
123
+ value: z.string().min(1).max(255),
124
+ label: z.string().min(1).max(255),
125
+ })
126
+ .passthrough();
127
+
128
+ /**
129
+ * Campo do dicionário (qualquer entidade). O `code` aceita o legado (1–64);
130
+ * o slug `^[a-z][a-z0-9_]{0,63}$` é regra de CRIAÇÃO, aplicada no backend.
131
+ */
132
+ export const zCaptureDataFieldSchema = zFireDocSchema
133
+ .extend({
134
+ code: z.string().min(1).max(64),
135
+ name: z.string().min(1).max(255),
136
+ type: zCaptureDataFieldTypeSchema.optional(),
137
+ options: z.array(zCaptureDataFieldOptionSchema).nullable().optional(),
138
+ required: z.boolean().optional(),
139
+ order: z.number().int().nullable().optional(),
140
+ searchable: z.boolean().optional(),
141
+ mcp_description: z.string().max(2000).nullable().optional(),
142
+ mcp_enabled: z.boolean().optional(),
143
+ })
144
+ .passthrough();
145
+
146
+ export const zCaptureDataValueSchema = z.union([
147
+ z.string(),
148
+ z.number(),
149
+ z.boolean(),
150
+ ]);
151
+
152
+ /** Mapa `capture_data` gravado na entidade. */
153
+ export const zCaptureDataMapSchema = z.record(zCaptureDataValueSchema);
@@ -1,5 +1,5 @@
1
1
  export * from "../fb_collections";
2
- import { FirestoreDocumentReference, IAddress, IContact, IExternalLink, ITag } from "../../shared";
2
+ import { CaptureDataMap, FirestoreDocumentReference, IAddress, IContact, IExternalLink, ITag } from "../../shared";
3
3
  import { IProfile } from "../../evo-people";
4
4
  import { QualificationFunnelLevel } from "../dic";
5
5
  export declare const EvoCrmLeadPermissions: {
@@ -112,6 +112,8 @@ export interface ILead extends IProfile {
112
112
  /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
113
113
  externalLinkKeys?: string[];
114
114
  tags?: ITag[] | null;
115
+ /** Campos complementares (code → valor), validados contra o dicionário `dics/leads/capture-data` (feat-196). */
116
+ capture_data?: CaptureDataMap | null;
115
117
  userRef?: FirestoreDocumentReference;
116
118
  ctwa_clid?: string | null;
117
119
  /**
@@ -1,6 +1,7 @@
1
1
  export * from "../fb_collections";
2
2
 
3
3
  import {
4
+ CaptureDataMap,
4
5
  FirestoreDocumentReference,
5
6
  IAddress,
6
7
  IContact,
@@ -154,6 +155,8 @@ export interface ILead extends IProfile {
154
155
  /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
155
156
  externalLinkKeys?: string[];
156
157
  tags?: ITag[] | null;
158
+ /** Campos complementares (code → valor), validados contra o dicionário `dics/leads/capture-data` (feat-196). */
159
+ capture_data?: CaptureDataMap | null;
157
160
  userRef?: FirestoreDocumentReference;
158
161
  // CTWA attribution (feat-034) — capturado do referral do 1º inbound vindo de anúncio Click-to-WhatsApp.
159
162
  ctwa_clid?: string | null;
@@ -1,6 +1,6 @@
1
1
  export * from "../fb_collections";
2
2
  import { IProfile } from "../../evo-people";
3
- import type { FirestoreDocumentReference, IAddress, IContact, IExternalLink, ITag } from "../../shared";
3
+ import type { CaptureDataMap, FirestoreDocumentReference, IAddress, IContact, IExternalLink, ITag } from "../../shared";
4
4
  import { IMedication, PatientAttachmentBaseCategory } from "../dic";
5
5
  export declare const EvoMedProfessionalPermissions: {
6
6
  readonly List: "evo_med_people_professional_read";
@@ -184,6 +184,8 @@ export interface IPatient extends IProfile {
184
184
  attachments?: IPatientAttachment[] | null;
185
185
  attachmentExternalLinkKeys?: string[] | null;
186
186
  tags?: ITag[] | null;
187
+ /** Campos complementares (code → valor), validados contra o dicionário `dics/patients/capture-data` (feat-196). */
188
+ capture_data?: CaptureDataMap | null;
187
189
  userRef?: FirestoreDocumentReference;
188
190
  [key: string]: unknown;
189
191
  }
@@ -1,6 +1,7 @@
1
1
  export * from "../fb_collections";
2
2
  import { IProfile } from "../../evo-people";
3
3
  import type {
4
+ CaptureDataMap,
4
5
  FirestoreDocumentReference,
5
6
  IAddress,
6
7
  IContact,
@@ -249,6 +250,8 @@ export interface IPatient extends IProfile {
249
250
  attachments?: IPatientAttachment[] | null;
250
251
  attachmentExternalLinkKeys?: string[] | null;
251
252
  tags?: ITag[] | null;
253
+ /** Campos complementares (code → valor), validados contra o dicionário `dics/patients/capture-data` (feat-196). */
254
+ capture_data?: CaptureDataMap | null;
252
255
  userRef?: FirestoreDocumentReference;
253
256
  [key: string]: unknown; // index signature
254
257
  }
@@ -0,0 +1,49 @@
1
+ import type { IFireDoc } from "./index";
2
+ /** Nome da subcoleção do dicionário, sob `dics/{entidade}/`. */
3
+ export declare const CAPTURE_DATA_COLLECTION = "capture-data";
4
+ /** Entidades que têm dicionário de campos complementares (= segmento do path em `dics/`). */
5
+ export type CaptureDataEntity = "leads" | "patients";
6
+ export declare const CAPTURE_DATA_FIELD_TYPES: readonly ["text", "number", "date", "select", "boolean"];
7
+ /** Tipo do campo. Ausente no doc = `text` (campos legados de lead). */
8
+ export type CaptureDataFieldType = (typeof CAPTURE_DATA_FIELD_TYPES)[number];
9
+ /**
10
+ * Valor gravado no mapa `capture_data`. `date` é string `YYYY-MM-DD`;
11
+ * `select` grava o `value` da opção.
12
+ */
13
+ export type CaptureDataValue = string | number | boolean;
14
+ /** Mapa gravado na entidade (`lead.capture_data`, `patient.capture_data`). */
15
+ export type CaptureDataMap = Record<string, CaptureDataValue>;
16
+ /**
17
+ * Regra de CRIAÇÃO do `code` (aplicada no backend). Codes legados fora desse
18
+ * padrão (ex.: `Convênio`, `nome-paciente`) continuam válidos para leitura.
19
+ */
20
+ export declare const CAPTURE_DATA_CODE_PATTERN = "^[a-z][a-z0-9_]{0,63}$";
21
+ /** Limite de caracteres de um valor `text`. */
22
+ export declare const CAPTURE_DATA_TEXT_MAX_LENGTH = 2000;
23
+ export interface ICaptureDataFieldOption {
24
+ /** O que vai gravado no mapa. */
25
+ value: string;
26
+ /** O que a UI mostra. */
27
+ label: string;
28
+ }
29
+ export interface ICaptureDataField extends IFireDoc {
30
+ /** Chave no mapa `capture_data`. Imutável depois de criado. */
31
+ code: string;
32
+ name: string;
33
+ /** Ausente = `text` (legado). Imutável depois de definido. */
34
+ type?: CaptureDataFieldType;
35
+ /** Só para `select`. */
36
+ options?: ICaptureDataFieldOption[] | null;
37
+ required?: boolean;
38
+ order?: number | null;
39
+ /** Envia o valor ao índice de busca (Algolia, região US). Default false (D2). */
40
+ searchable?: boolean;
41
+ /** Instrução para a IA preencher o campo. */
42
+ mcp_description?: string | null;
43
+ /** Default true. */
44
+ mcp_enabled?: boolean;
45
+ }
46
+ /** Compatibilidade: o dicionário de lead é o genérico. */
47
+ export type ILeadCaptureDataField = ICaptureDataField;
48
+ /** Dicionário de campos complementares de paciente. */
49
+ export type IPatientCaptureDataField = ICaptureDataField;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CAPTURE_DATA_TEXT_MAX_LENGTH = exports.CAPTURE_DATA_CODE_PATTERN = exports.CAPTURE_DATA_FIELD_TYPES = exports.CAPTURE_DATA_COLLECTION = void 0;
4
+ // ----- Campos complementares (capture-data) — feat-196
5
+ //
6
+ // Dicionário genérico por entidade: cada tenant define campos próprios que são
7
+ // gravados em `{entidade}.capture_data` (mapa code → valor).
8
+ // leads → tenants/{t}/apps/evo-crm/dics/leads/capture-data/{id}
9
+ // patients → tenants/{t}/apps/evo-med/dics/patients/capture-data/{id}
10
+ // Herda do `base_tenant` (o tenant atual vence o base, deduplicado por `code`).
11
+ /** Nome da subcoleção do dicionário, sob `dics/{entidade}/`. */
12
+ exports.CAPTURE_DATA_COLLECTION = "capture-data";
13
+ exports.CAPTURE_DATA_FIELD_TYPES = [
14
+ "text",
15
+ "number",
16
+ "date",
17
+ "select",
18
+ "boolean",
19
+ ];
20
+ /**
21
+ * Regra de CRIAÇÃO do `code` (aplicada no backend). Codes legados fora desse
22
+ * padrão (ex.: `Convênio`, `nome-paciente`) continuam válidos para leitura.
23
+ */
24
+ exports.CAPTURE_DATA_CODE_PATTERN = "^[a-z][a-z0-9_]{0,63}$";
25
+ /** Limite de caracteres de um valor `text`. */
26
+ exports.CAPTURE_DATA_TEXT_MAX_LENGTH = 2000;
@@ -0,0 +1,74 @@
1
+ import type { IFireDoc } from "./index";
2
+
3
+ // ----- Campos complementares (capture-data) — feat-196
4
+ //
5
+ // Dicionário genérico por entidade: cada tenant define campos próprios que são
6
+ // gravados em `{entidade}.capture_data` (mapa code → valor).
7
+ // leads → tenants/{t}/apps/evo-crm/dics/leads/capture-data/{id}
8
+ // patients → tenants/{t}/apps/evo-med/dics/patients/capture-data/{id}
9
+ // Herda do `base_tenant` (o tenant atual vence o base, deduplicado por `code`).
10
+
11
+ /** Nome da subcoleção do dicionário, sob `dics/{entidade}/`. */
12
+ export const CAPTURE_DATA_COLLECTION = "capture-data";
13
+
14
+ /** Entidades que têm dicionário de campos complementares (= segmento do path em `dics/`). */
15
+ export type CaptureDataEntity = "leads" | "patients";
16
+
17
+ export const CAPTURE_DATA_FIELD_TYPES = [
18
+ "text",
19
+ "number",
20
+ "date",
21
+ "select",
22
+ "boolean",
23
+ ] as const;
24
+
25
+ /** Tipo do campo. Ausente no doc = `text` (campos legados de lead). */
26
+ export type CaptureDataFieldType = (typeof CAPTURE_DATA_FIELD_TYPES)[number];
27
+
28
+ /**
29
+ * Valor gravado no mapa `capture_data`. `date` é string `YYYY-MM-DD`;
30
+ * `select` grava o `value` da opção.
31
+ */
32
+ export type CaptureDataValue = string | number | boolean;
33
+
34
+ /** Mapa gravado na entidade (`lead.capture_data`, `patient.capture_data`). */
35
+ export type CaptureDataMap = Record<string, CaptureDataValue>;
36
+
37
+ /**
38
+ * Regra de CRIAÇÃO do `code` (aplicada no backend). Codes legados fora desse
39
+ * padrão (ex.: `Convênio`, `nome-paciente`) continuam válidos para leitura.
40
+ */
41
+ export const CAPTURE_DATA_CODE_PATTERN = "^[a-z][a-z0-9_]{0,63}$";
42
+
43
+ /** Limite de caracteres de um valor `text`. */
44
+ export const CAPTURE_DATA_TEXT_MAX_LENGTH = 2000;
45
+
46
+ export interface ICaptureDataFieldOption {
47
+ /** O que vai gravado no mapa. */
48
+ value: string;
49
+ /** O que a UI mostra. */
50
+ label: string;
51
+ }
52
+
53
+ export interface ICaptureDataField extends IFireDoc {
54
+ /** Chave no mapa `capture_data`. Imutável depois de criado. */
55
+ code: string;
56
+ name: string;
57
+ /** Ausente = `text` (legado). Imutável depois de definido. */
58
+ type?: CaptureDataFieldType;
59
+ /** Só para `select`. */
60
+ options?: ICaptureDataFieldOption[] | null;
61
+ required?: boolean;
62
+ order?: number | null;
63
+ /** Envia o valor ao índice de busca (Algolia, região US). Default false (D2). */
64
+ searchable?: boolean;
65
+ /** Instrução para a IA preencher o campo. */
66
+ mcp_description?: string | null;
67
+ /** Default true. */
68
+ mcp_enabled?: boolean;
69
+ }
70
+
71
+ /** Compatibilidade: o dicionário de lead é o genérico. */
72
+ export type ILeadCaptureDataField = ICaptureDataField;
73
+ /** Dicionário de campos complementares de paciente. */
74
+ export type IPatientCaptureDataField = ICaptureDataField;
@@ -1,5 +1,6 @@
1
1
  export * from "./fb_collections";
2
2
  export * from "./external-links";
3
+ export * from "./capture-data";
3
4
  export interface FirestoreDocumentReference {
4
5
  id: string;
5
6
  path: string;
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.IEvoApp = void 0;
18
18
  __exportStar(require("./fb_collections"), exports);
19
19
  __exportStar(require("./external-links"), exports);
20
+ __exportStar(require("./capture-data"), exports);
20
21
  var IEvoApp;
21
22
  (function (IEvoApp) {
22
23
  IEvoApp["EvoActivity"] = "evo-activity";
@@ -1,5 +1,6 @@
1
1
  export * from "./fb_collections";
2
2
  export * from "./external-links";
3
+ export * from "./capture-data";
3
4
 
4
5
  // ----- FirestoreTypes
5
6
  // Definir o tipo unificado para DocumentReference
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.602",
3
+ "version": "1.3.604",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",