P2-12 Teacher Management: - Add profile JSON field (subjects, joinedAt, qualifications) to User entity - Add GET/PUT /rbac/users/:id/profile endpoints with UpdateProfileDto - Add GET /rbac/teacher-workspace endpoint returning assignedClasses, todaySchedules, and myStudents - Create /teacher-workspace page with tabs (My Classes, Today's Schedule, My Students) - Add route with PermissionRoute and menu item in MainLayout P2-13 Student Archive Multi-class: - Add GET /students/:id/compare-classes endpoint returning side-by-side enrollment data with per-class attendance statistics - Students module now includes ClassStudent and AttendanceRecord entities - No 2-enrollment cap existed in the codebase; student enrollments already return all records via class-student table
82 lines
1.1 KiB
TypeScript
82 lines
1.1 KiB
TypeScript
import { IsString, MinLength, IsOptional, IsArray, IsBoolean } from 'class-validator';
|
|
|
|
export class CreateRoleDto {
|
|
@IsString()
|
|
name: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
permissionIds?: number[];
|
|
}
|
|
|
|
export class UpdateRoleDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
name?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
permissionIds?: number[];
|
|
}
|
|
|
|
export class CreateUserDto {
|
|
@IsString()
|
|
username: string;
|
|
|
|
@IsString()
|
|
@MinLength(4)
|
|
password: string;
|
|
|
|
@IsString()
|
|
name: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
roleIds?: number[];
|
|
}
|
|
|
|
export class UpdateUserDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
username?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
name?: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isActive?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
roleIds?: number[];
|
|
}
|
|
|
|
export class ResetPasswordDto {
|
|
@IsString()
|
|
@MinLength(4)
|
|
password: string;
|
|
}
|
|
|
|
export class UpdateProfileDto {
|
|
@IsOptional()
|
|
subjects?: string[];
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
joinedAt?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
qualifications?: string;
|
|
}
|