refactor(backend/api): extract LegalDocumentConsentService (Step 4 — file 12 of 18)

Extract consent, audit log, cookie category, and consent stats endpoints
from legal_document_routes into LegalDocumentConsentService. The route
file is now a thin handler layer delegating to LegalDocumentService and
LegalDocumentConsentService with translate_domain_errors(). Legacy
helpers (_doc_to_response, _version_to_response, _transition,
_log_approval) and schemas are re-exported for existing tests. Two
transition tests updated to expect domain errors instead of HTTPException.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-04-09 08:47:56 +02:00
parent cc1c61947d
commit d2c94619d8
6 changed files with 1118 additions and 742 deletions

View File

@@ -93,5 +93,7 @@ ignore_errors = False
ignore_errors = False
[mypy-compliance.api.incident_routes]
ignore_errors = False
[mypy-compliance.api.legal_document_routes]
ignore_errors = False
[mypy-compliance.api._http_errors]
ignore_errors = False