-- Customer portal API performance/support indexes. Safe to run manually before production deployment.
ALTER TABLE orders ADD INDEX idx_customer_portal_orders (tenant_id, client_id, requested_service_type, current_status, created_at, is_delete);
ALTER TABLE order_items ADD INDEX idx_customer_portal_order_items (tenant_id, client_id, order_id, sku_code, is_delete);
ALTER TABLE order_addresses ADD INDEX idx_customer_portal_order_addresses (tenant_id, order_id, address_type, zone_id, is_delete);
ALTER TABLE inventory_stocks ADD INDEX idx_customer_portal_inventory (tenant_id, client_id, sku_code, available_qty, reserved_qty, is_delete);
ALTER TABLE client_saved_addresses ADD INDEX idx_customer_portal_addresses (tenant_id, client_id, status, is_default_dropoff, is_delete);
ALTER TABLE client_invoices ADD INDEX idx_customer_portal_invoices (tenant_id, client_id, status, created_at, is_delete);
ALTER TABLE client_settlements ADD INDEX idx_customer_portal_settlements (tenant_id, client_id, status, created_at, is_delete);
