import {
  IsInt,
  IsOptional,
  IsString,
  Matches,
  MaxLength,
  Min,
} from 'class-validator';

export class CreateReviewDto {
  @IsString()
  @MaxLength(120)
  customerName!: string;

  @IsOptional()
  @Matches(/^\+?[1-9]\d{7,14}$/)
  customerPhone?: string;

  @IsInt()
  @Min(1)
  rating!: number; // 1..5 (validated in service)

  @IsString()
  @MaxLength(2000)
  comment!: string;
}
