code quality fixes
This commit is contained in:
@@ -29,9 +29,7 @@ def create_feeding(
|
||||
feeding_repo: Annotated[
|
||||
FeedingRepositoryInterface, Depends(get_feeding_repository)
|
||||
],
|
||||
child_repo: Annotated[
|
||||
ChildRepositoryInterface, Depends(get_child_repository)
|
||||
],
|
||||
child_repo: Annotated[ChildRepositoryInterface, Depends(get_child_repository)],
|
||||
) -> FeedingResponse:
|
||||
"""Create a new feeding log entry."""
|
||||
# Verify the child belongs to the authenticated user
|
||||
@@ -53,9 +51,7 @@ def get_active_feeding(
|
||||
feeding_repo: Annotated[
|
||||
FeedingRepositoryInterface, Depends(get_feeding_repository)
|
||||
],
|
||||
child_repo: Annotated[
|
||||
ChildRepositoryInterface, Depends(get_child_repository)
|
||||
],
|
||||
child_repo: Annotated[ChildRepositoryInterface, Depends(get_child_repository)],
|
||||
) -> FeedingResponse | None:
|
||||
"""Get the current active feeding (where end_time is null) for the user."""
|
||||
feedings = feeding_repo.get_by_user_id(user_id)
|
||||
@@ -92,9 +88,7 @@ def get_feeding(
|
||||
feeding_repo: Annotated[
|
||||
FeedingRepositoryInterface, Depends(get_feeding_repository)
|
||||
],
|
||||
child_repo: Annotated[
|
||||
ChildRepositoryInterface, Depends(get_child_repository)
|
||||
],
|
||||
child_repo: Annotated[ChildRepositoryInterface, Depends(get_child_repository)],
|
||||
) -> FeedingResponse:
|
||||
"""Get a specific feeding log by ID."""
|
||||
feeding = feeding_repo.get_by_id(feeding_id)
|
||||
@@ -116,9 +110,7 @@ def update_feeding(
|
||||
feeding_repo: Annotated[
|
||||
FeedingRepositoryInterface, Depends(get_feeding_repository)
|
||||
],
|
||||
child_repo: Annotated[
|
||||
ChildRepositoryInterface, Depends(get_child_repository)
|
||||
],
|
||||
child_repo: Annotated[ChildRepositoryInterface, Depends(get_child_repository)],
|
||||
) -> FeedingResponse:
|
||||
"""Update a feeding log entry."""
|
||||
feeding = feeding_repo.get_by_id(feeding_id)
|
||||
@@ -130,9 +122,7 @@ def update_feeding(
|
||||
verify_child_access(child_repo, feeding["child_id"], user_id)
|
||||
|
||||
# Update the feeding
|
||||
feeding_type_value = (
|
||||
request.feeding_type.value if request.feeding_type else None
|
||||
)
|
||||
feeding_type_value = request.feeding_type.value if request.feeding_type else None
|
||||
updated_feeding = feeding_repo.update(
|
||||
feeding_id=feeding_id,
|
||||
start_time=request.start_time,
|
||||
@@ -153,9 +143,7 @@ def delete_feeding(
|
||||
feeding_repo: Annotated[
|
||||
FeedingRepositoryInterface, Depends(get_feeding_repository)
|
||||
],
|
||||
child_repo: Annotated[
|
||||
ChildRepositoryInterface, Depends(get_child_repository)
|
||||
],
|
||||
child_repo: Annotated[ChildRepositoryInterface, Depends(get_child_repository)],
|
||||
) -> None:
|
||||
"""Delete a feeding log entry."""
|
||||
feeding = feeding_repo.get_by_id(feeding_id)
|
||||
|
||||
Reference in New Issue
Block a user