Skip to content

Conversation

@fe51
Copy link
Member

@fe51 fe51 commented Feb 7, 2026

Fixes #534

It introduces the following modifications

API Changes

Database Model (models.py)

  • Added image: Union[str, None] field to Pose model

Schemas (poses.py)

  • Added PoseImage schema for image updates
  • Updated PoseRead:
    • Added image
    • Added image_url

CRUD (crud_pose.py)

  • Updated type annotations to support PoseImage

API Endpoints (endpoints/poses.py)

  • GET /api/v1/poses/{pose_id}
    • Returns image_url (presigned S3 URL)
  • PATCH /api/v1/poses/{pose_id}/image
    • Endpoint for image uploads
    • Auto-deletes old image on new upload

Authorization

  • Allowed roles:
    • CAMERA
    • ADMIN
    • AGENT

Client Changes

Routes (client.py)

  • Added POSES_IMAGE route constant

Methods (client.py)

  • Added update_pose_image(pose_id, media) method

Tests

API Tests (test_poses.py)

  • Added:
    • test_get_pose_with_image()
    • test_update_pose_image()
  • Updated existing tests:
    • Expectations now include image and image_url

Client Tests (test_client.py)

  • Added test_update_pose_image_camera()

Fixtures (conftest.py)

  • Updated POSE_TABLE with image fields

Camera Tests (test_cameras.py)

  • Updated expected poses

Documentation

DB Diagram (dbdiagram.txt)

  • Added image varchar field to poses table

Pattern

  • Follows the same implementation pattern as Camera.last_image for consistency

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 92.68293% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.14%. Comparing base (af8d048) to head (cd40d9c).

Files with missing lines Patch % Lines
src/app/api/api_v1/endpoints/cameras.py 66.66% 2 Missing ⚠️
src/app/api/api_v1/endpoints/poses.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #546      +/-   ##
==========================================
+ Coverage   87.92%   88.14%   +0.22%     
==========================================
  Files          50       50              
  Lines        1962     1990      +28     
==========================================
+ Hits         1725     1754      +29     
+ Misses        237      236       -1     
Flag Coverage Δ
backend 88.16% <92.10%> (+0.21%) ⬆️
client 87.80% <100.00%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add last_img field to Pose table

1 participant