feat: link transactions to Mros via many-to-many (PR 1.3)#3624
Merged
TaprootFreak merged 3 commits intodevelopfrom Apr 28, 2026
Merged
feat: link transactions to Mros via many-to-many (PR 1.3)#3624TaprootFreak merged 3 commits intodevelopfrom
TaprootFreak merged 3 commits intodevelopfrom
Conversation
A compliance officer selects which transactions are relevant to an MROS report — goAML XML needs these as structured transaction nodes (t_from_my_client / t_to_my_client) at export time. - Many-to-many relation on Mros.transactions (new join table generated by typeorm via migration) - transactionIds: number[] on create/update DTO; service resolves to Transaction entities via the new TransactionService.getTransactionsByIds - Update loads the existing transactions relation so replacing the selection works cleanly Migration to be generated locally via npm run migration AddMrosTransactionsRelation (per CONTRIBUTING.md).
davidleomay
reviewed
Apr 24, 2026
Comment on lines
+45
to
+47
| @ManyToMany(() => Transaction) | ||
| @JoinTable() | ||
| transactions: Transaction[]; |
Collaborator
Author
There was a problem hiding this comment.
Migration committed in 60c2690 (join table mros_transactions_transaction with composite PK + indices + cascading FKs, all constraint names via TypeORM hash formula).
Join table mros_transactions_transaction with composite PK + indices + cascading FKs on both sides. All constraint names computed via TypeORM's DefaultNamingStrategy (sha1(table_name + '_' + column).substring(0, N)) so future 'npm run migration' won't see drift.
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.
Summary
Third of four small API PRs preparing Mros for goAML SAR export. Adds a many-to-many relation between Mros and Transaction so a compliance officer can select which transactions belong in a report.
At XML export time (Phase 2) these become the structured transaction nodes (
t_from_my_client/t_to_my_client) of the goAML schema.Changes
Mros.transactionsManyToMany (owning side, generates a join table)transactionIds: number[]on both create and update DTOTransactionService.getTransactionsByIdsfor bulk resolutionTransactionModuleintoMrosModuleMrosService:createresolves transactionIds → Transaction[] and attachesupdateloads the existing transactions relation so replacing the selection worksresolveTransactionsthrowsNotFoundExceptionif any id is invalidMigration
Per
CONTRIBUTING.md, the schema migration must be generated locally:```bash
cd ~/Documents/GitHub/dfx/api
git pull
git checkout feat/mros-transactions-relation
npm run migration AddMrosTransactionsRelation
git add migration/*-AddMrosTransactionsRelation.js
git commit -m "feat: add migration for mros transactions many-to-many"
git push
```
Roadmap
Test plan