Skip to content

Delete assigned resource must return HTTP status code 409 Conflict - #693

Merged
david-monichi merged 4 commits into
mainfrom
fix/issue-692_delete-assigned-location-returns-409
Jul 24, 2026
Merged

Delete assigned resource must return HTTP status code 409 Conflict#693
david-monichi merged 4 commits into
mainfrom
fix/issue-692_delete-assigned-location-returns-409

Conversation

@stiliyan-v

Copy link
Copy Markdown
Member

Changes Made:

  • Added the new exception class CompasAssignedLocationException for cases when a location with assigned resources is attempted to be deleted.
  • Updated LocationsService.deleteLocation to throw CompasAssignedLocationException instead of the more generic CompasSclDataServiceException when deletion is not allowed.
  • Introduced CompasAssignedLocationExceptionHandler to map CompasAssignedLocationException to a 409 Conflict HTTP response with a structured error body.

Testing Updates:

  • Added a unit test for CompasAssignedLocationExceptionHandler to verify correct error response mapping.
  • Updated service and resource tests to expect and use CompasAssignedLocationException instead of the previous exception.

…d location

Signed-off-by: Stiliyan Valkanov <stiliyan.valkanov@bearingpoint.com>
Signed-off-by: Stiliyan Valkanov <stiliyan.valkanov@bearingpoint.com>
@stiliyan-v stiliyan-v self-assigned this Jul 9, 2026
@stiliyan-v
stiliyan-v requested a review from a team as a code owner July 9, 2026 13:28
Signed-off-by: Stiliyan Valkanov <stiliyan.valkanov@bearingpoint.com>
clepski
clepski previously approved these changes Jul 21, 2026
Signed-off-by: David Monichi <david.monichi@bearingpoint.com>
@sonarqubecloud

Copy link
Copy Markdown

@david-monichi

Copy link
Copy Markdown
Contributor

@clepski Hi, I just did a code cleanup and we would need your approval. Somehow this feels like a situation we mentioned last Retro where we should be able to merge ourself without your approval (just the code cleanup).

@Sander3003 Is it possible that at least I get the permission to merge for such cases?

@Sander3003

Copy link
Copy Markdown
Member

Yes, let me check the permissions.

@Sander3003

Copy link
Copy Markdown
Member

Bearingpoint has maintainer rights now.

@david-monichi

Copy link
Copy Markdown
Contributor

Bearingpoint has maintainer rights now.

Thx, we will use them as we agreed on.

@david-monichi
david-monichi self-requested a review July 24, 2026 08:50
@david-monichi

Copy link
Copy Markdown
Contributor

@Sander3003 I guess for development you would need to approve this PR:
#707

@david-monichi
david-monichi merged commit dd11a4c into main Jul 24, 2026
8 checks passed
@david-monichi
david-monichi deleted the fix/issue-692_delete-assigned-location-returns-409 branch July 24, 2026 12:21
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.

Deleting a location assigned to resources returns 500 instead of 409 Conflict

4 participants