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:
+17
-2
@@ -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] = []
|
||||
|
||||
Reference in New Issue
Block a user