export type Section =
  | "dashboard"
  | "projectBuilder"
  | "cricutExport"
  | "materialsDeals"
  | "customers"
  | "orders"
  | "products"
  | "templates"
  | "inventory"
  | "pricing"
  | "marketing"
  | "license"
  | "release";

export type OrderStatus = "Quoted" | "Proofing" | "Approved" | "In Production" | "Ready" | "Delivered";

export type Customer = {
  id: string;
  name: string;
  company: string;
  email: string;
  phone: string;
  tags: string[];
  lifetimeValue: number;
};

export type Product = {
  id: string;
  name: string;
  category: string;
  materialCost: number;
  laborMinutes: number;
  retailPrice: number;
  targetMargin: number;
};

export type Order = {
  id: string;
  orderNumber: string;
  customerId: string;
  productId: string;
  status: OrderStatus;
  dueDate: string;
  quantity: number;
  paid: number;
  total: number;
};

export type InventoryMaterial = {
  id: string;
  name: string;
  supplier: string;
  color: string;
  onHand: number;
  reserved: number;
  reorderPoint: number;
  unitCost: number;
};

export type TemplateRecord = {
  id: string;
  name: string;
  category: string;
  skill: "Beginner" | "Intermediate" | "Advanced";
  price: number;
  margin: number;
};

export type CricutLayer = {
  id: string;
  name: string;
  colorName: string;
  material: string;
  x: number;
  y: number;
  width: number;
  height: number;
  optional: boolean;
  notes: string;
};

export type CricutPanel = {
  id: string;
  layerName: string;
  column: number;
  row: number;
  x: number;
  y: number;
  width: number;
  height: number;
  svg: string;
};

export type CricutProject = {
  title: string;
  width: number;
  height: number;
  prompt: string;
  projectPlan: string;
  assemblyGuide: string;
  layers: CricutLayer[];
  panels: CricutPanel[];
  svg: string;
};

export type MarketingDraft = {
  listingTitle: string;
  shortDescription: string;
  socialPost: string;
  productionNote: string;
};

export type AppState = {
  customers: Customer[];
  products: Product[];
  orders: Order[];
  inventory: InventoryMaterial[];
  templates: TemplateRecord[];
  currentProject: CricutProject | null;
  marketingDraft: MarketingDraft;
  lastSavedAt: string;
};
