dbd90ee52a
Player-service play-session tracker (floor + 3-bucket classify), SharePopover share tracker with debounce, sendBeacon interop, proxied rate-limited POST api/event/{play,share}, append-only event logs + incremental play_counter with server-side release resolution. Migration authored, not applied. No anonId, no read surface.
17 lines
818 B
C#
17 lines
818 B
C#
using DeepDrftModels.Enums;
|
|
|
|
namespace DeepDrftPublic.Client.Services;
|
|
|
|
/// <summary>
|
|
/// The emit seam for the <see cref="PlayTracker"/> (Phase 16 §2.1). The tracker owns the session
|
|
/// lifecycle, the engagement floor, and the bucket classification but knows nothing about transport —
|
|
/// it hands a finished classification to a sink. The production sink fires a <c>sendBeacon</c> POST to
|
|
/// <c>api/event/play</c>; tests substitute a fake sink to assert floor and bucket behaviour with no
|
|
/// JS interop. This keeps the tracker's logic testable behind one seam, as the spec calls for.
|
|
/// </summary>
|
|
public interface IPlayEventSink
|
|
{
|
|
/// <summary>Emit one recorded play. Called at most once per session, only when the floor is crossed.</summary>
|
|
void EmitPlay(string trackEntryKey, PlayBucket bucket);
|
|
}
|