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

export class UpdateIssueMatrixRowDto {
  @ApiPropertyOptional({
    type: [Number],
    example: [3],
    description: 'One ministry stakeholder id. It becomes the primary agency.',
  })
  @IsOptional()
  @IsArray()
  @ArrayNotEmpty()
  @ArrayMaxSize(1)
  @ArrayUnique()
  @Type(() => Number)
  @IsInt({ each: true })
  @Min(1, { each: true })
  governmentAgencyIds?: number[];

  @ApiPropertyOptional({
    example: 4,
    description: 'The new issue status id.',
  })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  issueStatusId?: number;
}
