feat(db): add gacha-point balance + received tables
This commit is contained in:
@@ -65,6 +65,10 @@ public class Viewer : BaseEntity<long>
|
||||
|
||||
public List<ViewerPackOpenCount> PackOpenCounts { get; set; } = new List<ViewerPackOpenCount>();
|
||||
|
||||
public List<ViewerGachaPointBalance> GachaPointBalances { get; set; } = new List<ViewerGachaPointBalance>();
|
||||
|
||||
public List<ViewerGachaPointReceived> GachaPointReceived { get; set; } = new List<ViewerGachaPointReceived>();
|
||||
|
||||
public List<ViewerBuildDeckProductPurchase> BuildDeckPurchases { get; set; } = new List<ViewerBuildDeckProductPurchase>();
|
||||
|
||||
public List<ViewerMission> Missions { get; set; } = new List<ViewerMission>();
|
||||
|
||||
17
SVSim.Database/Models/ViewerGachaPointBalance.cs
Normal file
17
SVSim.Database/Models/ViewerGachaPointBalance.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Per-viewer, per-pack gacha-point balance. Owned collection on <see cref="Viewer"/>.
|
||||
/// <c>PackId</c> = parent_gacha_id. <c>Points</c> accumulates one per pack opened (or
|
||||
/// <c>PackChildGachaEntry.OverrideIncreaseGachaPoint</c> when set on the child) and is
|
||||
/// decremented by <see cref="PackGachaPointConfig.ExchangeablePoint"/> per exchange.
|
||||
/// Unique index on (ViewerId, PackId) per feedback_owned_collection_unique_index.
|
||||
/// </summary>
|
||||
[Owned]
|
||||
public class ViewerGachaPointBalance
|
||||
{
|
||||
public int PackId { get; set; }
|
||||
public int Points { get; set; }
|
||||
}
|
||||
17
SVSim.Database/Models/ViewerGachaPointReceived.cs
Normal file
17
SVSim.Database/Models/ViewerGachaPointReceived.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Marker row recording that a viewer has already redeemed <c>CardId</c> from <c>PackId</c>'s
|
||||
/// gacha-point exchange. Drives the per-entry <c>is_received</c> flag in
|
||||
/// <c>/pack/get_gacha_point_rewards</c>. Owned collection on <see cref="Viewer"/>.
|
||||
/// Unique index on (ViewerId, PackId, CardId) per feedback_owned_collection_unique_index.
|
||||
/// </summary>
|
||||
[Owned]
|
||||
public class ViewerGachaPointReceived
|
||||
{
|
||||
public int PackId { get; set; }
|
||||
public long CardId { get; set; }
|
||||
public DateTime ReceivedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user