Panly API docsstaging

Screens / Dashboard

Dashboard

KPIs for the selected period and the prior one, the daily sales chart, the Low stock card, recent expenses, plan and seats, and an item sales ranking with the presets Most items sold, Most sales, Most refunds, Most net sales, Most cost of sales and Most gross profit; the net-sales and cost-of-sales presets show only with `costs.view`, and the app never asks for them without it. The Low stock card shows stock below zero as the real number in red (PAN-62). Back on the tab (PAN-59) the figures refresh quietly. Money follows the business currency (PAN-90). On a 390 phone the KPI values shrink to fit one line (down to 20sp) and the subtitle wraps to two lines (PAN-145).

App routes
/dashboard
Access
reports.sales, reports.cashflow
Screen code
lib/screens/dashboard/dashboard_page.dart
lib/screens/dashboard/dashboard_controller.dart
lib/screens/dashboard/widgets/cards/low_stock_card.dart
lib/screens/dashboard/widgets/item_sales_rank.dart
lib/screens/dashboard/widgets/recent_expense.dart
lib/screens/dashboard/widgets/kpi_value.dart
Source
elmermj/panly-app @ pre-staging-test (72aaffd)

API calls (6)

CallWhy the screen makes itWhere in the app code
GET /v1/reports/cashflow
Cashflow report (backed by the daily_financials summary)
Period KPIs, prior period, chart (group_by=day) and the low_stock list for the Low stock card lib/screens/dashboard/dashboard_controller.dart:114
lib/screens/dashboard/dashboard_controller.dart:151
lib/screens/dashboard/dashboard_controller.dart:166
lib/data/repositories/report_repository.dart:16
GET /v1/expenses
List expenses
Recent expenses (limit=4) lib/screens/dashboard/dashboard_controller.dart:174
lib/data/repositories/dashboard_repository.dart:12
GET /v1/expense-categories
List expense categories
Category names for the recent expenses lib/data/repositories/dashboard_repository.dart:26
GET /v1/me
Get the signed-in account, its role here and the current merchant
Plan and storage for the plan card lib/screens/dashboard/dashboard_controller.dart:181
lib/data/repositories/dashboard_repository.dart:42
GET /v1/members
List members (memberships) of my merchant
Staff seats (limit=100, all pages) lib/screens/dashboard/dashboard_controller.dart:196
lib/data/repositories/dashboard_repository.dart:51
GET /v1/reports/sales
Ranked sales by menu item
Item sales ranking: `type` is the chosen preset (most_items_sold, most_sales, most_refunds, most_net_sales, most_cost_of_sales, most_gross_profit), from/to the period, limit and cursor for "load more"
The server answers 403 permission_denied to the net-sales and cost-of-sales types without `costs.view`; the app hides those presets and never sends them for such a role.
lib/screens/dashboard/dashboard_controller.dart:227
lib/domain/usecases/dashboard/dashboard_usecase.dart:34
lib/data/repositories/dashboard_repository.dart:64

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.