<?php
declare(strict_types=1);

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

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

Validator::required($data, ['id']);

$stmt = $db->prepare("
    DELETE FROM hospitality_products WHERE id = :id
");
$stmt->execute(['id' => $data['id']]);

Response::success('Hospitality product deleted');
