fix: add historical import jobs to unified jobs list

Historical import jobs were not appearing in the recent jobs list because
list_letzshop_jobs() only queried marketplace_import_jobs and letzshop_sync_logs.

Changes:
- Add LetzshopHistoricalImportJob query to list_letzshop_jobs()
- Add current_phase and error_message fields to LetzshopJobItem schema
- Fixed stuck job 8 (marked as failed)

🤖 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 13:18:07 +01:00
parent d6d658dd85
commit 49523fe6fe
2 changed files with 42 additions and 4 deletions

View File

@@ -397,10 +397,12 @@ class LetzshopVendorListResponse(BaseModel):
class LetzshopJobItem(BaseModel):
"""Schema for a unified job item (import, export, or order sync)."""
"""Schema for a unified job item (import, export, order sync, or historical import)."""
id: int
type: str = Field(..., description="Job type: import, export, or order_sync")
type: str = Field(
..., description="Job type: import, export, order_sync, or historical_import"
)
status: str = Field(..., description="Job status")
created_at: datetime
started_at: datetime | None = None
@@ -408,6 +410,11 @@ class LetzshopJobItem(BaseModel):
records_processed: int = 0
records_succeeded: int = 0
records_failed: int = 0
# Historical import specific fields
current_phase: str | None = Field(
None, description="Current phase for historical imports"
)
error_message: str | None = Field(None, description="Error message if failed")
class LetzshopJobsListResponse(BaseModel):