Repository navigation
feat(testimonials): add Testimonials module domain model and persistence - #1493
Merged
Merged
Conversation
Adds DevBetterWeb.Modules.Testimonials (+ .Contracts) as the first modular-monolith module: Testimonial aggregate with review state machine, AuthorProfile value object, module-owned DbContext in the testimonials schema with initial migration, ITestimonialQueries.ListAcceptedAsync, and host wiring. Includes a module test project. Refs #1489 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Guard author deletion to drafts (EnsureCanBeDeletedByAuthor) - Add RowVersion concurrency token; regenerate migration - Require https photo URLs - Make generated migration internal - Add tests for review gaps and functional-host DI resolution Refs #1489 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
This adds the Testimonials module, the first module built on the modular-monolith layout in
.claude/plans/2026-07-29-modular-monolith-recommendations.md§4.4. It covers the domain model and persistence only. Authoring UI, the admin review queue and public display come next, in #1490, #1491 and #1492.New projects
DevBetterWeb.Modules.Testimonials.Contractshas no dependencies. It holdsTestimonialStatus, theTestimonialDtoread model andITestimonialQueries.ListAcceptedAsync.DevBetterWeb.Modules.Testimonialskeeps everything internal. Its only public surface isAddTestimonialsModule,UseTestimonialsSqlServerandApplyTestimonialsMigrationsAsync. It does not referenceDevBetterWeb.Core, and it points at the author byMemberIdonly.tests/DevBetterWeb.Modules.Testimonials.Testsis the module's test project (xUnit and Shouldly).Domain
Testimonialaggregate, with these transitions:DraftPendingReviewPendingReviewAcceptedPendingReviewDeclinedPendingReviewChangesRequestedChangesRequestedPendingReviewAcceptedDeclinedDeclinedis terminal.DraftandChangesRequested. An author can delete only aDraft(EnsureCanBeDeletedByAuthor).InvalidTestimonialStateException. Inputs are checked before any state changes.AuthorProfilevalue object: display name (required), title and organization (optional), and an optional https-only photo URL override.Persistence
TestimonialsDbContextowns thetestimonialsschema, including its own__EFMigrationsHistorytable. It shares the existing database throughDefaultConnection.AddTestimonials:AuthorProfilestored as an owned typeRowVersionconcurrency tokenMemberIdand(Status, ReviewedAt)Host wiring
Program.csregisters the module (SQL Server with Metronome tracking outside Testing). It applies the module's migrations in the same Development, container or Aspire cases as the other contexts.efscripts.txtgains the module'sdotnet efcommands.Directory.Packages.propsaddsMicrosoft.EntityFrameworkCore.Design11.0.0, whichdotnet efneeds on the module project.Deploy note
Production migrations are applied by hand. Before #1492 reads from the table, run the script below (also in
efscripts.txt) fromsrc/DevBetterWeb.Modules.Testimonials. The DB login needs CREATE SCHEMA permission.Tests
AuthorProfilevalidation, including rejectinghttp,javascript:anddata:photo URLstestimonials, and migrations match the model (HasPendingModelChangesis false)ListAcceptedAsyncfiltering, ordering and limitITestimonialQueriesagainst its in-memory database.Verification
dotnet BuildTestFormat.cs: the build succeeds and all 396 tests pass (AppHost 4, Functional 6, Testimonials 73, Tests 118, UnitTests 195).main. The three new projects and the new or changed test files are clean.Program.csreports the same whitespace errors as onmain(about 30, file-wide)..claude/plans/2026-11-15-issue-1489-testimonials-module-domain.md.Fixes #1489
Relates to #1472
🤖 Generated with Claude Code