refactor: product independence - remove inheritance pattern

Change Product/ProductTranslation from "override/inheritance" pattern
(NULL = inherit from marketplace) to "independent copy" pattern
(all fields populated at creation).

Key changes:
- Remove OVERRIDABLE_FIELDS, effective_* properties, reset_* methods
- Rename get_override_info() → get_source_comparison_info()
- Update copy_to_vendor_catalog() to copy ALL fields + translations
- Replace effective_* with direct field access in services
- Remove *_overridden fields from schema, keep *_source for comparison
- Add migration to populate NULL fields from marketplace products

The marketplace_product_id FK is kept for "view original source" feature.
Rollback tag: v1.0.0-pre-product-independence

🤖 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-24 23:41:20 +01:00
parent 4ba911e263
commit 508e121a0e
10 changed files with 444 additions and 418 deletions

View File

@@ -107,7 +107,7 @@ def create_dummy_order(
customer_email = f"{customer_first.lower()}.{customer_last.lower()}@example.lu"
# Calculate totals in cents
subtotal_cents = sum((p.effective_price_cents or 0) * random.randint(1, 3) for p in products[:items_count])
subtotal_cents = sum((p.price_cents or 0) * random.randint(1, 3) for p in products[:items_count])
shipping_cents = 595 # €5.95
total_cents = subtotal_cents + shipping_cents
@@ -180,8 +180,8 @@ def create_dummy_order(
# Create order items with prices in cents
for i, product in enumerate(products[:items_count]):
quantity = random.randint(1, 3)
unit_price_cents = product.effective_price_cents or 0
product_name = product.get_effective_title("en") or f"Product {product.id}"
unit_price_cents = product.price_cents or 0
product_name = product.get_title("en") or f"Product {product.id}"
item = OrderItem(
order_id=order.id,
product_id=product.id,