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

SIMSBIOHUB-619: Import Observations With Sampling Information #1389

Merged
merged 17 commits into from
Oct 30, 2024

Conversation

mauberti-bc
Copy link
Collaborator

@mauberti-bc mauberti-bc commented Oct 3, 2024

Links to Jira Tickets

Description of Changes

  • Allow observations to be imported from a .csv with sampling site, sampling method, and sampling period
  • Sampling information is optional
  • Replaces the observation latitude/longitude NOT NULL constraints with a check for either latitude/longitude or survey_sample_period_id being NOT NULL
  • Replaces the observation date/time NOT NULL constraints with a check for either date or survey_sample_period_id being NOT NULL
  • If sign is not specified, sign defaults to "direct sighting"

Testing Notes

  • Sampling information is optional in the csv
  • If a site but no method is specified, and only one method exists for that site, SIMS will use the only method
  • If a method but no period is specified, and only one period exists for that method, SIMS will use the only period
  • If a method but no period is specified and multiple periods exists, SIMS will try to find the period based on the observation date/time.
  • There is no validation that the observation date/time lies within the period's start and end

NOTE: Dates are assumed to be in UTC format when read in with xlsx.read(), causing observation dates to be incorrectly offset by 1 day earlier. This will be fixed in a separate PR.

@mauberti-bc mauberti-bc added the Early Feedback Welcome PR is not finished, but early review feedback is welcomed label Oct 3, 2024
@mauberti-bc mauberti-bc changed the title Import Observations With Sampling Information SIMSBIOHUB-619: Import Observations With Sampling Information Oct 3, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 32.38095% with 71 lines in your changes missing coverage. Please review.

Project coverage is 46.27%. Comparing base (bb7855b) to head (1777265).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
api/src/services/observation-service.ts 6.25% 60 Missing ⚠️
api/src/utils/xlsx-utils/cell-utils.ts 70.00% 3 Missing and 3 partials ⚠️
...s/observation-repository/observation-repository.ts 0.00% 0 Missing and 4 partials ⚠️
api/src/utils/media/xlsx/xlsx-utils.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1389      +/-   ##
==========================================
- Coverage   46.34%   46.27%   -0.07%     
==========================================
  Files         782      783       +1     
  Lines       21116    21193      +77     
  Branches     3166     3188      +22     
==========================================
+ Hits         9787     9808      +21     
- Misses      10745    10798      +53     
- Partials      584      587       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mauberti-bc mauberti-bc added Ready For Review PR is ready for review and removed Early Feedback Welcome PR is not finished, but early review feedback is welcomed labels Oct 24, 2024
@mauberti-bc mauberti-bc marked this pull request as ready for review October 24, 2024 00:31
NickPhura
NickPhura previously approved these changes Oct 29, 2024
Copy link
Collaborator

@NickPhura NickPhura left a comment

Choose a reason for hiding this comment

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

🐧

Copy link

sonarcloud bot commented Oct 30, 2024

@NickPhura NickPhura merged commit 0d9d67d into dev Oct 30, 2024
21 of 23 checks passed
@NickPhura NickPhura deleted the SIMSBIOHUB-619 branch October 30, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants