Implement Feedback.cs model.
This commit is contained in:
parent
ef15623b10
commit
901d495bff
1 changed files with 35 additions and 2 deletions
|
@ -1,7 +1,40 @@
|
|||
namespace Retroactiune.Core.Entities
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Retroactiune.Core.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Feedback is the feedback given to the <see cref="FeedbackReceiver"/>.
|
||||
/// </summary>
|
||||
public class Feedback
|
||||
{
|
||||
// TODO: Entity model for feedback.
|
||||
private uint _rating;
|
||||
|
||||
[BsonId, JsonPropertyName("id")]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("rating")]
|
||||
public uint Rating
|
||||
{
|
||||
get => _rating;
|
||||
set
|
||||
{
|
||||
if (value <= 5)
|
||||
{
|
||||
_rating = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("description")] public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue