2021-05-29 17:02:16 +00:00
|
|
|
|
using System;
|
2021-06-30 20:07:39 +00:00
|
|
|
|
using System.Runtime.CompilerServices;
|
2021-06-07 19:49:43 +00:00
|
|
|
|
using System.Text.Json.Serialization;
|
2021-05-29 17:02:16 +00:00
|
|
|
|
using MongoDB.Bson;
|
|
|
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
|
|
2021-06-21 14:46:44 +00:00
|
|
|
|
namespace Retroactiune.Core.Entities
|
2021-05-29 17:02:16 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-06-09 21:03:07 +00:00
|
|
|
|
/// FeedbackReceiver is the entity that receives feedback from the users.
|
2021-05-29 17:02:16 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public class FeedbackReceiver
|
|
|
|
|
{
|
2021-07-04 17:34:10 +00:00
|
|
|
|
public FeedbackReceiver()
|
|
|
|
|
{
|
|
|
|
|
Id = ObjectId.GenerateNewId().ToString();
|
|
|
|
|
CreatedAt = DateTime.UtcNow;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-07 19:49:43 +00:00
|
|
|
|
[BsonId, JsonPropertyName("id")]
|
2021-05-29 17:02:16 +00:00
|
|
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
|
2021-06-07 19:49:43 +00:00
|
|
|
|
[JsonPropertyName("name")] public string Name { get; set; }
|
2021-05-29 17:02:16 +00:00
|
|
|
|
|
2021-06-07 19:49:43 +00:00
|
|
|
|
[JsonPropertyName("description")] public string Description { get; set; }
|
2021-05-29 17:02:16 +00:00
|
|
|
|
|
2021-06-07 19:49:43 +00:00
|
|
|
|
[JsonPropertyName("createdAt")] public DateTime CreatedAt { get; set; }
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (!(obj is FeedbackReceiver convertedObj))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-11 19:49:12 +00:00
|
|
|
|
return string.Equals(Id, convertedObj.Id) && string.Equals(Name, convertedObj.Name) &&
|
2021-06-07 19:49:43 +00:00
|
|
|
|
Description.Equals(convertedObj.Description) && CreatedAt.Equals(convertedObj.CreatedAt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
2021-06-30 20:07:39 +00:00
|
|
|
|
return RuntimeHelpers.GetHashCode(this);
|
2021-06-07 19:49:43 +00:00
|
|
|
|
}
|
2021-05-29 17:02:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|