namespace DeepDrftModels.Entities;
///
/// Incremental rollup of play counts per track (Phase 16 §4.1 / D6). One row per track, bumped inside
/// the same transaction that appends the — no background aggregation job. The
/// home card and per-target reads sum these instead of COUNT(*)-ing the event log on every
/// landing. Release totals are derived (D4) by summing the counters of the release's tracks,
/// so there is no separate release-counter row — this keeps the rollup normalized at one row per track.
///
public class PlayCounter
{
public long Id { get; set; }
/// The track these counts belong to (SQL id). Unique — one counter row per track.
public long TrackId { get; set; }
/// Count of plays that ended in the Partial bucket (< 30%).
public long PartialCount { get; set; }
/// Count of plays that ended in the Sampled bucket (30%–80%).
public long SampledCount { get; set; }
/// Count of plays that ended in the Complete bucket (> 80%).
public long CompleteCount { get; set; }
/// Total plays for the track — the sum of the three bucket counts (headline figure).
public long TotalPlays => PartialCount + SampledCount + CompleteCount;
}