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>
14 lines
479 B
C#
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; }
|
|
}
|