docs(decisions): propose 0014, registration step 5 on the session

Step 5 runs under (onboarding) behind AuthGuard; a creator's profile
autosaves as a server draft and completes only through
POST /traders/me/profile/complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Amiram_se 2026-10-05 22:33:00 +04:00
parent a6e6eddc94
commit 0d2528d66f
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# 0014 Registration step 5 on the session, with a server draft
Status: Proposed · Area: architecture · Date: 2026-10-05 · Decided by: agent
## Context
Step 5 (profile completion) runs after the account exists, so it can't sit behind `GuestGuard` like the other `(auth)` steps (0013). The design autosaves a creator's profile and lets them resume after a login, but the API had no draft: any save completed the profile. The user chose to fix the back end first.
## Decision
- Serve step 5 at `/onboarding/creator-profile` and `/onboarding/investor-profile` under `(onboarding)`, rendered only in the browser behind `AuthGuard` with the role, behind a same-size skeleton, with `noindex`.
- A creator's step 5 autosaves through `PATCH /traders/me/profile` (a draft, markets may be empty) and ends only with `POST /traders/me/profile/complete`; `profileComplete` needs that call.
- An investor's step 5 saves nothing until «ذخیره و ورود» (`PUT /users/profile/avatar`, then `PATCH /users/profile` with `interests`).
## Alternatives
- Autosave with `PUT`: rejected; it completes the profile at the first market, so resume after login breaks.
- Keep the draft in local storage: rejected; it would hold profile data in the browser and not follow the creator to another device.
## Consequences
- Login lands an unfinished creator on step 5 until they complete it (`profileComplete` is false).
- Posting and tiers stay locked by the back end until completion.

View File

@ -16,3 +16,4 @@
- 0003 design: Only semantic tokens, named as in the Lumina Design System, produce Tailwind utilities (`@theme inline`); primitives stay plain `:root` variables and Tailwind's defaults are removed.
- 0005 design: Island holds Lumina's product components and status-to-tone map; they take every text as props (`children` or `labels`) and never import i18next or platform code.
- 0006 architecture: Make every non-app project a pnpm workspace package `@lumina/<name>` with subpath `exports`; third-party dependencies stay in the root package.json.
- 0014 architecture: Serve registration step 5 under `(onboarding)` behind `AuthGuard`; a creator's profile autosaves as a server draft (`PATCH`) and completes only through `POST …/profile/complete`.