Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add top-level endpoints to Title-II #270

Open
Tracked by #257
sandeep-ps opened this issue Nov 1, 2024 · 0 comments
Open
Tracked by #257

[FEATURE] Add top-level endpoints to Title-II #270

sandeep-ps opened this issue Nov 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sandeep-ps
Copy link
Member

sandeep-ps commented Nov 1, 2024

A title level endpoint can help with displaying a map at the title level without having to calculate total values on the client side. It can also help with easy debugging to understand if something changes at the title level. We don't have such an endpoint for Title-2. For Crop Insurance and SNAP, since there is only one program under the respective titles, the current endpoints could be used to display a title-level map/debugging.

Add endpoints:

GET /pdl/titles/title-ii/summary
GET /pdl/titles/title-ii/state-distribution

The response structure can be similar to the following, but should include all attributes (not just totalPaymentInDollars and totalRecipients) from Title-2 data.

{
    "2014": [
        {
            "totalPaymentInDollars": 938565060.0,
            "totalRecipients": 70670,
            "state": "IA"
        },
        {
            "totalPaymentInDollars": 710358926.2,
            "totalRecipients": 58943,
            "state": "NE"
        },
        {
            "totalPaymentInDollars": 701288133.3,
            "totalRecipients": 47081,
            "state": "MN"
        }
     ....
]}

When calculating the title level summaries for Title-2 for the above endpoints, from CRP, only the "Total CRP" sub-programs' data should be used. This is because due to the way that program is organized, other sub programs in that contain repeated and overlapping information and the "Total CRP" sub program contains the consolidated numbers for that program.

@sandeep-ps sandeep-ps added the enhancement New feature or request label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant