using System.ComponentModel.DataAnnotations;
namespace DorkNet.Server.Data.Entities;
///
/// A club announcement — wire type RecNet.ClubAnnouncement
/// (Cpp2IL_ISIL/.../NFEMLMAFFIP.txt). The 2020.12 watch reads
/// the JSON keys
/// AnnouncementId, CreatorAccountId, ClubId, Title, Body, ImageName,
/// CreatedAt, Meta verbatim —
/// emits exactly those, PascalCase. Drives the bell-icon "you have unread
/// club announcements" feed under announcements/v2/mine/unread and
/// announcements/v2/subscription/mine/unread.
///
public class ClubAnnouncementEntity
{
/// Mirrors wire field AnnouncementId (Int64).
public long Id { get; set; }
public long ClubId { get; set; }
/// Mirrors wire CreatorAccountId (Int32 in the
/// payload — cast in the serialiser).
public long AuthorPlayerId { get; set; }
[MaxLength(200)]
public string Title { get; set; } = string.Empty;
[MaxLength(4000)]
public string Body { get; set; } = string.Empty;
[MaxLength(256)]
public string ImageName { get; set; } = string.Empty;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
///
/// One row per (announcement, player). Records which player has read
/// which announcement so the unread feeds can filter out already-seen
/// rows. Upserted by ClubService.MarkAnnouncementReadAsync.
///
public class ClubAnnouncementReadEntity
{
public long Id { get; set; }
public long AnnouncementId { get; set; }
public long PlayerId { get; set; }
public DateTime ReadAt { get; set; } = DateTime.UtcNow;
}