Fixed ui and template mapping issue
This commit is contained in:
@@ -58,11 +58,7 @@ class DocumentProcessingService:
|
||||
metadata["layout"] = layout_results
|
||||
document.document_metadata = metadata
|
||||
|
||||
# Step 3: Generate template
|
||||
self.db.refresh(document)
|
||||
template = self.template_service.generate_template(document)
|
||||
|
||||
# Step 4: Update document status
|
||||
# Step 3: Update document status
|
||||
self.doc_repo.update_status(document_id, "completed")
|
||||
self.db.commit()
|
||||
|
||||
@@ -70,7 +66,6 @@ class DocumentProcessingService:
|
||||
"processing_completed",
|
||||
document_id=str(document_id),
|
||||
pages=document.page_count,
|
||||
template_id=str(template.id),
|
||||
)
|
||||
|
||||
return document
|
||||
|
||||
@@ -187,7 +187,7 @@ class FingerprintService:
|
||||
serialized = json.dumps(normalized, sort_keys=True, default=str)
|
||||
return hashlib.sha256(serialized.encode()).hexdigest()
|
||||
|
||||
def _normalize_coordinates(self, data: dict[str, Any]) -> dict[str, Any]:
|
||||
def _normalize_coordinates(self, data: Any) -> Any:
|
||||
"""Normalize coordinates by rounding to reduce sensitivity to small variations."""
|
||||
if isinstance(data, dict):
|
||||
return {k: self._normalize_coordinates(v) for k, v in data.items()}
|
||||
|
||||
@@ -80,6 +80,7 @@ class TemplateService:
|
||||
description=f"Auto-generated template from {document.original_filename}",
|
||||
source_document_id=document.id,
|
||||
created_by=user_id,
|
||||
is_active=False,
|
||||
)
|
||||
|
||||
# Process each page
|
||||
|
||||
Reference in New Issue
Block a user