export type ScanType = "invoice" | "payment" | "declaration";

export interface ScanPayload {
  type: ScanType;
  id?: string;
  data: any;
}

let _scanData: ScanPayload | null = null;

export function setScanData(payload: ScanPayload) {
  _scanData = payload;
}

export function getScanData(): ScanPayload | null {
  const data = _scanData;
  _scanData = null;
  return data;
}

export function clearScanData() {
  _scanData = null;
}
