import { OnlineSnapshot } from '../entities/online-snapshot.entity';

export interface IOnlineSnapshotRepository {
  /**
   * 插入快照
   */
  insert(snapshot: OnlineSnapshot): Promise<OnlineSnapshot>;

  /**
   * 按时间范围查询
   */
  findByTimeRange(
    startTime: Date,
    endTime: Date,
    interval?: '1m' | '5m' | '1h',
  ): Promise<OnlineSnapshot[]>;

  /**
   * 获取最新快照
   */
  findLatest(): Promise<OnlineSnapshot | null>;
}

export const ONLINE_SNAPSHOT_REPOSITORY = Symbol('IOnlineSnapshotRepository');
