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-59: Estimate Replication Replicates Actuals As Well #78

Closed klondikemarlen closed 5 months ago

klondikemarlen commented 5 months ago

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

Relates to:

Context

User Report

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

  1. When I replicated estimates, it replicated April’s actuals as well throughout the months

Relates to components:

Propose Implementation

Move replicateFirstEstimateToAllOthers function to the back-end and write some tests for it. Create a back-end endpoint POST /api/funding-submission-line-jsons/replicate-estimates that maps to a funding-submission-line-jsons/replicate-estimates/create-service

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. Select the Worksheets tab.
  5. This will select the “April” sub-tab.
  6. Click the “add worksheets for xxx” if no worksheets exist.
  7. In the first section “Child Care Spaces”, fill in an estimate of “5” for Infants, and “6” for actuals.
  8. Click the “Save” button at the top right of the tab.
  9. Click the “replicate estimates” button below the “save” button.
  10. Select the “May” sub-tab, and note that the “Actual” for Infants has been copied as well as the “Estimate”.

Implementation

Upgrade BaseSerivce and BaseController pattern with code from https://github.com/icefoganalytics/wrap Move estimate replication to back-end service, and write some tests for it. Add api/src/services/funding-submission-line-jsons/replicate-estimates-service.ts and use it in api/src/controllers/funding-submission-line-jsons/replicate-estimates-controller.ts Make estimate generation slightly more flexible, so that it operates forward in time only. This means that we could update the UI so that the replicate estimates feature was on every tab, instead of just the first one.

Screenshots

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 2023/24 fiscal year from top right selector thing.
  6. Select the Worksheets tab.
  7. This will select the “April” sub-tab.
  8. Click the “add worksheets for xxx” if no worksheets exist.
  9. In the first section “Child Care Spaces”, fill in an estimate of “5” for Infants, and “6” for actuals.
  10. Click the “Save” button at the top right of the tab.
  11. Click the “replicate estimates” button below the “save” button.
  12. Select the “May” sub-tab, and note that the “Actual” for Infants has been copied as well as the “Estimate”.