import { ApiProperty } from '@nestjs/swagger';
import { IsDateString, IsNotEmpty, IsString } from 'class-validator';
import validateJS from 'validator';

export class PeriodDto {
    @ApiProperty({type: String, required: true, description: 'Date in Format YYYY-MM-DD'})
    @IsString()
    @IsNotEmpty()
    @IsDateString()
    start_date?: validateJS.IsISO8601Options;

    @ApiProperty({type: String, required: true, description: 'Date in Format YYYY-MM-DD'})
    @IsString()
    @IsNotEmpty()
    @IsDateString()
    end_date?: validateJS.IsISO8601Options;
}