add to tasks service

This commit is contained in:
IluaAir
2025-08-29 22:10:15 +03:00
parent 07f14b0564
commit bd9786c14c
3 changed files with 23 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
from datetime import date
from fastapi import HTTPException
from src.schemas.users import User, UserUpdate, UserWithTasks
@@ -39,7 +40,16 @@ class UserService(BaseService):
await self.session.commit()
return User.model_validate(user)
async def get_user_with_tasks(self, user_id: int):
async def get_user_with_tasks(
self,
user_id: int,
status: str | None,
limit: int | None,
offset: int | None,
date_to: date | None,
date_from: date | None,
):
print(type(status), status)
user = await self.session.user.get_one_with_load(user_id)
if user is None:
raise HTTPException(status_code=404, detail="User not found.")