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

export class CreatePublicReviewDto {
  @IsString()
  @MaxLength(40)
  shopId!: string;

  @IsString()
  @MaxLength(120)
  category!: string;

  @IsOptional()
  @IsString()
  @MaxLength(40)
  customerUserId?: string;

  @IsOptional()
  @IsString()
  @MaxLength(120)
  customerName?: string;

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

  @IsInt()
  @Min(1)
  rating!: number;

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