Skip to content

fix: improve listing deletion process#6491

Merged
mcgarrye merged 3 commits into
mainfrom
fix/listing-cascade-delete-unit-groups
Jul 13, 2026
Merged

fix: improve listing deletion process#6491
mcgarrye merged 3 commits into
mainfrom
fix/listing-cascade-delete-unit-groups

Conversation

@mcgarrye

@mcgarrye mcgarrye commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

This PR addresses #(insert-number-here)

  • Addresses the issue in full
  • Addresses only certain aspects of the issue

Description

With the implementation of the ExternalListingService, it was found that a number of associated records with a listing record do not cascade on delete. Unfortunately, most of these would require a serious refactor with dedicated time and lift. This is covered in this backlog ticket.

This PR adds the cascade onDelete for unitGroups and unitGroupAmiLevels.
It also adds a manual delete of the address associated as the ListingBuildingAddress for a listing in the ExternalListingService.

How Can This Be Tested/Reviewed?

Through the API, call GET /externalListings

Using the data returned in the above GET response, call PUT /externalListings/ingest with the following payload
{ externalURL: 'http://localhost:3100', jurisdictionId: '{jurisdictionId}', targetName: '{jurisdictionName}', }
Should duplicate all active listings in the target jurisdiction with external fields filled out. Verify in the database.
Choose a listing to edit and store the listing id and associated buildingAddressId of the external copy
Edit the internal listing (or change contentUpdatedAt in the db)
Confirm in the db that the listing was delete AND the address with id = buildingAddressId

Author Checklist:

  • Added QA notes to the issue with applicable URLs
  • Reviewed in a desktop view
  • Reviewed in a mobile view
  • Reviewed considering accessibility
  • Added tests covering the changes
  • Made corresponding changes to the documentation
  • Ran yarn generate:client and/or created a migration when required

Review Process:

  • Read and understand the issue
  • Ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Pull the changes down locally and test that the acceptance criteria is met
  • Either (1) explicitly ask a clarifying question, (2) request changes, or (3) approve the PR, even if there are very small remaining changes, if you don't need to re-review after the updates

@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-angelopolis canceled.

Name Link
🔨 Latest commit b8d977f
🔍 Latest deploy log https://app.netlify.com/projects/bloom-angelopolis/deploys/6a5515853067dd00084b4216

@mcgarrye mcgarrye added the 1 review needed Requires 1 more review before ready to merge label Jul 9, 2026
@mcgarrye mcgarrye requested a review from ludtkemorgan July 9, 2026 15:21
@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for partners-bloom-dev ready!

Name Link
🔨 Latest commit b8d977f
🔍 Latest deploy log https://app.netlify.com/projects/partners-bloom-dev/deploys/6a551585ca8b840008962a34
😎 Deploy Preview https://deploy-preview-6491--partners-bloom-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-exygy-dev ready!

Name Link
🔨 Latest commit b8d977f
🔍 Latest deploy log https://app.netlify.com/projects/bloom-exygy-dev/deploys/6a55158459144e00081ed66a
😎 Deploy Preview https://deploy-preview-6491--bloom-exygy-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ludtkemorgan ludtkemorgan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

functionally looks good! I just recommend you update the PR title to be more descriptive of what this PR does since the cascade delete is just small part.

@ludtkemorgan ludtkemorgan added ready to merge Should be applied when a PR has been reviewed and approved and removed 1 review needed Requires 1 more review before ready to merge labels Jul 13, 2026
@mcgarrye mcgarrye changed the title fix: listing cascade delete unit groups fix: improve listing deletion process Jul 13, 2026
@mcgarrye mcgarrye merged commit 722a6a1 into main Jul 13, 2026
25 checks passed
@mcgarrye mcgarrye deleted the fix/listing-cascade-delete-unit-groups branch July 13, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Should be applied when a PR has been reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants