ffl_core.staff_switch¶
Source: apps/ffl_core/ffl_core/staff_switch.py · 6 endpoint(s)
Generated by
make api-docs— do not edit by hand.
clear_pin¶
POST /api/method/ffl_core.staff_switch.clear_pin
Auth (derived from code): Roles: Sales Manager / System Manager
Clear someone's counter PIN (they sign in with the password, and may set a new one).
| arg | type | required | default | description |
|---|---|---|---|---|
user |
string | yes | — | The user whose PIN goes. |
Returns: {"has_pin": False}.
apps/ffl_core/ffl_core/staff_switch.py:249
counter_users¶
POST /api/method/ffl_core.staff_switch.counter_users
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Everyone who can sign in at the counter, for the switch-user list.
Returns: [{"user", "full_name", "image", "current": bool, "has_pin": bool, "pin_off": bool (five wrong PINs: their password until they next use it)}] for enabled desk users holding a counter role, by name (never Administrator, the site's superuser), and always the signed-in one, marked current: a locked screen is unlocked by picking yourself, whatever your roles.
apps/ffl_core/ffl_core/staff_switch.py:84
lock_screen¶
POST /api/method/ffl_core.staff_switch.lock_screen
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Lock this session's screen (idle, or the clerk walked away).
Returns: {"locked": 1}.
apps/ffl_core/ffl_core/staff_switch.py:100
set_pin¶
POST /api/method/ffl_core.staff_switch.set_pin
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Set (or change) the signed-in user's counter PIN.
| arg | type | required | default | description |
|---|---|---|---|---|
password |
string | yes | — | Their login password. |
pin |
string | yes | — | The new PIN, 4–6 digits, not 1111 / 1234-style. |
confirm |
string | yes | — | The new PIN again. |
Returns: {"has_pin": True}.
apps/ffl_core/ffl_core/staff_switch.py:225
switch_with_pin¶
POST /api/method/ffl_core.staff_switch.switch_with_pin
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
Sign someone else in at this counter with their PIN: a new session for them
(frappe's LoginManager, so the login history records it, and its IP / hours rules apply) and this one ends. Only a counter user who has a PIN, without a second sign-in step; anyone else signs in with their password (frappe's login).
| arg | type | required | default | description |
|---|---|---|---|---|
user |
string | yes | — | Who is taking over the counter. |
pin |
string | yes | — | Their counter PIN. |
Returns: {"user"}.
apps/ffl_core/ffl_core/staff_switch.py:265
unlock_screen¶
POST /api/method/ffl_core.staff_switch.unlock_screen
Auth (derived from code): Roles: Sales User / Sales Manager / Stock Manager / System Manager
The signed-in person unlocks their own screen with their password (10 wrong
tries per person per 10 minutes, counted per person, not per IP — a shop's
counters share one address) or their counter PIN (5 wrong ones turn it off).
Signing in as someone else is frappe's login, or :func:switch_with_pin.
| arg | type | required | default | description |
|---|---|---|---|---|
password |
string | null | no | None |
The signed-in user's password. |
pin |
string | null | no | None |
Or their counter PIN. |
Returns: {"locked": 0}.
apps/ffl_core/ffl_core/staff_switch.py:112