Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements soft-delete semantics for DACs (mark as deleted instead of hard deleting) and updates DAC-related queries to exclude deleted DACs, while restoring the data_access_agreement.initial_dac_id FK now that DAC rows remain.
Changes:
- Add
deleted,delete_user_id, anddelete_datefields todacand update DAC delete to a soft delete. - Update DAC lookup queries and various joins to exclude deleted DACs.
- Add/adjust tests to validate soft-delete behavior and filtering.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/org/broadinstitute/consent/http/service/dao/DacServiceDAOTest.java | Adds service-layer test coverage around DAC soft delete behavior. |
| src/test/java/org/broadinstitute/consent/http/db/DacDAOTest.java | Adds DAO-level tests for soft delete filtering and audit expectations. |
| src/main/resources/changesets/changelog-consent-2026-04-24-dac-soft-delete.xml | Liquibase changes to add soft-delete columns + restore DAA→DAC FK + add index. |
| src/main/resources/changesets/changelog-consent-2026-03-31-daa-audit.xml | Updates comment to reflect FK restoration in the new changelog. |
| src/main/resources/changelog-master.xml | Includes the new Liquibase changeset. |
| src/main/java/org/broadinstitute/consent/http/service/DacService.java | Guards against null associated DAA when computing Broad DAA flag. |
| src/main/java/org/broadinstitute/consent/http/models/Dac.java | Adds soft-delete fields to the DAC model. |
| src/main/java/org/broadinstitute/consent/http/db/mapper/DacMapper.java | Maps new soft-delete columns when present in result sets. |
| src/main/java/org/broadinstitute/consent/http/db/UserDAO.java | Excludes deleted DACs in role/dataset-scoped user lookups. |
| src/main/java/org/broadinstitute/consent/http/db/ElectionDAO.java | Excludes deleted DACs when resolving a DAC for an election. |
| src/main/java/org/broadinstitute/consent/http/db/DatasetDAO.java | Excludes deleted DACs in joins used by dataset/DAR-related queries. |
| src/main/java/org/broadinstitute/consent/http/db/DarCollectionSummaryDAO.java | Excludes deleted DACs in collection summary queries. |
| src/main/java/org/broadinstitute/consent/http/db/DacDAO.java | Filters deleted DACs from reads and changes delete to soft-delete update + audit insert. |
| src/main/java/org/broadinstitute/consent/http/db/DaaDAO.java | Excludes deleted DACs in multiple DAA-related joins. |
kevinmarete
approved these changes
Apr 27, 2026
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Addresses
https://broadworkbench.atlassian.net/browse/DT-3150
Summary
This PR adds new code for soft deleting DACs.
See related UI PR that fixes a minor bug in the same feature space: DataBiosphere/duos-ui#3452
Have you read CONTRIBUTING.md lately? If not, do that first.