import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { ArrayNotEmpty, IsArray, IsInt, IsOptional } from 'class-validator';
import { Type } from 'class-transformer';

export class BulkManualCheckinDto {
  @ApiProperty({ description: 'Attendance record ids to mark as attended', type: [Number] })
  @IsArray()
  @ArrayNotEmpty()
  @IsInt({ each: true })
  @Type(() => Number)
  attendanceIds: number[];

  @ApiPropertyOptional({ description: 'Session id to link these check-ins to' })
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  sessionId?: number;

  // Populated from the authenticated admin in the controller.
  checkedInByUserId?: number;

  // Populated from the authenticated caller's roles in the controller.
  roles?: string[];
}
