Add Login Module
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using AMREZ.EOP.Domain.Entities.Common;
|
||||
|
||||
namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class AccessTokenDeny : BaseEntity
|
||||
{
|
||||
public string Jti { get; set; } = default!;
|
||||
public DateTimeOffset ExpiresAt { get; set; }
|
||||
}
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class Permission : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public string Code { get; set; } = default!; // e.g. "auth:session:read"
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
|
||||
18
AMREZ.EOP.Domain/Entities/Authentications/RefreshToken.cs
Normal file
18
AMREZ.EOP.Domain/Entities/Authentications/RefreshToken.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using AMREZ.EOP.Domain.Entities.Common;
|
||||
|
||||
namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class RefreshToken : BaseEntity
|
||||
{
|
||||
public string FamilyId { get; set; } = default!;
|
||||
public string RefreshTokenHash { get; set; } = default!;
|
||||
|
||||
public Guid UserId { get; set; }
|
||||
public Guid SessionId { get; set; }
|
||||
|
||||
public DateTimeOffset ExpiresAt { get; set; }
|
||||
public DateTimeOffset? RevokedAt { get; set; }
|
||||
|
||||
public User User { get; set; } = default!;
|
||||
public UserSession Session { get; set; } = default!;
|
||||
}
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class Role : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public string Code { get; set; } = default!; // system code, unique per tenant
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class RolePermission : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid RoleId { get; set; }
|
||||
public Guid PermissionId { get; set; }
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class User : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
|
||||
public string PasswordHash { get; set; } = default!;
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class UserExternalAccount : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public ExternalProvider Provider { get; set; }
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class UserIdentity : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public IdentityType Type { get; set; }
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class UserMfaFactor : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public MfaType Type { get; set; }
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class UserPasswordHistory : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public string PasswordHash { get; set; } = default!;
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class UserRole : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public Guid RoleId { get; set; }
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.Authentications;
|
||||
|
||||
public sealed class UserSession : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public string RefreshTokenHash { get; set; } = default!;
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace AMREZ.EOP.Domain.Entities.Common;
|
||||
public abstract class BaseEntity
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string TenantId { get; set; } = default!;
|
||||
public Guid TenantId { get; set; } = default!;
|
||||
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.HumanResources;
|
||||
|
||||
public sealed class Department : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public string Code { get; set; } = default!;
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.HumanResources;
|
||||
|
||||
public sealed class EmergencyContact : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserProfileId { get; set; }
|
||||
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace AMREZ.EOP.Domain.Entities.HumanResources;
|
||||
|
||||
public sealed class EmployeeAddress : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserProfileId { get; set; }
|
||||
|
||||
public AddressType Type { get; set; } = AddressType.Home;
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.HumanResources;
|
||||
|
||||
public sealed class EmployeeBankAccount : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserProfileId { get; set; }
|
||||
|
||||
public string BankName { get; set; } = default!;
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace AMREZ.EOP.Domain.Entities.HumanResources;
|
||||
|
||||
public sealed class Employment : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserProfileId { get; set; }
|
||||
|
||||
public EmploymentType EmploymentType { get; set; } = EmploymentType.Permanent;
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace AMREZ.EOP.Domain.Entities.HumanResources;
|
||||
|
||||
public sealed class Position : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public string Code { get; set; } = default!;
|
||||
public string Title { get; set; } = default!;
|
||||
public int? Level { get; set; }
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace AMREZ.EOP.Domain.Entities.HumanResources;
|
||||
|
||||
public sealed class UserProfile : BaseEntity
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public string FirstName { get; set; } = default!;
|
||||
|
||||
Reference in New Issue
Block a user