"""Delete utilities for milestones and VMs."""

from fastapi import HTTPException


def delete_milestone(delete_func, item_id: str):
    """Generic delete function for milestones."""
    if delete_func(item_id):
        return {"ok": True}
    raise HTTPException(404, "Milestone not found")


def delete_vm(delete_func, item_id: str):
    """Generic delete function for VMs."""
    if delete_func(item_id):
        return {"ok": True}
    raise HTTPException(404, "VM not found")
