refactor: calEventParser CalendarEvent ISP (#25890)
* refactor: calEventParser CalendarEvent ISP
* update
* fix: complete CalEventParser ISP refactoring - update call sites and fix type errors
- Update getUid call sites to pass only uid instead of whole CalendarEvent
- Update getLocation call sites to pass narrow shape with videoCallData, additionalInformation, location, uid
- Update narrow input shapes to accept null for location (matching CalendarEvent type)
- Update recurringEvent type to accept RecurringEvent | null instead of boolean
- Update videoCallData type to be more flexible ({ type?: string; url?: string })
- Fix ManageLink.tsx to pass recurringEvent directly instead of converting to boolean
Co-Authored-By: [email protected] <[email protected]>
* test: update CalEventParser tests to use narrow input shapes
- Update getPublicVideoCallUrl test to pass uid instead of calEvent
- Update getVideoCallPassword tests to pass videoCallData instead of calEvent
Co-Authored-By: [email protected] <[email protected]>
* few fix
* fix type error
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Morgan <[email protected]>
This commit is contained in:
17 files changed
+426
-136
No files matched your search
@@ -1249,7 +1249,7 @@ export default class EventManager {
|
||||
? await featureRepo.checkIfTeamHasFeature(event.team.id, "salesforce-crm-tasker")
|
||||
: false;
|
||||
|
||||
const uid = getUid(event);
|
||||
const uid = getUid(event.uid);
|
||||
for (const credential of this.crmCredentials) {
|
||||
if (isTaskerEnabledForSalesforceCrm) {
|
||||
if (!event.uid) {
|
||||
|
||||
@@ -295,7 +295,7 @@ export const createEvent = async (
|
||||
): Promise<EventResult<NewCalendarEventType>> => {
|
||||
// Some calendar libraries may edit the original event so let's clone it
|
||||
const formattedEvent = formatCalEvent(originalEvent);
|
||||
const uid: string = getUid(formattedEvent);
|
||||
const uid: string = getUid(formattedEvent.uid);
|
||||
const calendar = await getCalendar(credential, "booking");
|
||||
let success = true;
|
||||
let calError: string | undefined = undefined;
|
||||
@@ -394,7 +394,7 @@ export const updateEvent = async (
|
||||
}
|
||||
|
||||
const calEvent = processEvent(formattedEvent);
|
||||
const uid = getUid(calEvent);
|
||||
const uid = getUid(calEvent.uid);
|
||||
const calendar = await getCalendar(credential, "booking");
|
||||
let success = false;
|
||||
let calError: string | undefined = undefined;
|
||||
|
||||
@@ -30,7 +30,7 @@ const createMeeting = async (
|
||||
credential: CredentialPayload | CredentialForCalendarService,
|
||||
calEvent: CalendarEvent
|
||||
) => {
|
||||
const uid: string = getUid(calEvent);
|
||||
const uid: string = getUid(calEvent.uid);
|
||||
log.debug(
|
||||
"createMeeting",
|
||||
safeStringify({
|
||||
|
||||
@@ -438,7 +438,7 @@ export class EmailWorkflowService {
|
||||
sendToEmail: sendTo[0],
|
||||
});
|
||||
const meetingUrl =
|
||||
getVideoCallUrlFromCalEvent(evt) || bookingMetadataSchema.parse(evt.metadata || {})?.videoCallUrl;
|
||||
getVideoCallUrlFromCalEvent({ videoCallData: evt.videoCallData }) || bookingMetadataSchema.parse(evt.metadata || {})?.videoCallUrl;
|
||||
const variables: VariablesType = {
|
||||
eventName: evt.title || "",
|
||||
organizerName: evt.organizer.name,
|
||||
|
||||
Reference in new issue
Block a user