<?php
// api_runner.php
$workspace_path = "c:\\Users\\User\\Documents\\Antigravity Projects\\Apperal Managment System -Vanila- PHP";
chdir($workspace_path . "\\api");

// Start mock session
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
$_SESSION['user_id'] = 1;
$_SESSION['user_role'] = 'owner';
$_SESSION['role'] = 'owner';
$_SESSION['company_id'] = 1;
$_SESSION['company_name'] = 'NexCore Apparel';
$_SESSION['company_currency'] = 'LKR';
$_SESSION['company_modules'] = ['invoices'];

// Read input from command line or stdin
$input_json = '';
if (isset($argv[1])) {
    $input_json = $argv[1];
} else {
    $input_json = file_get_contents('php://input');
}

if ($input_json) {
    $data = json_decode($input_json, true);
    if (is_array($data)) {
        $_POST = $data;
    }
}

require 'invoices.php';
