sdac-validate-federal-funding-backout
Purpose
Checks federal source code backouts and mixed funding calculations against state/local percentages.
Tool type
Deterministic (rule-based)
Tool ID
sdac-validate-federal-funding-backout
Inputs
report_id(string)record_ids(number[], optional)amount_tolerance(number, optional, default: 1)
Outputs
errorsandwarningsfor incorrect backouts or missing percentages
Example output
{
"success": true,
"report_id": "SDAC-2024-Q2-001",
"passed": false,
"errors": [
{
"rule_id": "FEDERAL_FUNDS_NOT_BACKED_OUT",
"row_number": 19,
"message": "Source code includes federal funding but 100% of salary is still claimed.",
"severity": "ERROR"
}
],
"warnings": []
}
Functional details
- Ensures federal-only rows have zero claimable amounts.
- Validates mixed funding backout calculations using state/local percentages.
- Applies
amount_tolerancefor rounding differences.
Implementation details
- Parses source codes from
SourceCodesParsedorSourceCode. - Federal-only rows emit
FEDERAL_SOURCE_ONLY_NONZEROif claimables > 0. - Mixed funding requires state/local percentages (derived from
PctStateLocalFunds*orPctFederalFunds*). - Uses
amount_tolerancewhen comparing expected vs actual claimable amounts. - Calculates expected claimable amounts from gross * state/local percentage.
Code Location: packages/domain-sdac/src/tools/validate-federal-funding-backout.tool.ts