Refactor/remove isseeded from flag - #60
Merged
Merged
Conversation
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.
Removes
IsSeededfrom theFlagdomain entity and relocates the bookkeepingto an EF Core shadow property on
FlagConfiguration. The seeder's"I touched it last, I'll clean it up" safety guarantee is preserved —
SEED_RESET=truestill deletes only previously-seeded rows and leaves manually-created flags untouched —
but the domain layer no longer leaks an infrastructure concern.
Changes in this PR
refactor(domain)— removeIsSeededproperty and the second constructor fromFlagrefactor(infra)— mapIsSeededas a shadow property; rewriteDatabaseSeedercall sites; add non-destructive migrationtest— delete obsoleteFlagTestscases; rewrite seed-startup assertion viaEF.Property; addSeedReset_DoesNotDeleteManuallyCreatedFlagsdocs— Phase 2 progress incurrent-state.md, tick the backlog item, ship the specSpec
Docs/Decisions/remove-isseeded-from-flag - PR# 60/spec.mdImplementation Notes
Not authored as a separate file — the spec's Design Decisions, Technical Notes,
and Definition of Done sections together cover the implementation record. Key
deviations from spec: none. The migration was generated as expected with no
destructive
Up/Downcontent;BanderasDbContextModelSnapshot.csdid notrequire regeneration because the snapshot already represented the property in
shadow-equivalent form.
Definition of Done
IsSeededproperty removed fromBanderas.Domain/Entities/Flag.csFlagconstructor (isSeededoverload) removedFlagConfigurationconfiguresIsSeededas a shadow property (Property<bool>("IsSeeded"))DatabaseSeederupdated at all four call sites:SeedMissingAsyncResetSeedAsyncWhere(f => EF.Property<bool>(f, "IsSeeded")))!EF.Property<bool>(f, "IsSeeded"))SeedRecord.ToFlag()no longer passesisSeeded: trueRemoveIsSeededFromFlagEntitygenerated and committed; verified non-destructiveBanderasDbContextModelSnapshot.csreconciledFlagTests.Constructor_WithoutIsSeededParameter_DefaultsToFalsedeletedFlagTests.Constructor_WithIsSeededParameter_SetsSeededStatedeletedSeedDataStartupTestsIsSeededassertion rewritten viaEF.Property<bool>in the LINQ querySeedReset_DoesNotDeleteManuallyCreatedFlagsadded and passingdotnet build -p:TreatWarningsAsErrors=truecleandotnet csharpier check .cleanDocs/current-state.mdupdated — Phase 2 progress reflects this changeDocs/Decisions/flag-ddd-analysis-backlog.md—Remove IsSeeded from Flagcheckbox ticked, with PR referenceTesting
dotnet build -p:TreatWarningsAsErrors=true— cleandotnet testagainstBanderas.TestsandBanderas.Tests.Integration— full suite green (164 passing)dotnet csharpier check .— no formatting violationsSeedReset_DoesNotDeleteManuallyCreatedFlagsexercises AC-4 end-to-end: a manually inserted flag survives aSEED_RESET=truecycle while seeded rows are deleted and re-inserted