finalized application acceptance system and started making types shared across front and backend
This commit is contained in:
57
shared/types/application.ts
Normal file
57
shared/types/application.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
export interface ApplicationData {
|
||||
dob: string;
|
||||
name: string;
|
||||
playtime: number;
|
||||
hobbies: string;
|
||||
military: boolean;
|
||||
communities: string;
|
||||
joinReason: string;
|
||||
milsimAttraction: string;
|
||||
referral: string;
|
||||
steamProfile: string;
|
||||
timezone: string;
|
||||
canAttendSaturday: boolean;
|
||||
interests: string;
|
||||
aknowledgeRules: boolean;
|
||||
}
|
||||
|
||||
export interface ApplicationRow {
|
||||
id: number;
|
||||
member_id: number;
|
||||
app_version: number;
|
||||
app_data: ApplicationData;
|
||||
|
||||
submitted_at: string; // ISO datetime from DB (e.g., "2025-08-25T18:04:29.000Z")
|
||||
updated_at: string | null;
|
||||
approved_at: string | null;
|
||||
denied_at: string | null;
|
||||
|
||||
app_status: Status; // generated column
|
||||
decision_at: string | null; // generated column
|
||||
|
||||
// present when you join members (e.g., SELECT a.*, m.name AS member_name)
|
||||
member_name: string;
|
||||
}
|
||||
|
||||
export interface CommentRow {
|
||||
comment_id: number;
|
||||
post_content: string;
|
||||
poster_id: number;
|
||||
post_time: string;
|
||||
last_modified: string | null;
|
||||
poster_name: string;
|
||||
}
|
||||
|
||||
export interface ApplicationFull {
|
||||
application: ApplicationRow;
|
||||
comments: CommentRow[];
|
||||
}
|
||||
|
||||
//for get all applications route
|
||||
export interface ApplicationListRow {
|
||||
id: number;
|
||||
member_id: number;
|
||||
member_name: string | null; // because LEFT JOIN means it might be null
|
||||
submitted_at: Date;
|
||||
app_status: string; // or enum if you have one
|
||||
}
|
||||
Reference in New Issue
Block a user