// src/dto/review.dto.ts
import { IsInt, IsString, Min, Max, IsOptional } from 'class-validator';

export class ReviewRequest {
  @IsInt()
  @Min(1)
  @Max(5)
  rating!: number;

  @IsString()
  @IsOptional()
  comment?: string;

  @IsInt()
  product_id!: number;
}

export class ReviewResponse {
  review_id!: number;
  rating!: number;
  comment?: string;
  created_at!: Date;
  user_id!: number;
  product_id!: number;
}