import type { Visibility } from "@/core/module-registry/types";
import type { CompanyId } from "@/core/auth/types";

export type SignatureAssetType = "signature" | "stamp";

/** Version history entry */
export interface AssetVersion {
  id: string;
  imageUrl: string;
  notes: string;
  createdAt: string;
}

/** Default subcategory options (users can add more) */
export const DEFAULT_SUBCATEGORIES = [
  "Colaboratori",
  "Experți tehnici",
  "Verificatori de proiect",
  "Proiectanți",
  "Diriginți de șantier",
  "Responsabili tehnici",
] as const;

export interface SignatureAsset {
  id: string;
  label: string;
  type: SignatureAssetType;
  /** Preview image data URL (PNG/JPG — browsers can render this) */
  imageUrl: string;
  /** Original file data URL (for TIFF originals or same as imageUrl) */
  originalFileData?: string;
  /** Original file name for downloads */
  originalFileName?: string;
  owner: string;
  company: CompanyId;
  /** Subcategory for grouping (e.g. "Colaboratori firma X") */
  subcategory: string;
  /** Version history */
  versions: AssetVersion[];
  tags: string[];
  visibility: Visibility;
  createdAt: string;
  updatedAt: string;
}
