chore: Phase 2c - third Repository port: Request (all five variants) - #10336
Draft
gatzjames wants to merge 1 commit into
Draft
chore: Phase 2c - third Repository port: Request (all five variants)#10336gatzjames wants to merge 1 commit into
gatzjames wants to merge 1 commit into
Conversation
RequestRepository, covering HTTP Request/GrpcRequest/WebSocketRequest/ SocketIORequest/McpRequest as one aggregate root, per the one-per- aggregate-root decision: - domain/src/request/ - one entity file per variant, plus request-shared.entity.ts (RequestHeader/RequestParameter/RequestBody/ RequestAuthentication and its 13 AuthType* variants, shared by HTTP/ WebSocket/Socket.IO/MCP) and any-request.entity.ts (the AnyRequest discriminated union, per-variant type guards, and getRequestTypeFromId - dispatching on each variant's distinct id prefix, since there's no existing 5-way union anywhere in insomnia-data to reuse). - domain/src/request/request-repository.port.ts - findById/findByParentId/ save/delete over AnyRequest. - infrastructure/src/persistence/nedb/nedb-request-repository.ts - turned out simpler than expected: database.update()/remove() already dispatch on the doc's own `type` field internally, so save()/delete() need no per-variant switch. Only findById() (needs a type to query with, derived from the id prefix) and findByParentId() (queries all five types and merges) know about the variants explicitly. - domain/src/testing/request-repository.contract.ts - parameterized over all five variants via it.each. Found and worked around a real, pre-existing insomnia-data gap while writing the contract tests (not something introduced by this PR, and not fixed here per strict scoping - see commit discussion): McpRequest's init() declares no `name` or `isPrivate` default, and neither is in its optionalKeys, so initModel()'s field-pruning strips both on every write (create, update, and the raw update() save() uses). Marked both optional on the domain McpRequest entity to reflect that reality, and used `description` (which every variant's init() does declare) rather than `name` for the cross-variant "save() persists changes" contract test. Nothing in apps/desktop or apps/cli switches over yet, same as the Workspace/Environment PRs. Verified: lint, type-check, check-boundaries, and the full test suite all pass clean across every workspace (infrastructure now has 3 test files / 27 contract tests).
✅ Circular References ReportGenerated at: 2026-08-05T15:10:25.535Z Summary
Click to view all circular references in PR (13)Click to view all circular references in base branch (13)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
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.
No description provided.