import { ApiProperty } from "@nestjs/swagger"

export class TimesheetEntryDto {
  @ApiProperty({
    description: "Date of the timesheet entry",
    example: "2025-11-25",
  })
  date: string

  @ApiProperty({
    description: "Employee ID",
    example: 1,
  })
  employee_id: number

  @ApiProperty({
    description: "Employee name",
    example: "Rahul Sharma",
  })
  employee_name: string

  @ApiProperty({
    description: "Employee designation/role",
    example: "Project Manager",
  })
  designation: string

  @ApiProperty({
    description: "Department name",
    example: "Design",
  })
  department_name: string

  @ApiProperty({
    description: "Activity type name",
    example: "Client Meeting",
  })
  activity_type: string

  @ApiProperty({
    description: "Whether the activity type is productive",
    example: true,
  })
  is_productive: boolean

  @ApiProperty({
    description: "Clock in time",
    example: "09:45 AM",
  })
  clock_in: string

  @ApiProperty({
    description: "Clock out time",
    example: "05:34 PM",
  })
  clock_out: string

  @ApiProperty({
    description: "Duration worked",
    example: "07:49",
  })
  duration: string

  @ApiProperty({
    description: "Work description",
    example: "Working on interior design project",
  })
  description: string

  @ApiProperty({
    description: "Status of the timesheet entry",
    example: "Completed",
  })
  status: string
}

export class TimesheetReportSummaryDto {
  @ApiProperty({
    description: "Total number of timesheet records",
    example: 12,
  })
  total_records: number

  @ApiProperty({
    description: "Total hours across all matching timesheet records",
    example: "123:45",
  })
  total_hours_all_records: string

  @ApiProperty({
    description: "Number of employees present",
    example: 5,
  })
  employees_present: number

  @ApiProperty({
    description: "Total number of employees in company",
    example: 5,
  })
  total_employees: number

  @ApiProperty({
    description: "Average hours per employee per day",
    example: "07:52",
  })
  average_hours_per_employee_per_day: string
}

export class TimesheetReportResponseDto {
  @ApiProperty({
    description: "Summary statistics",
    type: TimesheetReportSummaryDto,
  })
  summary: TimesheetReportSummaryDto

  @ApiProperty({
    description: "Paginated list of timesheet entries",
    type: [TimesheetEntryDto],
  })
  entries: TimesheetEntryDto[]

  @ApiProperty({
    description: "Total count for pagination",
    example: 12,
  })
  total_count: number

  @ApiProperty({
    description: "Current page",
    example: 1,
  })
  current_page: number

  @ApiProperty({
    description: "Items per page",
    example: 10,
  })
  per_page: number

  @ApiProperty({
    description: "Total pages",
    example: 2,
  })
  total_pages: number
}
