Add read model abstraction - #4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64f78ac329
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Query result payloads should derive from `ReadModel`. Collections, pagination | ||
| models, and result wrappers may contain read models, but domain entities, | ||
| aggregate roots, value objects, enumerations, and strongly typed identifiers | ||
| must not cross the read-side boundary. |
There was a problem hiding this comment.
Use read models in the pagination examples
The newly documented boundary says pagination models should contain ReadModel payloads, but the immediately following page and cursor examples still use PaginationResult<string> and CursorPaginationResult<string>. Consumers following these examples will therefore adopt the exact primitive-result pattern this change discourages; update both examples to contain a record derived from ReadModel.
AGENTS.md reference: AGENTS.md:L63-L64
Useful? React with 👍 / 👎.
What changed
ReadModelrecord inPANiXiDA.Core.Application.Querying;Why
Application read repositories and query handlers need a common marker for immutable read-side result payloads. Naming alone cannot reliably distinguish a read model from an arbitrary DTO, while the base type enables consumer architecture tests without coupling the read side to Domain types.
Impact
Consumers can derive query and read repository result models from
ReadModel. Existing APIs remain source-compatible because this is an additive public API change.Validation
dotnet restoredotnet formatdotnet build --configuration Release— 0 warnings, 0 errorsdotnet test --configuration Release— 48/48 passed