/**
 * LeaveAllocation DTOs
 * @module HR
 */

import {
  IsString,
  IsOptional,
  IsNumber,
  IsUUID,
  IsDateString,
  Min,
} from 'class-validator';

export class CreateLeaveAllocationDto {
  @IsUUID()
  employeeId: string;

  @IsUUID()
  leaveTypeId: string;

  @IsNumber()
  @Min(0)
  daysAllocated: number;

  @IsDateString()
  dateFrom: string;

  @IsDateString()
  dateTo: string;

  @IsOptional()
  @IsString()
  notes?: string;
}

export class UpdateLeaveAllocationDto {
  @IsOptional()
  @IsNumber()
  @Min(0)
  daysAllocated?: number;

  @IsOptional()
  @IsDateString()
  dateFrom?: string;

  @IsOptional()
  @IsDateString()
  dateTo?: string;

  @IsOptional()
  @IsString()
  notes?: string;
}

export class AdjustLeaveAllocationDto {
  @IsNumber()
  adjustment: number;

  @IsOptional()
  @IsString()
  reason?: string;
}
