feat: enhance vendor product edit form with all mandatory fields
- Add translations support with language tabs (EN, FR, DE, LU) - Add product identifiers: vendor SKU with auto-generate, brand, GTIN, GTIN type - Add pricing fields: price (incl. VAT), sale price, currency, VAT rate - Add primary image field with preview - Add product status (active, featured) checkboxes - Add optional supplier info section - Pre-populate form with existing product data from API - Add form validation (isFormValid method) - Make is_digital read-only (derived from marketplace product) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,9 @@ class VendorProductDetail(BaseModel):
|
||||
vendor_code: str | None = None
|
||||
marketplace_product_id: int
|
||||
vendor_sku: str | None = None
|
||||
# Product identifiers
|
||||
gtin: str | None = None
|
||||
gtin_type: str | None = None # ean13, ean8, upc, isbn, etc.
|
||||
# Product fields with source comparison
|
||||
price: float | None = None
|
||||
price_cents: int | None = None
|
||||
@@ -163,20 +166,41 @@ class VendorProductCreate(BaseModel):
|
||||
description: str | None = None
|
||||
|
||||
|
||||
class TranslationUpdate(BaseModel):
|
||||
"""Translation data for a single language."""
|
||||
|
||||
title: str | None = None
|
||||
description: str | None = None
|
||||
|
||||
|
||||
class VendorProductUpdate(BaseModel):
|
||||
"""Schema for updating a vendor product."""
|
||||
|
||||
title: str | None = None
|
||||
# Translations by language code (en, fr, de, lu)
|
||||
translations: dict[str, TranslationUpdate] | None = None
|
||||
|
||||
# Product identifiers
|
||||
brand: str | None = None
|
||||
vendor_sku: str | None = None
|
||||
gtin: str | None = None
|
||||
price_override: float | None = None
|
||||
currency_override: str | None = None
|
||||
availability: str | None = None
|
||||
gtin_type: str | None = None # ean13, ean8, upc, isbn, etc.
|
||||
|
||||
# Pricing
|
||||
price: float | None = None # Price incl. VAT in euros
|
||||
sale_price: float | None = None # Optional sale price
|
||||
currency: str | None = None
|
||||
tax_rate_percent: int | None = None # 3, 8, 14, 17
|
||||
|
||||
# Status (is_digital is derived from marketplace product, not editable)
|
||||
is_active: bool | None = None
|
||||
is_featured: bool | None = None
|
||||
is_digital: bool | None = None
|
||||
description: str | None = None
|
||||
|
||||
# Images
|
||||
primary_image_url: str | None = None
|
||||
|
||||
# Optional supplier info
|
||||
supplier: str | None = None
|
||||
cost: float | None = None # Cost in euros
|
||||
|
||||
|
||||
class VendorProductCreateResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user