fedspendingtransparency / usaspending-api

Server application to serve U.S. federal spending data via a RESTful API
https://www.usaspending.gov
Creative Commons Zero v1.0 Universal
310 stars 113 forks source link

[DEV-11422] Fixes total outlay calculation relating to bound by year #4195

Closed collinwr closed 2 months ago

collinwr commented 2 months ago

Description: A problem was found relating to how data was bound to a fiscal year when calculating total outlays. Instead of using the fiscal year from the File C records, the fiscal year was coming from transactions. This PR reorganizes the queries to calculate the totals and breakdown by year, state, and type and join back to Summary state view based on this rather than using the DUH from Transactions that occurred within a given Fiscal Year.

Requirements for PR merge:

  1. [ ] Unit & integration tests updated
  2. N/A API documentation updated
  3. [ ] Necessary PR reviewers:
    • [ ] Backend
    • [ ] Domain Expert
  4. N/A Matview impact assessment completed
  5. N/A Frontend impact assessment completed
  6. [x] Data validation completed
  7. [x] Appropriate Operations ticket(s) created
  8. [x] Jira Ticket DEV-11422:
    • [x] Link to this Pull-Request
    • [ ] Performance evaluation of affected (API | Script | Download)
    • [ ] Before / After data comparison

Area for explaining above N/A when needed: