chore: deleted all the stuff we don't need here
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class AuthDTO
|
||||
{
|
||||
[Required]
|
||||
[StringLength(50, MinimumLength = 3, ErrorMessage = "Username must be between 3 and 50 characters")]
|
||||
public string Username { get; set; } = null!;
|
||||
|
||||
[Required]
|
||||
[EmailAddress(ErrorMessage = "Invalid email address")]
|
||||
public string Email { get; set; } = null!;
|
||||
|
||||
[Required]
|
||||
[StringLength(100, MinimumLength = 8, ErrorMessage = "Password must be between 8 and 100 characters")]
|
||||
public string Password { get; set; } = null!;
|
||||
|
||||
[Required]
|
||||
public bool RememberMe { get; set; }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class DisableTwoFactorDTO
|
||||
{
|
||||
public int TwoFactorProvider { get; set; }
|
||||
public string Code { get; set; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class EnableTwoFactorDTO
|
||||
{
|
||||
public int TwoFactorProvider { get; set; }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class GetAllRightsResponse
|
||||
{
|
||||
public List<Right> Rights { get; set; }
|
||||
public int TotalCount { get; set; }
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class GetAllRolesResponse
|
||||
{
|
||||
public List<ApplicationRole> Roles { get; set; }
|
||||
public int TotalCount { get; set; }
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class GetTwoFactorDTO
|
||||
{
|
||||
[Required]
|
||||
public int TwoFactorProvider { get; set; }
|
||||
[StringLength(50, MinimumLength = 3, ErrorMessage = "Username must be between 3 and 50 characters")]
|
||||
public string? Username { get; set; } = null!;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class LoginResultResponse
|
||||
{
|
||||
public bool? RequiresTwoFactorAuth { get; set; }
|
||||
public bool Success { get; set; }
|
||||
public RefreshTokenDTO? Token { get; set; }
|
||||
public int? TwoFactorProvider { get; set; }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class RefreshTokenDTO
|
||||
{
|
||||
public string AccessToken { get; set; } = null!;
|
||||
public string RefreshToken { get; set; } = null!;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class RightDTO
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class RoleDTO
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class TwoFactorDTO
|
||||
{
|
||||
[Required]
|
||||
public int TwoFactorProvider { get; set; }
|
||||
[StringLength(50, MinimumLength = 3, ErrorMessage = "Username must be between 3 and 50 characters")]
|
||||
public string? Username { get; set; } = null!;
|
||||
|
||||
[Required]
|
||||
[StringLength(6, MinimumLength = 6, ErrorMessage = "Code must be 6 characters long")]
|
||||
public string Code { get; set; } = null!;
|
||||
public bool RememberMe { get; set; }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using GamificationService.Utils.Enums;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class UserProfileCreateDTO
|
||||
{
|
||||
[Required(ErrorMessage = "Name is required")]
|
||||
[StringLength(100, ErrorMessage = "Name must be less than 100 characters")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "Surname is required")]
|
||||
[StringLength(100, ErrorMessage = "Surname must be less than 100 characters")]
|
||||
public string Surname { get; set; } = null!;
|
||||
|
||||
[StringLength(50, ErrorMessage = "Patronymic must be less than 50 characters")]
|
||||
public string? Patronymic { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Birthdate is required")]
|
||||
public DateTime Birthdate { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Gender is required")]
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
[EmailAddress(ErrorMessage = "Invalid email")]
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
[Phone(ErrorMessage = "Invalid contact phone number")]
|
||||
public string? ContactPhone { get; set; }
|
||||
|
||||
[Url(ErrorMessage = "Invalid avatar url")]
|
||||
public string? ProfilePicture { get; set; }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using GamificationService.Utils.Enums;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class UserProfileDTO
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
public long? UserId { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Name is required")]
|
||||
[StringLength(100, ErrorMessage = "Name must be less than 100 characters")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "Surname is required")]
|
||||
[StringLength(100, ErrorMessage = "Surname must be less than 100 characters")]
|
||||
public string Surname { get; set; } = null!;
|
||||
|
||||
[StringLength(50, ErrorMessage = "Patronymic must be less than 50 characters")]
|
||||
public string? Patronymic { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Birthdate is required")]
|
||||
public DateTime Birthdate { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Gender is required")]
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
[EmailAddress(ErrorMessage = "Invalid email")]
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
[Phone(ErrorMessage = "Invalid contact phone number")]
|
||||
public string? ContactPhone { get; set; }
|
||||
|
||||
[Url(ErrorMessage = "Invalid avatar url")]
|
||||
public string? ProfilePicture { get; set; }
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using StackExchange.Redis;
|
||||
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
|
||||
public class ApplicationRole : IdentityRole<long>
|
||||
{
|
||||
public ApplicationRole() : base() { }
|
||||
public ApplicationRole(string roleName) : base(roleName) { }
|
||||
public string? Description { get; set; }
|
||||
|
||||
public List<UserRole> UserRoles { get; set; } = new List<UserRole>();
|
||||
public List<RoleRight> RoleRights { get; set; } = new List<RoleRight>();
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using GamificationService.Utils;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class ApplicationUser : IdentityUser<long>
|
||||
{
|
||||
[Required(ErrorMessage = "Username is required")]
|
||||
[StringLength(50, ErrorMessage = "Username must be less than 50 characters")]
|
||||
public string Username { get; set; } = null!;
|
||||
public bool TwoFactorEnabled { get; set; }
|
||||
public string? TwoFactorSecret { get; set; }
|
||||
public bool EmailConfirmed { get; set; }
|
||||
public List<TwoFactorProvider> TwoFactorProviders { get; set; } = new List<TwoFactorProvider>();
|
||||
public List<RefreshToken> RefreshTokens { get; set; } = new List<RefreshToken>();
|
||||
|
||||
public List<UserRole> UserRoles { get; set; } = new List<UserRole>();
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class RefreshToken
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
public long UserId { get; set; }
|
||||
public ApplicationUser User { get; set; } = null!;
|
||||
|
||||
[Required]
|
||||
public string Token { get; set; } = null!;
|
||||
|
||||
public DateTime Expires { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public bool IsExpired => DateTime.UtcNow >= Expires;
|
||||
|
||||
public bool IsRevoked { get; set; }
|
||||
public string? RevokedByIp { get; set; }
|
||||
public DateTime? RevokedOn { get; set; }
|
||||
|
||||
public bool IsActive => !IsRevoked && !IsExpired;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class Right
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(50)]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[StringLength(100)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
public List<RoleRight> RoleRights { get; set; } = new List<RoleRight>();
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class RoleRight
|
||||
{
|
||||
public long RoleId { get; set; }
|
||||
public ApplicationRole Role { get; set; } = null!;
|
||||
|
||||
public long RightId { get; set; }
|
||||
public Right Right { get; set; } = null!;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using GamificationService.Utils.Enums;
|
||||
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class UserProfile
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "User is required")]
|
||||
public long UserId { get; set; }
|
||||
public ApplicationUser? User { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Name is required")]
|
||||
[StringLength(100, ErrorMessage = "Name must be less than 100 characters")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
[Required(ErrorMessage = "Surname is required")]
|
||||
[StringLength(100, ErrorMessage = "Surname must be less than 100 characters")]
|
||||
public string Surname { get; set; } = null!;
|
||||
|
||||
[StringLength(50, ErrorMessage = "Patronymic must be less than 50 characters")]
|
||||
public string? Patronymic { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Gender is required")]
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Birthdate is required")]
|
||||
public DateTime Birthdate { get; set; }
|
||||
|
||||
[EmailAddress(ErrorMessage = "Invalid email")]
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
[Phone(ErrorMessage = "Invalid contact phone number")]
|
||||
public string? ContactPhone { get; set; }
|
||||
|
||||
[Url(ErrorMessage = "Invalid avatar url")]
|
||||
public string? ProfilePicture { get; set; }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class UserRole
|
||||
{
|
||||
public long UserId { get; set; }
|
||||
public ApplicationUser User { get; set; } = null!;
|
||||
|
||||
public long RoleId { get; set; }
|
||||
public ApplicationRole Role { get; set; } = null!;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace GamificationService.Models.Messages.UserProfiles;
|
||||
|
||||
public class CreateUserProfileRequest
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace GamificationService.Models.Messages.UserProfiles;
|
||||
|
||||
public class CreateUserProfileResponse
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace GamificationService.Models.Messages.UserProfiles;
|
||||
|
||||
public class UpdateUserProfileRequest
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace GamificationService.Models.Messages.UserProfiles;
|
||||
|
||||
public class UpdateUserProfileResponse
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace GamificationService.Models;
|
||||
|
||||
public class UserSession
|
||||
{
|
||||
public string? Login { get; set; }
|
||||
public bool IsAuthenticated { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user