Initial commit
This commit is contained in:
commit
63ee71a19b
123 files changed
+11268
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OnlyPrompt.Backend.Database.Core;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace OnlyPrompt.Backend.Database.Models
|
||||
{
|
||||
[PrimaryKey(nameof(ReviewerId), nameof(PromptId))]
|
||||
public class ReviewModel : ITrackableEntity
|
||||
{
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey(nameof(Reviewer))]
|
||||
public Guid ReviewerId { get; set; }
|
||||
|
||||
[DeleteBehavior(DeleteBehavior.Cascade)]
|
||||
public virtual UserModel Reviewer { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey(nameof(Prompt))]
|
||||
public Guid PromptId { get; set; }
|
||||
|
||||
[DeleteBehavior(DeleteBehavior.Cascade)]
|
||||
public virtual PromptModel Prompt { get; set; }
|
||||
|
||||
[Range(1, 5)]
|
||||
public int Rating { get; set; }
|
||||
|
||||
[MaxLength(200)]
|
||||
public string? Comment { get; set; } = null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user