Evaluates eligibility for schemes based on input conditions and returns eligible and ineligible schemes with reasons.
// Source: https://github.com/nitrocloudofficial/nitrostack | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import type { CheckSchemeEligibilityInput, EligibilityResult, Scheme } from '../../shared/contracts.js';
export function evaluateEligibility(schemes: Scheme[], input: CheckSchemeEligibilityInput): EligibilityResult {
const eligible: EligibilityResult['eligible'] = [];
const ineligible: EligibilityResult['ineligible'] = [];
for (const scheme of schemes) {
const failedCondition = findFailedCondition(scheme, input);
if (failedCondition) {
ineligible.push({ schemeId: scheme.schemeId, schemeName: scheme.schemeName, failedCondition });
} else {
elig
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key