export type ProductVisibility = "PUBLIC" | "HIDDEN";
export type ProductStatus = "ACTIVE" | "DISABLED" | "ARCHIVED";

export type AdminProductRow = {
  id: number;
  uuid: string;
  name: string;
  slug: string;
  platform: string | null;
  partRole: string | null;
  brandName: string | null;
  importStatus: string | null;
  caliber: string | null;
  caliberGroup: string | null;
  caliberLocked: boolean;
  visibility: ProductVisibility;
  status: ProductStatus;
  builderEligible: boolean;
  adminLocked: boolean;
  adminNote: string | null;
  mainImageUrl: string | null;
  createdAt: string | null;
  updatedAt: string | null;
};

export type PageResponse<T> = {
  content: T[];
  totalElements: number;
  totalPages: number;
  number: number;
  size: number;
};

export type AdminFilters = {
  q: string;
  platform: string;
  partRole: string;
  caliber: string;
  visibility: ProductVisibility | "";
  status: ProductStatus | "";
  builderEligible: "" | "true" | "false";
  adminLocked: "" | "true" | "false";
};

export type PlatformDto = {
  id: number;
  key: string;
  label: string;
  is_active: boolean;
};

export const initialFilters: AdminFilters = {
  q: "",
  platform: "",
  partRole: "",
  caliber: "",
  visibility: "",
  status: "",
  builderEligible: "",
  adminLocked: "",
};

export type CaliberDto = {
  id: number;
  key: string;      // canonical key (ex: "5.56 NATO")
  label: string;    // human-readable label
  isActive: boolean;
  createdAt?: string;
  updatedAt?: string;
};