refactor: align forms, contracts, and lifecycle models #4

Merged
wangziqi merged 13 commits from codex/wzq into main 2026-07-13 08:31:25 +00:00
2 changed files with 18 additions and 3 deletions
Showing only changes of commit effa34434b - Show all commits

View File

@@ -0,0 +1,18 @@
import 'reflect-metadata';
import { validate } from 'class-validator';
import { CreateStudentDto } from './student.dto';
describe('CreateStudentDto relationship boundaries', () => {
it('removes classId because class membership is managed by the classes API', async () => {
const dto = Object.assign(new CreateStudentDto(), {
name: '测试学生',
organizationId: 1,
classId: 9,
});
await validate(dto, { whitelist: true });
expect(dto).toMatchObject({ name: '测试学生', organizationId: 1 });
expect(dto).not.toHaveProperty('classId');
});
});

View File

@@ -38,9 +38,6 @@ export class CreateStudentDto {
@IsOptional()
@IsString()
supervisor?: string;
@IsOptional()
@IsInt()
classId?: number;
}
export class UpdateStudentDto {