Skip to content

Commit

Permalink
docs(Clients_service): Added comments to clarify the functions that i…
Browse files Browse the repository at this point in the history
… created
  • Loading branch information
MoMo2Win committed Nov 20, 2024
1 parent 249ec6d commit 76931d4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Binary file modified myfinances/clients/__pycache__/service.cpython-312.pyc
Binary file not shown.
26 changes: 26 additions & 0 deletions myfinances/clients/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ def update_client(self,
address: Optional[str] = None,
city: Optional[str] = None,
country: Optional[str] = None) -> MyFinancesResponse[Client]:
"""
Updating an existing client's details, with the provided parameters
Args:
name (Optional[str]): name of the client to update
phone_number (Optional[str]): client's phone number to update
email (Optional[EmailStr]): client's email address to update
company (Optional[str]): client's company name to update
contact_method (Optional[str]): client's preferred contact to update
is_representative (Optional[bool]): to update the client if they are representative
address (Optional[str]): client's address to update
city (Optional[str]): client's location in the city to update
country (Optional[str]): client's country location to update
Returns:
MyFinancesResponse[Client]: Data of the client's details is updated
"""
params = {
key: value for key, value in{
"name": name,
Expand All @@ -94,5 +111,14 @@ def update_client(self,
return MyFinancesResponse(**response.dict())

def delete_client(self, client_id: int) -> MyFinancesResponse[Client]:
"""
Deletion of a specific client
Args:
client_id (int): client's id
Returns:
MyFinancesResponse[Client]: Confirming the deletion of the client
"""
response = self._client._delete(f"/clients/{client_id}/delete")
return MyFinancesResponse(**response.dict())

0 comments on commit 76931d4

Please sign in to comment.