changes in model, actor roles adding in person edit page finished
This commit is contained in:
@@ -2,7 +2,7 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class ActorRole
|
||||
public abstract class ActorRole
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
@@ -12,11 +12,5 @@ public class ActorRole
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
public long MediaId { get; set; }
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
public long PersonId { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class ActorRoleMediaRequest : ActorRoleRequest, IActorRoleMediaRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
public long PersonId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public PersonActorRole CreateActorRole(long mediaId) => base.CreateActorRole(mediaId, PersonId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class ActorRolePersonRequest : ActorRoleRequest, IActorRolePersonRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
public long MediaId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public PersonActorRole CreateActorRole(long personId) => base.CreateActorRole(MediaId, personId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,51 +3,22 @@ using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class ActorRoleRequest : ActorRole, IActorRoleMediaRequest, IActorRolePersonRequest
|
||||
public abstract class ActorRoleRequest : ActorRole
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public ActorRoleRequest(ActorRoleResponse data)
|
||||
{
|
||||
Name = data.Name;
|
||||
PersonId = data.PersonId;
|
||||
MediaId = data.MediaId;
|
||||
TypeId = data.TypeId;
|
||||
}
|
||||
|
||||
public ActorRoleRequest() {}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
PersonActorRole IActorRoleMediaRequest.CreateActorRole(long mediaId)
|
||||
{
|
||||
MediaId = mediaId;
|
||||
return CreateActorRole();
|
||||
}
|
||||
|
||||
PersonActorRole IActorRolePersonRequest.CreateActorRole(long personId)
|
||||
public PersonActorRole CreateActorRole(long mediaId, long personId) => new PersonActorRole
|
||||
{
|
||||
PersonId = personId;
|
||||
return CreateActorRole();
|
||||
}
|
||||
|
||||
public PersonActorRole CreateActorRole() => new PersonActorRole
|
||||
{
|
||||
MediaId = MediaId,
|
||||
PersonId = PersonId,
|
||||
MediaId = mediaId,
|
||||
PersonId = personId,
|
||||
PersonActorRoleTypeId = TypeId,
|
||||
RoleName = Name,
|
||||
};
|
||||
|
||||
public void UpdateActorRole(PersonActorRole item)
|
||||
public void UpdateActorRole(PersonActorRole item, long mediaId, long personId)
|
||||
{
|
||||
item.MediaId = MediaId;
|
||||
item.PersonId = PersonId;
|
||||
item.MediaId = mediaId;
|
||||
item.PersonId = personId;
|
||||
item.PersonActorRoleTypeId = TypeId;
|
||||
item.RoleName = Name;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,12 @@ public class ActorRoleResponse : ActorRole, IQueryOrderable<ActorRoleResponse>
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public required Guid Id { get; set; }
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
public long MediaId { get; set; }
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
public long PersonId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class ActorRoleUniversalRequest : ActorRoleRequest, IActorRolePersonRequest, IActorRoleMediaRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
public long PersonId { get; set; }
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
public long MediaId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public ActorRoleUniversalRequest() { }
|
||||
|
||||
public ActorRoleUniversalRequest(ActorRoleResponse data)
|
||||
{
|
||||
MediaId = data.MediaId;
|
||||
PersonId = data.PersonId;
|
||||
TypeId = data.TypeId;
|
||||
Name = data.Name;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public PersonActorRole CreateActorRole() => base.CreateActorRole(MediaId, PersonId);
|
||||
|
||||
public void UpdateActorRole(PersonActorRole item) => base.UpdateActorRole(item, MediaId, PersonId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -2,18 +2,12 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class CreatorRole
|
||||
public abstract class CreatorRole
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("type_id")]
|
||||
public required short TypeId { get; set; }
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
public required long MediaId { get; set; }
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
public required long PersonId { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,23 +3,20 @@ using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public interface ICreatorRoleMediaRequest
|
||||
public class CreatorRoleMediaRequest : CreatorRoleRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
long PersonId { get; set; }
|
||||
|
||||
[JsonPropertyName("type_id")]
|
||||
short TypeId { get; set; }
|
||||
public required long PersonId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
PersonCreatorRole CreateCreatorRole(long mediaId);
|
||||
|
||||
|
||||
public PersonCreatorRole CreateCreatorRole(long mediaId) => base.CreateCreatorRole(mediaId, PersonId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,23 +3,20 @@ using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public interface ICreatorRolePersonRequest
|
||||
public class CreatorRolePersonRequest : CreatorRoleRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
long MediaId { get; set; }
|
||||
|
||||
[JsonPropertyName("type_id")]
|
||||
short TypeId { get; set; }
|
||||
public required long MediaId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
PersonCreatorRole CreateCreatorRole(long personId);
|
||||
|
||||
|
||||
public PersonCreatorRole CreateCreatorRole(long personId) => base.CreateCreatorRole(MediaId, personId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -2,33 +2,21 @@ using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class CreatorRoleRequest : CreatorRole, ICreatorRoleMediaRequest, ICreatorRolePersonRequest
|
||||
public abstract class CreatorRoleRequest : CreatorRole
|
||||
{
|
||||
#region PUBLIC METHODS
|
||||
|
||||
PersonCreatorRole ICreatorRoleMediaRequest.CreateCreatorRole(long mediaId)
|
||||
{
|
||||
MediaId = mediaId;
|
||||
return CreateCreatorRole();
|
||||
}
|
||||
|
||||
PersonCreatorRole ICreatorRolePersonRequest.CreateCreatorRole(long personId)
|
||||
public PersonCreatorRole CreateCreatorRole(long mediaId, long personId) => new PersonCreatorRole
|
||||
{
|
||||
PersonId = personId;
|
||||
return CreateCreatorRole();
|
||||
}
|
||||
|
||||
public PersonCreatorRole CreateCreatorRole() => new PersonCreatorRole
|
||||
{
|
||||
MediaId = MediaId,
|
||||
PersonId = PersonId,
|
||||
MediaId = mediaId,
|
||||
PersonId = personId,
|
||||
PersonCreatorRoleTypeId = TypeId,
|
||||
};
|
||||
|
||||
public void UpdateCreatorRole(PersonCreatorRole item)
|
||||
public void UpdateCreatorRole(PersonCreatorRole item, long mediaId, long personId)
|
||||
{
|
||||
item.MediaId = MediaId;
|
||||
item.PersonId = PersonId;
|
||||
item.MediaId = mediaId;
|
||||
item.PersonId = personId;
|
||||
item.PersonCreatorRoleTypeId = TypeId;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,12 @@ public class CreatorRoleResponse : CreatorRole, IQueryOrderable<CreatorRoleRespo
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public required Guid Id { get; set; }
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
public long MediaId { get; set; }
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
public long PersonId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public class CreatorRoleUniversalRequest : CreatorRoleRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
public long PersonId { get; set; }
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
public long MediaId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public PersonCreatorRole CreateCreatorRole() => base.CreateCreatorRole(MediaId, PersonId);
|
||||
|
||||
public void UpdateCreatorRole(PersonCreatorRole item) => base.UpdateCreatorRole(item, MediaId, PersonId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,28 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public interface IActorRoleMediaRequest
|
||||
public interface IActorRoleMediaRequest : IActorRoleRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("person_id")]
|
||||
long PersonId { get; set; }
|
||||
public long PersonId { get; set; }
|
||||
|
||||
[JsonPropertyName("type_id")]
|
||||
short TypeId { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
PersonActorRole CreateActorRole(long mediaId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,28 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public interface IActorRolePersonRequest
|
||||
public interface IActorRolePersonRequest : IActorRoleRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("media_id")]
|
||||
long MediaId { get; set; }
|
||||
public long MediaId { get; set; }
|
||||
|
||||
[JsonPropertyName("type_id")]
|
||||
short TypeId { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
PersonActorRole CreateActorRole(long personId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace WatchIt.Common.Model.Roles;
|
||||
|
||||
public interface IActorRoleRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public short TypeId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user