chore: claude final touches

This commit is contained in:
Daniil
2026-03-17 18:11:23 +03:00
parent 4b90925c2a
commit 0299949553
21 changed files with 1915 additions and 101 deletions
+25
View File
@@ -35,6 +35,31 @@ class JobRepository:
)
return result.scalar_one_or_none()
async def list_active_by_type(
self,
*,
requester: User,
job_type: str,
project_id: uuid.UUID | None,
statuses: tuple[str, ...],
) -> list[Job]:
stmt: Select[tuple[Job]] = (
select(Job)
.where(Job.is_active.is_(True))
.where(Job.user_id == requester.id)
.where(Job.job_type == job_type)
.where(Job.status.in_(statuses))
.order_by(Job.created_at.desc())
)
if project_id is None:
stmt = stmt.where(Job.project_id.is_(None))
else:
stmt = stmt.where(Job.project_id == project_id)
result = await self._session.execute(stmt)
return list(result.scalars().all())
async def create(self, *, requester: User, data: JobCreate) -> Job:
job = Job(
user_id=requester.id,