Files
SVSimServer/SVSim.Database/Models/ViewerSerialCodeRedemption.cs
gamer147 206be77a86 feat(serial-code): add SerialCode + SerialCodeReward + ViewerSerialCodeRedemption entities
Three new EF entities for /campaign/regist_serial_code: SerialCodeEntry (code, message,
window, enabled flag), SerialCodeRewardEntry (FK child, per-slot reward), and
ViewerSerialCodeRedemption (composite-PK redemption record). Registered in SVSimDbContext
with unique index on Code and cascade FK constraints. 3/3 persistence tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 18:42:10 -04:00

14 lines
479 B
C#

namespace SVSim.Database.Models;
/// <summary>
/// One row per (viewer, code) redemption. Composite PK on <c>(ViewerId, SerialCodeId)</c>
/// enforces the single-use-per-viewer guarantee at the DB layer; the controller catches
/// the unique-constraint violation as a race-condition backstop.
/// </summary>
public class ViewerSerialCodeRedemption
{
public long ViewerId { get; set; }
public int SerialCodeId { get; set; }
public DateTime RedeemedAt { get; set; }
}