Files
SVSimServer/SVSim.Database/Repositories/BattlePass/IViewerBattlePassRepository.cs
gamer147 1420c60486 feat(bp): repositories + identity generation for runtime-inserted tables
Add ValueGeneratedOnAdd to ViewerBattlePassProgress.Id and
ViewerBattlePassClaims.Id so Postgres generates IDENTITY values at
runtime. Regenerate AddBattlePass migration in-place to include the
IdentityByDefaultColumn annotations. Add IBattlePassRepository /
BattlePassRepository (season lookup + level-curve cache) and
IViewerBattlePassRepository / ViewerBattlePassRepository
(get-or-create progress, claim reads/writes).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 22:40:45 -04:00

24 lines
915 B
C#

using SVSim.Database.Enums;
using SVSim.Database.Models;
namespace SVSim.Database.Repositories.BattlePass;
public interface IViewerBattlePassRepository
{
/// <summary>
/// Get-or-create progress row for (viewer, season). New rows are added to the change-tracker
/// but NOT saved — caller batches with other mutations.
/// </summary>
Task<ViewerBattlePassProgressEntry> GetOrCreateProgressAsync(long viewerId, int seasonId, CancellationToken ct);
/// <summary>
/// All claim rows for (viewer, season). Used by /battle_pass/info to enrich is_received.
/// </summary>
Task<List<ViewerBattlePassClaimEntry>> GetClaimsAsync(long viewerId, int seasonId, CancellationToken ct);
/// <summary>
/// Append a claim row (in-memory; caller saves).
/// </summary>
void AddClaim(long viewerId, int seasonId, BattlePassTrack track, int level, DateTimeOffset claimedAt);
}