# employee-role-filter Specification

## Purpose
Defines how the `employee_role` query filter splits accounts into managers and staff across the account/employee, payroll and cash payroll lists, so that the two groups never overlap and together make up the full list.
## Requirements
### Requirement: Employee Role Classification
The `employee_role` filter SHALL classify accounts only by whether they hold the `Manager` role. With `employee_role=manager`, the result SHALL include exactly the accounts that hold `Manager`. With any other non-empty value (e.g. `staff`), the result SHALL include exactly the accounts that do not hold `Manager`, including accounts with no roles. Other roles the account holds, such as admin roles, SHALL NOT affect the classification.

#### Scenario: Manager filter
- **WHEN** a list is requested with `employee_role=manager`
- **THEN** the result includes every account that holds the `Manager` role, whatever other roles it holds
- **AND** excludes every account that does not hold `Manager`

#### Scenario: Staff filter excludes managers who also hold admin roles
- **WHEN** a list is requested with `employee_role=staff`, and an account holds both `Manager` and an admin role (e.g. `Administrator`)
- **THEN** that account is not included in the result

#### Scenario: Staff filter includes accounts without roles
- **WHEN** a list is requested with `employee_role=staff`, and an account holds no roles
- **THEN** that account is included in the result

#### Scenario: Staff filter includes non-manager accounts holding other roles
- **WHEN** a list is requested with `employee_role=staff`, and an account holds only roles other than `Manager`
- **THEN** that account is included in the result

### Requirement: Employee Role Filter Partitions the List
For the same request, with all other filters unchanged, the `employee_role=manager` result and the `employee_role=staff` result SHALL be disjoint. Their union SHALL equal the result with no `employee_role` filter. This SHALL hold for every endpoint that supports `employee_role`: account/employee lists, payroll lists, and cash payroll lists.

#### Scenario: Counts add up
- **WHEN** a list is requested three times with identical filters except `employee_role` (`manager`, `staff`, and omitted)
- **THEN** the manager count plus the staff count equals the unfiltered count

#### Scenario: No account appears in both lists
- **WHEN** a list is requested with `employee_role=manager` and with `employee_role=staff`, using otherwise identical filters
- **THEN** no account (or payroll belonging to an account) appears in both results

