refactor: remove residual campus and department fields

This commit is contained in:
2026-07-13 12:16:39 +08:00
parent 6396d3e934
commit 0377acd33b
7 changed files with 67 additions and 8 deletions

View File

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

View File

@@ -63,9 +63,6 @@ export class CreateScheduleDto {
@MaxLength(500)
notes?: string;
@IsOptional()
@IsInt()
departmentId?: number;
}
export class UpdateScheduleDto {