Urgent Needs - Gary-Community-Ventures/benefits-api GitHub Wiki

Urgent Needs

A secondary list of resources on the results page. These "urgent needs" are meant to support the more immediate needs of the user. Urgent needs do not have values, and should not have many eligibility requirements (because they should have no/a quicker application proccess), as they are meant to be a quick way for users meet a need. An example urgent need would be a food pantry because it helps the user solve the immediate need food.

Admin

The Admin allows non developers to edit urgent need information (like name and description) without the help of a developer.

Creating an urgent need

  1. Go to the "Translation Admin".
  2. Go to "Urgent Needs".
  3. Click "Add New".

image

  1. Enter a "Label" (just a string to identify the urgent need) and optional "Phone number".

image

  1. Add all of the text for the urgent need by clicking the links, and replacing the placeholder text with the desired text.

  2. Click "Edit in Main Admin"

image

  1. Update the fields
    • Documentation for each field can be found in the Main Admin section.

Updating an urgent need

Translation admin

To edit any of the text in the translation admin:

  1. Go to the "Translation Admin".
  2. Go to "Urgent Needs".
  3. Search the name of the urgent need.
  4. Select "Go to".
  5. Select the field to update.

The translations can also be accessed through the main admin by clicking on the hamburger menu in the "Translate" column

image

Main Admin

  1. Go to "Urgent Needs".
  2. Search the name of the urgent need.
  3. Click on the name.
  4. Update the fields.

image

What things mean

Translation admin

The following translated text can be edited in the translation admin:

  • Name: The name that is displayed to the user
  • Description: The description that is displayed to the user
  • Link: The link to the urgent need website
  • Type: The category that the urgent need goes in. If multiple urgent needs have the same type, they will be grouped. The type is also used to select the icon
  • Warning: Deprecated
  • Website Description: The description on the page that lists all of the MFB benefits

Main admin

  • White label: The white label to show this urgent need in
  • External name: Syncs urgent needs across environments
  • Phone number: An optional phone number for the urgent need
  • Type short: The needs on step-9 to show this benefit for
  • Active: Only active urgent needs are showed to the user
  • Low confidence: Display a flag to the user that reads "Low Confidence"
  • Functions: The calculators that are used to determine if the urgent need should be shown

Development

A base class is provided to determine if an urgent need should be shown.

Custom Rules

Add a new class in /programs/programs/urgent_needs/urgent_need_functions.py that inherits from the UrgentNeedFunction class.

The following methods and attributes can be overridden:

  • eligible: Returns if the urgent need should be shown to the user.
  • dependencies (attribute): A list of fields needed so that the urgent need does not through an error when run. If the screen is missing one of these fields, then the urgent need will be skipped. Syntax:
    • Screen and HouseholdMember fields: {field}
    • IncomeStream fields: income_{field}
    • Expense fields: expense_{field}

Add the new urgent need class to the urgent_need_functions at the bottom of the file. The key is matched to the functions of the urgent need

Brief technical overview