refactor: improve code readability by formatting arguments across multiple files
Test / test (push) Successful in 15s
Test / test (push) Successful in 15s
This commit is contained in:
@@ -41,7 +41,8 @@ class ActivityRepository:
|
||||
select(Activity)
|
||||
.join(Deal, Deal.id == Activity.deal_id)
|
||||
.where(
|
||||
Activity.deal_id == params.deal_id, Deal.organization_id == params.organization_id,
|
||||
Activity.deal_id == params.deal_id,
|
||||
Deal.organization_id == params.organization_id,
|
||||
)
|
||||
.order_by(Activity.created_at)
|
||||
)
|
||||
|
||||
@@ -63,7 +63,8 @@ class ContactRepository:
|
||||
user_id: int,
|
||||
) -> Contact | None:
|
||||
stmt = select(Contact).where(
|
||||
Contact.id == contact_id, Contact.organization_id == organization_id,
|
||||
Contact.id == contact_id,
|
||||
Contact.organization_id == organization_id,
|
||||
)
|
||||
result = await self._session.scalars(stmt)
|
||||
return result.first()
|
||||
|
||||
@@ -148,7 +148,9 @@ class DealRepository:
|
||||
return stmt
|
||||
|
||||
def _apply_ordering(
|
||||
self, stmt: Select[tuple[Deal]], params: DealQueryParams,
|
||||
self,
|
||||
stmt: Select[tuple[Deal]],
|
||||
params: DealQueryParams,
|
||||
) -> Select[tuple[Deal]]:
|
||||
column = ORDERABLE_COLUMNS.get(params.order_by or "created_at", Deal.created_at)
|
||||
order_func = desc if params.order_desc else asc
|
||||
|
||||
@@ -107,7 +107,9 @@ class TaskRepository:
|
||||
return task
|
||||
|
||||
def _apply_filters(
|
||||
self, stmt: Select[tuple[Task]], params: TaskQueryParams,
|
||||
self,
|
||||
stmt: Select[tuple[Task]],
|
||||
params: TaskQueryParams,
|
||||
) -> Select[tuple[Task]]:
|
||||
if params.deal_id is not None:
|
||||
stmt = stmt.where(Task.deal_id == params.deal_id)
|
||||
|
||||
Reference in New Issue
Block a user