import { IsOptional, IsString, Length, MaxLength } from 'class-validator';

/**
 * Body for POST /documents/:id/unlock — staff types password + email OTP
 * to gain a short-lived access token for viewing / downloading.
 * Either field may be omitted if the document does not require it.
 */
export class UnlockDocumentDto {
  @IsOptional()
  @IsString()
  @MaxLength(120)
  password?: string;

  @IsOptional()
  @IsString()
  @Length(4, 10)
  otp?: string;
}
