# Eligibility Screen

`D03-F06-A01` · Index and Benchmark Engineering → Governance and Maintenance · archetype `record-transform` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/index-and-benchmark-engineering/governance-and-maintenance/eligibility-screen/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## Install and import

```bash
npm install fintech-algorithms
```

```ts
import { calculate } from "fintech-algorithms/index-and-benchmark-engineering/governance-and-maintenance/eligibility-screen";
```

## Signature

```ts
calculate(data)
```

Applies the qualification rules that decide what may be considered for membership at all — domicile, listing status, share class, and the rest. The first gate, and the one that defines what the index claims to represent.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ candidates: Candidate[] }` | yes | Each candidate carries the attributes the rules test. The rules travel with the data rather than being hard-coded, so a rule change is a data change. |

## Returns

`{ results, eligibleIds, rejectedCount }`

A per-candidate result naming which rule rejected it — a rejection without a reason cannot be appealed or audited.

## Errors

- When a candidate is missing an attribute a rule requires — recorded as a rejection reason rather than thrown

## Complexity

Time `O(n × rules)`, space `O(n)`.

## Worked example

This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.

### Input

`data`:

```json
{
  "candidates": [
    {
      "id": "A",
      "primaryListing": true,
      "eligibleType": true,
      "minPricePass": true,
      "historyPass": true
    },
    {
      "id": "B",
      "primaryListing": false,
      "eligibleType": true,
      "minPricePass": true,
      "historyPass": true
    },
    {
      "id": "C",
      "primaryListing": true,
      "eligibleType": true,
      "minPricePass": false,
      "historyPass": true
    }
  ]
}
```

### Call

```ts
calculate(data)
```

### Returns

object with 3 fields: results, eligibleIds, rejectedCount

```json
{
  "results": [
    {
      "id": "A",
      "eligible": true,
      "reasons": []
    },
    {
      "id": "B",
      "eligible": false,
      "reasons": ["primaryListing"]
    },
    {
      "id": "C",
      "eligible": false,
      "reasons": ["minPricePass"]
    }
  ],
  "eligibleIds": ["A", "D"],
  "rejectedCount": 3
}
```

## Verification and provenance

Tier: **verified** (via input-expected).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.1.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/index-and-benchmark-engineering/governance-and-maintenance/eligibility-screen/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/index-and-benchmark-engineering/governance-and-maintenance/eligibility-screen/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/index-and-benchmark-engineering/llms.txt
