feat: add email, scheduler, and Zulip integration services
- Add email service for sending meeting invites with ICS attachments - Add scheduler for background calendar sync jobs - Add Zulip service for meeting notifications - Make ics_url optional for participants - Add /api/schedule endpoint with 2-hour lead time validation - Update frontend to support scheduling flow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ export interface ParticipantAPI {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
ics_url: string;
|
||||
ics_url: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export interface TimeSlotAPI {
|
||||
export interface CreateParticipantRequest {
|
||||
name: string;
|
||||
email: string;
|
||||
ics_url: string;
|
||||
ics_url?: string;
|
||||
}
|
||||
|
||||
async function handleResponse<T>(response: Response): Promise<T> {
|
||||
@@ -76,3 +76,24 @@ export async function syncParticipant(id: string): Promise<void> {
|
||||
throw new Error('Failed to sync participant calendar');
|
||||
}
|
||||
}
|
||||
|
||||
export async function scheduleMeeting(
|
||||
participantIds: string[],
|
||||
title: string,
|
||||
description: string,
|
||||
startTime: string,
|
||||
endTime: string,
|
||||
): Promise<{ email_sent: boolean; zulip_sent: boolean }> {
|
||||
const response = await fetch(`${API_URL}/api/schedule`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
participant_ids: participantIds,
|
||||
title,
|
||||
description,
|
||||
start_time: startTime,
|
||||
end_time: endTime,
|
||||
}),
|
||||
});
|
||||
return handleResponse(response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user