```php
<?php

require_once '../../core/api_bootstrap.php';
require_once '../../services/crud_service.php';


require_once '../../core/employee_auth.php';

EmployeeAuth::check('manage_categories');


$data = Request::post();

try {

    Validator::required($data,[
        'id'
    ]);

    $db = new Database();
    $conn = $db->connect();

    $crud = new CrudService($conn);

    $id = (int)$data['id'];


    $crud->softDelete('categories',$id);


    $employee_id = ApiAuth::employeeId();

    Logger::activity(
        $employee_id,
        "delete",
        "categories",
        $id,
        ApiAuth::ip()
    );


    Logger::log(
        "api.log",
        "Category deleted: ".$id
    );


    Response::success([],"Category deleted successfully");


}
catch(Exception $e){

    Logger::log("system.log",$e->getMessage());

    Response::error("Server error",500);

}
