/** Admin surface for RFID card batches (carsharing-badge submission lots). */

export type RfidBatchStatus = "processing" | "processed";

export type RfidChangeType =
  | "create"
  | "assign"
  | "vehicles"
  | "activate"
  | "deactivate"
  | "archive";

export interface RfidBatchCompany {
  id: number;
  name: string;
}

export interface RfidCardBatch {
  id: number;
  reference: string;
  status: RfidBatchStatus;
  status_label: string;
  status_color: string;
  changes_count: number;
  company: RfidBatchCompany;
  submitted_by: string | null;
  submitted_at: string | null;
  processed_by: string | null;
  processed_at: string | null;
}

export interface RfidBatchChangeCard {
  id: number;
  public_number: string;
}

export interface RfidBatchChange {
  id: number;
  change_type: RfidChangeType;
  status: string;
  summary: string;
  payload: Record<string, unknown> | null;
  requested_by: string | null;
  card: RfidBatchChangeCard | null;
  created_at: string | null;
  submitted_at: string | null;
  processed_at: string | null;
}

export interface RfidCardBatchDetail extends RfidCardBatch {
  changes: RfidBatchChange[];
}

export interface RfidCardBatchStats {
  total: number;
  processing: number;
  processed: number;
  changes_pending: number;
  companies: number;
}
