Add event management system with calendar and CRUD operations
Some checks failed
Build And Push Image / docker (push) Failing after 2m37s
Some checks failed
Build And Push Image / docker (push) Failing after 2m37s
- Add EventCalendar component with FullCalendar integration - Create event CRUD dialogs and upcoming event banner - Implement server-side events API and database utilities - Add events dashboard page and navigation - Improve dues calculation with better overdue day logic - Install FullCalendar and date-fns dependencies
This commit is contained in:
134
utils/types.ts
134
utils/types.ts
@@ -432,3 +432,137 @@ export interface DuesCalculationUtils {
|
||||
calculateOverdueDays: (member: Member) => number;
|
||||
calculateDaysUntilDue: (member: Member) => { daysUntilDue: number; nextDueDate: string } | null;
|
||||
}
|
||||
|
||||
// Event Management System Types
|
||||
export interface Event {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
event_type: 'meeting' | 'social' | 'fundraiser' | 'workshop' | 'board-only';
|
||||
start_datetime: string;
|
||||
end_datetime: string;
|
||||
location: string;
|
||||
is_recurring: string; // 'true' or 'false' as string
|
||||
recurrence_pattern?: string; // JSON string
|
||||
max_attendees?: string; // null/empty for unlimited
|
||||
is_paid: string; // 'true' or 'false' as string
|
||||
cost_members?: string;
|
||||
cost_non_members?: string;
|
||||
member_pricing_enabled: string; // 'true' or 'false' as string
|
||||
visibility: 'public' | 'board-only' | 'admin-only';
|
||||
status: 'active' | 'cancelled' | 'completed' | 'draft';
|
||||
creator: string; // member_id who created event
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
|
||||
// Computed fields
|
||||
current_attendees?: number;
|
||||
user_rsvp?: EventRSVP;
|
||||
attendee_list?: EventRSVP[];
|
||||
}
|
||||
|
||||
export interface EventRSVP {
|
||||
id: string;
|
||||
event_id: string;
|
||||
member_id: string;
|
||||
rsvp_status: 'confirmed' | 'declined' | 'pending' | 'waitlist';
|
||||
payment_status: 'not_required' | 'pending' | 'paid' | 'overdue';
|
||||
payment_reference: string; // EVT-{member_id}-{date}
|
||||
attended: string; // 'true' or 'false' as string
|
||||
rsvp_notes?: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
|
||||
// Computed fields
|
||||
member_details?: Member;
|
||||
is_member_pricing?: string; // 'true' or 'false'
|
||||
}
|
||||
|
||||
export interface EventsResponse {
|
||||
success: boolean;
|
||||
data: Event[];
|
||||
total?: number;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface EventCreateRequest {
|
||||
title: string;
|
||||
description: string;
|
||||
event_type: string;
|
||||
start_datetime: string;
|
||||
end_datetime: string;
|
||||
location: string;
|
||||
is_recurring?: string;
|
||||
recurrence_pattern?: string;
|
||||
max_attendees?: string;
|
||||
is_paid: string;
|
||||
cost_members?: string;
|
||||
cost_non_members?: string;
|
||||
member_pricing_enabled: string;
|
||||
visibility: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface EventRSVPRequest {
|
||||
event_id: string;
|
||||
member_id: string;
|
||||
rsvp_status: 'confirmed' | 'declined' | 'pending';
|
||||
rsvp_notes?: string;
|
||||
}
|
||||
|
||||
export interface EventAttendanceRequest {
|
||||
event_id: string;
|
||||
member_id: string;
|
||||
attended: boolean;
|
||||
}
|
||||
|
||||
// Calendar subscription types
|
||||
export interface CalendarSubscription {
|
||||
user_id: string;
|
||||
feed_url: string;
|
||||
include_rsvp_only?: boolean;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
// Event configuration types
|
||||
export interface EventsConfig {
|
||||
eventsBaseId: string;
|
||||
eventsTableId: string;
|
||||
defaultEventTypes: string[];
|
||||
maxEventsPerPage: number;
|
||||
cacheTimeout: number;
|
||||
}
|
||||
|
||||
// FullCalendar integration types
|
||||
export interface FullCalendarEvent {
|
||||
id: string;
|
||||
title: string;
|
||||
start: string;
|
||||
end: string;
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
textColor?: string;
|
||||
extendedProps: {
|
||||
description: string;
|
||||
location: string;
|
||||
event_type: string;
|
||||
is_paid: boolean;
|
||||
cost_members?: string;
|
||||
cost_non_members?: string;
|
||||
max_attendees?: number;
|
||||
current_attendees?: number;
|
||||
user_rsvp?: EventRSVP;
|
||||
visibility: string;
|
||||
creator: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface EventFilters {
|
||||
start_date?: string;
|
||||
end_date?: string;
|
||||
event_type?: string;
|
||||
visibility?: string;
|
||||
status?: string;
|
||||
user_role?: 'user' | 'board' | 'admin';
|
||||
search?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user