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

header('Content-Type: application/json');
$model = new Customer();

$success = $model->delete((int)$_POST['id']);
echo json_encode([
    'success' => $success,
    'message' => $success ? 'Customer deleted successfully!' : 'Failed to delete customer.'
]);
