Restore the security-review context comment that explains why the
storniert status check is necessary. This comment was part of the
original trigger function body and should be preserved for future
maintainers who inspect the function directly in the database.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
- Add migration 20260818120000_auftrag_fotos_optional_trigger.sql that replaces
check_auftrag_status_transition() function, removing ONLY the photo-count check
while preserving all other validation (start_km, end_km, uebergabe_bestaetigt_at,
status transitions, column lockdown, role-based restrictions)
- Update pgTAP test: plan(13) -> plan(12), replace photo-mandatory test with
test verifying transition succeeds without photos
- Completes DB-level optional photos feature (app-level optional already done in Task 1)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P