async def remove(self, db: AsyncSession, *, id: UUID) -> Optional[ModelType]:
        """Soft delete an object.

        Args:
        ----
            db (AsyncSession): The database session.
            id (UUID): The UUID of the object to delete.

        Returns:
        -------
            Optional[ModelType]: The soft deleted object.

        """
        result = await db.execute(select(self.model).where(self.model.id == id))
        db_obj = result.unique().scalar_one_or_none()

        if db_obj:
            db_obj.deleted_at = datetime.utcnow()
            db.add(db_obj)
            await db.commit()
            await db.refresh(db_obj)
        return db_obj
Soft delete an object.

        Args:
        ----
            db (AsyncSession): The database session.
            id (UUID): The UUID of the object to delete.

        Returns:
        -------
            Optional[ModelType]: The soft deleted object.

        
backend/airweave/crud/_base_soft_delete.py