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>
This commit is contained in:
gamer147
2026-05-26 22:40:45 -04:00
parent 44da54c418
commit 1420c60486
8 changed files with 168 additions and 3 deletions

View File

@@ -1905,8 +1905,11 @@ namespace SVSim.Database.Migrations
modelBuilder.Entity("SVSim.Database.Models.ViewerBattlePassClaimEntry", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTimeOffset>("ClaimedAt")
.HasColumnType("timestamp with time zone");
@@ -1941,8 +1944,11 @@ namespace SVSim.Database.Migrations
modelBuilder.Entity("SVSim.Database.Models.ViewerBattlePassProgressEntry", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("CurrentPoint")
.HasColumnType("integer");