async def disconnect_source(
        self, db: AsyncSession, connection_id: UUID, user: schemas.User
    ) -> schemas.Connection:
        """Disconnect from a source connection (set to inactive).

        Args:
            db: The database session
            connection_id: The ID of the source connection
            user: The current user

        Returns:
            The updated connection

        Raises:
            NotFoundException: If the connection is not found
            HTTPException: If the connection is not a source
        """
        async with UnitOfWork(db) as uow:
            connection = await crud.connection.get(uow.session, id=connection_id, current_user=user)
            if not connection:
                raise NotFoundException("Connection not found")

            if connection.integration_type != IntegrationType.SOURCE:
                raise HTTPException(status_code=400, detail="Connection is not a source")

            connection.status = ConnectionStatus.INACTIVE
            connection_update = schemas.ConnectionUpdate.model_validate(
                connection, from_attributes=True
            )
            await crud.connection.update(
                uow.session, db_obj=connection, obj_in=connection_update, current_user=user, uow=uow
            )

            # Also set all syncs using this source to inactive
            syncs = await crud.sync.get_all_for_source_connection(
                uow.session, connection_id, current_user=user
            )

            for sync in syncs:
                sync.status = SyncStatus.INACTIVE
                sync_update = schemas.SyncUpdate.model_validate(sync, from_attributes=True)
                await crud.sync.update(
                    uow.session, db_obj=sync, obj_in=sync_update, current_user=user, uow=uow
                )
            connection = schemas.Connection.model_validate(connection, from_attributes=True)
            await uow.commit()
            return connection
Disconnect from a source connection (set to inactive).

        Args:
            db: The database session
            connection_id: The ID of the source connection
            user: The current user

        Returns:
            The updated connection

        Raises:
            NotFoundException: If the connection is not found
            HTTPException: If the connection is not a source
        
backend/airweave/core/connection_service.py