refactor: remove residual campus and department fields
This commit is contained in:
@@ -27,3 +27,21 @@ describe('schedule notes validation', () => {
|
||||
expect(errors.some((error) => error.property === 'notes')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('removes the retired departmentId field from create requests', async () => {
|
||||
const dto = Object.assign(new CreateScheduleDto(), {
|
||||
classId: 1,
|
||||
classroomId: 2,
|
||||
weekDay: 1,
|
||||
startTime: '09:00',
|
||||
endTime: '10:00',
|
||||
startDate: '2026-07-01',
|
||||
endDate: '2026-07-31',
|
||||
subject: '语文',
|
||||
departmentId: 99,
|
||||
});
|
||||
|
||||
await validate(dto, { whitelist: true });
|
||||
|
||||
expect(dto).not.toHaveProperty('departmentId');
|
||||
});
|
||||
|
||||
@@ -63,9 +63,6 @@ export class CreateScheduleDto {
|
||||
@MaxLength(500)
|
||||
notes?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
departmentId?: number;
|
||||
}
|
||||
|
||||
export class UpdateScheduleDto {
|
||||
|
||||
Reference in New Issue
Block a user