-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add Reef Check entities #1052
base: master
Are you sure you want to change the base?
Add Reef Check entities #1052
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ApiProperty() | ||
@VirtualColumn({ | ||
query: (survey) => ` | ||
SELECT satellite_temperature | ||
FROM daily_data | ||
WHERE DATE(daily_data.date) = DATE(${survey}.date) | ||
AND daily_data.site_id = ${survey}.site_id | ||
LIMIT 1 | ||
`, | ||
}) | ||
satelliteTemperature: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is based on surveys service
aqualink-app/packages/api/src/surveys/surveys.service.ts
Lines 247 to 252 in 343573b
.leftJoinAndMapOne( | |
'survey.latestDailyData', | |
'daily_data', | |
'data', | |
'data.site_id = survey.site_id AND DATE(data.date) = DATE(survey.diveDate)', | |
) |
@ericboucher please verify whether this is the right way to compute the satellite temperature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ This pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!
What to expect from this code review:
- Comments posted to any areas of potential concern or improvement.
- Detailed feedback or actions needed to resolve issues that are found.
- Turnaround times vary, but we aim to be swift.
@K-Markopoulos you can click here to see the review status or cancel the code review job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequest Breakdown
Reviewable lines of change
+ 1,431
- 4
99% TypeScript
1% JSON
Generated lines of change
+ 38
- 87
Type of change
Feature - These changes are adding a new feature or improvement to existing code.
1 Message | |
---|---|
Due to its size, this pull request will likely have a little longer turnaround time and will probably require multiple passes from our reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work here. I noticed just one issue noted inline for your consideration.
Reviewed with ❤️ by PullRequest
query: (survey) => ` | ||
SELECT satellite_temperature | ||
FROM daily_data | ||
WHERE DATE(daily_data.date) = DATE(${survey}.date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential SQL injection vulnerability. I'd recommend applying validation on survey within this function to guard against this, even if this is not vulnerable today, but future refactors could inadvertently introduce this. Having this function check that the survey matches a regex is good security practice.
Integrate provided Reef Check Data into Aqualink.
ReefCheckSite
,ReefCheckSurvey
,ReefCheckOrganism
,ReefCheckSubstrate