-
Notifications
You must be signed in to change notification settings - Fork 9
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-647: Create Observations Page #1444
Open
mauberti-bc
wants to merge
28
commits into
dev
Choose a base branch
from
SIMSBIOHUB-647b
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b7317db
cherry-pick
mauberti-bc 4683f3f
Tweaks
NickPhura a24649d
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-647b
NickPhura d72a7aa
Update create observation form components. Re-arrange folder structure.
NickPhura 60f90ef
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-647b
NickPhura 167ea81
- Updated observation components.
NickPhura 7bbc575
Fix migration, update seeds.
NickPhura 7daf2d3
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-647b
NickPhura 49e7e43
Most of the backend is happy with the environment changes.
NickPhura 676df35
Fix existing unit tests
NickPhura 397d54b
Initial: Split some interfaces into separate files for readability
NickPhura a0ccafc
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-647b
NickPhura 37747f6
Update/add database models
NickPhura b2586f5
Update interfaces
NickPhura d3c0a11
Change count back to subcount.
NickPhura 4db6afd
Add get/find flattened observation service/repo functions
NickPhura bd8e33d
Remove console logs
NickPhura 05ddb06
Fix sql
NickPhura 24d01eb
styling subcount card
mauberti-bc d11c591
Merge branch 'SIMSBIOHUB-647b' of github.com:bcgov/biohubbc into SIMS…
mauberti-bc 265fc1c
Update UI to fetch flattened observations
NickPhura ad03bf7
Merge branch 'SIMSBIOHUB-647b' of https://github.com/bcgov/biohubbc i…
NickPhura 2347bea
Update observation comment column component.
NickPhura 9073358
Fix sampling styling
NickPhura a4a8d03
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-647b
NickPhura bfa4367
Preload sites, techniques, and periods.
NickPhura c58073f
Fixes
NickPhura 51dcadd
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-647b
NickPhura File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Environment Qualitative Model. | ||
* | ||
* @description Data model for `environment_qualitative`. | ||
*/ | ||
export const EnvironmentQualitativeModel = z.object({ | ||
environment_qualitative_id: z.string().uuid(), | ||
name: z.string(), | ||
description: z.string().nullable(), | ||
record_end_date: z.string().nullable(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type EnvironmentQualitativeModel = z.infer<typeof EnvironmentQualitativeModel>; | ||
|
||
/** | ||
* Environment Qualitative Record. | ||
* | ||
* @description Data record for `environment_qualitative`. | ||
*/ | ||
export const EnvironmentQualitativeRecord = EnvironmentQualitativeModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type EnvironmentQualitativeRecord = z.infer<typeof EnvironmentQualitativeRecord>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Environment Qualitative Option Model. | ||
* | ||
* @description Data model for `environment_qualitative_option`. | ||
*/ | ||
export const EnvironmentQualitativeOptionModel = z.object({ | ||
environment_qualitative_option_id: z.string(), | ||
environment_qualitative_id: z.string(), | ||
name: z.string(), | ||
description: z.string().nullable(), | ||
record_end_date: z.string().nullable(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type EnvironmentQualitativeOptionModel = z.infer<typeof EnvironmentQualitativeOptionModel>; | ||
|
||
/** | ||
* Environment Qualitative Option Record. | ||
* | ||
* @description Data record for `environment_qualitative_option`. | ||
*/ | ||
export const EnvironmentQualitativeOptionRecord = EnvironmentQualitativeOptionModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type EnvironmentQualitativeOptionRecord = z.infer<typeof EnvironmentQualitativeOptionRecord>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { z } from 'zod'; | ||
import { EnvironmentUnit } from '../database-units/environment_unit'; | ||
|
||
/** | ||
* Environment Quantitative Model. | ||
* | ||
* @description Data model for `environment_quantitative`. | ||
*/ | ||
export const EnvironmentQuantitativeModel = z.object({ | ||
environment_quantitative_id: z.string().uuid(), | ||
name: z.string(), | ||
description: z.string().nullable(), | ||
min: z.number().nullable(), | ||
max: z.number().nullable(), | ||
unit: EnvironmentUnit.nullable(), | ||
record_end_date: z.string().nullable(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type EnvironmentQuantitativeModel = z.infer<typeof EnvironmentQuantitativeModel>; | ||
|
||
/** | ||
* Environment Quantitative Record. | ||
* | ||
* @description Data record for `environment_quantitative`. | ||
*/ | ||
export const EnvironmentQuantitativeRecord = EnvironmentQuantitativeModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type EnvironmentQuantitativeRecord = z.infer<typeof EnvironmentQuantitativeRecord>; |
35 changes: 35 additions & 0 deletions
35
api/src/database-models/observation_environment_qualitative.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Observation Environment Qualitative Model. | ||
* | ||
* @description Data model for `observation_environment_qualitative`. | ||
*/ | ||
export const ObservationEnvironmentQualitativeModel = z.object({ | ||
observation_environment_qualitative_id: z.number(), | ||
survey_observation_id: z.number(), | ||
environment_qualitative_id: z.string().uuid(), | ||
environment_qualitative_option_id: z.string().uuid(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type ObservationEnvironmentQualitativeModel = z.infer<typeof ObservationEnvironmentQualitativeModel>; | ||
|
||
/** | ||
* Observation Environment Qualitative Record. | ||
* | ||
* @description Data record for `observation_environment_qualitative`. | ||
*/ | ||
export const ObservationEnvironmentQualitativeRecord = ObservationEnvironmentQualitativeModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type ObservationEnvironmentQualitativeRecord = z.infer<typeof ObservationEnvironmentQualitativeRecord>; |
35 changes: 35 additions & 0 deletions
35
api/src/database-models/observation_environment_quantitative.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Observation Environment Quantitative Model. | ||
* | ||
* @description Data model for `observation_environment_quantitative`. | ||
*/ | ||
export const ObservationEnvironmentQuantitativeModel = z.object({ | ||
observation_environment_quantitative_id: z.number(), | ||
survey_observation_id: z.number(), | ||
environment_quantitative_id: z.string().uuid(), | ||
value: z.number(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type ObservationEnvironmentQuantitativeModel = z.infer<typeof ObservationEnvironmentQuantitativeModel>; | ||
|
||
/** | ||
* Observation Environment Quantitative Record. | ||
* | ||
* @description Data record for `observation_environment_quantitative`. | ||
*/ | ||
export const ObservationEnvironmentQuantitativeRecord = ObservationEnvironmentQuantitativeModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type ObservationEnvironmentQuantitativeRecord = z.infer<typeof ObservationEnvironmentQuantitativeRecord>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Observation Sign Model. | ||
* | ||
* @description Data model for `observation_sign`. | ||
*/ | ||
export const ObservationSignModel = z.object({ | ||
observation_sign_id: z.number(), | ||
name: z.string(), | ||
description: z.string().nullable(), | ||
record_end_date: z.string().nullable(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type ObservationSignModel = z.infer<typeof ObservationSignModel>; | ||
|
||
/** | ||
* Observation Sign Record. | ||
* | ||
* @description Data record for `observation_sign`. | ||
*/ | ||
export const ObservationSignRecord = ObservationSignModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type ObservationSignRecord = z.infer<typeof ObservationSignRecord>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Observation Subcount Model. | ||
* | ||
* @description Data model for `observation_subcount`. | ||
*/ | ||
export const ObservationSubcountModel = z.object({ | ||
observation_subcount_id: z.number(), | ||
survey_observation_id: z.number(), | ||
subcount: z.number(), | ||
comment: z.string().nullable(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type ObservationSubcountModel = z.infer<typeof ObservationSubcountModel>; | ||
|
||
/** | ||
* Observation Subcount Record. | ||
* | ||
* @description Data record for `observation_subcount`. | ||
*/ | ||
export const ObservationSubcountRecord = ObservationSubcountModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type ObservationSubcountRecord = z.infer<typeof ObservationSubcountRecord>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Subcount Critter Model. | ||
* | ||
* @description Data model for `subcount_critter`. | ||
*/ | ||
export const SubcountCritterModel = z.object({ | ||
subcount_critter_id: z.number(), | ||
observation_subcount_id: z.number(), | ||
critter_id: z.number(), | ||
create_date: z.string(), | ||
create_user: z.number(), | ||
update_date: z.string().nullable(), | ||
update_user: z.number().nullable(), | ||
revision_count: z.number() | ||
}); | ||
|
||
export type SubcountCritterModel = z.infer<typeof SubcountCritterModel>; | ||
|
||
/** | ||
* Subcount Critter Record. | ||
* | ||
* @description Data record for `subcount_critter`. | ||
*/ | ||
export const SubcountCritterRecord = SubcountCritterModel.omit({ | ||
create_date: true, | ||
create_user: true, | ||
update_date: true, | ||
update_user: true, | ||
revision_count: true | ||
}); | ||
|
||
export type SubcountCritterRecord = z.infer<typeof SubcountCritterRecord>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { z } from 'zod'; | ||
|
||
/** | ||
* Environment Unit Data Type. | ||
* | ||
* @description Data type for `environment_unit`. | ||
*/ | ||
export const EnvironmentUnit = z.enum([ | ||
'millimeter', | ||
'centimeter', | ||
'meter', | ||
'milligram', | ||
'gram', | ||
'kilogram', | ||
'percent', | ||
'celsius', | ||
'ppt', | ||
'SCF', | ||
'degrees', | ||
'pH' | ||
]); | ||
|
||
export type EnvironmentUnit = z.infer<typeof EnvironmentUnit>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
question: Do you think we should name this directory
database-units
or something likedatabase-types / database-enums
. I see in the database there is an additional type / enum foralert_severity
would this also be adatabase-unit
?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.
Open to any name for the folder. Can't remember how I landed on
unit
. Probably just trying to pick something generic that could cover database enums (but also any other enum-like concept, if there are others?), and which aren't specifically table models.