<?php
declare(strict_types=1);

require_once __DIR__.'/../../security/auth_guard.php';
require_once __DIR__.'/../../config/database.php';
require_once __DIR__.'/../../core/Response.php';

$data = json_decode(file_get_contents('php://input'), true);

if (empty($data['id'])) {
    Response::error('ID required', 422);
}

$db = Database::getInstance();
$stmt = $db->prepare("
UPDATE hospitality_product_sections
SET status='InActive', updated_at=NOW()
WHERE id=:id
");
$stmt->execute(['id'=>$data['id']]);

Response::success('Section deleted');
