Panly API docsstaging

Screens / Onboarding (new-owner setup)

Onboarding (new-owner setup)

New-owner setup (PAN-78, PAN-79, PAN-80, PAN-82, PAN-90), reached by the startup gate while the business's setup is not finished (owner only, `settings.manage`). Steps: business (name, type, currency; the currency picker is PAN-90, and the currency locks once chosen), businesses, team (team size), stock, payroll, summary, plan (Premium with add-ons; there is no Free plan to pick, and a business that already paid skips this step, PAN-119) and done. The server holds the progress (current_step and answers), so a refresh or another device resumes where the owner stopped; every move is one PATCH with a fresh Idempotency-Key, reused only when the identical request is sent again after a failure. Another business of an owner already set up gets a shorter flow without the plan step. A sign-out menu sits at the top right. Leaving without finishing is possible only when the first load failed.

App routes
/onboarding
Access
settings.manage
Screen code
lib/screens/onboarding/onboarding_page.dart
lib/screens/onboarding/onboarding_controller.dart
lib/screens/onboarding/onboarding_bindings.dart
lib/screens/onboarding/onboarding_copy.dart
lib/screens/onboarding/onboarding_drafts.dart
lib/screens/onboarding/widgets/business_step.dart
lib/screens/onboarding/widgets/businesses_step.dart
lib/screens/onboarding/widgets/team_step.dart
lib/screens/onboarding/widgets/stock_step.dart
lib/screens/onboarding/widgets/payroll_step.dart
lib/screens/onboarding/widgets/summary_step.dart
lib/screens/onboarding/widgets/plan_step.dart
lib/screens/onboarding/widgets/payment_stub_step.dart
lib/screens/onboarding/widgets/done_step.dart
lib/screens/onboarding/widgets/currency_sheet.dart
lib/core/navigation/onboarding_gate.dart
lib/data/repositories/onboarding_repository.dart
Source
elmermj/panly-app @ pre-staging-test (72aaffd)

API calls (8)

CallWhy the screen makes itWhere in the app code
GET /v1/merchants/me/onboarding
Get onboarding state
Open, resync after a conflict and after a failed save: version, current_step, answers, completed and plan_state lib/screens/onboarding/onboarding_controller.dart:106
lib/domain/usecases/onboarding/onboarding_usecase.dart:12
lib/data/repositories/onboarding_repository.dart:16
PATCH /v1/merchants/me/onboarding
Save an onboarding step and answers
Every Continue or Back: {version, current_step, answers} with an Idempotency-Key (owner only)
A version conflict makes the app read the state again.
lib/screens/onboarding/onboarding_controller.dart:510
lib/domain/usecases/onboarding/onboarding_usecase.dart:14
lib/data/repositories/onboarding_repository.dart:20
lib/data/repositories/onboarding_repository.dart:31
POST /v1/merchants/me/onboarding/apply
Apply the onboarding answers
Summary > Confirm: writes the name, time zone and payroll settings from the answers and seeds the starter menus once (Idempotency-Key reused on retry)
The answer's applied_at and categories_created feed the Done step; the business currency is adopted into the session.
lib/screens/onboarding/onboarding_controller.dart:433
lib/domain/usecases/onboarding/onboarding_usecase.dart:25
lib/data/repositories/onboarding_repository.dart:37
POST /v1/merchants/me/onboarding/complete
Complete onboarding
Done > open the dashboard (repeating it is a 200). 409 onboarding_already_completed leaves setup; 409 onboarding_not_ready reads the state again lib/screens/onboarding/onboarding_controller.dart:451
lib/domain/usecases/onboarding/onboarding_usecase.dart:29
lib/data/repositories/onboarding_repository.dart:47
GET /v1/plans
List plans and add-ons
Plan step: the plans and add-ons on offer. A failure only affects this step: "Start with Free" keeps working lib/screens/onboarding/onboarding_controller.dart:145
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)
Continue with Premium: the tier and add-ons are saved (nothing is charged); Remind me later sends {remind_later: true}. A failure of the reminder never stops the owner lib/screens/onboarding/onboarding_controller.dart:331
lib/screens/onboarding/onboarding_controller.dart:364
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
Start with Free after a saved Premium choice (plan_selected_pending_payment): cleared as a courtesy, a failure never stops the owner lib/screens/onboarding/onboarding_controller.dart:319
lib/domain/usecases/plans/plans_usecase.dart:22
lib/data/repositories/plans_repository.dart:43
GET /v1/billing
Billing status of the current business
A business that already paid skips the plan step (PAN-119) lib/screens/onboarding/onboarding_controller.dart:132
lib/domain/usecases/billing/billing_usecase.dart:14
lib/data/repositories/billing_repository.dart:29

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.