feat: complete marketplace module migration (Phase 6)

Migrates marketplace module to self-contained structure:
- Create app/modules/marketplace/services/ re-exporting from existing locations
- Create app/modules/marketplace/models/ with marketplace & letzshop models
- Create app/modules/marketplace/schemas/ with product & import schemas
- Create app/modules/marketplace/tasks/ with 5 Celery tasks:
  - process_marketplace_import - CSV product import
  - process_historical_import - Letzshop order import
  - sync_vendor_directory - Scheduled daily vendor sync
  - export_vendor_products_to_folder - Multi-language export
  - export_marketplace_products - Admin export
- Create app/modules/marketplace/exceptions.py
- Update definition.py with is_self_contained=True and scheduled_tasks

Celery task migration:
- process_marketplace_import, process_historical_import -> import_tasks.py
- sync_vendor_directory -> sync_tasks.py (scheduled daily at 02:00)
- export_vendor_products_to_folder, export_marketplace_products -> export_tasks.py

Backward compatibility:
- Legacy task files now re-export from new locations
- Remove marketplace/letzshop/export from LEGACY_TASK_MODULES

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-27 23:19:31 +01:00
parent 4f379b472b
commit eb47daec8b
15 changed files with 1088 additions and 704 deletions

View File

@@ -0,0 +1,61 @@
# app/modules/marketplace/services/__init__.py
"""
Marketplace module services.
Re-exports Letzshop and marketplace services from their current locations.
Services remain in app/services/ for now to avoid breaking existing imports.
Usage:
from app.modules.marketplace.services import (
letzshop_export_service,
marketplace_import_job_service,
marketplace_product_service,
)
from app.modules.marketplace.services.letzshop import (
LetzshopClient,
LetzshopCredentialsService,
LetzshopOrderService,
LetzshopVendorSyncService,
)
"""
# Re-export from existing locations for convenience
from app.services.letzshop_export_service import (
LetzshopExportService,
letzshop_export_service,
)
from app.services.marketplace_import_job_service import (
MarketplaceImportJobService,
marketplace_import_job_service,
)
from app.services.marketplace_product_service import (
MarketplaceProductService,
marketplace_product_service,
)
# Letzshop submodule re-exports
from app.services.letzshop import (
LetzshopClient,
LetzshopClientError,
)
from app.services.letzshop.credentials_service import LetzshopCredentialsService
from app.services.letzshop.order_service import LetzshopOrderService
from app.services.letzshop.vendor_sync_service import LetzshopVendorSyncService
__all__ = [
# Export service
"LetzshopExportService",
"letzshop_export_service",
# Import job service
"MarketplaceImportJobService",
"marketplace_import_job_service",
# Product service
"MarketplaceProductService",
"marketplace_product_service",
# Letzshop services
"LetzshopClient",
"LetzshopClientError",
"LetzshopCredentialsService",
"LetzshopOrderService",
"LetzshopVendorSyncService",
]