diff --git a/docs/decisions/0032-notification-centre-page-and-panel.md b/docs/decisions/0032-notification-centre-page-and-panel.md index 981f6a0..ca4e8d3 100644 --- a/docs/decisions/0032-notification-centre-page-and-panel.md +++ b/docs/decisions/0032-notification-centre-page-and-panel.md @@ -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 diff --git a/docs/decisions/0036-promotions-save-during-lock.md b/docs/decisions/0036-promotions-save-during-lock.md index 0e1b72f..ebad41c 100644 --- a/docs/decisions/0036-promotions-save-during-lock.md +++ b/docs/decisions/0036-promotions-save-during-lock.md @@ -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 diff --git a/docs/decisions/0044-invite-codes-kept-per-creator.md b/docs/decisions/0044-invite-codes-kept-per-creator.md index 1ad9b52..bcf8b4a 100644 --- a/docs/decisions/0044-invite-codes-kept-per-creator.md +++ b/docs/decisions/0044-invite-codes-kept-per-creator.md @@ -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. diff --git a/docs/decisions/0048-publish-guard-and-idempotency.md b/docs/decisions/0048-publish-guard-and-idempotency.md index c695725..ae3332c 100644 --- a/docs/decisions/0048-publish-guard-and-idempotency.md +++ b/docs/decisions/0048-publish-guard-and-idempotency.md @@ -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. diff --git a/docs/decisions/0058-notifications-seen-and-read.md b/docs/decisions/0058-notifications-seen-and-read.md new file mode 100644 index 0000000..7ee839f --- /dev/null +++ b/docs/decisions/0058-notifications-seen-and-read.md @@ -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`. diff --git a/docs/decisions/0059-invite-code-in-checkout-link.md b/docs/decisions/0059-invite-code-in-checkout-link.md new file mode 100644 index 0000000..283e77d --- /dev/null +++ b/docs/decisions/0059-invite-code-in-checkout-link.md @@ -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. diff --git a/docs/decisions/0060-compose-lock-on-own-channel.md b/docs/decisions/0060-compose-lock-on-own-channel.md new file mode 100644 index 0000000..30bbcf0 --- /dev/null +++ b/docs/decisions/0060-compose-lock-on-own-channel.md @@ -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`). diff --git a/docs/decisions/README.md b/docs/decisions/README.md index 8ffb491..f9315a7 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -21,6 +21,9 @@ - 0054 Set `htmlLimitedBots: /.*/` in both apps' `next.config.ts`, so every visitor gets metadata in ``. - 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.