## ADDED Requirements

### Requirement: The Manager's Overtime List Reports Who Each Request Covers

Each row of the manager's overtime listing SHALL report a preview of the employees the request covers and the total number of them.

The preview SHALL carry at most ten employees. The total SHALL be the real number the request covers, so a request covering more than ten is reported as ten employees and a total that exceeds them.

Each previewed employee SHALL carry their name, their avatar and their employee code, and SHALL NOT carry the fuller employee record returned when a request's employees are listed in their own right.

The preview and the total SHALL describe the same set, so the difference between them is always the number of employees not previewed. Both SHALL count only employees that exist: a request may retain a link to an account that has since been removed, and such a link SHALL be reflected in neither.

#### Scenario: A request covering one employee
- **WHEN** a manager lists overtime requests and one covers a single employee
- **THEN** that row previews that employee
- **AND** reports a total of one

#### Scenario: A request covering fewer than the preview holds
- **WHEN** a request covers three employees
- **THEN** that row previews all three
- **AND** reports a total of three

#### Scenario: A request covering more than the preview holds
- **WHEN** a request covers twelve employees
- **THEN** that row previews ten of them
- **AND** reports a total of twelve

#### Scenario: What a previewed employee carries
- **WHEN** a row's preview is read
- **THEN** each employee in it carries a name, an avatar and an employee code

#### Scenario: The preview is stable between reads
- **WHEN** the same page is listed twice without the request changing
- **THEN** the same employees appear in the preview, in the same order

#### Scenario: A link to a removed account is ignored
- **WHEN** a request holds a link to an account that no longer exists
- **THEN** that link is counted in neither the preview nor the total
- **AND** the preview carries as many employees as the total allows, up to its cap

#### Scenario: Cost does not grow with a request's size
- **WHEN** a page of the listing contains a request covering several hundred employees
- **THEN** the page is produced in a number of database queries that does not grow with that number
- **AND** only the previewed employees are carried in the response

### Requirement: The Preview Covers the Manager's Own Employees

The preview and the total SHALL cover the employees of a request that the manager reading the list leads, and no others.

A manager's listing reaches a request when it covers at least one of their own employees. Such a request MAY cover others; those others SHALL be neither previewed nor counted. Opening a request SHALL still report every employee it covers.

#### Scenario: A request spanning two teams
- **WHEN** a request covers five employees, of whom two report to a given manager
- **THEN** that manager's row previews those two and reports a total of two

#### Scenario: Two managers see the same request differently
- **WHEN** two managers each lead some of the employees a single request covers
- **THEN** each sees previewed and counted only their own

#### Scenario: A request covering none of the manager's employees
- **WHEN** a request covers no employee the manager leads
- **THEN** it does not appear in that manager's listing at all

### Requirement: Narrowing the Manager's Overtime List

The manager's overtime listing SHALL narrow by the employee a request covers and by the date the overtime falls on.

A request SHALL match an employee search when the search text matches an employee's name or employee code among the employees it covers, or the request's own title.

A date range SHALL select requests by the date their overtime falls on, which is distinct from the date the request was raised; both SHALL be available and SHALL be separate.

Each filter SHALL be optional, and filters given together SHALL all apply.

#### Scenario: Searching by employee name
- **WHEN** the listing is narrowed by text matching an employee's name
- **THEN** it contains the requests covering that employee

#### Scenario: Searching by employee code
- **WHEN** the listing is narrowed by text matching an employee's code
- **THEN** it contains the requests covering that employee

#### Scenario: The search also matches a request's title
- **WHEN** the listing is narrowed by text matching a request's title
- **THEN** that request is returned, even if the text matches none of its employees

#### Scenario: Narrowing by overtime date
- **WHEN** the listing is narrowed to a range of dates
- **THEN** it contains the requests whose overtime falls within that range
- **AND** not those merely raised within it

#### Scenario: Narrowing by the date a request was raised
- **WHEN** the listing is narrowed by the date requests were raised
- **THEN** it selects on that date rather than on the overtime date

#### Scenario: Filters combine
- **WHEN** the listing is narrowed by employee text and by a date range together
- **THEN** it contains only the requests meeting both

#### Scenario: No filter given
- **WHEN** the listing is requested with no filter
- **THEN** it contains every request the manager can see
