Initial account microservice
Account dashboard, newsletters, widget pages (tickets, bookings). OAuth SSO client via shared blueprint — per-app first-party cookies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
48
app.py
Normal file
48
app.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from __future__ import annotations
|
||||
import path_setup # noqa: F401 # adds shared/ to sys.path
|
||||
|
||||
from quart import g
|
||||
|
||||
from shared.infrastructure.factory import create_base_app
|
||||
from shared.services.registry import services
|
||||
|
||||
from bp import register_account_bp
|
||||
|
||||
|
||||
async def account_context() -> dict:
|
||||
"""Account app context processor."""
|
||||
from shared.infrastructure.context import base_context
|
||||
from shared.services.navigation import get_navigation_tree
|
||||
from shared.infrastructure.cart_identity import current_cart_identity
|
||||
|
||||
ctx = await base_context()
|
||||
|
||||
ctx["menu_items"] = await get_navigation_tree(g.s)
|
||||
|
||||
# Cart data (consistent with all other apps)
|
||||
ident = current_cart_identity()
|
||||
summary = await services.cart.cart_summary(
|
||||
g.s, user_id=ident["user_id"], session_id=ident["session_id"],
|
||||
)
|
||||
ctx["cart_count"] = summary.count + summary.calendar_count + summary.ticket_count
|
||||
ctx["cart_total"] = float(summary.total + summary.calendar_total + summary.ticket_total)
|
||||
|
||||
return ctx
|
||||
|
||||
|
||||
def create_app() -> "Quart":
|
||||
from services import register_domain_services
|
||||
|
||||
app = create_base_app(
|
||||
"account",
|
||||
context_fn=account_context,
|
||||
domain_services_fn=register_domain_services,
|
||||
)
|
||||
|
||||
# --- blueprints ---
|
||||
app.register_blueprint(register_account_bp())
|
||||
|
||||
return app
|
||||
|
||||
|
||||
app = create_app()
|
||||
Reference in New Issue
Block a user