feat: module-driven onboarding system + simplified 3-step signup
Add OnboardingProviderProtocol so modules declare their own post-signup onboarding steps. The core OnboardingAggregator discovers enabled providers and exposes a dashboard API (GET /dashboard/onboarding). A session-scoped banner on the store dashboard shows a checklist that guides merchants through setup without blocking signup. Signup is simplified from 4 steps to 3 (Plan → Account → Payment): store creation is merged into account creation, store language is captured from the user's browsing language, and platform-specific template branching is removed. Includes 47 unit and integration tests covering all new providers, the aggregator, the API endpoint, and the signup service changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,7 @@ from app.modules.core.schemas.dashboard import (
|
||||
StoreProductStats,
|
||||
StoreRevenueStats,
|
||||
)
|
||||
from app.modules.core.services.onboarding_aggregator import onboarding_aggregator
|
||||
from app.modules.core.services.stats_aggregator import stats_aggregator
|
||||
from app.modules.tenancy.exceptions import StoreNotActiveException
|
||||
from app.modules.tenancy.schemas.auth import UserContext
|
||||
@@ -124,3 +125,27 @@ def get_store_dashboard_stats(
|
||||
this_month=float(revenue_this_month),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@store_dashboard_router.get("/onboarding")
|
||||
def get_onboarding_status(
|
||||
request: Request,
|
||||
current_user: UserContext = Depends(get_current_store_api),
|
||||
platform=Depends(require_platform),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""
|
||||
Get onboarding checklist status for the current store.
|
||||
|
||||
Returns steps from all enabled modules with completion status,
|
||||
progress percentage, and whether all steps are completed.
|
||||
"""
|
||||
store_id = current_user.token_store_id
|
||||
store = store_service.get_store_by_id(db, store_id)
|
||||
|
||||
return onboarding_aggregator.get_onboarding_summary(
|
||||
db=db,
|
||||
store_id=store_id,
|
||||
platform_id=platform.id,
|
||||
store_code=store.store_code,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user