export interface Category { id: number; name: string; description: string | null; created_at: string; } export interface ComponentSpecs { // All categories manufacturer_id?: string; // Resistors & Capacitors value?: string; power?: string; voltage?: string; tolerance?: string; // LEDs color?: string; // Connectors no_of_pins?: string; no_of_rows?: string; connector_type?: string; // "Female" | "Male" } export interface Component { id: number; part_number: string; name: string; description: string | null; category_id: number | null; category_name?: string; manufacturer: string | null; package_type: string | null; unit_price: number; stock_quantity: number; min_stock_level: number; datasheet_url: string | null; supplier: string | null; supplier_part_number: string | null; shelf_location: string | null; is_internal: boolean; customer_supplied: boolean; customer_id: number | null; customer_name?: string; specs: ComponentSpecs; created_at: string; updated_at: string; } export interface Product { id: number; name: string; sku: string; description: string | null; version: string; status: string; created_at: string; updated_at: string; bom_count?: number; total_cost?: number; } export interface BomItem { id: number; product_id: number; component_id: number; quantity: number; reference_designator: string | null; notes: string | null; created_at: string; component_name?: string; part_number?: string; unit_price?: number; stock_quantity?: number; category_name?: string; line_cost?: number; } export interface StockTransaction { id: number; component_id: number; transaction_type: "purchase" | "adjustment" | "return" | "consumption"; quantity: number; unit_cost: number | null; total_cost: number | null; supplier: string | null; supplier_order_ref: string | null; notes: string | null; created_at: string; component_name?: string; part_number?: string; category_name?: string; } export interface Customer { id: number; name: string; code: string; email: string | null; phone: string | null; address: string | null; contact_person: string | null; notes: string | null; created_at: string; updated_at: string; order_count?: number; total_revenue?: number; } export interface PurchaseOrder { id: number; customer_id: number; po_number: string; customer_ref: string | null; status: "draft" | "confirmed" | "in_production" | "shipped" | "completed" | "cancelled"; order_date: string; due_date: string | null; notes: string | null; created_at: string; updated_at: string; customer_name?: string; customer_code?: string; item_count?: number; total_value?: number; total_ordered?: number; total_shipped?: number; } export interface PurchaseOrderItem { id: number; purchase_order_id: number; product_id: number; quantity: number; unit_price: number; notes: string | null; created_at: string; product_name?: string; product_sku?: string; line_total?: number; shipped_quantity?: number; remaining_quantity?: number; } export interface PackingList { id: number; purchase_order_id: number; po_item_id: number; packing_number: string; quantity: number; notes: string | null; created_at: string; po_number?: string; customer_name?: string; customer_code?: string; customer_email?: string; customer_phone?: string; customer_address?: string; product_name?: string; product_sku?: string; serial_count?: number; } export interface PackingListSerial { id: number; packing_list_id: number; serial_number: string; created_at: string; } export interface Supplier { id: number; name: string; code: string; email: string | null; phone: string | null; address: string | null; contact_person: string | null; country: string; currency: string; notes: string | null; created_at: string; updated_at: string; } export interface SupplierPackingList { id: number; supplier_id: number; packing_number: string; notes: string | null; created_at: string; supplier_name?: string; supplier_code?: string; supplier_email?: string | null; supplier_phone?: string | null; supplier_address?: string | null; supplier_contact?: string | null; item_count?: number; total_quantity?: number; } export interface SupplierPackingListItem { id: number; supplier_packing_list_id: number; component_id: number; quantity: number; created_at: string; part_number?: string; component_name?: string; used_in_products?: string; }