#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Common;
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
///
/// Represents the association between a user and a role within the authorization system.
///
[DebuggerDisplay("User: {User.Username}, Role: {Role.RoleName}")]
public class UserRoleEntity : IStorageEntity, IAuditableEntity
{
///
/// Gets the Id of the user role.
///
public Guid Id { get; init; }
///
/// Gets the Id of the user of the user role.
///
public required Guid UserId { get; init; }
///
/// Gets the user of the user role.
///
public required UserEntity User { get; init; }
///
/// Gets the Id of the role of the user role.
///
public required Guid RoleId { get; init; }
///
/// Gets the role of the user role.
///
public required RoleEntity Role { get; init; }
///
/// Gets or sets the time and date when the entity was added.
///
public DateTime CreatedOnUtc { get; set; }
///
/// Gets or sets the Id of the user that created the entity.
///
public Guid CreatedBy { get; set; }
///
/// Gets or sets the optional time and date when the entity was updated.
///
public DateTime? UpdatedOnUtc { get; set; }
///
/// Gets or sets the optional Id of the user that updated the entity.
///
public Guid? UpdatedBy { get; set; }
}