/**
 * Presence Service domain port.
 *
 * Abstracts user online presence tracking (backed by Redis in infrastructure).
 */

export const PRESENCE_SERVICE = Symbol('IPresenceService');

export interface IPresenceService {
  /** Update user heartbeat timestamp */
  updatePresence(userId: string): Promise<void>;

  /** Count users online within window */
  countOnline(): Promise<number>;

  /** Add user/installId to HyperLogLog DAU */
  addDauIdentifier(date: string, identifier: string): Promise<void>;

  /** Get approximate DAU from HyperLogLog */
  getApproxDau(date: string): Promise<number>;

  /** Clean up expired presence data */
  cleanupExpired(): Promise<number>;

  /** Get the online detection window in seconds */
  getWindowSeconds(): number;
}
