SNAP Negative core files
Program types, calculation, field codes, validation and policy. These functions are shared by client previews and server commands.
System explanation · Choosing checks
Source files
| File | Responsibility / entry points |
|---|---|
src/programs/snap-negative/calculation.ts
|
Versioned benefit formula, self-employment totals, proration, income combining and
Final selection. calculate, prorateBenefit, combineIncome, selectFinal, selfEmploymentTotals |
src/programs/snap-negative/constants.ts
|
Synthetic baseline month, review number, numeric seed and reference-date
constants. DEMO_REVIEW_NUMBER, DEMO_SAMPLE_MONTH, DEMO_GENERATOR_SEED, DEMO_BASELINE_PER_MONTH, DEMO_BASELINE_AS_OF |
src/programs/snap-negative/field-catalog.ts
|
Workbook field labels/codes, required sets, answer normalization and
element/nature validation. FieldDefinition, FieldChoice, reviewFieldDefinitions, reviewFieldByKey, elementCodeChoices, natureChoicesForElement … |
src/programs/snap-negative/input-limits.ts
|
Shared money, household, income-row and date/month bounds. MIN_HOUSEHOLD_SIZE, MAX_HOUSEHOLD_SIZE, MAX_INCOME_ROWS, MAX_MONEY_CENTS, isCalendarDate, isCalendarMonth |
src/programs/snap-negative/nature-catalog.json
|
Element/nature choice data consumed by the field catalog. |
src/programs/snap-negative/policy.ts
|
Policy types/default tables, effective-month selection and saved-copy
resolution. demoPolicy, expandedDemoPolicy, SnapPolicy, initialPolicy, policyForMonth, resolveReviewPolicy |
src/programs/snap-negative/review-template.ts
|
Lightweight import/loading and reset templates used by application code. createImportTemplate, demoScenarioTemplate, createDemoReviewTemplate |
src/programs/snap-negative/rule-versions.ts
|
Supported immutable calculation/check IDs and unknown-version rejection. LEGACY_CALC_VERSION, LEGACY_CHECK_VERSION, PREVIOUS_CALC_VERSION, EDUCATION_CALC_VERSION, CURRENT_CALC_VERSION, PREVIOUS_CHECK_VERSION … |
src/programs/snap-negative/types.ts
|
SNAP-specific review facts, scenarios, income, answers and calculation results. ScenarioId, HouseholdMember, IncomeStream, SuaType, Scenario, ComputationResult … |
src/programs/snap-negative/validation.ts
|
Versioned required-input blockers, stored edit-check findings and current/stale
predicates. validateRequiredInput, runFullEditCheck, validateReview, activeStoredFindings, hasOpenStoredFindings, requiredInputComplete … |
Tests
| File | Responsibility / entry points |
|---|---|
src/programs/snap-negative/calculation.test.ts
|
Checks calculation. Example: “ordinary monthly workbook snapshot”. |
src/programs/snap-negative/input-limits.test.ts
|
Checks input limits. Example: “scenario and roster limits agree at 1 and 20, with zero reserved for unpopulated drafts”. |
src/programs/snap-negative/policy.test.ts
|
Checks policy. Example: “dated rows select by sample month and retain the saved review table”. |
src/programs/snap-negative/rule-versions.test.ts
|
Checks rule versions. Example: “review rule bindings”. |
src/programs/snap-negative/validation.test.ts
|
Checks validation. Example: “field catalog”. |