-- Ürünler Tablosu
CREATE TABLE IF NOT EXISTS products (
    id VARCHAR(50) PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    brand VARCHAR(100),
    product_type VARCHAR(50),
    package_content VARCHAR(50),
    package_unit VARCHAR(20),
    price DECIMAL(10, 2) DEFAULT 0.00,
    list_price DECIMAL(10, 2) NULL,
    currency VARCHAR(10) DEFAULT 'tl',
    tax_rate VARCHAR(10) DEFAULT '20',
    usage_frequency VARCHAR(100),
    usage_comparison_m3 VARCHAR(50) DEFAULT '100',
    usage_amount DECIMAL(10, 2) DEFAULT 0.00,
    usage_unit VARCHAR(20),
    description TEXT,
    image VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Ekipmanlar Tablosu
CREATE TABLE IF NOT EXISTS equipment (
    id VARCHAR(50) PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    brand VARCHAR(100),
    category VARCHAR(50),
    supplier VARCHAR(100),
    supplier_contact VARCHAR(100),
    price DECIMAL(10, 2) DEFAULT 0.00,
    currency VARCHAR(10) DEFAULT 'tl',
    tax_rate VARCHAR(10) DEFAULT '20',
    profit_margin DECIMAL(5, 2) DEFAULT 0.00,
    description TEXT,
    image VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Ürün Seçim Paketleri
CREATE TABLE IF NOT EXISTS selection_packages (
    id VARCHAR(50) PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    product_ids TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Ekipman Seçim Paketleri
CREATE TABLE IF NOT EXISTS ekipman_selections (
    id VARCHAR(50) PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    product_ids TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
