app/modules/providers/services.py
def delete(self, db: Session, id: int) -> ProviderResponse:
        """
        Deletes a provider by id.

        Args:
            id (int): The provider ID.

        Returns:
            ProviderResponse: The provider response model.
        """
        original_provider = db.query(Provider).filter(and_(
            Provider.id == id,
            Provider.is_deleted == False
        )).first()
        if not original_provider:
            return None

        original_provider.is_deleted = True
        original_provider.update(db)
        disable_provider = ProviderResponse.from_orm(original_provider)
        return disable_provider

        Deletes a provider by id.

        Args:
            id (int): The provider ID.

        Returns:
            ProviderResponse: The provider response model.
        
Deletes a provider by id.
Deletes a provider by id .
def delete(self, db: Session, id: int) -> ProviderResponse:
        original_provider = db.query(Provider).filter(and_(
            Provider.id == id,
            Provider.is_deleted == False
        )).first()
        if not original_provider:
            return None
        original_provider.is_deleted = True
        original_provider.update(db)
        disable_provider = ProviderResponse.from_orm(original_provider)
        return disable_provider
def delete ( self , db : Session , id : int ) -> ProviderResponse : original_provider = db . query ( Provider ) . filter ( and_ ( Provider . id == id , Provider . is_deleted == False ) ) . first ( ) if not original_provider : return None original_provider . is_deleted = True original_provider . update ( db ) disable_provider = ProviderResponse . from_orm ( original_provider ) return disable_provider
Deletes a provider by id.
Deletes a provider by id .
"""
        Deletes a provider by id.

        Args:
            id (int): The provider ID.

        Returns:
            ProviderResponse: The provider response model.
        """
The provider response model.
The provider response model .
ProviderResponse
self
db
Session
id
int
The provider ID.
The provider ID .