-
Notifications
You must be signed in to change notification settings - Fork 0
feat(api): specify delete entity-template behavior and enforce relation-target validation #91
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
Closed
walterspieler-dkt
wants to merge
17
commits into
main
from
CPDE-2895-idp-core-specify-and-validate-behavior-of-delete-entity-template
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b0a3b10
feat(entity-template): implement cascade delete for templates and add…
walterspieler-dkt 9376bad
chore: resolve merge conflicts with origin/main
Copilot 48dff4c
Merge branch 'main' into CPDE-2895-idp-core-specify-and-validate-beha…
walterspieler-dkt cb918a4
Merge branch 'main' into CPDE-2895-idp-core-specify-and-validate-beha…
walterspieler-dkt ed8061d
Merge branch 'main' into CPDE-2895-idp-core-specify-and-validate-beha…
brandPittCode 73d125a
feat(core): add delete entity template workflow
brandPittCode a207269
feat(core): add check when deleting entity template
brandPittCode 5c1ed8e
Merge branch 'main' into CPDE-2895-idp-core-specify-and-validate-beha…
brandPittCode 8132dc6
feat(core)!: add check when deleting entity template
brandPittCode 8ddd2ac
feat(core): add check when deleting entity template
brandPittCode f242b9f
feat(core): add check when deleting entity template
brandPittCode acfd844
feat(core): add check when deleting entity template
brandPittCode a3a3194
feat(core): add check when deleting entity template
brandPittCode 98c59b7
feat(core): add check when deleting entity template
brandPittCode 67cd17e
feat(core): add check when deleting entity template
brandPittCode aacc4f5
feat(core): add check when deleting entity template
brandPittCode a910924
feat(core): add check when deleting entity template
brandPittCode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
32 changes: 32 additions & 0 deletions
32
...on/idp_core/domain/exception/entity_template/EntityTemplateIsRelationTargetException.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package com.decathlon.idp_core.domain.exception.entity_template; | ||
|
|
||
| import static com.decathlon.idp_core.domain.constant.ValidationMessages.TEMPLATE_IS_RELATION_TARGET; | ||
|
|
||
| /// Exception thrown when attempting to delete a template that is still referenced | ||
| /// as a `targetTemplateIdentifier` in another template's relation definition. | ||
| /// | ||
| /// This exception enforces the template relation target integrity business rule: | ||
| /// a template may not be deleted while other templates declare relations that | ||
| /// point to it as the target, because doing so would create dangling relation | ||
| /// definitions and break the integrity of those templates. | ||
| /// | ||
| /// **Why this exception exists:** | ||
| /// - Prevents orphaned relation definitions in other templates | ||
| /// - Provides a clear, domain-specific error for callers | ||
| public class EntityTemplateIsRelationTargetException extends RuntimeException { | ||
|
|
||
| private final String identifier; | ||
|
|
||
| /// Constructs a new exception for the template identifier that cannot be | ||
| /// deleted. | ||
| /// | ||
| /// @param identifier the identifier of the template blocked from deletion | ||
| public EntityTemplateIsRelationTargetException(String identifier) { | ||
| super(String.format(TEMPLATE_IS_RELATION_TARGET, identifier)); | ||
| this.identifier = identifier; | ||
| } | ||
|
|
||
| public String getIdentifier() { | ||
| return identifier; | ||
| } | ||
| } | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.