2024-10-06 14:51:58 +02:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
using WatchIt.Common.Query;
|
|
|
|
|
|
|
|
|
|
namespace WatchIt.Common.Model.Roles;
|
|
|
|
|
|
|
|
|
|
public class ActorRoleResponse : ActorRole, IQueryOrderable<ActorRoleResponse>
|
|
|
|
|
{
|
|
|
|
|
#region PROPERTIES
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public static IDictionary<string, Func<ActorRoleResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<ActorRoleResponse, IComparable>>
|
|
|
|
|
{
|
|
|
|
|
{ "name", item => item.Name },
|
|
|
|
|
{ "type_id", item => item.TypeId },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("id")]
|
|
|
|
|
public required Guid Id { get; set; }
|
2024-10-08 19:56:14 +02:00
|
|
|
|
|
|
|
|
[JsonPropertyName("media_id")]
|
|
|
|
|
public long MediaId { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("person_id")]
|
|
|
|
|
public long PersonId { get; set; }
|
2024-10-06 14:51:58 +02:00
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region CONSTRUCTORS
|
|
|
|
|
|
|
|
|
|
[JsonConstructor]
|
|
|
|
|
public ActorRoleResponse() {}
|
|
|
|
|
|
|
|
|
|
[SetsRequiredMembers]
|
|
|
|
|
public ActorRoleResponse(Database.Model.Person.PersonActorRole data)
|
|
|
|
|
{
|
|
|
|
|
Id = data.Id;
|
|
|
|
|
MediaId = data.MediaId;
|
|
|
|
|
PersonId = data.PersonId;
|
|
|
|
|
TypeId = data.PersonActorRoleTypeId;
|
|
|
|
|
Name = data.RoleName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|