diff --git a/docs/decisions/0034-creator-dashboard-routes.md b/docs/decisions/0034-creator-dashboard-routes.md new file mode 100644 index 0000000..ebc52b0 --- /dev/null +++ b/docs/decisions/0034-creator-dashboard-routes.md @@ -0,0 +1,23 @@ +# 0034 The creator's داشبورد is two tab routes, C7 a pushed page + +Status: Proposed · Area: architecture · Date: 2026-10-08 · Decided by: agent + +## Context + +Board 04 gives the creator two dashboard tabs, «طرح‌های اشتراک» (pricing card and مشترکان) and «مالی» (C19 + C20), and opens C7 as a full page behind «ویرایش قیمت‌ها» with no tab row and no bottom nav. The repo had placeholder routes `/dashboard/pricing` (under `(main)`), `/dashboard/finance/ledger` and `/dashboard/finance/sheba`. + +## Decision + +- The creator's tabs live in `dashboard/(creator)`, mirroring 0025: `/dashboard/plans` (the default; the nav's داشبورد links here) and `/dashboard/finance`, each with its own `loading.tsx`, under a layout with the bar or heading, `DashboardTabs role="creator"` and `OnboardingGuard`. +- C7 is `/dashboard/pricing` in `(flow)`: back · title · support on mobile, the header with back beside the title on desktop. +- The شبا form expands in place inside مالی and the ledger's details open in a bottom sheet (mobile) or side panel (desktop); `ledger` and `sheba` sub-routes are removed. Only the ledger tab is in the URL (`?ledger=payouts`). +- Each card (pricing, مشترکان, balance, شبا, ledger) is its own browser part with a same-size skeleton and `PartBoundary`; the payout-day notice is server-rendered, the same for every creator. + +## Alternatives + +- One `/dashboard` page with in-page tabs: one boundary for both tabs, and the URL couldn't open مالی (the SMS links to `/dashboard/finance`). +- Keep C7 under `(main)`: the bottom nav would show on a task page (R8). + +## Consequences + +The new_subscriber notice now links to `/dashboard/plans` (API). `ROUTES.dashboard.ledger` and `.sheba` are gone. diff --git a/docs/decisions/0035-promotion-date-picker-native-selects.md b/docs/decisions/0035-promotion-date-picker-native-selects.md new file mode 100644 index 0000000..606cc5a --- /dev/null +++ b/docs/decisions/0035-promotion-date-picker-native-selects.md @@ -0,0 +1,20 @@ +# 0035 A promotion's date and time are picked with native selects + +Status: Proposed · Area: design · Date: 2026-10-08 · Decided by: agent + +## Context + +C7 ۴.۳ draws a Shamsi wheel picker (day, month, year columns and a time row) in a bottom sheet. Island has no date picker, and a drawn wheel needs its own scroll physics, snapping and keyboard model. + +## Decision + +Pick a promotion's start and end with island `Select`s (day, month, year, hour, minute; minutes in steps of 5 plus 59) in a `Sheet` on mobile and a `Modal` on desktop, with «بدون تاریخ پایان» for an end. Phones draw native selects as wheels. Shamsi ↔ instant conversion is `@lumina/tools/jalali`, in Tehran time. + +## Alternatives + +- A drawn wheel: closer to the board, but a new interaction component to build and test for one field. +- ``: Gregorian only. + +## Consequences + +The desktop picker is a row of selects rather than columns. A real wheel can replace the body later without changing the form. diff --git a/docs/decisions/0036-promotions-save-during-lock.md b/docs/decisions/0036-promotions-save-during-lock.md new file mode 100644 index 0000000..0e1b72f --- /dev/null +++ b/docs/decisions/0036-promotions-save-during-lock.md @@ -0,0 +1,20 @@ +# 0036 Save stays live during the 7-day lock, for promotions + +Status: Proposed · Area: architecture · Date: 2026-10-08 · Decided by: agent + +## Context + +C7 ۶.۲ removes «ذخیره قیمت‌گذاری» during the lock while promotion controls stay live; the board leaves open how a promotion change is then committed. The API saves a promotion change during the lock and refuses only a standing-price or period change (409). + +## 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. + +## Alternatives + +- No save button (as drawn): a promotion set during the lock could never be stored. +- Save each promotion on toggle: a second commit path, unlike every other C7 change. + +## Consequences + +The locked form looks like the free one apart from the frozen fields and the notice. diff --git a/docs/decisions/0037-payout-receipts-through-the-session.md b/docs/decisions/0037-payout-receipts-through-the-session.md new file mode 100644 index 0000000..0dbedfb --- /dev/null +++ b/docs/decisions/0037-payout-receipts-through-the-session.md @@ -0,0 +1,19 @@ +# 0037 Payout receipts open through the creator's session, not signed URLs + +Status: Proposed · Area: architecture · Date: 2026-10-08 · Decided by: agent + +## Context + +C20 ۳.۷ opens a payout's receipt (an image in the lightbox, a PDF in a new tab) and downloads it "through a signed expiring URL". The API has no signed URLs; an admin uploads the receipt, so file-service's owner check would refuse the creator. + +## Decision + +The API streams a receipt from `GET /v1/payouts/me/payouts/:id/receipt` after checking the payout is the creator's (`?download=1` for an attachment). The browser loads it on its own origin through `/api` (0018), so the session cookie authorizes it; the repository maps each payout to `receipt { url, downloadUrl, isImage }`. + +## Alternatives + +- Signed expiring URLs: a signing secret and expiry handling in the gateway, for files that only their creator ever opens. + +## Consequences + +A receipt link only works in a signed-in browser of that creator; nothing expires to regenerate (C20 ۳.۸'s "expired link" case cannot happen). diff --git a/docs/decisions/README.md b/docs/decisions/README.md index 8522050..91b9670 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -35,3 +35,7 @@ - 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) 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. +- 0037 architecture: Open payout receipts from the API's session-authorized `/payouts/me/payouts/:id/receipt` through `/api`, not signed expiring URLs.