Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
f746954
[BI-2067] - Fix version
HMS17 Oct 8, 2024
0664cb2
[BI-2067] - Fix version
HMS17 Oct 8, 2024
7d23725
Merge pull request #407 from Breeding-Insight/feature/BI-2067
HMS17 Oct 8, 2024
890aeee
[autocommit] bumping build number
rob-ouser-bi Oct 8, 2024
687910b
[BI-2203] Added migtations to address bug in staging
davedrp Sep 26, 2024
54eb634
removed backup file
davedrp Sep 27, 2024
bcc25c4
[BI-2203] modified .env.template to include ORCID_SANDBOX_AUTHENTICATION
davedrp Sep 27, 2024
bcd19fa
[BI-2203] delete the user 'Chris Tucker' when it has a NULL email
davedrp Sep 30, 2024
50f67df
[BI-2203]Moved logic from SQL migration to Java migration, to insure …
davedrp Oct 1, 2024
43ac16b
[BI-2203] fixed unit test to deal with one less user
davedrp Oct 10, 2024
011f006
Merge pull request #408 from Breeding-Insight/bug/BI-2203
davedrp Oct 10, 2024
5976aab
[autocommit] bumping build number
rob-ouser-bi Oct 10, 2024
a761163
[BI-2328] Added new validation for periods in a trait name
davedrp Oct 9, 2024
f437b97
[BI-2328] fixed error I created in previous commit
davedrp Oct 11, 2024
beaee3a
[BI-2328] fixed test, future proofed some code
davedrp Oct 23, 2024
e4177a0
[BI-2328] fixed bug and unit test
davedrp Oct 24, 2024
d6bcf37
Merge pull request #411 from Breeding-Insight/bug/BI-2328
davedrp Oct 24, 2024
9c4c2d1
[autocommit] bumping build number
rob-ouser-bi Oct 24, 2024
ac40aff
Merge branch 'develop' into bug/BI-2330
mlm483 Oct 28, 2024
3fbb75f
Merge pull request #418 from Breeding-Insight/bug/BI-2330
mlm483 Oct 29, 2024
9d4f7c7
[autocommit] bumping build number
rob-ouser-bi Oct 29, 2024
ee5a46a
Merge branch 'develop' into bug/BI-2344
mlm483 Oct 30, 2024
a98bbf8
Merge pull request #421 from Breeding-Insight/bug/BI-2344
mlm483 Oct 30, 2024
862f819
[autocommit] bumping build number
rob-ouser-bi Oct 30, 2024
0151cf4
Merge branch 'develop' into bug/BI-2354
mlm483 Nov 4, 2024
99507a6
Merge pull request #424 from Breeding-Insight/bug/BI-2354
mlm483 Nov 4, 2024
6f65626
[autocommit] bumping build number
rob-ouser-bi Nov 4, 2024
2f32914
Merge pull request #425 from Breeding-Insight/bug/BI-2338
mlm483 Nov 4, 2024
02acaae
[autocommit] bumping build number
rob-ouser-bi Nov 4, 2024
5ac1ba9
[BI-2156] - updated apache tika
mlm483 Nov 14, 2024
92b08d0
[BI-2156] - hard-coded apache commons compress version
mlm483 Nov 14, 2024
da84b7c
[BI-2203] - renamed migration
mlm483 Nov 15, 2024
b7d65b0
Merge pull request #433 from Breeding-Insight/bug/BI-2203-hotfix
mlm483 Nov 18, 2024
893ebe0
[autocommit] bumping build number
rob-ouser-bi Nov 18, 2024
369f421
[BI-2376] - added method signatures
mlm483 Nov 18, 2024
6afa355
merged develop into release/1.0-develop
mlm483 Nov 18, 2024
beae447
[autocommit] bumping build number
rob-ouser-bi Nov 18, 2024
75e978c
Merge pull request #429 from Breeding-Insight/release/1.0-develop
mlm483 Nov 18, 2024
3716bfc
[autocommit] bumping build number
rob-ouser-bi Nov 18, 2024
257e848
[BI-2343] - GID filtering not informative
HMS17 Nov 19, 2024
22e0003
[BI-2156] - removed unused variable from pom.xml
mlm483 Nov 20, 2024
87d0962
add delete endpoint to list controller
dmeidlin Nov 15, 2024
e29d0fe
get germplasm list contents via germplasm controller
dmeidlin Nov 18, 2024
095342f
revert GET list data objects from ListController
dmeidlin Nov 20, 2024
bfbddf6
Merge branch 'develop' into bug/BI-2343
HMS17 Nov 20, 2024
2aedf3b
Merge branch 'develop' into bug/BI-2156
mlm483 Nov 20, 2024
16cdff9
Merge pull request #432 from Breeding-Insight/bug/BI-2156
mlm483 Nov 20, 2024
e778c65
[autocommit] bumping build number
rob-ouser-bi Nov 20, 2024
0a3fda7
update tests
dmeidlin Nov 21, 2024
3c5bcc1
Merge branch 'develop' into feature/BI-2376
mlm483 Nov 22, 2024
f6d6745
[BI-2376] - renamed lists methods
mlm483 Nov 22, 2024
cd9498f
[BI-2376] - added method stubs
mlm483 Nov 22, 2024
0982192
add httpok helper methods to BrAPIDAOUtil
dmeidlin Nov 26, 2024
d389288
[BI-2343] - added entry number matching
HMS17 Nov 26, 2024
dae48ce
[BI-2376] - initial implementation
mlm483 Nov 26, 2024
6a88ec8
[BI-2376] - merged feature/BI-2372 into feature/BI-2376
mlm483 Nov 26, 2024
a0c5e91
[BI-2376] - updated method reference
mlm483 Nov 26, 2024
0130ce6
Merge branch 'develop' into bug/BI-2343
HMS17 Nov 27, 2024
8e7ec0c
Merge pull request #435 from Breeding-Insight/bug/BI-2343
HMS17 Nov 27, 2024
fa60291
[autocommit] bumping build number
rob-ouser-bi Nov 27, 2024
7dbaf09
[BI-2376] - added cache invalidation
mlm483 Dec 5, 2024
e5c6fea
[BI-2376] - used 204 No Content
mlm483 Dec 16, 2024
270b858
[BI-2376] - improved exception handling
mlm483 Dec 17, 2024
3a2a1d3
[BI-2376] - added integration tests
mlm483 Dec 17, 2024
98ff599
add delete endpoint to list controller
dmeidlin Nov 15, 2024
664083e
get germplasm list contents via germplasm controller
dmeidlin Nov 18, 2024
582c695
revert GET list data objects from ListController
dmeidlin Nov 20, 2024
c93e834
update tests
dmeidlin Nov 21, 2024
a4169ff
add httpok helper methods to BrAPIDAOUtil
dmeidlin Nov 26, 2024
9b25bf2
update ListControllerIntegrationTest
dmeidlin Dec 3, 2024
7fe03bf
update TODO comment
dmeidlin Dec 16, 2024
710e677
incorporate PR feedback
dmeidlin Dec 20, 2024
3deb60b
[BI-2424] - refactored getObservationUnitsByDbId
mlm483 Dec 23, 2024
90fcfa0
Delete sample submission initial work
nickpalladino Jan 9, 2025
fe5f667
fix germplasm integration test
dmeidlin Jan 10, 2025
7fabdbf
Merge pull request #434 from Breeding-Insight/feature/BI-2372
dmeidlin Jan 10, 2025
bd6d393
[autocommit] bumping build number
rob-ouser-bi Jan 10, 2025
925af9e
Merge branch 'develop' into bug/BI-2424
mlm483 Jan 13, 2025
1d19a82
Merge pull request #439 from Breeding-Insight/bug/BI-2424
mlm483 Jan 13, 2025
f874c82
[autocommit] bumping build number
rob-ouser-bi Jan 13, 2025
191adc2
[BI-2376] - merged develop into feature/BI-2376
mlm483 Jan 13, 2025
7c03b4f
Merge branch 'develop' into feature/BI-2379
nickpalladino Jan 13, 2025
2a05053
[BI-2376] - cleaned up comment
mlm483 Jan 14, 2025
6ee7e4f
[BI-2376] - changes based on review
mlm483 Jan 14, 2025
9c0fdb5
Merge pull request #437 from Breeding-Insight/feature/BI-2376
mlm483 Jan 15, 2025
3ff0eb4
[autocommit] bumping build number
rob-ouser-bi Jan 15, 2025
e76de77
Merge branch 'develop' into feature/BI-2379
nickpalladino Jan 15, 2025
b58768c
Cleanup
nickpalladino Jan 16, 2025
8de90d9
Removed added spacing
nickpalladino Jan 16, 2025
4ead129
Cleanup comments
nickpalladino Jan 16, 2025
110bdaa
[autocommit] bumping build number
rob-ouser-bi Jan 27, 2025
bc2b09c
Handle non-immediate response
nickpalladino Jan 27, 2025
4855dca
[BI-2156-qa] - fixed ObsUnitIds not found error handling
mlm483 Jan 29, 2025
e52481f
[BI-2156-qa] - fixed edge case NPE
mlm483 Jan 29, 2025
4f0b941
[BI-2156-qa] - made changes based on review
mlm483 Jan 31, 2025
d23c84c
[BI-2156-qa] - cleaned up imports
mlm483 Jan 31, 2025
6742121
[BI-2156-qa] - made error tabular
mlm483 Feb 4, 2025
a35eb5f
Added plate deletion
nickpalladino Feb 4, 2025
6b6728f
[BI-2047] - added getByObservationVariableDbId
mlm483 Feb 6, 2025
4d73e2d
refactor append workflow obs unit validation and create UndefinedData…
dmeidlin Feb 7, 2025
5309676
Add program admin permission
nickpalladino Feb 10, 2025
10c6adf
Cleaned up comments
nickpalladino Feb 11, 2025
f44a4f9
[BI-2047] - added observations test
mlm483 Feb 11, 2025
cfea75b
[BI-2047] - implemented BrAPIObservationsController::observationsGet
mlm483 Feb 11, 2025
6277612
[BI-2156-qa] - added notice to new files
mlm483 Feb 11, 2025
3883e85
[BI-2156-qa] - added notice
mlm483 Feb 12, 2025
c83d037
[BI-2047] - improved efficiency
mlm483 Feb 12, 2025
c9de044
Update src/main/java/org/breedinginsight/services/SampleSubmissionSer…
nickpalladino Feb 13, 2025
21ce4be
Added return type to docs
nickpalladino Feb 13, 2025
5cbc69a
Merge branch 'feature/BI-2379' of https://github.com/Breeding-Insight…
nickpalladino Feb 13, 2025
eab67a0
Merge pull request #440 from Breeding-Insight/feature/BI-2379
nickpalladino Feb 13, 2025
e57120c
[autocommit] bumping build number
rob-ouser-bi Feb 13, 2025
e3be5b6
[BI-2047] - implemented pagination
mlm483 Feb 14, 2025
123e94f
[BI-2047] - translated DbIds
mlm483 Feb 14, 2025
5a0b69e
[BI-2047] - handled division by zero edge case
mlm483 Feb 17, 2025
d0ab4c3
[BI-2047] - added pagination test
mlm483 Feb 17, 2025
618d8a7
[BI-2047] - updated comments
mlm483 Feb 17, 2025
9ea73d4
[BI-2047] - improved exception handling
mlm483 Feb 17, 2025
3279b5b
[BI-2047] - reused observations list
mlm483 Feb 17, 2025
edb94f5
[BI-2047] - added correct defaults
mlm483 Feb 18, 2025
c988d88
[BI-2047] - removed comment
mlm483 Feb 18, 2025
8d41a91
[BI-2047] - added studyDbId translation
mlm483 Feb 18, 2025
7aed5ac
Merge branch 'develop' into feature/BI-2047
mlm483 Feb 18, 2025
487aedb
Merge pull request #443 from Breeding-Insight/feature/BI-2047
mlm483 Feb 18, 2025
a3e6fc5
[autocommit] bumping build number
rob-ouser-bi Feb 18, 2025
b4f1a24
Merge branch 'develop' into BI-2156-qa
mlm483 Feb 19, 2025
686568c
Merge pull request #442 from Breeding-Insight/BI-2156-qa
mlm483 Feb 19, 2025
d4677ab
[autocommit] bumping build number
rob-ouser-bi Feb 19, 2025
10e74d0
[BI-2450] made the delay for caching, config driven. If no nnew valu…
davedrp Feb 17, 2025
f83b841
[BI-2450] made .env variables uppercase
davedrp Feb 24, 2025
03326c6
Merge pull request #444 from Breeding-Insight/feature/BI-2450
davedrp Feb 26, 2025
be4d0a1
[autocommit] bumping build number
rob-ouser-bi Feb 26, 2025
5e6af03
[autocommit] bumping build number
rob-ouser-bi Mar 3, 2025
69c82ee
[BI-2585] fixed type-o in migrations
davedrp Mar 24, 2025
8c30a39
Merge pull request #449 from Breeding-Insight/bug/BI-2585
davedrp Mar 24, 2025
1996f2a
[autocommit] bumping build number
rob-ouser-bi Mar 24, 2025
79ee1c6
[BI-2187] call GermplasmProcessor::createPostOrder for commit and NOT…
davedrp Feb 21, 2025
05f25b5
[BI-2187] Fixed bug, caused by the gemplasm Pedigree string being di…
davedrp Mar 26, 2025
8be0c65
Merge pull request #445 from Breeding-Insight/bug/BI-2187
davedrp Mar 26, 2025
14acf7a
[autocommit] bumping build number
rob-ouser-bi Mar 26, 2025
3c4d3e3
Baseline tests
nickpalladino Mar 31, 2025
55065ff
Added test csv import files
nickpalladino Apr 1, 2025
6dd0073
Removed debug comments from processor
nickpalladino Apr 1, 2025
2060027
Added gid assignment order check for committed data
nickpalladino Apr 1, 2025
5f9c804
Added pedigree check for committed data
nickpalladino Apr 1, 2025
8076cd1
Cleaned up comments in tests
nickpalladino Apr 1, 2025
d4258a0
Merge pull request #451 from Breeding-Insight/bug/BI-2573
nickpalladino Apr 3, 2025
21ca293
[autocommit] bumping build number
rob-ouser-bi Apr 3, 2025
46de113
[BI-2567] speed up data gathering for germplasm list and list-detail …
davedrp Mar 27, 2025
bf82568
[BI-2567] cleaned up code (moved code from a foreach loop to a simula…
davedrp Mar 28, 2025
83f392e
Merge pull request #450 from Breeding-Insight/bug/BI-2567
davedrp Apr 4, 2025
dccdf96
[autocommit] bumping build number
rob-ouser-bi Apr 4, 2025
116be9e
[autocommit] bumping build number
rob-ouser-bi Apr 7, 2025
a41e184
Use appropriate ids for both preview and commit
nickpalladino Apr 7, 2025
8a134c3
Refactored to clean up a bit
nickpalladino Apr 8, 2025
aa4a43e
Added file header
nickpalladino Apr 8, 2025
8610b9a
Added test case
nickpalladino Apr 8, 2025
5c1b90a
Switched to using gids to track germplasm
nickpalladino Apr 8, 2025
8c0ed22
Merge pull request #452 from Breeding-Insight/bug/BI-2593
nickpalladino Apr 9, 2025
7bdf11c
[autocommit] bumping build number
rob-ouser-bi Apr 9, 2025
b94b215
Merge branch 'release/1.1' into bug/BI-2594
nickpalladino Apr 9, 2025
d982380
Removed unused code
nickpalladino Apr 9, 2025
88640ec
Merge pull request #453 from Breeding-Insight/bug/BI-2594
nickpalladino Apr 9, 2025
c643ea0
[autocommit] bumping build number
rob-ouser-bi Apr 9, 2025
1062f71
[BI-2595] - added logging
mlm483 Apr 15, 2025
c2698fe
Merge pull request #455 from Breeding-Insight/logging/BI-2595
mlm483 Apr 15, 2025
7f081b6
[autocommit] bumping build number
rob-ouser-bi Apr 15, 2025
1bdd132
[BI-2595] - reverted dependency changes
mlm483 Apr 18, 2025
fa35140
Merge pull request #457 from Breeding-Insight/bug/BI-2595
mlm483 Apr 23, 2025
baa7cc0
[autocommit] bumping build number
rob-ouser-bi Apr 23, 2025
88d42cd
[REVERT ME] - temporary test configuration change
mlm483 Apr 24, 2025
d3fd922
[autocommit] bumping build number
rob-ouser-bi Apr 24, 2025
a05d1e1
[BI-2608] Changed column-name from 'Long' to 'Elevation' in error mes…
davedrp Apr 23, 2025
d50dc65
Merge pull request #460 from Breeding-Insight/bug/BI-2608
davedrp Apr 29, 2025
f5d06b4
[autocommit] bumping build number
rob-ouser-bi Apr 29, 2025
4d8e00f
Merge branch 'main' into release/1.1-main
mlm483 Apr 30, 2025
bda5533
[autocommit] bumping build number
rob-ouser-bi Apr 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
USER_ID=<user id of system user>
GROUP_ID=<group id of system user>

ORCID_SANDBOX_AUTHENTICATION=<true or false; true=>use the Sandbox Orcid, false=>use the Production Orcid. Defaults to false.>

# Authentication variables
OAUTH_CLIENT_ID=<oauth app client id>
OAUTH_CLIENT_SECRET=<ouath_client_secret goes here>
Expand Down Expand Up @@ -59,4 +61,12 @@ AWS_GENO_BUCKET=<s3 bucket for genotypic data uploads>
AWS_S3_ENDPOINT=<s3 endpoint, default https://s3.us-east-1.amazonaws.com>

BRAPI_VENDOR_SUBMISSION_ENABLED=false #can a submission be sent to a vendor via BrAPI
BRAPI_VENDOR_CHECK_FREQUENCY=1d #how often to check for vendor updates for sample submissions
BRAPI_VENDOR_CHECK_FREQUENCY=1d #how often to check for vendor updates for sample submissions

#The initial caching of each type of object needs to be staggered by the prescribed number of seconds
GERMPLASM_START_DELAY=5s
STUDY_START_DELAY=10s
TRIAL_START_DELAY=15s
TRAIT_START_DELAY=20s
OBSERVATION_START_DELAY=25s
OBSERVATION_UNIT_START_DELAY=30s
184 changes: 92 additions & 92 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
Expand All @@ -499,9 +499,9 @@
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
</filters>

<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${exec.mainClass}</mainClass>
</transformer>
Expand Down Expand Up @@ -536,98 +536,98 @@
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>${jooq.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>${jooq.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>

<configuration>
<jdbc>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://${DB_SERVER}/${DB_NAME}</url>
<user>${DB_USER}</user>
<password>${DB_PASSWORD}</password>
</jdbc>
<generator>
<name>org.breedinginsight.generation.JooqDaoGenerator</name>
<database>
<name>org.jooq.meta.postgres.PostgresDatabase</name>
<includes>.*</includes>
<inputSchema>public</inputSchema>
<includeTables>true</includeTables>
<includeUDTs>true</includeUDTs>
<includeRoutines>false</includeRoutines>
<includePrimaryKeys>true</includePrimaryKeys>
<includeUniqueKeys>true</includeUniqueKeys>
<includeForeignKeys>true</includeForeignKeys>
<includeCheckConstraints>true</includeCheckConstraints>
<includeIndexes>false</includeIndexes>
<excludes>
flyway_schema_history|base_entity|base_track_edit_entity|spatial_ref_sys
</excludes>
</database>

<configuration>
<jdbc>
<driver>org.postgresql.Driver</driver>
<strategy>
<matchers>
<tables>
<table>
<pojoClass>
<transform>PASCAL</transform>
<expression>$0_ENTITY</expression>
</pojoClass>
<tableClass>
<transform>PASCAL</transform>
<expression>$0_TABLE</expression>
</tableClass>
</table>
</tables>
</matchers>
</strategy>

<target>
<packageName>org.breedinginsight.dao.db</packageName>
<directory>target/generated-sources/jooq</directory>
</target>
<generate>
<pojos>true</pojos>
<daos>true</daos>
<fluentSetters>false</fluentSetters>
<javaTimeTypes>true</javaTimeTypes>
</generate>
</generator>
</configuration>
<dependencies>
<dependency>
<groupId>org.breedinginsight</groupId>
<artifactId>bi-jooq-codegen</artifactId>
<version>${jooq.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway.version}</version>
<configuration>
<url>jdbc:postgresql://${DB_SERVER}/${DB_NAME}</url>
<user>${DB_USER}</user>
<password>${DB_PASSWORD}</password>
</jdbc>
<generator>
<name>org.breedinginsight.generation.JooqDaoGenerator</name>
<database>
<name>org.jooq.meta.postgres.PostgresDatabase</name>
<includes>.*</includes>
<inputSchema>public</inputSchema>
<includeTables>true</includeTables>
<includeUDTs>true</includeUDTs>
<includeRoutines>false</includeRoutines>
<includePrimaryKeys>true</includePrimaryKeys>
<includeUniqueKeys>true</includeUniqueKeys>
<includeForeignKeys>true</includeForeignKeys>
<includeCheckConstraints>true</includeCheckConstraints>
<includeIndexes>false</includeIndexes>
<excludes>
flyway_schema_history|base_entity|base_track_edit_entity|spatial_ref_sys
</excludes>
</database>

<strategy>
<matchers>
<tables>
<table>
<pojoClass>
<transform>PASCAL</transform>
<expression>$0_ENTITY</expression>
</pojoClass>
<tableClass>
<transform>PASCAL</transform>
<expression>$0_TABLE</expression>
</tableClass>
</table>
</tables>
</matchers>
</strategy>

<target>
<packageName>org.breedinginsight.dao.db</packageName>
<directory>target/generated-sources/jooq</directory>
</target>
<generate>
<pojos>true</pojos>
<daos>true</daos>
<fluentSetters>false</fluentSetters>
<javaTimeTypes>true</javaTimeTypes>
</generate>
</generator>
</configuration>
<dependencies>
<dependency>
<groupId>org.breedinginsight</groupId>
<artifactId>bi-jooq-codegen</artifactId>
<version>${jooq.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway.version}</version>
<configuration>
<url>jdbc:postgresql://${DB_SERVER}/${DB_NAME}</url>
<user>${DB_USER}</user>
<password>${DB_PASSWORD}</password>
</configuration>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
</dependency>
</dependencies>
</plugin>
</configuration>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,43 @@ public HttpResponse deleteExperimentalCollaborator(
}

}

/**
* Deletes an experiment.
* @param programId The UUID of the program
* @param experimentId The UUID of the experiment
* @param hard Specifies hard or soft delete
* @return A Http Response
*/
@Delete("/${micronaut.bi.api.version}/programs/{programId}/experiments/{experimentId}{?hard}")
@ProgramSecured(roles = {ProgramSecuredRole.PROGRAM_ADMIN, ProgramSecuredRole.SYSTEM_ADMIN})
@Produces(MediaType.APPLICATION_JSON)
public HttpResponse deleteExperiment(
@PathVariable("programId") UUID programId,
@PathVariable("experimentId") UUID experimentId,
@QueryValue(defaultValue = "false") Boolean hard
) throws ApiException {
try {
Optional<Program> program = programService.getById(programId);
if(program.isEmpty()) {
return HttpResponse.notFound();
}
int observationCount = experimentService.deleteExperiment(program.get(), experimentId, hard);
if (observationCount > 0 && hard) {
// 409 Conflict. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409
return HttpResponse.status(HttpStatus.CONFLICT);
}
// 204 No Content indicates successful delete. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204
return HttpResponse.noContent();
} catch (ApiException e) {
log.error("Error deleting experiment.\n\tprogramId: " + programId + "\n\texperimentId: " + experimentId + "\n\thard: " + hard);
if (e.getCode() == 404) {
return HttpResponse.notFound();
} else {
return HttpResponse.serverError();
}
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,42 @@ public HttpResponse<Response<SampleSubmission>> checkVendorStatus(@PathVariable
return HttpResponse.serverError();
}
}

/**
* Delete sample submission.
* Deletes the bidb submission record and BrAPI samples & plates
* @param programId bi-api id of program
* @param submissionId bi-api id of submission
* @return HttpResponse
* @throws ApiException
*/
@Delete("programs/{programId}/submissions/{submissionId}")
@Produces(MediaType.APPLICATION_JSON)
// sys admin and program admin roles to match file import permissions
@ProgramSecured(roles = {ProgramSecuredRole.SYSTEM_ADMIN, ProgramSecuredRole.PROGRAM_ADMIN})
public HttpResponse deleteSubmissionById(@PathVariable UUID programId, @PathVariable UUID submissionId) throws ApiException {

// program validation
Optional<Program> program = programService.getById(programId);
if(program.isEmpty()) {
log.info(String.format("programId not found: %s", programId.toString()));
return HttpResponse.notFound();
}

// sample status validation
Optional<SampleSubmission> submissionOpt = sampleSubmissionService.getSampleSubmission(program.get(), submissionId, false);

if(submissionOpt.isEmpty()) {
return HttpResponse.notFound();
}
SampleSubmission submission = submissionOpt.get();
if (!submission.isDeletable()) {
return HttpResponse.notAllowed();
}

sampleSubmissionService.deleteSampleSubmission(program.get(), submissionId);

return HttpResponse.ok();
}

}
Loading
Loading