feat(bp): IBattlePassService skeleton + level-curve method + DI

This commit is contained in:
gamer147
2026-05-26 22:49:30 -04:00
parent 1420c60486
commit 9043e20646
7 changed files with 96 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
using System.Globalization;
using SVSim.Database.Repositories.BattlePass;
using SVSim.EmulatedEntrypoint.Models.Dtos;
namespace SVSim.EmulatedEntrypoint.Services;
public sealed class BattlePassService : IBattlePassService
{
private readonly IBattlePassRepository _bp;
public BattlePassService(IBattlePassRepository bp)
{
_bp = bp;
}
public async Task<IReadOnlyDictionary<string, BattlePassLevel>?> GetLevelCurveAsync(CancellationToken ct)
{
var rows = await _bp.GetLevelCurveAsync(ct);
if (rows.Count == 0) return null;
return rows.ToDictionary(
r => r.Level.ToString(CultureInfo.InvariantCulture),
r => new BattlePassLevel
{
Level = r.Level.ToString(CultureInfo.InvariantCulture),
RequiredPoint = r.RequiredPoint.ToString(CultureInfo.InvariantCulture),
});
}
}