<?php
declare(strict_types=1);

require_once dirname(__DIR__) . '/_admin_auth.php';

golder_require_method('GET');
golder_api_admin_auth();
$master = golder_master_pdo();

golder_ensure_plan_tables($master);

$plans = $master->query('SELECT * FROM plan_catalog ORDER BY plan_type ASC')->fetchAll() ?: [];
$features = $master->query('SELECT plan_type, feature_key, is_enabled FROM plan_feature_map ORDER BY plan_type, feature_key')->fetchAll() ?: [];

golder_json_response(['status' => 'ok', 'plans' => $plans, 'features' => $features]);


