finalized application acceptance system and started making types shared across front and backend

This commit is contained in:
2025-10-21 12:38:00 -04:00
parent a67a66db1b
commit 47de7b9ebb
17 changed files with 259 additions and 111 deletions

6
shared/package.json Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "@app/shared",
"version": "1.0.0",
"main": "index.ts",
"type": "module"
}

View 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
}