Skip to content

Add photo station backend - #3

Closed
noobydp wants to merge 1 commit into
mainfrom
codex/photo-stations-backend
Closed

noobydp wants to merge 1 commit into
mainfrom
codex/photo-stations-backend

Conversation

@noobydp

@noobydp noobydp commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

This adds the backend foundation for reusable photo stations. A photo station stores a known camera/paper setup so later captures from the same setup can reuse or compare against saved paper corners instead of starting from scratch each time.

The PR includes:

  • photo station request/response schemas
  • a JSON-backed photo station store
  • endpoints for listing, creating, updating, deleting, and reusing stations
  • station suggestions for an uploaded session
  • corner redetection support
  • saving a station directly while confirming corners
  • focused backend tests for the new station behavior

Implementation Notes

The station store follows the existing local JSON-store pattern used elsewhere in the backend. Station records include paper size, image dimensions, source image path, saved corners, and timestamps.

The corner confirmation endpoint can now optionally receive save_station_name. When present, the backend creates a station from the confirmed session image and corners as part of the same workflow.

This also addresses review feedback from the original larger PR:

  • Uses timezone-aware UTC timestamps instead of datetime.utcnow().
  • Centralizes station creation logic in a helper instead of duplicating it between routes.
  • Copies the original uploaded image into station storage before unlinking the upload source.
  • Adds backend coverage for station creation, suggestion behavior, invalid input, corrupt store handling, and the copy-before-unlink path.

Tests

  • python -m pytest backend/tests/test_photo_stations.py

Code and PR drafted with Codex

@noobydp
noobydp changed the base branch from codex/photo-stations-pr-base to main July 11, 2026 07:39
@noobydp

noobydp commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

Closed because this draft was created in the fork by mistake. Recreated against tracefinity/tracefinity as tracefinity#135.

@noobydp noobydp closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant