feat random bullshit GO!
This commit is contained in:
37
LctMonolith/Domain/Entities/AppUser.cs
Normal file
37
LctMonolith/Domain/Entities/AppUser.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace LctMonolith.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Application user (candidate or employee) participating in gamification.
|
||||
/// Extends IdentityUser with Guid primary key.
|
||||
/// </summary>
|
||||
public class AppUser : IdentityUser<Guid>
|
||||
{
|
||||
/// <summary>User given (first) name.</summary>
|
||||
public string? FirstName { get; set; }
|
||||
/// <summary>User family (last) name.</summary>
|
||||
public string? LastName { get; set; }
|
||||
/// <summary>Date of birth.</summary>
|
||||
public DateOnly? BirthDate { get; set; }
|
||||
|
||||
/// <summary>Current accumulated experience points.</summary>
|
||||
public int Experience { get; set; }
|
||||
/// <summary>Current mana (in-game currency).</summary>
|
||||
public int Mana { get; set; }
|
||||
|
||||
/// <summary>Current rank reference.</summary>
|
||||
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>();
|
||||
}
|
||||
95
LctMonolith/Domain/Entities/ArtifactsAndStore.cs
Normal file
95
LctMonolith/Domain/Entities/ArtifactsAndStore.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
namespace LctMonolith.Domain.Entities;
|
||||
|
||||
/// <summary>Artifact definition (unique reward objects).</summary>
|
||||
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>();
|
||||
}
|
||||
|
||||
/// <summary>Mapping artifact to user ownership.</summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>Reward mapping: mission grants artifact(s).</summary>
|
||||
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!;
|
||||
}
|
||||
|
||||
/// <summary>Item in store that can be purchased with mana.</summary>
|
||||
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>();
|
||||
}
|
||||
|
||||
/// <summary>User owned store item record.</summary>
|
||||
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; }
|
||||
}
|
||||
|
||||
/// <summary>Transaction record for purchases/returns/sales.</summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>System event log for auditing user actions and progression.</summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>Refresh token for JWT auth.</summary>
|
||||
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;
|
||||
}
|
||||
|
||||
41
LctMonolith/Domain/Entities/Competency.cs
Normal file
41
LctMonolith/Domain/Entities/Competency.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace LctMonolith.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Competency (skill) that can be progressed by completing missions.
|
||||
/// </summary>
|
||||
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>();
|
||||
}
|
||||
|
||||
/// <summary>Per-user competency level.</summary>
|
||||
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!;
|
||||
/// <summary>Current level (integer simple scale).</summary>
|
||||
public int Level { get; set; }
|
||||
/// <summary>Optional numeric progress inside level (e.g., partial points).</summary>
|
||||
public int ProgressPoints { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Reward mapping: mission increases competency level points.</summary>
|
||||
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!;
|
||||
/// <summary>Increment value in levels (could be 0 or 1) or points depending on design.</summary>
|
||||
public int LevelDelta { get; set; }
|
||||
public int ProgressPointsDelta { get; set; }
|
||||
}
|
||||
|
||||
54
LctMonolith/Domain/Entities/Enums.cs
Normal file
54
LctMonolith/Domain/Entities/Enums.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
namespace LctMonolith.Domain.Entities;
|
||||
|
||||
/// <summary>Mission category taxonomy.</summary>
|
||||
public enum MissionCategory
|
||||
{
|
||||
Quest = 0,
|
||||
Recruiting = 1,
|
||||
Lecture = 2,
|
||||
Simulator = 3
|
||||
}
|
||||
|
||||
/// <summary>Status of a mission for a specific user.</summary>
|
||||
public enum MissionStatus
|
||||
{
|
||||
Locked = 0,
|
||||
Available = 1,
|
||||
InProgress = 2,
|
||||
Submitted = 3,
|
||||
Completed = 4,
|
||||
Rejected = 5
|
||||
}
|
||||
|
||||
/// <summary>Rarity level of an artifact.</summary>
|
||||
public enum ArtifactRarity
|
||||
{
|
||||
Common = 0,
|
||||
Rare = 1,
|
||||
Epic = 2,
|
||||
Legendary = 3
|
||||
}
|
||||
|
||||
/// <summary>Type of transactional operation in store.</summary>
|
||||
public enum TransactionType
|
||||
{
|
||||
Purchase = 0,
|
||||
Return = 1,
|
||||
Sale = 2
|
||||
}
|
||||
|
||||
/// <summary>Auditable event types enumerated in requirements.</summary>
|
||||
public enum EventType
|
||||
{
|
||||
SkillProgress = 1,
|
||||
MissionStatusChanged = 2,
|
||||
RankChanged = 3,
|
||||
ItemPurchased = 4,
|
||||
ArtifactObtained = 5,
|
||||
RewardGranted = 6,
|
||||
ProfileChanged = 7,
|
||||
AuthCredentialsChanged = 8,
|
||||
ItemReturned = 9,
|
||||
ItemSold = 10
|
||||
}
|
||||
|
||||
44
LctMonolith/Domain/Entities/Mission.cs
Normal file
44
LctMonolith/Domain/Entities/Mission.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
namespace LctMonolith.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Mission (task) definition configured by HR.
|
||||
/// </summary>
|
||||
public class Mission
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Title { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
/// <summary>Optional branch (path) name for grouping / visualization.</summary>
|
||||
public string? Branch { get; set; }
|
||||
public MissionCategory Category { get; set; }
|
||||
/// <summary>Minimum rank required to access the mission (nullable = available from start).</summary>
|
||||
public Guid? MinRankId { get; set; }
|
||||
public Rank? MinRank { get; set; }
|
||||
/// <summary>Experience reward on completion.</summary>
|
||||
public int ExperienceReward { get; set; }
|
||||
/// <summary>Mana reward on completion.</summary>
|
||||
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>();
|
||||
}
|
||||
|
||||
/// <summary>Per-user mission status and progression.</summary>
|
||||
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;
|
||||
/// <summary>Date/time of last status change.</summary>
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
/// <summary>Optional submission payload (e.g., link, text, attachments pointer).</summary>
|
||||
public string? SubmissionData { get; set; }
|
||||
}
|
||||
|
||||
16
LctMonolith/Domain/Entities/Notification.cs
Normal file
16
LctMonolith/Domain/Entities/Notification.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace LctMonolith.Domain.Entities;
|
||||
|
||||
/// <summary>User notification (in-app).</summary>
|
||||
public class Notification
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid UserId { get; set; }
|
||||
public AppUser User { get; set; } = null!;
|
||||
/// <summary>Short classification tag (e.g., rank, mission, store).</summary>
|
||||
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; }
|
||||
}
|
||||
40
LctMonolith/Domain/Entities/Rank.cs
Normal file
40
LctMonolith/Domain/Entities/Rank.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace LctMonolith.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Linear rank in progression ladder. User must meet XP, key mission and competency requirements.
|
||||
/// </summary>
|
||||
public class Rank
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
/// <summary>Display name (e.g., "Искатель", "Пилот-кандидат").</summary>
|
||||
public string Name { get; set; } = null!;
|
||||
/// <summary>Ordering position. Lower value = earlier rank.</summary>
|
||||
public int Order { get; set; }
|
||||
/// <summary>Required cumulative experience to attain this rank.</summary>
|
||||
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>();
|
||||
}
|
||||
|
||||
/// <summary>Mapping of rank to required mission.</summary>
|
||||
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!;
|
||||
}
|
||||
|
||||
/// <summary>Mapping of rank to required competency minimum level.</summary>
|
||||
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!;
|
||||
/// <summary>Minimum level required for the competency.</summary>
|
||||
public int MinLevel { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user