Add DTOs for owner

This commit is contained in:
Jacob Windsor
2025-02-19 15:22:02 +01:00
parent 6f5a2f422e
commit 8c2f5acccf
6 changed files with 57 additions and 6 deletions
@@ -11,6 +11,11 @@ class OwnerRepository:
def __init__(self, session: Annotated[AsyncSession, Depends(get_session)]) -> None:
self.session = session
async def get_all(self, offset: int = 0, limit: int = 100):
statement = select(Owner).offset(offset).limit(limit)
result = await self.session.execute(statement)
return result.scalars().all()
async def get_by_id(self, owner_id: UUID):
statement = select(Owner).where(Owner.id == owner_id)
result = await self.session.execute(statement)