feat: Fixed errors
This commit is contained in:
24
LctMonolith/Models/AppUser.cs
Normal file
24
LctMonolith/Models/AppUser.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class AppUser : IdentityUser<Guid>
|
||||
{
|
||||
public string? FirstName { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public DateOnly? BirthDate { get; set; }
|
||||
public int Experience { get; set; }
|
||||
public int Mana { get; set; }
|
||||
public Guid? RankId { get; set; }
|
||||
public Rank? Rank { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
public ICollection<UserCompetency> Competencies { get; set; } = new List<UserCompetency>();
|
||||
public ICollection<UserMission> Missions { get; set; } = new List<UserMission>();
|
||||
public ICollection<UserInventoryItem> Inventory { get; set; } = new List<UserInventoryItem>();
|
||||
public ICollection<Transaction> Transactions { get; set; } = new List<Transaction>();
|
||||
public ICollection<RefreshToken> RefreshTokens { get; set; } = new List<RefreshToken>();
|
||||
public ICollection<EventLog> Events { get; set; } = new List<EventLog>();
|
||||
public ICollection<Notification> Notifications { get; set; } = new List<Notification>();
|
||||
}
|
||||
13
LctMonolith/Models/Artifact.cs
Normal file
13
LctMonolith/Models/Artifact.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class Artifact
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Name { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
public ArtifactRarity Rarity { get; set; }
|
||||
public ICollection<UserArtifact> Users { get; set; } = new List<UserArtifact>();
|
||||
public ICollection<MissionArtifactReward> MissionRewards { get; set; } = new List<MissionArtifactReward>();
|
||||
}
|
||||
|
||||
3
LctMonolith/Models/ArtifactRarity.cs
Normal file
3
LctMonolith/Models/ArtifactRarity.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public enum ArtifactRarity { Common = 0, Rare = 1, Epic = 2, Legendary = 3 }
|
||||
11
LctMonolith/Models/Competency.cs
Normal file
11
LctMonolith/Models/Competency.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class Competency
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Name { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public ICollection<UserCompetency> UserCompetencies { get; set; } = new List<UserCompetency>();
|
||||
public ICollection<MissionCompetencyReward> MissionRewards { get; set; } = new List<MissionCompetencyReward>();
|
||||
public ICollection<RankRequiredCompetency> RankRequirements { get; set; } = new List<RankRequiredCompetency>();
|
||||
}
|
||||
11
LctMonolith/Models/EventLog.cs
Normal file
11
LctMonolith/Models/EventLog.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class EventLog
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public EventType Type { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public string? Data { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
19
LctMonolith/Models/Mission.cs
Normal file
19
LctMonolith/Models/Mission.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class Mission
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Title { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public string? Branch { get; set; }
|
||||
public MissionCategory Category { get; set; }
|
||||
public Guid? MinRankId { get; set; }
|
||||
public Rank? MinRank { get; set; }
|
||||
public int ExperienceReward { get; set; }
|
||||
public int ManaReward { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public ICollection<MissionCompetencyReward> CompetencyRewards { get; set; } = new List<MissionCompetencyReward>();
|
||||
public ICollection<MissionArtifactReward> ArtifactRewards { get; set; } = new List<MissionArtifactReward>();
|
||||
public ICollection<UserMission> UserMissions { get; set; } = new List<UserMission>();
|
||||
public ICollection<RankRequiredMission> RanksRequiring { get; set; } = new List<RankRequiredMission>();
|
||||
}
|
||||
9
LctMonolith/Models/MissionArtifactReward.cs
Normal file
9
LctMonolith/Models/MissionArtifactReward.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class MissionArtifactReward
|
||||
{
|
||||
public Guid MissionId { get; set; }
|
||||
public Mission Mission { get; set; } = null!;
|
||||
public Guid ArtifactId { get; set; }
|
||||
public Artifact Artifact { get; set; } = null!;
|
||||
}
|
||||
3
LctMonolith/Models/MissionCategory.cs
Normal file
3
LctMonolith/Models/MissionCategory.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public enum MissionCategory { Quest = 0, Recruiting = 1, Lecture = 2, Simulator = 3 }
|
||||
11
LctMonolith/Models/MissionCompetencyReward.cs
Normal file
11
LctMonolith/Models/MissionCompetencyReward.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class MissionCompetencyReward
|
||||
{
|
||||
public Guid MissionId { get; set; }
|
||||
public Mission Mission { get; set; } = null!;
|
||||
public Guid CompetencyId { get; set; }
|
||||
public Competency Competency { get; set; } = null!;
|
||||
public int LevelDelta { get; set; }
|
||||
public int ProgressPointsDelta { get; set; }
|
||||
}
|
||||
11
LctMonolith/Models/MissionStatus.cs
Normal file
11
LctMonolith/Models/MissionStatus.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public enum MissionStatus
|
||||
{
|
||||
Locked = 0,
|
||||
Available = 1,
|
||||
InProgress = 2,
|
||||
Submitted = 3,
|
||||
Completed = 4,
|
||||
Rejected = 5
|
||||
}
|
||||
14
LctMonolith/Models/Notification.cs
Normal file
14
LctMonolith/Models/Notification.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class Notification
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public string Type { get; set; } = null!;
|
||||
public string Title { get; set; } = null!;
|
||||
public string Message { get; set; } = null!;
|
||||
public bool IsRead { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? ReadAt { get; set; }
|
||||
}
|
||||
12
LctMonolith/Models/Rank.cs
Normal file
12
LctMonolith/Models/Rank.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class Rank
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Name { get; set; } = null!;
|
||||
public int Order { get; set; }
|
||||
public int RequiredExperience { get; set; }
|
||||
public ICollection<RankRequiredMission> RequiredMissions { get; set; } = new List<RankRequiredMission>();
|
||||
public ICollection<RankRequiredCompetency> RequiredCompetencies { get; set; } = new List<RankRequiredCompetency>();
|
||||
public ICollection<AppUser> Users { get; set; } = new List<AppUser>();
|
||||
}
|
||||
10
LctMonolith/Models/RankRequiredCompetency.cs
Normal file
10
LctMonolith/Models/RankRequiredCompetency.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class RankRequiredCompetency
|
||||
{
|
||||
public Guid RankId { get; set; }
|
||||
public Rank Rank { get; set; } = null!;
|
||||
public Guid CompetencyId { get; set; }
|
||||
public Competency Competency { get; set; } = null!;
|
||||
public int MinLevel { get; set; }
|
||||
}
|
||||
9
LctMonolith/Models/RankRequiredMission.cs
Normal file
9
LctMonolith/Models/RankRequiredMission.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class RankRequiredMission
|
||||
{
|
||||
public Guid RankId { get; set; }
|
||||
public Rank Rank { get; set; } = null!;
|
||||
public Guid MissionId { get; set; }
|
||||
public Mission Mission { get; set; } = null!;
|
||||
}
|
||||
12
LctMonolith/Models/RefreshToken.cs
Normal file
12
LctMonolith/Models/RefreshToken.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class RefreshToken
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Token { get; set; } = null!;
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
public bool IsRevoked { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
12
LctMonolith/Models/StoreItem.cs
Normal file
12
LctMonolith/Models/StoreItem.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class StoreItem
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Name { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public int Price { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public int? Stock { get; set; }
|
||||
public ICollection<UserInventoryItem> UserInventory { get; set; } = new List<UserInventoryItem>();
|
||||
}
|
||||
13
LctMonolith/Models/Transaction.cs
Normal file
13
LctMonolith/Models/Transaction.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class Transaction
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public TransactionType Type { get; set; }
|
||||
public Guid? StoreItemId { get; set; }
|
||||
public StoreItem? StoreItem { get; set; }
|
||||
public int ManaAmount { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
3
LctMonolith/Models/TransactionType.cs
Normal file
3
LctMonolith/Models/TransactionType.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public enum TransactionType { Purchase = 0, Return = 1, Sale = 2 }
|
||||
10
LctMonolith/Models/UserArtifact.cs
Normal file
10
LctMonolith/Models/UserArtifact.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class UserArtifact
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public Guid ArtifactId { get; set; }
|
||||
public Artifact Artifact { get; set; } = null!;
|
||||
public DateTime ObtainedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
11
LctMonolith/Models/UserCompetency.cs
Normal file
11
LctMonolith/Models/UserCompetency.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class UserCompetency
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public Guid CompetencyId { get; set; }
|
||||
public Competency Competency { get; set; } = null!;
|
||||
public int Level { get; set; }
|
||||
public int ProgressPoints { get; set; }
|
||||
}
|
||||
12
LctMonolith/Models/UserInventoryItem.cs
Normal file
12
LctMonolith/Models/UserInventoryItem.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class UserInventoryItem
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public Guid StoreItemId { get; set; }
|
||||
public StoreItem StoreItem { get; set; } = null!;
|
||||
public int Quantity { get; set; } = 1;
|
||||
public DateTime AcquiredAt { get; set; } = DateTime.UtcNow;
|
||||
public bool IsReturned { get; set; }
|
||||
}
|
||||
12
LctMonolith/Models/UserMission.cs
Normal file
12
LctMonolith/Models/UserMission.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace LctMonolith.Models;
|
||||
|
||||
public class UserMission
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
public Guid MissionId { get; set; }
|
||||
public Mission Mission { get; set; } = null!;
|
||||
public MissionStatus Status { get; set; } = MissionStatus.Available;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
public string? SubmissionData { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user