added service with base function to get course and event attendees
This commit is contained in:
17
shared/tsconfig.json
Normal file
17
shared/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "dist",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true,
|
||||
"isolatedModules": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": ["./**/*.ts"]
|
||||
}
|
||||
49
shared/types/course.ts
Normal file
49
shared/types/course.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
export interface Course {
|
||||
id: number;
|
||||
name: string;
|
||||
short_name: string;
|
||||
category: string;
|
||||
description?: string | null;
|
||||
image_url?: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
deleted?: number | boolean;
|
||||
prereq_id?: number | null;
|
||||
}
|
||||
|
||||
export interface CourseAttendee {
|
||||
passed: boolean; // tinyint(1)
|
||||
attendee_id: number; // PK
|
||||
course_event_id: number; // PK
|
||||
attendee_role_id: number | null;
|
||||
role: CourseAttendeeRole | null;
|
||||
created_at: string; // datetime → ISO string
|
||||
updated_at: string; // datetime → ISO string
|
||||
remarks: string | null;
|
||||
}
|
||||
|
||||
export interface CourseAttendeeRole {
|
||||
id: number; // PK, auto-increment
|
||||
name: string | null; // varchar(50), unique, nullable
|
||||
description: string | null; // text
|
||||
created_at: string | null; // datetime (nullable)
|
||||
updated_at: string | null; // datetime (nullable)
|
||||
deleted: boolean; // tinyint(4)
|
||||
}
|
||||
|
||||
export interface RawAttendeeRow {
|
||||
passed: number;
|
||||
attendee_id: number;
|
||||
course_event_id: number;
|
||||
attendee_role_id: number | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
remarks: string | null;
|
||||
|
||||
role_id: number | null;
|
||||
role_name: string | null;
|
||||
role_description: string | null;
|
||||
role_deleted: number | null;
|
||||
role_created_at: string | null;
|
||||
role_updated_at: string | null;
|
||||
}
|
||||
Reference in New Issue
Block a user