<?php
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Cache-Control: no-store, no-cache, must-revalidate');

if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
    http_response_code(204);
    exit;
}

/*
 * ============================================
 *  IVAC PRO - Dynamic API Endpoints + Headers
 *  Change any path / header value below when needed.
 *  Python app polls this every 10 seconds
 *  and auto-updates all endpoints + sec headers.
 * ============================================
 */

$endpoints = [
    "login"          => "/auth//auth/v3-sign-in",
    "otp"            => "/otp/verifySigninOtp",
    "appointment"    => "/appointment",
    "file_upload"    => "/file/upload_file_v321",
    "mission"        => "/appointment/appointment-booking-config",
    "booking_config" => "/appointment/get-booking-config",
    "reserve"        => "/slots/139fd4d2-27c9-4758-a623-368583e830bs/reserve-slot",
    "payment"        => "/payment/23228961-2326-3s28-861f-465bb28337a3/dg-epay/initiate"
];

$headers = [
    "x-sec-runtime-state"    => "v1.5a4c8831.9a53.47ed.b579.042a2c0cee5a",
    "x-sec-navigation-state" => "80d51dc5-af20-46fa-a7bb-e6a8f3f80065",
    "x-v-request-meta"       => "windos.s"
];

echo json_encode([
    "status"    => "success",
    "endpoints" => $endpoints,
    "headers"   => $headers
], JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
