41 lines
901 B
C#
41 lines
901 B
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Webshop.Domain.Entities;
|
|
|
|
/// <summary>
|
|
/// Kundenbewertungen für Produkte.
|
|
/// </summary>
|
|
public class Review
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
[Required]
|
|
[ForeignKey(nameof(Product))]
|
|
public Guid ProductId { get; set; }
|
|
|
|
[ForeignKey(nameof(Customer))]
|
|
public Guid? CustomerId { get; set; }
|
|
|
|
[Required]
|
|
[Range(1, 5)]
|
|
public int Rating { get; set; }
|
|
|
|
[MaxLength(100)]
|
|
public string? Title { get; set; }
|
|
|
|
[MaxLength(2000)]
|
|
public string? Comment { get; set; }
|
|
|
|
[Required]
|
|
public DateTimeOffset ReviewDate { get; set; }
|
|
|
|
[Required]
|
|
public bool IsApproved { get; set; }
|
|
|
|
// Navigation Properties
|
|
public virtual Product Product { get; set; }
|
|
public virtual Customer? Customer { get; set; }
|
|
} |