Skip to content

tylernford/wic-code-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Sample

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.

Files

  • navigation.js: A vanilla-JS mobile nav. Accessible disclosure with a focus trap, inert on the background, and Esc to close.
  • eligibilityAssessment/Module.php: Hooks up the listeners and makes checkEligibility available 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors