evo360-types 1.3.446 → 1.3.448

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.
@@ -161,6 +161,31 @@ export declare const zLeadSchema: z.ZodObject<{
161
161
  }, z.ZodTypeAny, "passthrough">>>>;
162
162
  chat_contact_id: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
163
163
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
164
+ /**
165
+ * Vínculos com outros objetos do sistema. O par lead↔paciente é gravado nos
166
+ * DOIS lados: aqui entram `{ type: 'med_patient', id, label: display_name do
167
+ * paciente }` e, no paciente, `{ type: 'crm_lead', id, label: display_name do
168
+ * lead }`. É N↔N: um lead pode ter vários pacientes (ex.: mãe que agenda para
169
+ * a família inteira) e um paciente pode responder a vários leads. feat-095.
170
+ */
171
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
172
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
173
+ id: z.ZodString;
174
+ label: z.ZodOptional<z.ZodString>;
175
+ ref: z.ZodOptional<z.ZodAny>;
176
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
177
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
178
+ id: z.ZodString;
179
+ label: z.ZodOptional<z.ZodString>;
180
+ ref: z.ZodOptional<z.ZodAny>;
181
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
182
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
183
+ id: z.ZodString;
184
+ label: z.ZodOptional<z.ZodString>;
185
+ ref: z.ZodOptional<z.ZodAny>;
186
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
187
+ /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
188
+ externalLinkKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
164
189
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
165
190
  name: z.ZodString;
166
191
  color: z.ZodOptional<z.ZodString>;
@@ -307,6 +332,31 @@ export declare const zLeadSchema: z.ZodObject<{
307
332
  }, z.ZodTypeAny, "passthrough">>>>;
308
333
  chat_contact_id: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
309
334
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
+ /**
336
+ * Vínculos com outros objetos do sistema. O par lead↔paciente é gravado nos
337
+ * DOIS lados: aqui entram `{ type: 'med_patient', id, label: display_name do
338
+ * paciente }` e, no paciente, `{ type: 'crm_lead', id, label: display_name do
339
+ * lead }`. É N↔N: um lead pode ter vários pacientes (ex.: mãe que agenda para
340
+ * a família inteira) e um paciente pode responder a vários leads. feat-095.
341
+ */
342
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
343
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
344
+ id: z.ZodString;
345
+ label: z.ZodOptional<z.ZodString>;
346
+ ref: z.ZodOptional<z.ZodAny>;
347
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
348
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
349
+ id: z.ZodString;
350
+ label: z.ZodOptional<z.ZodString>;
351
+ ref: z.ZodOptional<z.ZodAny>;
352
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
353
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
354
+ id: z.ZodString;
355
+ label: z.ZodOptional<z.ZodString>;
356
+ ref: z.ZodOptional<z.ZodAny>;
357
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
358
+ /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
359
+ externalLinkKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
310
360
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
311
361
  name: z.ZodString;
312
362
  color: z.ZodOptional<z.ZodString>;
@@ -453,6 +503,31 @@ export declare const zLeadSchema: z.ZodObject<{
453
503
  }, z.ZodTypeAny, "passthrough">>>>;
454
504
  chat_contact_id: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
455
505
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
506
+ /**
507
+ * Vínculos com outros objetos do sistema. O par lead↔paciente é gravado nos
508
+ * DOIS lados: aqui entram `{ type: 'med_patient', id, label: display_name do
509
+ * paciente }` e, no paciente, `{ type: 'crm_lead', id, label: display_name do
510
+ * lead }`. É N↔N: um lead pode ter vários pacientes (ex.: mãe que agenda para
511
+ * a família inteira) e um paciente pode responder a vários leads. feat-095.
512
+ */
513
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
514
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
515
+ id: z.ZodString;
516
+ label: z.ZodOptional<z.ZodString>;
517
+ ref: z.ZodOptional<z.ZodAny>;
518
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
519
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
520
+ id: z.ZodString;
521
+ label: z.ZodOptional<z.ZodString>;
522
+ ref: z.ZodOptional<z.ZodAny>;
523
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
524
+ type: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign"]>;
525
+ id: z.ZodString;
526
+ label: z.ZodOptional<z.ZodString>;
527
+ ref: z.ZodOptional<z.ZodAny>;
528
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
529
+ /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
530
+ externalLinkKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
456
531
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
457
532
  name: z.ZodString;
458
533
  color: z.ZodOptional<z.ZodString>;
@@ -4,12 +4,13 @@ exports.zLeadSchema = exports.zLeadReactivationSchema = exports.zLeadDistChannel
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-people/zod-schemas");
7
- const zod_schemas_3 = require("../dic/zod-schemas");
7
+ const zod_schemas_3 = require("../../evo-task/zod-schemas");
8
+ const zod_schemas_4 = require("../dic/zod-schemas");
8
9
  exports.zLeadStatusSchema = zod_1.z.enum(["active", "inactive", "draft"]);
9
10
  exports.zLeadQualificationSchema = zod_1.z.object({
10
11
  code: zod_1.z.string().min(1).max(20),
11
12
  name: zod_1.z.string().min(1).max(255),
12
- funnelLevel: zod_schemas_3.zQualificationFunnelLevelSchema,
13
+ funnelLevel: zod_schemas_4.zQualificationFunnelLevelSchema,
13
14
  ref: zod_1.z.any(),
14
15
  updated_at: zod_1.z.coerce.date().nullable().optional(),
15
16
  });
@@ -38,6 +39,16 @@ exports.zLeadSchema = zod_schemas_2.zProfileSchema // Extend from ProfileSchema
38
39
  contact: zod_schemas_1.zContactSchema.nullable().optional(),
39
40
  chat_contact_id: zod_1.z.string().or(zod_1.z.number()).nullable().optional(),
40
41
  notes: zod_1.z.string().nullable().optional(),
42
+ /**
43
+ * Vínculos com outros objetos do sistema. O par lead↔paciente é gravado nos
44
+ * DOIS lados: aqui entram `{ type: 'med_patient', id, label: display_name do
45
+ * paciente }` e, no paciente, `{ type: 'crm_lead', id, label: display_name do
46
+ * lead }`. É N↔N: um lead pode ter vários pacientes (ex.: mãe que agenda para
47
+ * a família inteira) e um paciente pode responder a vários leads. feat-095.
48
+ */
49
+ externalLinks: zod_1.z.array(zod_schemas_3.zExternalLinkSchema).optional(),
50
+ /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
51
+ externalLinkKeys: zod_1.z.array(zod_1.z.string()).optional(),
41
52
  tags: zod_1.z.array(zod_schemas_1.zTagSchema).nullable().optional(),
42
53
  userRef: zod_1.z.any(),
43
54
  reactivation: exports.zLeadReactivationSchema.nullable().optional(),
@@ -5,6 +5,7 @@ import {
5
5
  zTagSchema,
6
6
  } from "../../shared/zod-schemas";
7
7
  import { zProfileSchema } from "../../evo-people/zod-schemas";
8
+ import { zExternalLinkSchema } from "../../evo-task/zod-schemas";
8
9
  import { zQualificationFunnelLevelSchema } from "../dic/zod-schemas";
9
10
 
10
11
  export const zLeadStatusSchema = z.enum(["active", "inactive", "draft"]);
@@ -44,6 +45,16 @@ export const zLeadSchema = zProfileSchema // Extend from ProfileSchema
44
45
  contact: zContactSchema.nullable().optional(),
45
46
  chat_contact_id: z.string().or(z.number()).nullable().optional(),
46
47
  notes: z.string().nullable().optional(),
48
+ /**
49
+ * Vínculos com outros objetos do sistema. O par lead↔paciente é gravado nos
50
+ * DOIS lados: aqui entram `{ type: 'med_patient', id, label: display_name do
51
+ * paciente }` e, no paciente, `{ type: 'crm_lead', id, label: display_name do
52
+ * lead }`. É N↔N: um lead pode ter vários pacientes (ex.: mãe que agenda para
53
+ * a família inteira) e um paciente pode responder a vários leads. feat-095.
54
+ */
55
+ externalLinks: z.array(zExternalLinkSchema).optional(),
56
+ /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
57
+ externalLinkKeys: z.array(z.string()).optional(),
47
58
  tags: z.array(zTagSchema).nullable().optional(),
48
59
  userRef: z.any(),
49
60
  reactivation: zLeadReactivationSchema.nullable().optional(),
@@ -1,5 +1,5 @@
1
1
  export * from "../fb_collections";
2
- import { FirestoreDocumentReference, IAddress, IContact, ITag } from "../../shared";
2
+ import { 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: {
@@ -101,6 +101,16 @@ export interface ILead extends IProfile {
101
101
  contact?: IContact | null;
102
102
  chat_contact_id?: string | number | null;
103
103
  notes?: string | null;
104
+ /**
105
+ * Vínculos com outros objetos do sistema. O par lead↔paciente é gravado nos
106
+ * DOIS lados: aqui entram `{ type: 'med_patient', id, label: display_name do
107
+ * paciente }` e, no paciente, `{ type: 'crm_lead', id, label: display_name do
108
+ * lead }`. É N↔N: um lead pode ter vários pacientes (ex.: mãe que agenda para
109
+ * a família inteira) e um paciente pode responder a vários leads. feat-095.
110
+ */
111
+ externalLinks?: IExternalLink[];
112
+ /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
113
+ externalLinkKeys?: string[];
104
114
  tags?: ITag[] | null;
105
115
  userRef?: FirestoreDocumentReference;
106
116
  ctwa_clid?: string | null;
@@ -4,6 +4,7 @@ import {
4
4
  FirestoreDocumentReference,
5
5
  IAddress,
6
6
  IContact,
7
+ IExternalLink,
7
8
  ITag,
8
9
  } from "../../shared";
9
10
  import { IProfile } from "../../evo-people";
@@ -142,6 +143,16 @@ export interface ILead extends IProfile {
142
143
  contact?: IContact | null;
143
144
  chat_contact_id?: string | number | null;
144
145
  notes?: string | null; // Anotações sobre o lead
146
+ /**
147
+ * Vínculos com outros objetos do sistema. O par lead↔paciente é gravado nos
148
+ * DOIS lados: aqui entram `{ type: 'med_patient', id, label: display_name do
149
+ * paciente }` e, no paciente, `{ type: 'crm_lead', id, label: display_name do
150
+ * lead }`. É N↔N: um lead pode ter vários pacientes (ex.: mãe que agenda para
151
+ * a família inteira) e um paciente pode responder a vários leads. feat-095.
152
+ */
153
+ externalLinks?: IExternalLink[];
154
+ /** Derivado de `externalLinks` (`"type:id"`) pelo model — habilita `array-contains`. */
155
+ externalLinkKeys?: string[];
145
156
  tags?: ITag[] | null;
146
157
  userRef?: FirestoreDocumentReference;
147
158
  // CTWA attribution (feat-034) — capturado do referral do 1º inbound vindo de anúncio Click-to-WhatsApp.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.446",
3
+ "version": "1.3.448",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",