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');
  });
});
