using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace LittleShop.Models;

public class Review
{
    [Key]
    public Guid Id { get; set; }
    
    [Required]
    public Guid ProductId { get; set; }
    
    [Required]
    public Guid CustomerId { get; set; }
    
    [Required]
    public Guid OrderId { get; set; }
    
    [Range(1, 5)]
    public int Rating { get; set; }
    
    [StringLength(100)]
    public string? Title { get; set; }
    
    [StringLength(2000)]
    public string? Comment { get; set; }
    
    public bool IsVerifiedPurchase { get; set; } = true;
    
    public bool IsApproved { get; set; } = false;
    
    public bool IsActive { get; set; } = true;
    
    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
    public DateTime? ApprovedAt { get; set; }
    public Guid? ApprovedByUserId { get; set; }
    
    // Navigation properties
    public virtual Product Product { get; set; } = null!;
    public virtual Customer Customer { get; set; } = null!;
    public virtual Order Order { get; set; } = null!;
    public virtual User? ApprovedByUser { get; set; }
}