refactor: models use guids as PKs now

This commit is contained in:
2025-09-29 14:40:46 +03:00
parent 8bc18c25b5
commit 56c874e220
12 changed files with 27 additions and 27 deletions

View File

@@ -2,7 +2,7 @@ namespace GamificationService.Models.Database;
public class Mission public class Mission
{ {
public long Id { get; set; } public Guid Id { get; set; }
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty; public string Description { get; set; } = string.Empty;
public MissionCategory? MissionCategory { get; set; } public MissionCategory? MissionCategory { get; set; }

View File

@@ -2,7 +2,7 @@ namespace GamificationService.Models.Database;
public class MissionCategory public class MissionCategory
{ {
public long Id { get; set; } public Guid Id { get; set; }
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
public ICollection<Mission> Missions { get; set; } = new List<Mission>(); public ICollection<Mission> Missions { get; set; } = new List<Mission>();

View File

@@ -2,8 +2,8 @@ namespace GamificationService.Models.Database;
public class MissionItemReward public class MissionItemReward
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long ItemId { get; set; } public Guid ItemId { get; set; }
public long MissionId { get; set; } public Guid MissionId { get; set; }
public required Mission Mission { get; set; } public required Mission Mission { get; set; }
} }

View File

@@ -4,10 +4,10 @@ namespace GamificationService.Models.Database;
public class MissionRankRule public class MissionRankRule
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long MissionId { get; set; } public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!; public Mission Mission { get; set; } = null!;
public long RankId { get; set; } public Guid RankId { get; set; }
public Rank Rank { get; set; } = null!; public Rank Rank { get; set; } = null!;
public MissionRankRuleType Type { get; set; } public MissionRankRuleType Type { get; set; }
} }

View File

@@ -2,8 +2,8 @@ namespace GamificationService.Models.Database;
public class MissionSkillReward public class MissionSkillReward
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long MissionId { get; set; } public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!; public Mission Mission { get; set; } = null!;
public long SkillId { get; set; } public long SkillId { get; set; }
public Skill Skill { get; set; } = null!; public Skill Skill { get; set; } = null!;

View File

@@ -2,10 +2,10 @@ namespace GamificationService.Models.Database;
public class Player public class Player
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long UserId { get; set; } public Guid UserId { get; set; }
public Rank? Rank { get; set; } public Rank? Rank { get; set; }
public long RankId {get; set; } public Guid RankId {get; set; }
public int Experience { get; set; } public int Experience { get; set; }
public ICollection<PlayerMission> PlayerMissions { get; set; } = new List<PlayerMission>(); public ICollection<PlayerMission> PlayerMissions { get; set; } = new List<PlayerMission>();

View File

@@ -2,10 +2,10 @@ namespace GamificationService.Models.Database;
public class PlayerMission public class PlayerMission
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long PlayerId { get; set; } public Guid PlayerId { get; set; }
public required Player Player { get; set; } public required Player Player { get; set; }
public long MissionId { get; set; } public Guid MissionId { get; set; }
public required Mission Mission { get; set; } public required Mission Mission { get; set; }
public DateTime? Completed { get; set; } public DateTime? Completed { get; set; }
public DateTime? RewardsRedeemed { get; set; } public DateTime? RewardsRedeemed { get; set; }

View File

@@ -2,10 +2,10 @@ namespace GamificationService.Models.Database;
public class PlayerSkill public class PlayerSkill
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long PlayerId { get; set; } public Guid PlayerId { get; set; }
public Player Player { get; set; } = null!; public Player Player { get; set; } = null!;
public long SkillId { get; set; } public Guid SkillId { get; set; }
public Skill Skill { get; set; } = null!; public Skill Skill { get; set; } = null!;
public int Score { get; set; } public int Score { get; set; }
} }

View File

@@ -2,7 +2,7 @@ namespace GamificationService.Models.Database;
public class Rank public class Rank
{ {
public long Id { get; set; } public Guid Id { get; set; }
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
public int ExpNeeded { get; set; } public int ExpNeeded { get; set; }

View File

@@ -2,9 +2,9 @@ namespace GamificationService.Models.Database;
public class RankMissionRule public class RankMissionRule
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long RankId { get; set; } public Guid RankId { get; set; }
public Rank Rank { get; set; } = null!; public Rank Rank { get; set; } = null!;
public long MissionId { get; set; } public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!; public Mission Mission { get; set; } = null!;
} }

View File

@@ -2,10 +2,10 @@ namespace GamificationService.Models.Database;
public class RankSkillRule public class RankSkillRule
{ {
public long Id { get; set; } public Guid Id { get; set; }
public long RankId { get; set; } public Guid RankId { get; set; }
public Rank Rank { get; set; } = null!; public Rank Rank { get; set; } = null!;
public long SkillId { get; set; } public Guid SkillId { get; set; }
public Skill Skill { get; set; } = null!; public Skill Skill { get; set; } = null!;
public int Min { get; set; } public int Min { get; set; }
} }

View File

@@ -2,7 +2,7 @@ namespace GamificationService.Models.Database;
public class Skill public class Skill
{ {
public long Id { get; set; } public Guid Id { get; set; }
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
public ICollection<MissionSkillReward> MissionSkillRewards { get; set; } = new List<MissionSkillReward>(); public ICollection<MissionSkillReward> MissionSkillRewards { get; set; } = new List<MissionSkillReward>();
public ICollection<RankSkillRule> RankSkillRules { get; set; } = new List<RankSkillRule>(); public ICollection<RankSkillRule> RankSkillRules { get; set; } = new List<RankSkillRule>();