feat(friend): add ViewerFriend + ViewerFriendApply + ViewerPlayedTogether entities

Lays the persistence foundation for the /friend/* API surface. Three new
model classes with composite PKs / unique constraints / FK cascades registered
on SVSimDbContext; 4/4 persistence tests pass on SQLite in-memory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-09 21:40:08 -04:00
parent c1eec9057a
commit 1813217c16
5 changed files with 187 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
namespace SVSim.Database.Models;
/// <summary>
/// One row per (owner, opponent) pair. Upserted on each new battle so the table
/// holds at most one row per opponent. Per-viewer 50-row retention cap pruned
/// by <c>IPlayedTogetherWriter.RecordAsync</c>.
/// </summary>
public class ViewerPlayedTogether
{
public long OwnerViewerId { get; set; }
public long OpponentViewerId { get; set; }
public DateTime PlayedAt { get; set; }
public int PlayedMode { get; set; }
public int BattleType { get; set; }
public int DeckFormat { get; set; }
public int TwoPickType { get; set; }
}