chore(quality): apply ruff autofixes and formatting (223 fixes, regression-free: 118/118 tests pass)

This commit is contained in:
Agent Zero
2026-06-10 21:24:24 +00:00
committed by leocrm-bot
parent 7104335334
commit b5f7a220fe
56 changed files with 459 additions and 528 deletions
+6 -12
View File
@@ -3,7 +3,6 @@
from __future__ import annotations
from datetime import UTC, datetime
from typing import Optional
from sqlalchemy.ext.asyncio import AsyncSession
@@ -19,7 +18,6 @@ async def create_account(
db: AsyncSession, payload: AccountCreate, *, org_id: int, owner_id: int
) -> Account:
"""Create a new account in the given org."""
from app.services._base import OrgScopedQuery
account = Account(
org_id=org_id,
@@ -36,9 +34,7 @@ async def create_account(
return account
async def get_account(
db: AsyncSession, account_id: int, *, org_id: int
) -> Optional[Account]:
async def get_account(db: AsyncSession, account_id: int, *, org_id: int) -> Account | None:
"""Fetch a single account by id (org-scoped, not soft-deleted)."""
from app.services._base import OrgScopedQuery
@@ -52,10 +48,10 @@ async def list_accounts(
org_id: int,
skip: int = 0,
limit: int = 20,
industry: Optional[str] = None,
size: Optional[str] = None,
owner_id: Optional[int] = None,
q: Optional[str] = None,
industry: str | None = None,
size: str | None = None,
owner_id: int | None = None,
q: str | None = None,
) -> list[Account]:
"""List accounts with filters and search."""
from app.services._base import OrgScopedQuery
@@ -76,9 +72,7 @@ async def list_accounts(
return base
async def update_account(
db: AsyncSession, account: Account, payload: AccountUpdate
) -> Account:
async def update_account(db: AsyncSession, account: Account, payload: AccountUpdate) -> Account:
"""Apply partial updates to an account."""
data = payload.model_dump(exclude_unset=True)
for field, value in data.items():