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/latest endpoints #372

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Feature/latest endpoints #372

merged 4 commits into from
Aug 28, 2024

Conversation

russbiggs
Copy link
Member

@russbiggs russbiggs commented Aug 26, 2024

Adds endpoints for /v3/locations/{locations_id}/latest and /v3/parameters/{parameters_id}/latest. Both have a datetime_min filter which allows users to filter out latest measurements that are older that the provider datetime or date. This query param uses the same structure and rules as the datetime_from, datetime_to query params.

This creates a new response model, Latest which looks like:

{
  "datetime": {
    "utc": "2024-08-26T22:00:00Z",
    "local": "2024-08-27T00:00:00+02:00"
  },
  "value": 14.879166841506958,
  "coordinates": {
    "latitude": 51.966058631890675,
    "longitude": 6.289890937160651
  },
  "sensorsId": 9074015,
  "locationsId": 2827201
},

Copy link
Collaborator

@caparker caparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I did add some more tests. Some unit tests for the new datetime min query param and then some sql tests for the latest endpoints - all passed without modification.

@russbiggs russbiggs merged commit 8347e35 into main Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants