async def delete_collection(
    readable_id: str,
    delete_data: bool = False,
    db: AsyncSession = Depends(deps.get_db),
    current_user: User = Depends(deps.get_user),
) -> schemas.Collection:
    """Delete a collection by its readable ID.

    Args:
        readable_id: The readable ID of the collection to delete
        delete_data: Whether to delete the data in destinations
        db: The database session
        current_user: The current user

    Returns:
        The deleted collection
    """
    # Find the collection
    db_obj = await crud.collection.get_by_readable_id(
        db, readable_id=readable_id, current_user=current_user
    )
    if db_obj is None:
        raise HTTPException(status_code=404, detail="Collection not found")

    # If delete_data is true, we need to delete data in destination systems
    # before deleting the collection (which will cascade delete source connections)
    if delete_data:
        # Note: This should be moved to a service method that can properly
        # handle the destination data deletion without requiring multiple queries
        pass

    # Delete the collection - CASCADE will handle all child objects
    return await crud.collection.remove(db, id=db_obj.id, current_user=current_user)
Delete a collection by its readable ID.

    Args:
        readable_id: The readable ID of the collection to delete
        delete_data: Whether to delete the data in destinations
        db: The database session
        current_user: The current user

    Returns:
        The deleted collection
    
backend/airweave/api/v1/endpoints/collections.py