icefoganalytics / elcc-data-management

Data Management application for Education's Early Learning Child Centre
Apache License 2.0
0 stars 0 forks source link

ELCC-17: Issue with Input Rounding Down, Affecting Operator Payments #51

Closed klondikemarlen closed 12 months ago

klondikemarlen commented 1 year ago

Fixes ELCC-17

Context

I noticed everything I enter rounds down to the nearest whole number. We definitely need to be able to enter 2 decimal places because rounding down gives the operators less money than they are entitled to.

  1. Spaces are sometimes (for example) 2.4 children, as there are 2 full time spots taken, and 1 child that only comes 2 days per week (or some other version of part time).
  2. Building Expenses are reported with cents, and then we multiply that by 37% (or 43% in the communities).
  3. Wage Enhancement hours are sometimes reported with decimals. (While filling in this section, I just input the total hours from each Level just so there was something to test.)

Implementation

  1. Remap funding submission line keys to increase clarity
    {
    estChildCount: "estimatedChildOccupancyRate",
    actChildCount: "actualChildOccupancyRate",
    estComputedTotal: "estimatedComputedTotal",
    actComputedTotal: "actualComputedTotal",
    }

child count isn't a number of children, it is an occupancy rate value. Switched from parsing the value as an integer to parsing it as a float.

Screenshots

(if making UI changes add screenshots comparing the old and new experience)

Testing Instructions

  1. Boot the app via dev up
  2. Check that the app complies, and that you can log in at http://localhost:8080.
  3. Go to http://localhost:8080/child-care-centres.
  4. Select the first child care center, then click the "view details" button in the far right panel.
  5. Select the "Worksheets" tab.
  6. Scroll down to the "Building Expenses" section.
  7. Enter a decimal value 1.6 for the first fields.
  8. Check that the total calculation does not lose precision when rounding. At least not more than a cent. It is possible that some precision is lost as we aren't using a financial library to perform these calculations; however, I'm leaving that level of precision till another day.