From 0d2528d66f08ecafadeeaf7ac300ee2b59bb875a Mon Sep 17 00:00:00 2001 From: Amiram_se Date: Mon, 5 Oct 2026 22:33:00 +0400 Subject: [PATCH] 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 --- ...0014-registration-step-5-on-the-session.md | 19 +++++++++++++++++++ docs/decisions/README.md | 1 + 2 files changed, 20 insertions(+) create mode 100644 docs/decisions/0014-registration-step-5-on-the-session.md diff --git a/docs/decisions/0014-registration-step-5-on-the-session.md b/docs/decisions/0014-registration-step-5-on-the-session.md new file mode 100644 index 0000000..bc130c6 --- /dev/null +++ b/docs/decisions/0014-registration-step-5-on-the-session.md @@ -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. diff --git a/docs/decisions/README.md b/docs/decisions/README.md index 032c155..6c763d4 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -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/` 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`.