Repository navigation
Add the Associations BQ as its own PartyAssociation aggregate: POST …/Associations/Register, PUT …/{id}/Update and GET …/Retrieve, owner and associate checked on the write side (roadmap 1.11) - #126
Merged
Conversation
Requirements, plan and validation for Register, Update and Retrieve of party associations: the associate, the relationship type and the validity period, with owner and associate checked on the write side (ADR 0024). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…od and decisions (roadmap 1.11) The Associations BQ as its own aggregate (ADR 0024): PartyAssociationId, the nine BIAN relationship types, the ISO 8601 validity period, the Register and Update input readers that refuse unrecorded fields first, and the pure Register/Update decisions with their decider laws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ociation view (roadmap 1.11) RegisterPartyAssociation loads the owner's and the associate's entry streams through IPartyDirectory (never a view), UpdatePartyAssociation checks the owner and the expected version, and RetrievePartyAssociation reads the new PartyAssociationView. Both ports gain the association streams and views, with in-memory adapters and the Marten members. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… view (roadmap 1.11) Stable stored names for PartyAssociationRegistered and PartyAssociationUpdated, the inline PartyAssociationView next to the entry view, and Testcontainers round trips: read-your-write, stale version, idempotent Register, an association id is never an entry, and a rebuild restores the view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nformance (roadmap 1.11)
POST /PartyReferenceDataDirectory/{id}/Associations/Register, PUT
…/Associations/{associationsid}/Update (If-Match) and GET …/Retrieve (ETag,
304), one BIAN request model for both commands, the three operations in the
conformance list, and the demo requests in RimBank.Host.http.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ee and roadmap tick ADR 0033 records what a party association records (associate, nine relationship types, validity period), the refused BIAN fields and the new error codes; ADR 0024 gains the Associations requests paragraph; the plan gains an As-built section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Roadmap phase
Phase: 1.11 Associations BQ
Planning package:
specs/2026-11-08-party-associations-bq/Closes #36
Summary
The directory can now record how one party relates to another (a parent company, a spouse, a power of attorney…), as the Associations Behavior Qualifier. As decided in ADR 0024, an association is its own aggregate,
PartyAssociation, with its own stream, version and inline view, so busy parties do not become a concurrency hotspot.What an association records (ADR 0033, new)
AssociateReference.PartyReference, the entry id of another registered party.AssociateType: the 7 BIAN enum values plusPartyIsThePowerOfAttorneyForPartyandPartyReceivesBenefitsFromAParty, which BIAN's description lists. They are read in any case and answered in BIAN spelling, and a record reads "this party type the associate".AssociationValidFromToDate: optional ISO 8601 bounds kept in UTC,From≤To, never compared with today. A knownToDateTimeis how an association ends.InvolvementReference) are refused withparty.association-field-not-supported.Commands (write side)
RegisterPartyAssociation:POST /PartyReferenceDataDirectory/{id}/Associations/Register. The handler loads the owner's and the associate's entry streams throughIPartyDirectory, never a view (mission principle 5). The checks run in order: owner exists (404party.party-not-found), not itself (422party.self-association), associate registered (422party.associate-not-registered).UpdatePartyAssociation:PUT …/Associations/{associationsid}/Update, a partial update of the type and the period, withIf-Matchon the association's own version (ADR 0027). The owner and the associate never change: another associate is 422party.associate-cannot-change.PartyAssociationAcknowledged).Query (read side)
RetrievePartyAssociation:GET …/Associations/{associationsid}/Retrieve, served from the inlinePartyAssociationView, withETagand304. Only the owning entry finds it (404party.association-not-foundotherwise).Plumbing
IPartyDirectory/IPartyDirectoryEnquirycover both stream types. The Marten loaders keep only their own event type, so an association id sent as an associate is a clean 422, not a cast failure.party_association_registeredandparty_association_updated, and a secondAddInlineView.Docs: new ADR 0033; ADR 0024 amended (Associations requests paragraph, events, error codes); tech-stack §3.4 tree; demo requests in
RimBank.Host.http; roadmap 1.11 ticked.Definition of done
.Subscriptions→.PublishedLanguagedocs/adr/for any significant or BIAN-interpretation decision (ADR 0033 new, ADR 0024 amended)Validation
Run locally on this branch:
dotnet restore RimBank.slnx --locked-mode: OK, no lock file change.dotnet build RimBank.slnx -c Release: 0 warnings, 0 errors.dotnet test --solution RimBank.slnx -c Release --no-build: 1,799 passed, 0 failed (incl. Testcontainers and Alba).dotnet format RimBank.slnx --verify-no-changes: exit 0.From
validation.md:RimBank.Core.Tests,Associations/): typed-id contract,PartyRelationshipTypesTests,AssociationValidityPeriodTests,PartyAssociationInputTests,PartyAssociationDecisionTests(every error code), FsCheckPartyAssociationLawsProperties(decider laws, owner and associate never change, an empty Update keeps the state),PartyAssociationViewProjectionTests(Given events → Then view), and handler tests with the in-memory ports.PartyAssociationRoundTripTests): both stream types in one store, inline read-your-write, stale version →party.version-conflict, idempotent Register (one stream), an association id is never an entry, andRebuildViewAsyncrestores the view.ETag, 304, and Problem Details for 400 (shared.invalid-identifier,party.association-invalid,party.association-field-not-supported, missingIdempotency-Key,shared.if-match-invalid), 404, 409, 422 and 428.PartyReferenceDataDirectoryConformanceTestsnow lists the three Associations operations..httpdemo was optional (not chosen in the interview) and was not run.Review focus
party.association-already-registered(409): a new code that only a replayed decision can meet. It is added so the decider is complete.PartyAssociationRequest) for Register and Update, because BIAN's two bodies are the same.🤖 Generated with Claude Code