namespace DorkNet.Server.Data.Entities; /// /// Storage-side enum mirroring the int values previously hard-coded in /// . Stays separate from the on-the-wire /// DorkNet.Models.Relationships.RelationshipStatus so the contract /// can evolve without touching the DB representation. Underlying int /// values match — no migration data fixup needed. /// public enum RelationshipStatus { /// Mutual friend (both directions accepted). Friend = 1, /// Outgoing request from /// awaiting accept/decline by . PendingSent = 2, /// /// Reserved for the receiving-side view if we later denormalise. The /// backing column is still 1-2-4 in practice; PendingReceived is what /// the wire DTO computes from the caller's perspective when the row's /// PendingSent direction is "into" them. /// PendingReceived = 3, /// Block held by /// against . Hides the target /// from the requester's friend list and prevents new requests both ways. Blocked = 4, } public class RelationshipEntity { public long Id { get; set; } public long RequesterId { get; set; } public long TargetId { get; set; } public RelationshipStatus Status { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; /// True when favorited /// . Favorited shows up first in the friend /// list and triggers an extra notification on "online". public bool Favorited { get; set; } /// True when muted text from /// . Drops chat-message notifications but /// keeps the friendship intact. public bool Muted { get; set; } /// True when ignored /// (a soft block — hides the player from /// the room browser without breaking the relationship row). public bool Ignored { get; set; } public PlayerEntity? Requester { get; set; } }