/**
 * Pluggable event store interface for ByteLyst product backends.
 * Products define their own event shapes; the store handles persistence.
 */

export interface StoredEvent {
  id: string;
  type: string;
  userId: string;
  productId: string;
  timestamp: string;
  payload: Record<string, unknown>;
}

export interface EventStoreQuery {
  userId?: string;
  type?: string;
  after?: string;
  before?: string;
  limit?: number;
}

export interface EventStore {
  append(event: StoredEvent): Promise<void>;
  query(q: EventStoreQuery): Promise<StoredEvent[]>;
  recent(limit?: number): Promise<StoredEvent[]>;
  count(): Promise<number>;
  clear(): Promise<void>;
}
