Repository navigation
Fix/enforce archive state as terminal - #59
Merged
Merged
Conversation
8 tasks done
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.
Summary
Flagnow treats archival as a terminal state. Every mutation method on the entity(
SetEnabled,UpdateStrategy,UpdateName,Update,Archive) carries a guardclause as its first statement: if
IsArchivedistrue, the method throws a newFlagDomainExceptionwhose message names the flag. The exception extendsBanderasExceptionwithStatusCode = 409, so the existingGlobalExceptionMiddlewaremaps it to a
409 ConflictProblemDetails response with no middleware change. Thechange is contained entirely within the Domain layer — no controllers, services,
repositories, or migrations were touched.
Changes in this PR
FlagDomainException(sealed,BanderasException-derived, 409); guard clause added as the first statement of all fiveFlagmutation methodsFlagArchivedInvariantTests(10 tests: 5 archived-guard + 5 happy-path baselines)current-state.md,roadmap.md, and theFlagDDD backlog updated; spec + implementation notes added underDocs/Decisions/enforce-archive-state-as-terminal - PR# 59/Spec
Docs/Decisions/enforce-archive-state-as-terminal - PR# 59/spec.mdImplementation Notes
Docs/Decisions/enforce-archive-state-as-terminal - PR# 59/implementation-notes.mdDefinition of Done
FlagDomainExceptionexists inBanderas.Domain/Exceptions/and extendsBanderasExceptionwithStatusCode = 409SetEnabled()(
SetEnabled,UpdateStrategy,UpdateName,Update,Archive) carries a guardclause as its first statement: if
IsArchivedistrue, the method throws a newFlagDomainExceptionwhose message names the flag. The exception extendsBanderasExceptionwithStatusCode = 409, so the existingGlobalExceptionMiddlewaremaps it to a
409 ConflictProblemDetails response with no middleware change. Thechange is contained entirely within the Domain layer — no controllers, services,
repositories, or migrations were touched.
Changes in this PR
FlagDomainException(sealed,BanderasException-derived, 409); guard clause added as the firststatement of all five
Flagmutation methodsFlagArchivedInvariantTests(10 tests: 5 archived-guard + 5 happy-path baselines)current-state.md,roadmap.md, and theFlagDDD backlog updated; spec + implementation notes addedunder
Docs/Decisions/enforce-archive-state-as-terminal - PR# 59/