import { Type } from "class-transformer";
import { IsArray, IsBoolean, IsEmail, IsInt, ValidateNested } from "class-validator";

export class BulkCrewApprovalItemDto {
    @IsInt()
    pay_year: number;

    @IsInt()
    period_no: number;

    @IsEmail()
    employee_email!: string;

    @IsBoolean()
    approve: boolean;
}

export class BulkCrewApprovalDto {
    @IsBoolean()
    include_subtree: boolean = false;

    @IsArray()
    @ValidateNested({each: true})
    @Type(()=> BulkCrewApprovalItemDto)
    items: BulkCrewApprovalItemDto[]
}