Panly API docsstaging

Screens / Users

Users

Staff logins (PAN-112 and the staff password work): each employee signs in with an employee ID and password instead of an invite link. Add employee takes a name, a username checked live against the business key, a role (every role but Owner, from GET /v1/roles) and an optional email, then shows the one-hour setup link to share. A row menu changes the role, deactivates or reactivates, issues a new reset link or deletes the login. Needs `staff.manage`. Invite links are gone from the app. Restyled to the refined design (PAN-136).

App routes
/users
Access
staff.manage
Screen code
lib/screens/users/users_page.dart
lib/screens/users/users_controller.dart
lib/screens/users/add_employee_controller.dart
lib/screens/users/widgets/add_employee_sheet.dart
lib/screens/users/widgets/employee_created_sheet.dart
lib/screens/users/widgets/staff_row_menu.dart
lib/screens/users/widgets/change_role_dialog.dart
lib/screens/users/widgets/delete_staff_dialog.dart
Source
elmermj/panly-app @ pre-staging-test (72aaffd)

API calls (7)

CallWhy the screen makes itWhere in the app code
GET /v1/staff
List staff logins
List staff logins (employee ID, name, role, active) lib/screens/users/users_controller.dart:106
lib/domain/usecases/staff/staff_usecase.dart:26
lib/data/repositories/staff_repository.dart:41
GET /v1/staff/id-availability
Is this employee ID free?
Live check of a typed employee ID in Add employee lib/screens/users/add_employee_controller.dart:116
lib/domain/usecases/staff/staff_usecase.dart:28
lib/data/repositories/staff_repository.dart:55
POST /v1/staff
Create a staff login (employee ID + setup link)
Add employee (name, username, role_id, optional email); the answer carries the one-hour setup link lib/screens/users/users_controller.dart:146
lib/domain/usecases/staff/staff_usecase.dart:36
lib/data/repositories/staff_repository.dart:69
PATCH /v1/staff/{staffId}
Rename, change role, deactivate or reactivate a staff login
Change role, or deactivate and reactivate lib/screens/users/users_controller.dart:180
lib/screens/users/users_controller.dart:185
lib/domain/usecases/staff/staff_usecase.dart:40
lib/data/repositories/staff_repository.dart:81
DELETE /v1/staff/{staffId}
Delete a staff login
Delete a staff login after a confirm lib/screens/users/users_controller.dart:195
lib/domain/usecases/staff/staff_usecase.dart:43
lib/data/repositories/staff_repository.dart:90
POST /v1/staff/{staffId}/reset
Reset a staff member's password (new setup link)
Issue a new one-hour password reset link lib/screens/users/users_controller.dart:164
lib/domain/usecases/staff/staff_usecase.dart:45
lib/data/repositories/staff_repository.dart:95
GET /v1/roles
List roles
Roles a person can be given (every role but Owner), for the member dropdown and the invite sheet
If it fails the app keeps the three built-in roles.
lib/screens/users/users_controller.dart:125
lib/domain/usecases/roles/roles_usecase.dart:12
lib/data/repositories/roles_repository.dart:11

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.