feat: add export job tracking to Letzshop jobs tab

- Export operations now create LetzshopSyncLog entries with type 'product_export'
- Added log_export method to LetzshopExportService (follows architecture rules)
- Updated list_letzshop_jobs to include export jobs
- Added export filter option back to jobs dropdown
- Export jobs display with blue badge and cloud-upload icon

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-20 22:53:53 +01:00
parent ee690e95c9
commit b841607a05
4 changed files with 108 additions and 1 deletions

View File

@@ -708,6 +708,34 @@ class LetzshopOrderService:
}
)
# Product exports from letzshop_sync_logs
if job_type in (None, "export"):
export_query = self.db.query(LetzshopSyncLog).filter(
LetzshopSyncLog.vendor_id == vendor_id,
LetzshopSyncLog.operation_type == "product_export",
)
if status:
export_query = export_query.filter(LetzshopSyncLog.status == status)
export_logs = export_query.order_by(
LetzshopSyncLog.created_at.desc()
).all()
for log in export_logs:
jobs.append(
{
"id": log.id,
"type": "export",
"status": log.status,
"created_at": log.created_at,
"started_at": log.started_at,
"completed_at": log.completed_at,
"records_processed": log.records_processed or 0,
"records_succeeded": log.records_succeeded or 0,
"records_failed": log.records_failed or 0,
}
)
# Sort all jobs by created_at descending
jobs.sort(key=lambda x: x["created_at"], reverse=True)