feat: DTOs and interfaces
This commit is contained in:
11
Models/DTO/MissionCompletionResult.cs
Normal file
11
Models/DTO/MissionCompletionResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class MissionCompletionResult
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public string Message { get; set; } = string.Empty;
|
||||
public int ExperienceGained { get; set; }
|
||||
public int ManaGained { get; set; }
|
||||
public List<SkillProgress> SkillsProgress { get; set; } = new();
|
||||
public List<Guid> UnlockedMissions { get; set; } = new();
|
||||
}
|
||||
8
Models/DTO/MissionValidationResult.cs
Normal file
8
Models/DTO/MissionValidationResult.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class MissionValidationResult
|
||||
{
|
||||
public bool IsValid { get; set; }
|
||||
public string Message { get; set; } = string.Empty;
|
||||
public int? SuggestedExperience { get; set; }
|
||||
}
|
||||
15
Models/DTO/PlayerProgress.cs
Normal file
15
Models/DTO/PlayerProgress.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class PlayerProgress
|
||||
{
|
||||
public Guid PlayerId { get; set; }
|
||||
public string PlayerName { get; set; } = string.Empty;
|
||||
public Rank? CurrentRank { get; set; }
|
||||
public int TotalExperience { get; set; }
|
||||
public int TotalMana { get; set; }
|
||||
public int CompletedMissions { get; set; }
|
||||
public int TotalAvailableMissions { get; set; }
|
||||
public Dictionary<string, int> SkillLevels { get; set; } = new();
|
||||
}
|
||||
9
Models/DTO/SkillProgress.cs
Normal file
9
Models/DTO/SkillProgress.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace GamificationService.Models.DTO;
|
||||
|
||||
public class SkillProgress
|
||||
{
|
||||
public Guid SkillId { get; set; }
|
||||
public string SkillTitle { get; set; } = string.Empty;
|
||||
public int PreviousLevel { get; set; }
|
||||
public int NewLevel { get; set; }
|
||||
}
|
||||
12
Services/Interfaces/IDialogueService.cs
Normal file
12
Services/Interfaces/IDialogueService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IDialogueService
|
||||
{
|
||||
Task<Dialogue?> GetDialogueByMissionIdAsync(Guid missionId);
|
||||
Task<Dialogue> CreateDialogueAsync(Dialogue dialogue);
|
||||
Task<DialogueMessage?> GetDialogueMessageByIdAsync(Guid messageId);
|
||||
Task<IEnumerable<DialogueMessageResponseOption>> GetResponseOptionsAsync(Guid messageId);
|
||||
Task<DialogueMessage?> ProcessDialogueResponseAsync(Guid messageId, Guid responseOptionId, Guid playerId);
|
||||
}
|
||||
13
Services/Interfaces/IMissionCategoryService.cs
Normal file
13
Services/Interfaces/IMissionCategoryService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IMissionCategoryService
|
||||
{
|
||||
Task<MissionCategory?> GetCategoryByIdAsync(Guid categoryId);
|
||||
Task<MissionCategory?> GetCategoryByTitleAsync(string title);
|
||||
Task<IEnumerable<MissionCategory>> GetAllCategoriesAsync();
|
||||
Task<MissionCategory> CreateCategoryAsync(MissionCategory category);
|
||||
Task<MissionCategory> UpdateCategoryAsync(MissionCategory category);
|
||||
Task<bool> DeleteCategoryAsync(Guid categoryId);
|
||||
}
|
||||
17
Services/Interfaces/IMissionService.cs
Normal file
17
Services/Interfaces/IMissionService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using GamificationService.Models.Database;
|
||||
using GamificationService.Models.DTO;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IMissionService
|
||||
{
|
||||
Task<Mission?> GetMissionByIdAsync(Guid missionId);
|
||||
Task<IEnumerable<Mission>> GetMissionsByCategoryAsync(Guid categoryId);
|
||||
Task<IEnumerable<Mission>> GetAvailableMissionsForPlayerAsync(Guid playerId);
|
||||
Task<IEnumerable<Mission>> GetChildMissionsAsync(Guid parentMissionId);
|
||||
Task<Mission> CreateMissionAsync(Mission mission);
|
||||
Task<Mission> UpdateMissionAsync(Mission mission);
|
||||
Task<bool> DeleteMissionAsync(Guid missionId);
|
||||
Task<bool> IsMissionAvailableForPlayerAsync(Guid missionId, Guid playerId);
|
||||
Task<MissionCompletionResult> CompleteMissionAsync(Guid missionId, Guid playerId, object? missionProof = null);
|
||||
}
|
||||
14
Services/Interfaces/IPlayerService.cs
Normal file
14
Services/Interfaces/IPlayerService.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IPlayerService
|
||||
{
|
||||
Task<Player?> GetPlayerByUserIdAsync(string userId);
|
||||
Task<Player> CreatePlayerAsync(string userId, string username);
|
||||
Task<Player> UpdatePlayerRankAsync(Guid playerId, Guid newRankId);
|
||||
Task<Player> AddPlayerExperienceAsync(Guid playerId, int experience);
|
||||
Task<Player> AddPlayerManaAsync(Guid playerId, int mana);
|
||||
Task<IEnumerable<Player>> GetTopPlayersAsync(int topCount, TimeSpan timeFrame);
|
||||
Task<Player> GetPlayerWithProgressAsync(Guid playerId);
|
||||
}
|
||||
14
Services/Interfaces/IProgressTrackingService.cs
Normal file
14
Services/Interfaces/IProgressTrackingService.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using GamificationService.Models.Database;
|
||||
using GamificationService.Models.DTO;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IProgressTrackingService
|
||||
{
|
||||
Task<PlayerMission> StartMissionAsync(Guid missionId, Guid playerId);
|
||||
Task<PlayerMission> UpdateMissionProgressAsync(Guid playerMissionId, int progressPercentage, object? proof = null);
|
||||
Task<PlayerMission> CompleteMissionAsync(Guid playerMissionId, object? proof = null);
|
||||
Task<IEnumerable<PlayerMission>> GetPlayerMissionsAsync(Guid playerId);
|
||||
Task<PlayerMission?> GetPlayerMissionAsync(Guid playerId, Guid missionId);
|
||||
Task<PlayerProgress> GetPlayerOverallProgressAsync(Guid playerId);
|
||||
}
|
||||
15
Services/Interfaces/IRankService.cs
Normal file
15
Services/Interfaces/IRankService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IRankService
|
||||
{
|
||||
Task<Rank?> GetRankByIdAsync(Guid rankId);
|
||||
Task<Rank?> GetRankByTitleAsync(string title);
|
||||
Task<IEnumerable<Rank>> GetAllRanksAsync();
|
||||
Task<Rank> CreateRankAsync(Rank rank);
|
||||
Task<Rank> UpdateRankAsync(Rank rank);
|
||||
Task<bool> DeleteRankAsync(Guid rankId);
|
||||
Task<bool> CanPlayerAdvanceToRankAsync(Guid playerId, Guid rankId);
|
||||
Task<Rank?> GetNextRankAsync(Guid currentRankId);
|
||||
}
|
||||
11
Services/Interfaces/IRewardService.cs
Normal file
11
Services/Interfaces/IRewardService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IRewardService
|
||||
{
|
||||
Task<IEnumerable<MissionSkillReward>> GetMissionSkillRewardsAsync(Guid missionId);
|
||||
Task<IEnumerable<MissionItemReward>> GetMissionItemRewardsAsync(Guid missionId);
|
||||
Task DistributeMissionRewardsAsync(Guid missionId, Guid playerId);
|
||||
Task<bool> CanClaimRewardAsync(Guid rewardId, Guid playerId);
|
||||
}
|
||||
10
Services/Interfaces/IRuleValidationService.cs
Normal file
10
Services/Interfaces/IRuleValidationService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface IRuleValidationService
|
||||
{
|
||||
Task<bool> ValidateMissionRankRulesAsync(Guid missionId, Guid playerId);
|
||||
Task<bool> ValidateRankAdvancementRulesAsync(Guid playerId, Guid targetRankId);
|
||||
Task<IEnumerable<MissionRankRule>> GetApplicableRankRulesAsync(Guid missionId);
|
||||
}
|
||||
16
Services/Interfaces/ISkillService.cs
Normal file
16
Services/Interfaces/ISkillService.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using GamificationService.Models.Database;
|
||||
|
||||
namespace GamificationService.Services.Interfaces;
|
||||
|
||||
public interface ISkillService
|
||||
{
|
||||
Task<Skill?> GetSkillByIdAsync(Guid skillId);
|
||||
Task<Skill?> GetSkillByTitleAsync(string title);
|
||||
Task<IEnumerable<Skill>> GetAllSkillsAsync();
|
||||
Task<Skill> CreateSkillAsync(Skill skill);
|
||||
Task<Skill> UpdateSkillAsync(Skill skill);
|
||||
Task<bool> DeleteSkillAsync(Guid skillId);
|
||||
Task<PlayerSkill> UpdatePlayerSkillAsync(Guid playerId, Guid skillId, int level);
|
||||
Task<IEnumerable<PlayerSkill>> GetPlayerSkillsAsync(Guid playerId);
|
||||
Task<int> GetPlayerSkillLevelAsync(Guid playerId, Guid skillId);
|
||||
}
|
||||
Reference in New Issue
Block a user