<?php
declare(strict_types=1);
require_once __DIR__ . '/../../../app/Models/Coa.php';
require_once __DIR__ . '/../../../app/Config/functions.php';
require_login();

header('Content-Type: application/json');
$model = new Coa();
$id = (int)($_POST['id'] ?? 0);

echo json_encode([
  'success' => $model->delete($id),
  'message' => 'Account deleted successfully!'
]);
