Skip to content

Add endpoint to get CautionaryAlerts from database#30

Merged
Asura5 merged 13 commits intomasterfrom
callum/flat-table-from-spreadsheet
Mar 24, 2022
Merged

Add endpoint to get CautionaryAlerts from database#30
Asura5 merged 13 commits intomasterfrom
callum/flat-table-from-spreadsheet

Conversation

@LBHCallumM
Copy link
Copy Markdown
Member

Describe this PR

What is the problem we're trying to solve

When loading cautionary alerts from an endpoint that uses GoogleSheets, it often returns 502 BadGateway. The issue correlates with a large number of requests to the endpoint, which suggests it is related to rate limiting on Google's end.

Currently, I cannot find a solution for this, other than reducing the number of requests made to the GoogleSheets API.

What changes have we introduced

This PR introduces a new endpoint GetPropertyAlertsNew and a new table in the UH database.

  • URL: api/v1/cautionary-alerts/properties-new/{propertyReference}
  • Table: PropertyAlertNew

To mitigate the issue with GoogleSheets, the data from the CautionaryAlerts spreadsheet will be read from a database directly.

The data will be manually imported into the database using a stored procedure.

The endpoint behaves the same as the googleSheets equivalent, other than reading data from a database.

Checklist

  • Added end-to-end (i.e. integration) tests where necessary e.g to test complete functionality of a newly added feature
  • Added tests to cover all new production code
  • Added comments to the README or updated relevant documentation (add link to documentation), where necessary.
  • Checked all code for possible refactoring
  • Code pipeline builds correctly

Follow up actions after merging PR

  • Create table
  • Add stored procedures for adding and removing cautionary alerts from the database.

@Asura5 Asura5 merged commit abf19f9 into master Mar 24, 2022
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