feat(api): implement /extract and /validate endpoints with error handling

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
m3tm3re
2026-02-04 20:07:35 +01:00
co-authored by Sisyphus
parent 4791c91f06
commit 867b47efd0
5 changed files with 263 additions and 7 deletions
+17 -2
View File
@@ -257,11 +257,26 @@ def validate_invoice(request: ValidateRequest) -> ValidationResult:
all_errors = []
all_warnings = []
xml_data = XmlData(**request.xml_data)
checks_run = 0
checks_passed = 0
if not request.checks:
return ValidationResult(
is_valid=True,
errors=[],
warnings=[],
summary={
"total_checks": 0,
"checks_passed": 0,
"checks_failed": 0,
"critical_errors": 0,
"warnings": 0,
},
validation_time_ms=0,
)
xml_data = XmlData(**request.xml_data)
# Run requested checks
for check_name in request.checks:
check_errors: list[ErrorDetail] = []