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

Update 2024 #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions farmsubsidy_store/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ async def payments(
Get a list of `Payment` object based on filters.

Example queries:
- [All payments for Slovakia in 2020 ordered by amount (descending)](/payments?country=SK&year=2020&order_by=-amount)
- [All payments related to climate schemes in 2020](/payments?year=2020&scheme__ilike=%climate%)
- [All payments for Slovakia in 2022 ordered by amount (descending)](/payments?country=SK&year=2022&order_by=-amount)
- [All payments related to climate schemes in 2022](/payments?year=2022&scheme__ilike=%climate%)
- [Get all payments for a specific recipient via `recipient_id`](/payments?recipient_id=2f5812af62c20b884ed5dbddbacaaba362525110)

Example return data for `Payment` model:
Expand Down Expand Up @@ -161,7 +161,7 @@ async def recipients(
"country": "DE",
"url": [],
"years": [
2020,
2022,
2015,
2017,
2019,
Expand Down Expand Up @@ -284,7 +284,7 @@ async def countries(
"total_recipients": 30276,
"total_payments": 264854,
"years": [
2020,
2022,
2015,
2017,
2016,
Expand Down Expand Up @@ -312,7 +312,7 @@ async def years(
Return aggregated values for years based on filter criteria.

Of course, you can filter by `years` to
[get a single year](/years?year=2020).
[get a single year](/years?year=2022).

There are two kinds of filters:

Expand All @@ -329,7 +329,7 @@ async def years(

```json
{
"year": 2020,
"year": 2022,
"total_recipients": 4300168,
"total_payments": 18301312,
"countries": [
Expand Down Expand Up @@ -401,12 +401,14 @@ async def locations(
{
"location": "ADMONT, 8913, AT",
"years": [
2022,
2021,
2020,
2015,
2017,
2016,
2019,
2018,
2017,
2016,
2015,
2014
],
"countries": [
Expand Down