Skip to content

DT-3150: Soft delete DACs#2876

Merged
rushtong merged 11 commits intodevelopfrom
gr-DT-3150-soft-delete-dacs
Apr 27, 2026
Merged

DT-3150: Soft delete DACs#2876
rushtong merged 11 commits intodevelopfrom
gr-DT-3150-soft-delete-dacs

Conversation

@rushtong
Copy link
Copy Markdown
Contributor

@rushtong rushtong commented Apr 24, 2026

Addresses

https://broadworkbench.atlassian.net/browse/DT-3150

Summary

This PR adds new code for soft deleting DACs.

  • DACs are no longer deleted, just marked as deleted similarly to how we treat FSOs
  • New fields added to DAC and mappers/reducers
  • DAC queries are updated to exclude deleted 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.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@rushtong rushtong marked this pull request as ready for review April 24, 2026 15:44
@rushtong rushtong requested a review from a team as a code owner April 24, 2026 15:44
@rushtong rushtong requested review from Copilot, eweitz, kevinmarete and otchet-broad and removed request for a team April 24, 2026 15:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, and delete_date fields to dac and 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.

Comment thread src/test/java/org/broadinstitute/consent/http/db/DacDAOTest.java Outdated
Comment thread src/test/java/org/broadinstitute/consent/http/service/dao/DacServiceDAOTest.java Outdated
Comment thread src/main/resources/changesets/changelog-consent-2026-04-24-dac-soft-delete.xml Outdated
Comment thread src/main/java/org/broadinstitute/consent/http/db/DacDAO.java
Comment thread src/test/java/org/broadinstitute/consent/http/db/DacDAOTest.java Outdated
Comment thread src/main/java/org/broadinstitute/consent/http/db/DaaDAO.java Outdated
Comment thread src/main/java/org/broadinstitute/consent/http/db/DaaDAO.java Outdated
Copy link
Copy Markdown
Contributor

@fboulnois fboulnois left a comment

Choose a reason for hiding this comment

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

👍

Comment thread src/main/java/org/broadinstitute/consent/http/db/DacDAO.java Outdated
@rushtong rushtong enabled auto-merge (squash) April 27, 2026 15:46
@rushtong rushtong disabled auto-merge April 27, 2026 15:49
@sonarqubecloud
Copy link
Copy Markdown

@rushtong rushtong merged commit 8759005 into develop Apr 27, 2026
14 checks passed
@rushtong rushtong deleted the gr-DT-3150-soft-delete-dacs branch April 27, 2026 16:15
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.

5 participants