feat: multi-module improvements across merchant, store, i18n, and customer systems
All checks were successful
All checks were successful
- Fix platform-grouped merchant sidebar menu with core items at root level - Add merchant store management (detail page, create store, team page) - Fix store settings 500 error by removing dead stripe/API tab - Move onboarding translations to module-owned locale files - Fix onboarding banner i18n with server-side rendering + context inheritance - Refactor login language selectors to use languageSelector() function (LANG-002) - Move HTTPException handling to global exception handler in merchant routes (API-003) - Add language selector to all login pages and portal headers - Fix customer module: drop order stats from customer model, add to orders module - Fix admin menu config visibility for super admin platform context - Fix storefront auth and layout issues - Add missing i18n translations for onboarding steps (en/fr/de/lb) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""orders 002 - customer order stats table
|
||||
|
||||
Revision ID: orders_002
|
||||
Revises: orders_001
|
||||
Create Date: 2026-03-07
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = "orders_002"
|
||||
down_revision = "orders_001"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"customer_order_stats",
|
||||
sa.Column("id", sa.Integer(), primary_key=True, index=True),
|
||||
sa.Column("store_id", sa.Integer(), sa.ForeignKey("stores.id"), nullable=False, index=True),
|
||||
sa.Column("customer_id", sa.Integer(), sa.ForeignKey("customers.id"), nullable=False, index=True),
|
||||
sa.Column("total_orders", sa.Integer(), nullable=False, server_default="0"),
|
||||
sa.Column("total_spent_cents", sa.Integer(), nullable=False, server_default="0"),
|
||||
sa.Column("last_order_date", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column("first_order_date", sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column("created_at", sa.DateTime(), server_default=sa.func.now(), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(), server_default=sa.func.now(), nullable=False),
|
||||
sa.UniqueConstraint("store_id", "customer_id", name="uq_customer_order_stats_store_customer"),
|
||||
)
|
||||
op.create_index("idx_customer_order_stats_customer", "customer_order_stats", ["customer_id"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_table("customer_order_stats")
|
||||
Reference in New Issue
Block a user