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-61: Add Wage Enhancement Replication Across Months #81

Closed klondikemarlen closed 5 months ago

klondikemarlen commented 5 months ago

Fixes https://yg-hpw.atlassian.net/browse/ELCC-61

Relates to:

Context

User Report

I went in today and started inputting data into the 23/24 sheet for Bright Stars. I noticed:

  1. Would be nice if employee entries under wage enhancement would replicate across sheets. Time consuming to re-enter information

I interpret this as being a request for a similar feature to "replicate estimates" that works on the "worksheets" tab.

Reproduction Instructions

  1. Go to the http://localhost:8080/child-care-centres page.
  2. Select a Child Care Centre by double-clicking on it, or adding a new one via the top right call-to-action.
  3. Select the 2023/24 fiscal year from top right selector thing.
  4. Go to the "Employees" tab.
  5. Scroll down to the "Wage Enhancements" section.
  6. This will select the "April" sub-tab.
  7. Click on the "+" icon on the "level 2" section.
  8. Add your name, then estimated and actual hours.
  9. Finally click the floppy disk icon to save.
  10. Go back to the top, and select the "May" sub-tab.
  11. Scroll down to the "Wage Enhancements" section, and note that the wage enhancement was not copied over.

Implementation

  1. Add /api/wage-enhancements/replicate-estimates endpoint with two required arguments centreId and fiscalPeriodId. I opted not to use /api/centres/:centreId/fiscalPeriods/:fiscalPeriodId/wage-enhancements/replicate-estimates, as there is no correlation between centres and fiscal periods. This lead me to try /api/centres/:centreId/wage-enhancements/replicate-estimates with required param fiscalPeriodId, but it felt weird to have one required param in the url and one in the body, so I just went with "flat is better than nested" with both required params needing to be passed in in the query or body.
  2. Used multilayered loop for wage enhancement replication service, this is very inefficient, but at least it is mostly readable and has tests. In the future, it might make sense to rework the data modeling to make this kind of functionality less difficult to implement.
  3. Update entity modeling
  4. Fix database test setup cleaner function.
  5. Add developer helper to create a GitHub branch from a Jira ticket URL.

Screenshots

New "replicate estimates button" for Wage Enhancements image

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 the http://localhost:8080/child-care-centres page.
  4. Select a Child Care Centre by double-clicking on it, or adding a new one via the top right call-to-action.
  5. Select the 2024/25 fiscal year from top right selector thing (if it isn't selected already)
  6. Go to the "Employees" tab.
  7. Scroll down to the "Wage Enhancements" section.
  8. This will select the "April" sub-tab.
  9. Click on the "+" icon on the "level 2" section.
  10. Add your name, then estimated and actual hours.
  11. Finally click the floppy disk icon to save.
  12. Go back to the top, and select the "May" sub-tab.
  13. Scroll down to the "Wage Enhancements" section, and note that the wage enhancement was not copied over.