Account #6

Open
opened 2026-10-23 03:31:57 -07:00 by westfarn · 0 comments
Owner

Part of #1.

Web route: /account/ (protected). Signed-out users are sent to Sign in.
Source: llm-fe/src/llm-fe/pages/Account2/Account2.tsx and the cards it mounts.

Screenshot

Not attached. /account/ redirects to Sign in without a session. Capture after sign-in: theme, usage, billing, company or account card, delete account.

Behavior

Same header as Dashboard. Page is a vertical stack of cards:

  1. Theme. Dark mode toggle and palette (blue, green, purple, orange, red from the web palettes). Those two are local UI state (ThemeContext), not a REST resource. Conversation list order and “use conversation context” are saved to the API.
  2. Usage. Prompt quota meter from the subscription payload. Upgrade opens billing (Stripe portal on web; Play purchase on Android).
  3. Billing. Plan, invoices, payments. Web starts Stripe Checkout or the customer portal. Android must use RevenueCat purchase and restore, then confirm on the backend. Do not open Stripe or the /billing/success and /billing/cancel routes.
  4. Company accounts only when account.is_company_manager. Table of email, first name, last name, manager, active, has password, delete. Invite card asks for an email. Non-managers see a short “Account Information” placeholder instead of the table.
  5. Delete account. Confirm, then deactivate. Copy says conversations are hidden and the user is signed out. Cannot be undone in the app. Success returns to Sign in.

Manager toggles: cannot toggle manager on your own row. Has-password toggle is disabled until the user already has a password; the checkbox shows checked only when has_password && has_signed_tos.

API

Call Purpose
GET /conversation_preferences { order, use_conversation_context }.
POST /conversation_preferences Body { order } or { use_conversation_context }.
GET /monetization/subscription/ Plan and usage (including prompt_quota).
GET /monetization/invoices/ Invoice list. Also gates the web billing portal.
GET /monetization/payments/ Payment list.
GET /monetization/plans/ Plan catalog for the picker.
POST /monetization/checkout/ Web only. { success_url, cancel_url, plan_slug? }.
POST /monetization/portal/ Web only. Returns portal_url.
POST /monetization/store/confirm/ Android/RevenueCat entitlement confirm (storeBilling.ts).
GET /company_users Manager roster.
POST /user/invite/ Body { email }.
POST /company_users Body { email, field, value }. field is company_manager, is_active, or has_password. value is the string "true" or "false".
DELETE /company_users Body { email }.
DELETE /user/ Body { refresh_token } when one exists. Then POST blacklist/ and clear the session.

Android

Replace AccountScreen. Billing section is RevenueCat (subscribe, restore, manage) with provider badge revenuecat + PLAY_STORE.

Part of #1. Web route: `/account/` (protected). Signed-out users are sent to Sign in. Source: `llm-fe/src/llm-fe/pages/Account2/Account2.tsx` and the cards it mounts. ## Screenshot Not attached. `/account/` redirects to Sign in without a session. Capture after sign-in: theme, usage, billing, company or account card, delete account. ## Behavior Same header as Dashboard. Page is a vertical stack of cards: 1. **Theme.** Dark mode toggle and palette (`blue`, `green`, `purple`, `orange`, `red` from the web palettes). Those two are local UI state (`ThemeContext`), not a REST resource. Conversation list order and “use conversation context” are saved to the API. 2. **Usage.** Prompt quota meter from the subscription payload. Upgrade opens billing (Stripe portal on web; Play purchase on Android). 3. **Billing.** Plan, invoices, payments. Web starts Stripe Checkout or the customer portal. Android must use RevenueCat purchase and restore, then confirm on the backend. Do not open Stripe or the `/billing/success` and `/billing/cancel` routes. 4. **Company accounts** only when `account.is_company_manager`. Table of email, first name, last name, manager, active, has password, delete. Invite card asks for an email. Non-managers see a short “Account Information” placeholder instead of the table. 5. **Delete account.** Confirm, then deactivate. Copy says conversations are hidden and the user is signed out. Cannot be undone in the app. Success returns to Sign in. Manager toggles: cannot toggle manager on your own row. Has-password toggle is disabled until the user already has a password; the checkbox shows checked only when `has_password && has_signed_tos`. ## API | Call | Purpose | | --- | --- | | `GET /conversation_preferences` | `{ order, use_conversation_context }`. | | `POST /conversation_preferences` | Body `{ order }` or `{ use_conversation_context }`. | | `GET /monetization/subscription/` | Plan and `usage` (including `prompt_quota`). | | `GET /monetization/invoices/` | Invoice list. Also gates the web billing portal. | | `GET /monetization/payments/` | Payment list. | | `GET /monetization/plans/` | Plan catalog for the picker. | | `POST /monetization/checkout/` | Web only. `{ success_url, cancel_url, plan_slug? }`. | | `POST /monetization/portal/` | Web only. Returns `portal_url`. | | `POST /monetization/store/confirm/` | Android/RevenueCat entitlement confirm (`storeBilling.ts`). | | `GET /company_users` | Manager roster. | | `POST /user/invite/` | Body `{ email }`. | | `POST /company_users` | Body `{ email, field, value }`. `field` is `company_manager`, `is_active`, or `has_password`. `value` is the string `"true"` or `"false"`. | | `DELETE /company_users` | Body `{ email }`. | | `DELETE /user/` | Body `{ refresh_token }` when one exists. Then `POST blacklist/` and clear the session. | ## Android Replace `AccountScreen`. Billing section is RevenueCat (subscribe, restore, manage) with provider badge `revenuecat` + `PLAY_STORE`.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_android#6