Real external adapters (BankApi/PartyDocumentApi/DocumentAnalyzer) + activate sync/analysis in apps/api #50
Labels
No labels
bug
enhancement
pr-split
question
security
transaction-matcher
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
momsse/octant#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from #48 (epic #42).
#48 composed the matcher backend into apps/api and activated the port-free pieces (the matching/supersede/supporting/creation/last-check saga projections, the reconcile + accounting-period daemons, all repositories/queries/migrations). The pieces that depend on the still-unimplemented external ports were deliberately left unwired rather than bound to test doubles in production (a stub
DocumentAnalyzerwould irreversibly archive every document).Deferred until real adapters exist:
SynchroniseBankAccountUseCase+SynchroniseBankAccountsDaemonLayer.SynchronizePartyDocumentsUseCase+SynchronizePartyDocumentsDaemonLayer.DocumentAnalysisSagaprojection.Work
Livelayers and re-introduce the five pieces intoapps/api/src/di/matcher.layer.ts(MatcherExternalPortsLayer, the analysis projection, the two sync use-cases, the two sync daemons).Also surfaced in the #48 review (track separately if desired): per-package
*ProjectionLayerexports for the matcher sagas (the cross-context transaction-matching sagas need a home — possibly apostgres-transaction-matchingpackage), and a multi-projector projection runner so two sagas over one aggregate stream don't double-poll.Sign convention dependency from #47:
amountsMatchnow requires bank debits to carry a negativeamountMinor(matched against positive document amounts). The realBankApiadapter wired here must emit debits as negative and credits as positive accordingly — otherwise no outgoing-payment match candidate is produced in production. (Today nothing enforces it; the test-only adapter and saga fixtures are sign-agnostic.)