Files
hats-app/lib/google-calendar/types.ts
T
Ichsan Kurniawan c9dc6a5e51 Add multi-calendar monthly grid view
Replace the event and task lists with a monthly calendar grid, calendar filters, and event detail view. Add multi-calendar event fetching and route create, edit, and delete actions to the selected calendar.
2026-11-18 18:17:26 +07:00

113 lines
2.5 KiB
TypeScript

export interface CalendarActionResponse<T = unknown> {
success: boolean;
data?: T;
error?: string;
warning?: string;
}
export interface GoogleCalendarListEntry {
id: string;
summary: string;
description?: string;
backgroundColor: string;
foregroundColor: string;
primary?: boolean;
accessRole: string;
isWritable: boolean;
isDefaultEnv?: boolean;
}
export interface CalendarEventItem {
id: string;
summary: string;
description?: string;
location?: string;
start: string; // ISO String or YYYY-MM-DD (inclusive for UI)
end: string; // ISO String or YYYY-MM-DD (inclusive for UI)
isAllDay: boolean;
colorId?: string;
attendees?: string[];
hangoutLink?: string;
htmlLink?: string;
creatorEmail?: string;
createdAt?: string;
updatedAt?: string;
// Multi-calendar metadata
calendarId?: string;
calendarSummary?: string;
calendarColor?: string;
isReadOnly?: boolean;
}
export interface MultiCalendarEventsResult {
calendars: GoogleCalendarListEntry[];
events: CalendarEventItem[];
defaultCalendarId: string;
serviceAccountEmail: string;
}
export interface CreateEventInput {
calendarId?: string;
summary: string;
description?: string;
location?: string;
startDateTime: string; // ISO string or YYYY-MM-DD
endDateTime: string; // ISO string or YYYY-MM-DD (inclusive from form)
isAllDay?: boolean;
colorId?: string;
attendees?: string[];
generateMeet?: boolean;
manualMeetLink?: string;
}
export interface UpdateEventInput {
calendarId?: string;
summary?: string;
description?: string;
location?: string;
startDateTime?: string;
endDateTime?: string;
isAllDay?: boolean;
colorId?: string;
attendees?: string[];
generateMeet?: boolean;
manualMeetLink?: string;
}
export type TaskStatus = 'needsAction' | 'completed';
export interface CalendarTaskItem {
id: string;
title: string;
description?: string;
due: string; // ISO date/time string
status: TaskStatus;
completedAt?: string;
htmlLink?: string;
createdAt?: string;
updatedAt?: string;
}
export interface CreateTaskInput {
title: string;
description?: string;
due: string; // ISO string
status?: TaskStatus;
}
export interface UpdateTaskInput {
title?: string;
description?: string;
due?: string;
status?: TaskStatus;
}
export interface CalendarSummaryStats {
totalEvents: number;
totalTasks: number;
completedTasks: number;
pendingTasks: number;
calendarId: string;
serviceAccountEmail: string;
}