Repository navigation
Record the BankRelations BQ: a typed relation to a bank employee or unit checked on the write side, with its dates and status (roadmap 1.12) - #128
Merged
Conversation
…employee or unit reference, dates and status Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cked employee or unit, dates and status (roadmap 1.12) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… section of the entry view (roadmap 1.12) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… trips and a view rebuild (roadmap 1.12) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Problem Details, conformance and a log-privacy test (roadmap 1.12) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1.12 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.12 BankRelations BQ
Planning package:
specs/2026-11-08-party-bank-relations-bq/Closes #37
Summary
Records the party's relationship with the bank: the last Behavior Qualifier of Party Reference Data Directory. As ADR 0024 decided, BankRelations is a singleton entity of the entry aggregate, so it uses the entry's stream, version (
ETag/If-Match) and inline view.What is recorded (ADR 0035, the core slice chosen in the planning interview):
BankRelationTypeas a closed list:RelationshipManagerandAccountOfficer(a bank employee),ServicingBranchandServicingBusinessUnit(a unit of the bank). BIAN gives free text with one example.BusinessUnitEmployeeReference.PartyReference: another registered entry of this directory, a person for an employee's role and an organisation for a unit's. It is checked on the write side, the same guarantee as the Associations (ADR 0033) and the Reference corporate references (ADR 0034).BankRelationReference:RelationshipStartDateandRelationshipEndDate(stored as UTC, the end not before the start) andRelationshipLifecycleStatus.StatusDescription(Active,SuspendedorEnded).InvolvementReference,RelationshipType,RelationshipValidityPeriod,RelationshipIdentification, the otherDatetimeandStatusparts) is refused with400 party.bank-relations-field-not-supported, naming each path.Command side.
UpdateBankRelationsis a partial update, as in 1.9–1.21: an omitted value keeps its value, and a blank value or empty object clears it. The handler loads the entry. When the Update sets the employee or unit, or changes the type it must fit, the handler also loads that entry throughIPartyDirectory, never through a view. The pureDecidethen checks the rules on the resulting BankRelations:400 party.bank-relations-invalid, and so is an end before the start;422 party.self-reference,party.referenced-party-not-registeredandparty.referenced-party-type-mismatch, which reuse the ADR 0034 codes.The new event is
BankRelationsUpdated(stored asparty_bank_relations_updated), carrying the full resulting BankRelations. The response is built from the acknowledgement.Query side.
RetrieveBankRelationsreads the new nullableBankRelationssection of the inlinePartyReferenceDataDirectoryEntryView(ETag, 304). Streams and views written before 1.12 still load, fold and rebuild.HTTP.
PUT …/BankRelations/{bankrelationsid}/UpdateandGET …/RetrieveinRimBank.Api/Party/PartyReferenceDataDirectory/BankRelations/, with a demo block inRimBank.Host.http.Small refactor.
PartyReferenceDates.TryReadUtcInstantreads a date or a date-time as UTC, andAssociationValidityPeriodnow uses it too, with no change in behaviour.Docs. New ADR 0035. ADR 0024 is amended with the "BankRelations requests (1.12)" paragraph, the events table and the error codes table. Tech-stack §3.4 now shows the
BankRelations/tree, and roadmap 1.12 is ticked.Definition of done
.Subscriptions→.PublishedLanguagedocs/adr/for any significant or BIAN-interpretation decision (ADR 0035, ADR 0024 amended)Validation
Local runs on the 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,953 passed, 0 failed (exit 0).dotnet format RimBank.slnx --verify-no-changes: exit 0.What the new tests cover (validation.md):
BankRelationTypesTests(types, statuses, and which party type each type references);BankRelationsChangesTests(refused paths first, each invalid path named, an emptyBankRelationReferenceclears);BankRelationsDecisionTests(every error code; set, keep and clear; a new type is checked against the kept reference);BankRelationsPartialUpdateProperties(the partial-update laws);UpdateBankRelationsHandlerTests(check order; a kept reference is not reloaded; an association id given as the employee is "not registered");RetrieveBankRelationsHandlerTests;BankRelationsViewProjectionTests(Given events → Then view, including a pre-1.12 stream and view).BankRelationsRoundTripTests, 8 tests: inline read-your-write, the stable event name with enums stored by name, a type mismatch refused on the write side, a stale version gives 409, idempotent replay appends once, andRebuildViewAsyncrestores the view.UpdateBankRelationsEndpointTestsandRetrieveBankRelationsEndpointTests: 200 withETagand 304; 400 for an invalid identifier, invalid values and refused parts; 404 for the party and for the BankRelations id; 409; 428; a missingIdempotency-Key; and 422 for a self-reference, an unregistered party, an association id and a type mismatch. Every error isapplication/problem+json;BankRelationsLogPrivacyTests: no submitted value is logged on success, refusal, 422, 409 or Retrieve.PartyReferenceDataDirectoryConformanceTestsnow listsBankRelations/Update(PUT, command) andBankRelations/Retrieve(GET, query), and is green.Not run yet: the manual
.httpdemo against the Aspire host (validation.md, "Manual / demo checks"). The "BankRelations BQ (roadmap 1.12, ADR 0035)" block insrc/RimBank.Host/RimBank.Host.httpis ready for it. Its output will be added here once it has run.Review focus
RelationshipManager,AccountOfficer,ServicingBranchandServicingBusinessUnitthe right closed set?detailstarts with the BIAN path.StatusDescription, with no rule linking it to the dates (Endeddoes not need an end date).🤖 Generated with Claude Code