refactor: improve code formatting and organization across multiple files

This commit is contained in:
2025-10-11 17:40:56 +02:00
parent 47bbd7ab0c
commit 834150518a
23 changed files with 317 additions and 126 deletions

View File

@@ -17,11 +17,15 @@ class UserRepository(BaseRepository[User]):
super().__init__(session)
def get_by_username(self, username: str) -> User | None:
statement = sa.select(self.model).where(sa.func.lower(self.model.username) == username.lower())
statement = sa.select(self.model).where(
sa.func.lower(self.model.username) == username.lower()
)
return self.session.scalar(statement)
def list_recent(self, limit: int = 50) -> list[User]:
statement = sa.select(self.model).order_by(self.model.created_at.desc()).limit(limit)
statement = (
sa.select(self.model).order_by(self.model.created_at.desc()).limit(limit)
)
return list(self.session.scalars(statement))
def create(self, data: UserCreate) -> User: