Panly API docsstaging

Screens / Plan and storage

Plan and storage

Settings > Plan and storage (owner only), opened from the Plan card in Settings. The plan card names the real plan: Lifetime shows "Lifetime" with "Assigned by Panly" and the header "Now (Lifetime)", an active Monthly plan reads "Now (Premium)" (PAN-98). Free, or Free with a saved Premium choice, shows a note that nothing was charged, the saved add-ons, the limits table (the effective limits the server enforces, including businesses), "Switch to Free" and "Manage add-ons"; the "What happens next" card shows only for Free or a pending plan. No payment is taken in the app yet: a payment-method placeholder stands in.

App routes
/settings/plan
Access
settings.manage
Screen code
lib/screens/plans/plan_page.dart
lib/screens/plans/plan_controller.dart
lib/screens/plans/plan_copy.dart
lib/screens/plans/plans_bindings.dart
lib/screens/plans/widgets/plan_state_card.dart
lib/screens/plans/widgets/limits_table.dart
lib/screens/plans/widgets/manage_add_ons_sheet.dart
lib/screens/plans/widgets/saved_add_ons_card.dart
lib/screens/plans/widgets/what_happens_next_card.dart
lib/screens/plans/widgets/pending_banner.dart
lib/domain/plans/plan_state_rules.dart
lib/data/repositories/plans_repository.dart
Source
elmermj/panly-app @ pre-staging-test (72aaffd)

API calls (4)

CallWhy the screen makes itWhere in the app code
GET /v1/merchants/me
Get my merchant (tier, storage usage)
The business with its plan_state, plan_selection and limits (also read again after every change) lib/screens/plans/plan_controller.dart:49
lib/domain/usecases/settings/settings_usecase.dart:12
lib/data/repositories/settings_repository.dart:14
GET /v1/plans
List plans and add-ons
The plans and add-ons on offer, with prices, for the limits table and Manage add-ons. A failure leaves the catalogue out and the rest of the page works lib/screens/plans/plan_controller.dart:50
lib/domain/usecases/plans/plans_usecase.dart:12
lib/data/repositories/plans_repository.dart:16
POST /v1/merchants/me/plan-selection
Save the plan choice (stub, charges nothing)
Save add-ons: the saved tier with the full replace list of add-ons (an empty list is valid). Nothing is charged
Plan or add-on not available answers are worded for the owner by code.
lib/screens/plans/plan_controller.dart:95
lib/domain/usecases/plans/plans_usecase.dart:14
lib/data/repositories/plans_repository.dart:38
DELETE /v1/merchants/me/plan-selection
Clear the saved plan choice
Switch to Free: clears the saved choice (idempotent); the business is read again lib/screens/plans/plan_controller.dart:113
lib/domain/usecases/plans/plans_usecase.dart:22
lib/data/repositories/plans_repository.dart:43

Each call links to its operation in the API reference. Code locations are file:line in panly-app at 72aaffd, listed from the screen down to the line that sends the request.