import { ApiProperty } from "@nestjs/swagger"

export class LeaveTypeBifurcationDto {
  @ApiProperty({ description: "Leave type code (CL, SL, PL, etc.)" })
  leave_type_code: string

  @ApiProperty({ description: "Leave type name" })
  leave_type_name: string

  @ApiProperty({ description: "Total days taken for this leave type" })
  total_days: number
}

export class EmployeeWiseLeaveDto {
  @ApiProperty({ description: "Employee ID" })
  employee_id: number

  @ApiProperty({ description: "Employee full name" })
  employee_name: string

  @ApiProperty({ description: "Total leave days taken by employee" })
  total_days: number

  @ApiProperty({
    description: "Leave bifurcation by leave type",
    type: [LeaveTypeBifurcationDto],
  })
  leave_types: LeaveTypeBifurcationDto[]
}

export class MonthlyLeaveCountDto {
  @ApiProperty({ description: "Month number (1-12)" })
  month: number

  @ApiProperty({ description: "Month name (January, February, etc.)" })
  month_name: string

  @ApiProperty({ description: "Total leave days taken in this month" })
  total_days: number

  @ApiProperty({
    description: "Leave type breakdown for this month",
    type: [LeaveTypeBifurcationDto],
  })
  leave_types: LeaveTypeBifurcationDto[]
}

export class LeaveAnalyticsResponseDto {
  @ApiProperty({
    description: "Employee-wise leave bifurcation by leave type",
    type: [EmployeeWiseLeaveDto],
  })
  employee_wise_leaves: EmployeeWiseLeaveDto[]

  @ApiProperty({
    description: "Monthly leave count for the selected year (all 12 months)",
    type: [MonthlyLeaveCountDto],
  })
  monthly_leave_count: MonthlyLeaveCountDto[]

  @ApiProperty({ description: "Selected year for analytics" })
  year: number

  @ApiProperty({ description: "Total approved leave days for the year" })
  total_leave_days: number
}
