import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsIn } from 'class-validator';

import {
  normalizeRgcDecisionStatus,
  RGC_DECISION_STATUS_VALUES,
} from '@/modules/rgc-decision/dto/create-rgc-decision.dto';

// CDC-GPSF changes only the RGC Decision status (NOT_ADDRESSED / IN_PROGRESS /
// SOLVED), mirroring the Issue status update but for a Plenary RGC Decision.
export class UpdateProgressReportRgcDecisionStatusDto {
  @ApiProperty({ enum: RGC_DECISION_STATUS_VALUES, example: 'IN_PROGRESS' })
  @Transform(({ value }: { value: unknown }) =>
    normalizeRgcDecisionStatus(value),
  )
  @IsIn(RGC_DECISION_STATUS_VALUES)
  status!: string;
}
