refactor: move letzshop endpoints to marketplace module and add vendor service tests
Move letzshop-related functionality from tenancy to marketplace module: - Move admin letzshop routes to marketplace/routes/api/admin_letzshop.py - Move letzshop schemas to marketplace/schemas/letzshop.py - Remove letzshop code from tenancy module (admin_vendors, vendor_service) - Update model exports and imports Add comprehensive unit tests for vendor services: - test_company_service.py: Company management operations - test_platform_service.py: Platform management operations - test_vendor_domain_service.py: Vendor domain operations - test_vendor_team_service.py: Vendor team management Update module definitions: - billing, messaging, payments: Minor definition updates Add architecture proposals documentation: - Module dependency redesign session notes - Decouple modules implementation plan - Module decoupling proposal Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,9 +21,6 @@ from app.modules.tenancy.schemas.company import (
|
||||
|
||||
# Vendor schemas
|
||||
from app.modules.tenancy.schemas.vendor import (
|
||||
LetzshopExportFileInfo,
|
||||
LetzshopExportRequest,
|
||||
LetzshopExportResponse,
|
||||
VendorCreate,
|
||||
VendorCreateResponse,
|
||||
VendorDetailResponse,
|
||||
@@ -125,9 +122,6 @@ __all__ = [
|
||||
"CompanyTransferOwnershipResponse",
|
||||
"CompanyUpdate",
|
||||
# Vendor
|
||||
"LetzshopExportFileInfo",
|
||||
"LetzshopExportRequest",
|
||||
"LetzshopExportResponse",
|
||||
"VendorCreate",
|
||||
"VendorCreateResponse",
|
||||
"VendorDetailResponse",
|
||||
|
||||
@@ -312,40 +312,21 @@ class VendorSummary(BaseModel):
|
||||
# Ownership transfer is now handled at the Company level.
|
||||
# See models/schema/company.py for CompanyTransferOwnership and CompanyTransferOwnershipResponse.
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# LETZSHOP EXPORT SCHEMAS
|
||||
# ============================================================================
|
||||
# NOTE: Letzshop export schemas have been moved to app.modules.marketplace.schemas.letzshop
|
||||
# See LetzshopExportRequest, LetzshopExportFileInfo, LetzshopExportResponse
|
||||
|
||||
|
||||
class LetzshopExportRequest(BaseModel):
|
||||
"""Request body for Letzshop export to pickup folder."""
|
||||
# Re-export VendorStatsResponse from core for convenience
|
||||
# This allows tenancy routes to use this schema without importing from core directly
|
||||
from app.modules.core.schemas.dashboard import VendorStatsResponse
|
||||
|
||||
include_inactive: bool = Field(
|
||||
default=False,
|
||||
description="Include inactive products in export"
|
||||
)
|
||||
|
||||
|
||||
class LetzshopExportFileInfo(BaseModel):
|
||||
"""Info about an exported file."""
|
||||
|
||||
language: str
|
||||
filename: str | None = None
|
||||
path: str | None = None
|
||||
size_bytes: int | None = None
|
||||
error: str | None = None
|
||||
|
||||
|
||||
class LetzshopExportResponse(BaseModel):
|
||||
"""Response from Letzshop export to folder."""
|
||||
|
||||
success: bool
|
||||
message: str
|
||||
vendor_code: str
|
||||
export_directory: str
|
||||
files: list[LetzshopExportFileInfo]
|
||||
celery_task_id: str | None = None # Set when using Celery async export
|
||||
is_async: bool = Field(default=False, serialization_alias="async") # True when queued via Celery
|
||||
|
||||
model_config = {"populate_by_name": True}
|
||||
__all__ = [
|
||||
"VendorCreate",
|
||||
"VendorUpdate",
|
||||
"VendorResponse",
|
||||
"VendorDetailResponse",
|
||||
"VendorCreateResponse",
|
||||
"VendorListResponse",
|
||||
"VendorSummary",
|
||||
"VendorStatsResponse",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user