using System.ComponentModel.DataAnnotations; namespace DorkNet.Server.Data.Entities; /// /// What one club role is allowed to do, as set by /// PUT club/{clubId}/permissions/{membershipType}. /// /// The 2023-03-21 client sends six booleans for a given role /// (RecNet.Runtime/IKMMOCKDKAF_NestedType_BOIMHOCCOEI.txt:173, :189, :205, /// :221, :237, :253) and reads them back on the club details envelope as the /// CoownerPermissions / ModeratorPermissions / /// MemberPermissions objects. /// /// One row per (club, role). A club with no row for a role falls back to the /// derived default policy in ClubsController.PermissionsForRole, so /// existing clubs keep behaving exactly as they did before this table existed. /// /// is the WIRE enum value (Member=10, /// Moderator=20, CoOwner=30), not the stored permission bitmask — the client /// addresses roles by the wire value and so does the route. /// public class ClubRolePermissionEntity { public long Id { get; set; } public long ClubId { get; set; } /// Wire membership-type enum: 10=Member, 20=Moderator, 30=CoOwner. public int MembershipType { get; set; } public bool EditDetails { get; set; } public bool ApproveMember { get; set; } public bool CreateEvent { get; set; } public bool PostAnnouncement { get; set; } public bool EditPermissionSettings { get; set; } public bool BanUnban { get; set; } public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; } /// /// One image in a club's gallery, addressed by slot. /// /// The client sets a slot with PUT club/{clubId}/additionalimage/{slot} /// and clears it with the DELETE twin, then reads the set back as the details /// envelope's AdditionalImages rows /// ({ImageName, Slot} — recnet-runtime-decomp/HIKCHBLAMLP.cs:9, :27). /// Without this table the envelope could only ever send an empty array, so the /// gallery rendered blank no matter what the creator uploaded. /// public class ClubAdditionalImageEntity { public long Id { get; set; } public long ClubId { get; set; } /// Gallery position, taken from the route. public int Slot { get; set; } [MaxLength(256)] public string ImageName { get; set; } = string.Empty; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; }