| export interface User { |
| _id: string; |
| username: string; |
| email: string; |
| role: 'trainee' | 'trainer' | 'organization' | 'admin'; |
| profilePhoto?: string; |
| traineeCategory?: string; |
| organization?: { |
| _id: string; |
| username: string; |
| email: string; |
| organizationType?: string; |
| }; |
| workDesignation?: string; |
| organizationType?: string; |
| organizationVerificationStatus?: 'pending' | 'verified' | 'rejected'; |
| verificationStatus?: 'pending' | 'approved' | 'rejected'; |
| createdAt: string; |
| lastActive: string; |
| isActive: boolean; |
| documents?: { |
| registrationCertificate?: string; |
| gstCertificate?: string; |
| authorizationLetter?: string; |
| additionalDocs?: string[]; |
| }; |
| isTwoFactorEnabled?: boolean; |
| location?: { |
| type: "Point"; |
| coordinates: [number, number]; |
| }; |
| rejectionReason?: string; |
| govtIdCard?: string; |
| documentsUploaded?: boolean; |
| } |
|
|
| export interface LoginRequest { |
| email: string; |
| password: string; |
| } |
|
|
| export interface LoginResponse { |
| token: string; |
| user: User; |
| requires2FASetup?: boolean; |
| requiresDocumentUpload?: boolean; |
| message?: string; |
| } |
|
|
| export interface SignupTraineeRequest { |
| username: string; |
| email: string; |
| password: string; |
| traineeCategory?: string; |
| } |
|
|
| export interface SignupTrainerRequest { |
| username: string; |
| email: string; |
| password: string; |
| organization: string; |
| workDesignation: string; |
| govtIdCard?: string; |
| } |
|
|
| export interface SignupOrganizationRequest { |
| username: string; |
| email: string; |
| password: string; |
| organizationType: string; |
| } |
|
|
| export interface ChangePasswordRequest { |
| currentPassword: string; |
| newPassword: string; |
| } |
|
|
| export interface ResetPasswordRequest { |
| password: string; |
| } |
|
|
| export interface ForgotPasswordRequest { |
| email: string; |
| } |
|
|
| export interface UpdateUserRequest { |
| username?: string; |
| email?: string; |
| traineeCategory?: string; |
| workDesignation?: string; |
| organizationType?: string; |
| [key: string]: any; |
| } |
|
|
| export interface VerifyTrainerRequest { |
| trainerId: string; |
| status: 'verified' | 'rejected'; |
| } |
|
|
| export interface VerifyOrganizationRequest { |
| organizationId: string; |
| status: 'approved' | 'rejected'; |
| } |
|
|
| export interface Organization { |
| _id: string; |
| username: string; |
| email: string; |
| organizationType?: string; |
| } |
|
|
| export interface PendingTrainer { |
| _id: string; |
| username: string; |
| email: string; |
| workDesignation: string; |
| govtIdCard?: string; |
| createdAt: string; |
| } |
|
|
| export interface PendingOrganization { |
| _id: string; |
| username: string; |
| email: string; |
| organizationType?: string; |
| documents?: any; |
| createdAt: string; |
| } |
|
|
| |
| export interface IGeoPoint { |
| type: "Point"; |
| coordinates: [number, number]; |
| } |
|
|
| export interface IEventParticipant { |
| user: string; |
| joinedAt: Date; |
| joinMethod: 'code' | 'link' | 'qr' | 'manual'; |
| attendance?: { |
| checkInTime?: Date; |
| checkInMethod?: 'qr' | 'gps' | 'link' | 'manual'; |
| checkInLocation?: IGeoPoint; |
| }; |
| } |
|
|
| export interface IEvent { |
| _id: string; |
| title: string; |
| code: string; |
| theme: string; |
| description?: string; |
| organization: string; |
| createdBy: string; |
| capacity: number; |
| startDate: Date; |
| endDate: Date; |
| type: 'in-person' | 'online' | 'hybrid'; |
| venue?: string; |
| location?: IGeoPoint; |
| geofenceRadius?: number; |
| onlineLink?: string; |
| joinToken: string; |
| allowSelfJoin: boolean; |
| participants: IEventParticipant[]; |
| waitlist: string[]; |
| status: 'draft' | 'published' | 'ongoing' | 'completed' | 'cancelled'; |
| reminderSent: boolean; |
| createdAt: Date; |
| updatedAt: Date; |
| } |
|
|
| export type EventStatus = 'ongoing' | 'upcoming' | 'completed' | 'cancelled'; |