* Type app options * Refactor `writeToPersonRecord` to `writeToRecord` * Abstract writing to salesforce record options component * Add option to write to event object on cancellation * Add on booking cancel write to event object to schema * Refactor writing to record on booking option to use `<WriteToObjectSettings />` * Pass event object to crm delete method * When cancelling booking write to event object - App data isn't being read * V1 pass app data to crm service * Undo .env commit * Fix passing event to cancel crm cancel event method * Pass event type metadata to `EventManager` in `handleCancelBooking` * Handle writing to event record * Type fix
57 lines
1.3 KiB
TypeScript
57 lines
1.3 KiB
TypeScript
import type { CalendarEvent, CalEventResponses } 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;
|
|
recordType?: string;
|
|
}
|
|
|
|
export interface CrmEvent {
|
|
id: string;
|
|
uid?: string;
|
|
type?: string;
|
|
password?: string;
|
|
url?: string;
|
|
additionalInfo?: any;
|
|
}
|
|
|
|
export interface CRM {
|
|
createEvent: (event: CalendarEvent, contacts: Contact[]) => Promise<CrmEvent | undefined>;
|
|
updateEvent: (uid: string, event: CalendarEvent) => Promise<CrmEvent>;
|
|
deleteEvent: (uid: string, event: CalendarEvent) => Promise<void>;
|
|
getContacts: ({
|
|
emails,
|
|
includeOwner,
|
|
forRoundRobinSkip,
|
|
}: {
|
|
emails: string | string[];
|
|
includeOwner?: boolean;
|
|
forRoundRobinSkip?: boolean;
|
|
}) => Promise<Contact[]>;
|
|
createContacts: (
|
|
contactsToCreate: ContactCreateInput[],
|
|
organizerEmail?: string,
|
|
calEventResponses?: CalEventResponses | null
|
|
) => Promise<Contact[]>;
|
|
getAppOptions: () => any;
|
|
handleAttendeeNoShow?: (
|
|
bookingUid: string,
|
|
attendees: { email: string; noShow: boolean }[]
|
|
) => Promise<void>;
|
|
}
|