import type { PosStore, ListStoresOptions } from './store.js';
import type { PosTerminal, ListTerminalsOptions } from './terminal.js';
import type { PosCashSession, OpenCashSessionInput, CloseCashSessionInput } from './cash-session.js';

export interface PosStoreRepository {
  findById(id: string): Promise<PosStore | undefined>;
  list(options?: ListStoresOptions): Promise<{ stores: PosStore[]; total: number }>;
}

export interface PosTerminalRepository {
  findById(id: string): Promise<PosTerminal | undefined>;
  findByBindingCode(code: string): Promise<PosTerminal | undefined>;
  list(options?: ListTerminalsOptions): Promise<{ terminals: PosTerminal[]; total: number }>;
  updateLastSeen(id: string): Promise<void>;
  bind(id: string, bindingCode: string): Promise<PosTerminal>;
}

export interface PosCashSessionRepository {
  findById(id: string): Promise<PosCashSession | undefined>;
  findOpenByTerminal(terminalId: string): Promise<PosCashSession | undefined>;
  open(input: OpenCashSessionInput): Promise<PosCashSession>;
  close(input: CloseCashSessionInput): Promise<PosCashSession>;
  listByStore(storeId: string, limit?: number, offset?: number): Promise<{ sessions: PosCashSession[]; total: number }>;
}
