Files
Event-Management-System/frontend/src/types.ts

168 lines
4.3 KiB
TypeScript

export type AppState = 'WELCOME' | 'LOGIN' | 'DASHBOARD' | 'ADMIN_LANDING' | 'FACULTY_DASHBOARD' | 'VERIFY';
export type UserRole = 'STUDENT' | 'COORDINATOR' | 'ADMIN';
export type DashboardView = 'HOME' | 'EVENTS' | 'REGISTRATIONS' | 'PROFILE' | 'ABOUT' | 'CONTACT' | 'STATUS_TRACKER';
export type FacultyView = 'OVERVIEW' | 'PARTICIPANTS' | 'ATTENDANCE' | 'NOTIFICATIONS' | 'PROFILE';
export interface ResourcePerson {
id?: string;
type: 'INTERNAL' | 'EXTERNAL';
name: string;
dept?: string;
college_name?: string;
phone: string;
email: string;
}
export interface Batch {
id: number;
startTime: string;
endTime: string;
date?: string;
resourcePerson?: ResourcePerson;
}
export interface EventDay {
date: string;
batches: Batch[]; // If unified, this will have one batch at index 0
startTime?: string;
endTime?: string;
resourcePerson?: ResourcePerson;
}
export interface EventSchedule {
id: string;
event_id: string;
day_idx: number;
batch_idx: number;
date: string;
start_time: string;
end_time: string;
resource_person?: ResourcePerson;
}
export interface Event {
id: string;
title: string;
date: string;
location: string;
category: 'TECHNICAL' | 'NON-TECHNICAL' | 'WORKSHOP' | 'CENTRE-ACTIVITY';
domain: string;
club?: string;
image: string;
pricingType: 'PAID' | 'FREE';
coordinator: string;
status?: 'Registered' | 'Event Ongoing' | 'Completed' | 'Scheduled' | 'APPROVED' | 'COMPLETED' | 'ONGOING' | 'REJECTED';
hasRegistrationFee?: boolean;
registrationFee?: number;
paymentLink?: string;
registrationDeadline?: string;
maxParticipants?: number;
durationDays?: number;
schedule?: EventSchedule[];
deptLimits?: Record<string, number>; // Maps department codes to specific seat counts
deptSectionLimits?: Record<string, Record<string, number>>; // Maps department codes to their section capacities
currentParticipants?: number;
currentDeptCounts?: Record<string, number>;
currentDeptSectionCounts?: Record<string, Record<string, number>>; // Maps department codes to their sections' current counts
event_summary?: string;
isTeamEvent?: boolean;
teamSizeLimit?: number;
teamComposition?: 'INTER_DEPT' | 'MIXED';
created_by?: string;
participantType?: 'INTERNAL' | 'EXTERNAL' | 'BOTH';
verificationStatus?: 'PENDING' | 'PENDING_HOD' | 'PENDING_ADMIN' | 'APPROVED' | 'REJECTED';
refreshment_expense?: number;
transportation_expense?: number;
session_coverage_fee?: number;
total_expense?: number;
conducting_dept?: string;
request_by_faculty?: string;
request_by_HOD?: string;
targetedBatch?: string;
openToAll?: boolean;
academicYears?: string[];
targetedSections?: string[];
department?: string;
}
export interface Announcement {
id: string;
title: string;
message: string;
timestamp: any;
expiresAt?: any;
type: 'DELAY' | 'INFO' | 'URGENT' | 'ENDED' | 'ONGOING';
eventId?: string;
eventTitle?: string;
}
export interface Ticket {
ticketId: string;
qrCodeData: string;
eventId: string;
userId: string;
userEmail: string;
userName: string;
regNo?: string;
dept?: string;
section?: string;
status: 'ACTIVE' | 'USED' | 'CANCELLED';
createdAt: any;
}
export interface Participant {
id: string;
studentName: string;
regNo: string;
branch: string;
year: string;
eventName: string;
eventId: string;
location: string;
timings: string;
category: 'TECHNICAL' | 'NON-TECHNICAL' | 'WORKSHOP' | 'CENTRE-ACTIVITY';
}
export interface StudentRequest {
id: string;
studentName: string;
rollNo: string;
branch: string;
eventName: string;
eventId: string;
timestamp: string;
status: 'PENDING' | 'APPROVED' | 'REJECTED';
}
export interface UserProfile {
name: string;
email: string;
phone?: string;
year?: string;
section?: string;
department?: string;
reg_no?: string;
id?: string;
}
export interface SpecialEvent {
id: string;
created_at: string;
title: string;
description: string;
link: string;
created_by: string;
is_active: boolean;
verificationStatus?: 'PENDING' | 'PENDING_HOD' | 'PENDING_ADMIN' | 'APPROVED' | 'REJECTED';
image?: string;
}
export interface DeptBatch {
id: number;
name: string;
department: string;
classes: string[]; // List of Year - Section strings, e.g. ["1st Year - A", "2nd Year - B"]
}