<?php

require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../helpers.php';

session_start();

if (!isset($_REQUEST['vrn']) || !isset($_REQUEST['from']) || !isset($_REQUEST['to'])) {
    die('ERROR: Please fill VRN, From, To and submit the form again');
}

$status = isset($_REQUEST['status']) ? $_REQUEST['status'] : null;
//$govTestScenario = isset($_GET['gov_test_scenario']) ? $_GET['gov_test_scenario'] : null;

$request = new \HMRC\VAT\RetrieveVATObligationsRequest($_GET['vrn'], $_REQUEST['from'], $_REQUEST['to'], $status);

//if (!is_null($govTestScenario)) {
//    $request->setGovTestScenario($govTestScenario);
//}
$response = $request->fire();
$response->echoObsHeader();
