import { IsIn, IsISO8601, IsOptional, IsString, Matches, MaxLength } from 'class-validator';
import { TASK_ACTIVITY_TYPES } from '../task_catalog';

export class ReportTaskActivityDto {
  @IsIn(TASK_ACTIVITY_TYPES)
  activity: typeof TASK_ACTIVITY_TYPES[number];

  @IsOptional()
  @IsString()
  @MaxLength(64)
  target_id?: string;

  @IsString()
  @MaxLength(64)
  @Matches(/^[A-Za-z0-9_-]{16,64}$/)
  nonce: string;

  @IsOptional()
  @IsISO8601()
  occurred_at?: string;
}
