import { IsMongoId, IsNotEmpty, IsNumber, IsOptional, Min } from "class-validator";

/**
 * VOLUME challenges only — the user's "starting value" (design: "Your starting
 * value" screen). Captured once before logging attempts so relative goals
 * (e.g. "+4 reps", "+10% weight", "+30sec") can be measured against it.
 * Send the field the goal is measured on: reps and/or weight for lift goals,
 * duration for time-based moves such as "Plank +30sec".
 */
export class SetChallengeBaselineDto {
  @IsMongoId()
  @IsNotEmpty()
  challenge_id: string;

  // Starting weight in kg (e.g. 80).
  @IsOptional()
  @IsNumber()
  @Min(0)
  weight?: number;

  // Starting repetitions (e.g. 5).
  @IsOptional()
  @IsNumber()
  @Min(0)
  reps?: number;

  // Starting hold time in seconds, e.g. 60 for a 1-minute plank.
  @IsOptional()
  @IsNumber()
  @Min(0)
  duration?: number;
}
