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

Add Reef Check entities #1052

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Add Reef Check entities #1052

wants to merge 14 commits into from

Conversation

K-Markopoulos
Copy link
Collaborator

Integrate provided Reef Check Data into Aqualink.

  • Add Reef Check entities: ReefCheckSite, ReefCheckSurvey, ReefCheckOrganism, ReefCheckSubstrate
  • Add script to parse the xlsx files and create the entities.
  • Add basic api controllers for sites and surveys

image

Copy link

@pullrequest pullrequest bot left a 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 not sent to the PullRequest network because the pull request is a draft.

Comment on lines +290 to +300
@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;
Copy link
Collaborator Author

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

.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.

image

@K-Markopoulos K-Markopoulos mentioned this pull request Nov 22, 2024
6 tasks
@K-Markopoulos K-Markopoulos marked this pull request as ready for review December 2, 2024 13:52
Copy link

@pullrequest pullrequest bot left a 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.

Copy link

@pullrequest pullrequest bot left a 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.

Copy link

@pullrequest pullrequest bot left a 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.

Image of Graham C Graham C


Reviewed with ❤️ by PullRequest

query: (survey) => `
SELECT satellite_temperature
FROM daily_data
WHERE DATE(daily_data.date) = DATE(${survey}.date)
Copy link

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.

🔺 Vulnerability (Error)

Image of Graham C Graham C

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