import { ApiProperty } from "@nestjs/swagger"

export class DashboardStatsDto {
  @ApiProperty({
    description: "Number of active projects (in progress status)",
  })
  active_projects: number

  @ApiProperty({ description: "Number of approved leaves for today" })
  approved_leaves_today: number

  @ApiProperty({ description: "Number of pending leaves" })
  pending_leaves: number

  @ApiProperty({ description: "Number of clocked-in users today" })
  clocked_in_users: number

  @ApiProperty({ description: "Number of non-clocked-in users today" })
  not_clocked_in_users: number
}

export class RecentProjectDto {
  @ApiProperty({ description: "Project ID" })
  project_id: number

  @ApiProperty({ description: "Project name" })
  project_name: string

  @ApiProperty({ description: "Client name" })
  client_name: string

  @ApiProperty({
    description: "Total hours logged by the user for this project",
  })
  total_hours: number

  @ApiProperty({ description: "Project status" })
  status: string
}

export class RecentLeaveDto {
  @ApiProperty({ description: "Leave request ID" })
  leave_id: number

  @ApiProperty({ description: "Leave start date" })
  from_date: string

  @ApiProperty({ description: "Leave end date" })
  to_date: string

  @ApiProperty({ description: "Leave type (Casual, Sick, Annual, etc.)" })
  type: string

  @ApiProperty({ description: "Leave status (Approved/Pending/Rejected)" })
  status: string

  @ApiProperty({ description: "Leave reason/description" })
  reason: string

  @ApiProperty({ description: "Date when leave was applied" })
  applied_date: string
}

export class DashboardResponseDto {
  @ApiProperty({ description: "Dashboard statistics" })
  stats: DashboardStatsDto

  @ApiProperty({
    description: "Recent projects assigned to the logged-in employee",
    type: [RecentProjectDto],
  })
  recent_projects: RecentProjectDto[]

  @ApiProperty({
    description: "Recent leave requests of the logged-in employee",
    type: [RecentLeaveDto],
  })
  recent_leaves: RecentLeaveDto[]
}
