code quality fixes
Build and Push Docker Image / build-and-push (pull_request) Successful in 58s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 18s

This commit is contained in:
Brian Bjarke Jensen
2025-11-11 20:43:47 +01:00
parent 696de14e6b
commit a2b78f7e96
17 changed files with 236 additions and 249 deletions
+6 -18
View File
@@ -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)