import { PartialType } from '@nestjs/mapped-types';
import { CreateAcademicYearDto } from './create-academic-year.dto';
import { IsBoolean, IsDateString, IsOptional, Matches } from 'class-validator';

export class UpdateAcademicYearDto extends PartialType(CreateAcademicYearDto) {
    @IsOptional()
    @Matches(/^\d{4}(-\d{4})?$/, { message: 'name must be like 2026 or 2025-2026' })
    name?: string;

    @IsOptional() @IsDateString() startDate?: string;
    @IsOptional() @IsDateString() endDate?: string;
    @IsOptional() @IsBoolean() isActive?: boolean;
}
