feat: client endpoints fixes for client tab in deal editor

This commit is contained in:
2025-10-05 12:05:03 +04:00
parent 986712d5b7
commit 7d6155ff6c
5 changed files with 25 additions and 6 deletions

View File

@ -17,8 +17,12 @@ class ClientRepository(
entity_class = Client
entity_not_found_msg = "Клиент не найден"
def _process_get_all_stmt(self, stmt: Select) -> Select:
return stmt.where(Client.is_deleted.is_(False)).order_by(Client.created_at)
def _process_get_all_stmt_with_args(
self, stmt: Select, include_deleted: bool
) -> Select:
if not include_deleted:
stmt = stmt.where(Client.is_deleted.is_(False))
return stmt.order_by(Client.created_at)
async def create(self, data: CreateClientSchema) -> int:
details = ClientDetails(**data.details.model_dump())