Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TierQuotaDefinitions are not deleted #330

Merged
merged 24 commits into from
Oct 17, 2023
Merged

TierQuotaDefinitions are not deleted #330

merged 24 commits into from
Oct 17, 2023

Conversation

Dannyps
Copy link
Contributor

@Dannyps Dannyps commented Oct 12, 2023

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration tests.
  • I ensured that the PR title is good enough for the changelog.
  • I labeled the PR.

Description

After an intensive round of tests, @JLSRKonk found that deleting a Tier did not delete the related TierQuotaDefinitions. Instead, it set their TierId to _ null_. This is not the expected behaviour, and this PR fixes that.
We also took the opportunity to change a number of other aspects about the application:

  1. The deletion of a TierQuotaDefinion is now done via its own repo method.
  2. When a TierQuotaDefinition is deleted, the IntegrationEvent does not delete the related TierQuotas, because they're now deleted via FK Cascade.
  3. When a TierQuotaDefinition is deleted, the IntegrationEvent recalculates MetricStatuses for all Identities with that TQD's Tier.
  4. When a Tier is deleted, related TierQuotaDefinitions are deleted via FK Cascade.
  5. When deleting a Tier from Quotas.Tiers, related Quotas.Identities are not subject to Cascade deletion. This was creating a double way for another entity, creating a circular cascade delete error.

@Dannyps Dannyps added the bug Something isn't working label Oct 12, 2023
@Dannyps Dannyps self-assigned this Oct 12, 2023
@Dannyps Dannyps marked this pull request as ready for review October 13, 2023 14:11
@Dannyps Dannyps requested a review from tnotheis as a code owner October 13, 2023 14:11
@Dannyps Dannyps merged commit cf8f081 into main Oct 17, 2023
18 checks passed
@Dannyps Dannyps deleted the tqd-not-deleted branch October 17, 2023 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants