feat(rank): add ViewerRankProgress owned entity + migration
One row per (viewer, format) tracking accumulated Point + MasterPoint. Unique index on (ViewerId, Format) enforces one row per format per viewer (mirrors owned-collection precedent per project_owned_collection_unique_index). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,8 @@ public class Viewer : BaseEntity<long>
|
||||
|
||||
public List<ViewerFreePackClaim> FreePackClaims { get; set; } = new List<ViewerFreePackClaim>();
|
||||
|
||||
public List<ViewerRankProgress> RankProgress { get; set; } = new List<ViewerRankProgress>();
|
||||
|
||||
public List<MyPageBgRotationEntry> MyPageBgRotation { get; set; } = new List<MyPageBgRotationEntry>();
|
||||
|
||||
public List<ViewerGachaPointBalance> GachaPointBalances { get; set; } = new List<ViewerGachaPointBalance>();
|
||||
|
||||
17
SVSim.Database/Models/ViewerRankProgress.cs
Normal file
17
SVSim.Database/Models/ViewerRankProgress.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SVSim.Database.Enums;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// One row per (viewer, format) tracking accumulated rank points and master points.
|
||||
/// Point is 0-based cumulative; the current rank_id is derived at read time from Point
|
||||
/// (and MasterPoint once past 50000). Owned collection on <see cref="Viewer"/>.
|
||||
/// </summary>
|
||||
[Owned]
|
||||
public class ViewerRankProgress
|
||||
{
|
||||
public Format Format { get; set; }
|
||||
public int Point { get; set; }
|
||||
public int MasterPoint { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user