export type FlyerMatchStatus = 'auto' | 'ambiguous' | 'unmatched';

export type ReceiptMatchPreviewRow = {
  rowIndex: number;
  status: FlyerMatchStatus;
  confidence: number;
  matchedVia: string;
  reasonCodes: string[];
  selectionId: number | null;
  sessionId: number | null;
  itemId: number | null;
  plannedName: string | null;
  plannedProductId: number | null;
  plannedProductName: string | null;
};

export type ReceiptMatchPreviewResponse = {
  rows: ReceiptMatchPreviewRow[];
  autoCount: number;
  ambiguousCount: number;
  unmatchedCount: number;
  candidateSelectionCount: number;
};

export type ReceiptMatchCommitResponse = {
  boughtCount: number;
  ambiguousCount: number;
  unmatchedCount: number;
  updatedSelectionIds: number[];
};
