<?php
/**
 * GET /api/loyalty/formula.php
 * Public (requires login, but any account type) - returns just the two
 * point-earning rates for display on loyalty.html. Deliberately separate
 * from admin/settings_list.php, which also holds OAuth secrets and must
 * stay admin-only.
 */

require_once __DIR__ . '/../config/database.php';
require_once __DIR__ . '/../includes/response.php';
require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/../includes/loyalty.php';

require_login();

$pdo = Database::connect();
send_json(true, 'OK', [
    'points_per_dollar_spent' => points_per_dollar_spent($pdo),
    'points_per_new_listing' => points_per_new_listing($pdo),
]);
