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,13 @@
namespace SVSim.Database.Models;
/// <summary>
/// One row per direction of a friendship. Approving an apply creates two rows
/// (A → B and B → A). <see cref="FriendViewerId"/> from a played-together row
/// can be self-joined against this table to detect an existing friendship.
/// </summary>
public class ViewerFriend
{
public long OwnerViewerId { get; set; }
public long FriendViewerId { get; set; }
public DateTime CreatedAt { get; set; }
}