chore: deleted all the stuff we don't need here

This commit is contained in:
2025-09-20 23:08:08 +03:00
parent 8ea18f1096
commit 44881818a2
67 changed files with 1 additions and 3139 deletions

View File

@@ -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>();
}

View File

@@ -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>();
}

View File

@@ -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;
}

View File

@@ -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>();
}

View File

@@ -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!;
}

View File

@@ -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; }
}

View File

@@ -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!;
}