fix: improve listing deletion process#6491
Merged
Merged
Conversation
✅ Deploy Preview for bloom-angelopolis canceled.
|
✅ Deploy Preview for partners-bloom-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for bloom-exygy-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ludtkemorgan
approved these changes
Jul 13, 2026
ludtkemorgan
left a comment
Collaborator
There was a problem hiding this comment.
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.
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.
This PR addresses #(insert-number-here)
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:
yarn generate:clientand/or created a migration when requiredReview Process: