- main.py: add docstring inside the lifespan function explaining why
dispose_engine is lazy-imported rather than top-level. The original
import path (top-level) crashed the container at import time with
'ImportError: cannot import name dispose_engine from cartsnitch_api.database'
when database.py was stale or stripped during a CI build. Lazy import
keeps the engine disposal behavior while preventing the module-load
crash.
- tests/test_openapi.py: add test_dispose_engine_importable_from_database
that asserts dispose_engine is importable and callable. This is the
exact path the deployed UAT image was failing on, captured as a
regression test so a future regression lands in CI before deploy.
Refs CAR-1135.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
- Revert auth/dependencies.py to cookie+Bearer dual auth with str user IDs
- Add GET /auth/me/email-in-address endpoint for receipt email routing
- Update User model: add email_inbound_token, change id/store_id/user_id to str
- Update AuthService and UserResponse to use str user IDs
- Update route count test: 33 -> 34 routes
- Restore e2e test for email-in-address endpoint
Co-Authored-By: Paperclip <noreply@paperclip.ing>
- Revert auth/dependencies.py, auth/routes.py, services/auth.py, schemas.py
to Better-Auth session-cookie auth (removed JWT register/login/refresh)
- Preserve GET /auth/me/email-in-address endpoint
- Fix UUIDString TypeDecorator: process_result_value returns uuid.UUID
(not str) so SQLAlchemy 2.0 sentinel tracking matches UUID-to-UUID
- Fix seed_data fixture: look up real user_id from session token via
sessions table; purchases now reference actual user FK
- Update purchase_data fixture to use session-cookie auth
- Update test_auth_endpoints, test_auth_validation to cookie-based tests
- Remove TestRegistrationErrors and TestLoginErrors (no longer applicable)
- Update test_openapi.py expected routes and count
- Update test_error_handler.py to use PATCH /auth/me validation
Co-Authored-By: Paperclip <noreply@paperclip.ing>