import { ISO_DATE } from '@humand-packages/common';
import { Expose, Type } from 'class-transformer';
import { IsDefined, IsOptional, IsString, ValidateNested } from 'class-validator';
import { IsValidDate } from '../../../../../middlewares/dateValidator';
import { ShiftManagementCalendarFiltersVC } from './shiftManagementCalendarFiltersVC';

export class DuplicateShiftPeriodVC {
    @IsDefined()
    @IsString()
    @Expose()
    @IsValidDate(ISO_DATE)
    sourceStartDate!: string;

    @IsDefined()
    @IsString()
    @Expose()
    @IsValidDate(ISO_DATE)
    sourceEndDate!: string;

    @IsDefined()
    @IsString()
    @Expose()
    @IsValidDate(ISO_DATE)
    targetStartDate!: string;

    @IsDefined()
    @IsString()
    @Expose()
    @IsValidDate(ISO_DATE)
    targetEndDate!: string;

    @IsOptional()
    @ValidateNested()
    @Type(() => ShiftManagementCalendarFiltersVC)
    @Expose()
    filters?: ShiftManagementCalendarFiltersVC;
}
