A few representative files from a Craft CMS build for SignUpWIC. The eligibility module determines whether someone qualifies for WIC based on their income, household size, and state.
ea-form-flow.png is a working diagram I made to walk the client through revised form routing: tribal vs. state coverage, opt-outs, and pre-app handoffs.
navigation.js: A vanilla-JS mobile nav. Accessible disclosure with a focus trap,inerton the background, and Esc to close.eligibilityAssessment/Module.php: Hooks up the listeners and makescheckEligibilityavailable to templates.eligibilityAssessment/Config.php: Where the Craft handles and the WIC Income Eligibility Guidelines live.eligibilityAssessment/services/EligibilityCalculator.php: Eligibility math. Pay-period conversion, Alaska and Hawaii poverty-line bumps, and pregnancy adjustment.eligibilityAssessment/listeners/IneligibleRedirect.php: Cuts the Formie submission flow short when the applicant's family answer means they don't qualify.eligibilityAssessment/listeners/StateAdminAccessControl.php: Narrows the Formie submission queries so state admins only see submissions from their own state.tests/EligibilityCalculatorTest.php: PHPUnit tests covering the calculator's poverty-line, pay-period, and pregnancy branches.