<?php
declare(strict_types=1);

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

$db = Database::getInstance();

$stmt = $db->query("
    SELECT
        id,
        title,
        slug,
        product_type,
        usage_category,
        cover_image,
        status,
        approval_status,
        priority,
        created_at
    FROM hospitality_products
    ORDER BY priority ASC, created_at DESC
");

Response::success('Hospitality products loaded', [
    'items' => $stmt->fetchAll()
]);
