Money Handling Architecture: - Store all monetary values as integer cents (€105.91 = 10591) - Add app/utils/money.py with Money class and conversion helpers - Add static/shared/js/money.js for frontend formatting - Update all database models to use _cents columns (Product, Order, etc.) - Update CSV processor to convert prices to cents on import - Add Alembic migration for Float to Integer conversion - Create .architecture-rules/money.yaml with 7 validation rules - Add docs/architecture/money-handling.md documentation Order Details Page Fixes: - Fix customer name showing 'undefined undefined' - use flat field names - Fix vendor info empty - add vendor_name/vendor_code to OrderDetailResponse - Fix shipping address using wrong nested object structure - Enrich order detail API response with vendor info Vendor Filter Persistence Fixes: - Fix orders.js: restoreSavedVendor now sets selectedVendor and filters - Fix orders.js: init() only loads orders if no saved vendor to restore - Fix marketplace-letzshop.js: restoreSavedVendor calls selectVendor() - Fix marketplace-letzshop.js: clearVendorSelection clears TomSelect dropdown - Align vendor selector placeholder text between pages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
108 lines
3.4 KiB
YAML
108 lines
3.4 KiB
YAML
# Architecture Rules - Main Configuration
|
|
# This file defines core settings and includes domain-specific rule files.
|
|
|
|
version: "2.0"
|
|
project: "letzshop-product-import"
|
|
description: "Comprehensive architectural rules for multi-tenant e-commerce platform"
|
|
|
|
# ============================================================================
|
|
# CORE ARCHITECTURAL PRINCIPLES
|
|
# ============================================================================
|
|
|
|
principles:
|
|
- name: "Separation of Concerns"
|
|
description: "API endpoints should only handle HTTP concerns. Business logic belongs in services."
|
|
|
|
- name: "Layered Architecture"
|
|
description: "Routes → Services → Models. Each layer has specific responsibilities."
|
|
|
|
- name: "Type Safety"
|
|
description: "Use Pydantic models for request/response validation. Use SQLAlchemy models for database."
|
|
|
|
- name: "Proper Exception Handling"
|
|
description: "Services throw domain exceptions. Global handler converts to HTTP responses. Endpoints do NOT catch or raise HTTPException."
|
|
|
|
- name: "Multi-Tenancy"
|
|
description: "All queries must be scoped to vendor_id. No cross-vendor data access."
|
|
|
|
- name: "Consistent Naming"
|
|
description: "API files: plural, Services: singular+service, Models: singular"
|
|
|
|
- name: "Integer Cents Money"
|
|
description: "All monetary values stored as integer cents. Convert to euros only at display layer. See docs/architecture/money-handling.md"
|
|
|
|
# ============================================================================
|
|
# RULE FILE INCLUDES
|
|
# ============================================================================
|
|
|
|
includes:
|
|
- api.yaml
|
|
- service.yaml
|
|
- model.yaml
|
|
- exception.yaml
|
|
- naming.yaml
|
|
- auth.yaml
|
|
- middleware.yaml
|
|
- frontend.yaml
|
|
- language.yaml
|
|
- quality.yaml
|
|
- money.yaml
|
|
|
|
# ============================================================================
|
|
# VALIDATION SEVERITY LEVELS
|
|
# ============================================================================
|
|
|
|
severity_levels:
|
|
error:
|
|
description: "Critical architectural violation - must be fixed"
|
|
exit_code: 1
|
|
|
|
warning:
|
|
description: "Pattern deviation - should be fixed"
|
|
exit_code: 0
|
|
|
|
info:
|
|
description: "Suggestion for improvement"
|
|
exit_code: 0
|
|
|
|
# ============================================================================
|
|
# IGNORED PATTERNS
|
|
# ============================================================================
|
|
|
|
ignore:
|
|
files:
|
|
- "**/*_test.py"
|
|
- "**/test_*.py"
|
|
- "**/__pycache__/**"
|
|
- "**/migrations/**"
|
|
- "**/alembic/versions/**"
|
|
- "**/node_modules/**"
|
|
- "**/.venv/**"
|
|
- "**/venv/**"
|
|
- ".venv/**"
|
|
- "venv/**"
|
|
- "**/build/**"
|
|
- "**/dist/**"
|
|
|
|
patterns:
|
|
# Allow HTTPException in specific files
|
|
- file: "app/core/exceptions.py"
|
|
pattern: "HTTPException"
|
|
reason: "Exception handling utilities"
|
|
|
|
- file: "app/exceptions/handler.py"
|
|
pattern: "HTTPException"
|
|
reason: "Exception handler converts to HTTP"
|
|
|
|
# ============================================================================
|
|
# DOCUMENTATION
|
|
# ============================================================================
|
|
|
|
documentation:
|
|
architecture: "docs/architecture/overview.md"
|
|
backend: "docs/backend/overview.md"
|
|
frontend: "docs/frontend/overview.md"
|
|
contributing: "docs/development/contributing.md"
|
|
code_quality: "docs/development/code-quality.md"
|
|
money_handling: "docs/architecture/money-handling.md"
|