This commit is contained in:
2026-02-27 22:44:02 +03:00
parent 55c3629868
commit c57a40b09a
14 changed files with 331 additions and 69 deletions
@@ -20,10 +20,10 @@ class HoursTransactionsDAO:
)
return list(result.scalars().all())
async def get_by_user_id(self, user_id: int) -> list[HoursTransaction]:
async def get_by_resident_id(self, resident_id: int) -> list[HoursTransaction]:
result = await self.session.execute(
select(HoursTransaction)
.where(HoursTransaction.user_id == user_id)
.where(HoursTransaction.resident_id == resident_id)
.order_by(HoursTransaction.created_at.desc())
)
return list(result.scalars().all())