feat: get projects endpoint

This commit is contained in:
2025-08-03 10:34:54 +04:00
parent 3e51d26c65
commit 8ef265cd45
9 changed files with 88 additions and 7 deletions

View File

@ -0,0 +1 @@
from .project import ProjectRepository as ProjectRepository

14
repositories/project.py Normal file
View File

@ -0,0 +1,14 @@
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from models.project import Project
class ProjectRepository:
def __init__(self, session: AsyncSession):
self.session = session
async def get_all(self) -> list[Project]:
stmt = select(Project).where(Project.is_deleted.is_(False))
result = await self.session.execute(stmt)
return list(result.scalars().all())