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

        Args:
            db (Session): The database session.
            id (int): The provider ID.
            provider (ProviderUpdate): The provider update model.

        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.update(db, **provider.dict(exclude_unset=True))
        updated_provider = ProviderResponse.from_orm(original_provider)
        return updated_provider

        Edits a provider by id.

        Args:
            db (Session): The database session.
            id (int): The provider ID.
            provider (ProviderUpdate): The provider update model.

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

        Args:
            db (Session): The database session.
            id (int): The provider ID.
            provider (ProviderUpdate): The provider update model.

        Returns:
            ProviderResponse: The provider response model.
        """
The provider response model.
The provider response model .
ProviderResponse
self
db
Session
The database session.
The database session .
id
int
The provider ID.
The provider ID .
provider
ProviderUpdate
The provider update model.
The provider update model .