docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Amiram_se 2026-10-10 13:29:48 +04:00
parent 7a6cd93b41
commit 39d687ed79
8 changed files with 59 additions and 8 deletions

View File

@ -1,6 +1,6 @@
# 0032 The notification centre is a page on mobile and a panel on desktop
Status: Proposed · Area: architecture · Date: 2026-10-08 · Decided by: agent
Status: Superseded by 0058 · Area: architecture · Date: 2026-10-08 · Decided by: agent
## Context

View File

@ -8,7 +8,7 @@ C7 ۶.۲ removes «ذخیره قیمت‌گذاری» during the lock while prom
## Decision
During the lock, standing prices and period switches are read-only (50%), promotions stay editable, and the save button stays, so promotion changes go through the same check and confirmation as any save.
During the lock, standing prices and period switches are read-only (50%), promotions stay editable, and the save button stays as «ذخیره تخفیف», so promotion changes go through the promotion check and confirmation (J10-4m).
## Alternatives

View File

@ -1,6 +1,6 @@
# 0044 An invite link's code is kept per creator in the checkout draft
Status: Proposed · Area: architecture · Date: 2026-10-09 · Decided by: agent
Status: Superseded by 0059 · Area: architecture · Date: 2026-10-09 · Decided by: agent
## Context
Creators share `/@username?code=…` (J10-2). The code must survive a guest's login and reach that creator's checkout (J06-1b/1c, 2n/2o). 0030 keeps checkout state out of the URL.

View File

@ -1,6 +1,6 @@
# 0048 Composers check publish standing and publish idempotently
Status: Proposed · Area: architecture · Date: 2026-10-09 · Decided by: agent
Status: Superseded by 0060 · Area: architecture · Date: 2026-10-09 · Decided by: agent
## Context
A pending, rejected or suspended creator could open a composer by URL and fail only on publish. A retried publish could duplicate a post.

View File

@ -0,0 +1,18 @@
# 0058 Opening notifications clears the bell; a row is read when tapped
Status: Accepted · Area: architecture · Date: 2026-10-10 · Decided by: user · Supersedes: 0032
## Context
The new canvas (J07-5h, A9) keeps an unread dot on each row until it is tapped, while opening the list clears the bell count. 0032 marked everything read on open.
## Decision
- `ROUTES.notifications` (`/notifications`) is a `(main)` page in both apps; bull's bell links there, bear's header bell opens the 400px side panel, loaded on the first click; a direct visit renders the page.
- Opening the list records "seen" (`POST /v1/notifications/seen`), which zeroes the bell count. A row stays unread, with its dot, until it is tapped (`POST /v1/notifications/:id/read`).
- Creators get one list with filter chips «همه · پیش‌بینی‌ها · مالی · حساب» that filter in place; categories come from the notification type.
- The bell shows for a member of either role on every tab bar and the desktop header.
## Alternatives
- Mark all read on open (0032): loses which rows the person never looked at.
## Consequences
The API keeps `seenAt` per user beside each row's `readAt`.

View File

@ -0,0 +1,17 @@
# 0059 Checkout takes an invite code from its link once, then forgets the URL
Status: Accepted · Area: architecture · Date: 2026-10-10 · Decided by: user · Supersedes: 0044
## Context
J06-7: the capacity-opened alert and SMS open `/checkout/@user?code=…` with the investor's code applied. 0044 kept the code out of checkout's URL.
## Decision
- The channel reads `?code=` and checkout reads `?code=` on arrival. Either one saves it in the persisted `session.checkout-draft` store under `inviteCodes[creatorId]`, written only after the draft is restored.
- Checkout then removes `code` from the address bar with `router.replace`, fills the field, marks it as from the link and checks it.
- The code is dropped after a paid subscription to that creator or on sign-out.
## Alternatives
- Link the alert to the channel (0044): one extra tap before paying while capacity lasts.
## Consequences
A shared checkout link carries a code only until it is opened.

View File

@ -0,0 +1,16 @@
# 0060 An analyst who can't publish sees the reason on their own channel
Status: Accepted · Area: architecture · Date: 2026-10-10 · Decided by: user · Supersedes: 0048
## Context
J09-1e draws «پیش‌بینی جدید» for a pending, rejected or suspended analyst as the locked dialog over their own channel. 0048 rendered a locked page on `/compose/*`.
## Decision
- `/compose/post` and `/compose/prediction` read the creator's standing in the browser; when publishing is blocked they replace the route with the creator's own channel and open the locked dialog there (`?locked=post|prediction`, removed once shown). A 403 on publish re-reads the standing and does the same.
- Every publish sends an `Idempotency-Key` that stays the same while the body is unchanged and is renewed after any change or `IDEMPOTENCY_KEY_REUSED`.
## Alternatives
- A locked page on the composer route (0048): a second place for the same message.
## Consequences
Published predictions can't be edited or deleted (API `PREDICTION_LOCKED`).

View File

@ -21,6 +21,9 @@
- 0054 Set `htmlLimitedBots: /.*/` in both apps' `next.config.ts`, so every visitor gets metadata in `<head>`.
- 0055 Export static `metadata` from every layout and page; only the channel and post pages use `generateMetadata`, through the page's cached read.
- 0057 Back links to `parentHref` and traverses history only when that is the previous entry; `backToPrevious` pages (and pages without `parentHref`) accept any previous page.
- 0058 Opening notifications records "seen" and clears the bell; a row stays unread until tapped; creators filter one list by «همه · پیش‌بینی‌ها · مالی · حساب».
- 0059 Checkout and the channel save `?code=` into the per-creator checkout draft on arrival; checkout then strips it from the URL.
- 0060 Composers send a creator who can't publish to their own channel with the locked dialog; every publish carries a stable `Idempotency-Key`.
## Proposed
@ -40,21 +43,18 @@
- 0029 architecture: End every payment on `/payment/result/[paymentId]`; the API's bank callback returns to `/payment/return`, which polls the payment until settled (30 s at most) and replaces itself.
- 0030 architecture: Keep the last checkout's period, invite code and bank payment in the persisted `session.checkout-draft` store from payment start until success, and restore them on the same creator's checkout.
- 0031 design: List renew and reactivate periods as island `TierOption` cards, as checkout does, instead of R3's chip grid.
- 0032 architecture: Serve the notification centre at `/notifications` on mobile and as a lazily loaded side panel from bear's header bell; opening it marks all read.
- 0033 architecture: Keep the payment sent to the bank in the checkout draft and settle it through `POST /subscriptions/payments/:id/abandon` only on the page that came back from the bank (bfcache or a history load), triggered by the app shell and awaited by checkout's screen read.
- 0034 architecture: Serve the creator's داشبورد from `dashboard/(creator)` as `/dashboard/plans` (default), `/dashboard/predictions` and `/dashboard/finance`, and C7 at `/dashboard/pricing` in `(flow)`; the شبا form and ledger details open in place.
- 0035 design: Pick a promotion's Shamsi date and time with island `Select`s in a sheet or modal, not a drawn wheel.
- 0036 architecture: Keep «ذخیره قیمت‌گذاری» live during the 7-day lock so promotion changes save; standing prices and period switches stay read-only.
- 0036 architecture: During the 7-day lock the save button reads «ذخیره تخفیف» and saves promotion changes; standing prices and period switches stay read-only.
- 0037 architecture: Open payout receipts from the API's session-authorized `/payouts/me/payouts/:id/receipt` through `/api`, not signed expiring URLs.
- 0039 design: Place toasts above whatever draws the bottom edge, declared by that part (nav 80, pinned footer 152, desktop 32, low in sheets).
- 0040 architecture: Render the connection bar under the sticky bars, inside their sticky box, never above or over content.
- 0041 architecture: Confirm sign-out, call `auth.logout`, then reload to the landing.
- 0042 architecture: When a session ends mid-use, show the session-ended state and keep drafts; only an explicit sign-out clears drafts and `session.*` keys.
- 0043 architecture: Freeze every network action offline with island `useOfflineFreeze`, showing the reason.
- 0044 architecture: Keep an invite link's `?code=` per creator in the persisted checkout draft, applied by that creator's checkout; never put it in checkout's URL.
- 0045 architecture: The channel's server read carries the public follower count; the browser keeps it live and shows «مشترک فعال» only to the owner.
- 0046 architecture: Serve `/account/profile` in `(flow)` for both roles, switching investor form and creator profile edit in the browser.
- 0047 architecture: The pwa lib keeps the browser's install offer; offer install at `/account/install` and once on bull's خانه with a 30-day snooze; the manifest starts at `/feed`.
- 0048 architecture: Composer routes check publish standing and render the locked state; every publish sends an Idempotency-Key stable while the body is unchanged.
- 0049 design: A page error keeps the page's own bar, derived from the path; route groups without a frame pass `standalone`.
- 0050 design: A post being read shows an info toast when the reader's access ends mid-read (J05-4f), the one toast not tied to the reader's own action.