* Refactor get SF user and create event * Add new Salesforce options * Pass app options to CrmService * Add record enum * Add creating new lead and contact under an account * Handle if the contact already exists but not connected to account * Create a lead if an account doesn't exist * Merge fix * Refactor - add generateCreateRecordBody * Type fix * Clean up * Add getAppOptions to other CRM services * Type fixes * Fix typo * feat: Salesforce round robin skip - choose which entity to search on (#17038) * Add option to search which entity for the owner * Add logic to search entity for skipping RR assignment * Type fixes * Disable license * Skip license check in component * Revert license changes --------- Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
43 lines
965 B
TypeScript
43 lines
965 B
TypeScript
import type { CalendarEvent } from "./Calendar";
|
|
|
|
export interface CrmData {
|
|
id: string;
|
|
type: string;
|
|
credentialId: number;
|
|
password?: string;
|
|
url?: string;
|
|
}
|
|
|
|
export interface ContactCreateInput {
|
|
email: string;
|
|
name: string;
|
|
}
|
|
|
|
export interface Contact {
|
|
id: string;
|
|
email: string;
|
|
ownerId?: string;
|
|
ownerEmail?: string;
|
|
}
|
|
|
|
export interface CrmEvent {
|
|
id: string;
|
|
}
|
|
|
|
export interface CRM {
|
|
createEvent: (event: CalendarEvent, contacts: Contact[]) => Promise<CrmEvent | undefined>;
|
|
updateEvent: (uid: string, event: CalendarEvent) => Promise<CrmEvent>;
|
|
deleteEvent: (uid: string) => Promise<void>;
|
|
getContacts: ({
|
|
emails,
|
|
includeOwner,
|
|
forRoundRobinSkip,
|
|
}: {
|
|
emails: string | string[];
|
|
includeOwner?: boolean;
|
|
forRoundRobinSkip?: boolean;
|
|
}) => Promise<Contact[]>;
|
|
createContacts: (contactsToCreate: ContactCreateInput[], organizerEmail?: string) => Promise<Contact[]>;
|
|
getAppOptions: () => any;
|
|
}
|