feat: add personOverrides JSON column to Mros (PR 1.2)#3623
Merged
TaprootFreak merged 4 commits intodevelopfrom Apr 27, 2026
Merged
feat: add personOverrides JSON column to Mros (PR 1.2)#3623TaprootFreak merged 4 commits intodevelopfrom
TaprootFreak merged 4 commits intodevelopfrom
Conversation
Adds an optional personOverrides field on Mros that lets a compliance officer supply goAML-required person data that is not captured on UserData (gender, middle name, birth place, profession, source of wealth, canton, ID document issue/expiry/country). Stored as a single JSON-serialised MAX-length column with a typed getter/setter (personOverridesObject) following the canonical priceStepsObject pattern from buy-crypto.entity.ts. Nested DTO validated via class-transformer @type and @ValidateNested. Migration to be generated locally via npm run migration AddMrosPersonOverrides (per CONTRIBUTING.md).
6 tasks
davidleomay
reviewed
Apr 24, 2026
Comment on lines
+56
to
+60
| // JSON-serialized MrosPersonOverrides — fields that override UserData | ||
| // when the compliance officer needs to supply goAML-required data that | ||
| // is not captured on UserData (e.g. gender, middle name, profession). | ||
| @Column({ length: 'MAX', nullable: true }) | ||
| personOverrides?: string; |
Member
There was a problem hiding this comment.
Can we use simple-json type here?
Collaborator
Author
There was a problem hiding this comment.
Done in 0c409ad — converted personOverrides to simple-json. Column SQL stays nvarchar(MAX) so the migration is unchanged.
Single nullable nvarchar(MAX) column — no DEFAULT constraint, so no hash-naming concern.
Per @davidleomay's review on #3623 — TypeORM's simple-json type serializes/deserializes JSON automatically, no need for the JSON.parse getter/setter dance. Column SQL stays nvarchar(MAX) on MSSQL so the migration is unchanged.
TypeORM's MSSQL driver maps simple-json columns to ntext (verified in node_modules/typeorm/driver/sqlserver/SqlServerDriver.js — see normalizeType). Previous nvarchar(MAX) would have created drift between entity and DB on the next 'npm run migration' run.
davidleomay
approved these changes
Apr 27, 2026
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
Second of four small API PRs preparing Mros for goAML SAR export. Adds an optional
personOverridesJSON column so compliance officers can supply goAML-required person data that's not available onUserData:gendermiddleNamebirthPlaceprofessionsourceOfWealthcantonidDocIssueDateidDocValidUntilidDocIssuingCountryCodeAll fields are optional — an override is only stored when the officer actively enters it; otherwise the goAML XML falls back to UserData at export time (Phase 2).
Pattern
Stored as a single
nvarchar(MAX)JSON string with a typed getter/setterpersonOverridesObject, following the canonicalpriceStepsObject/creditorDatapatterns frombuy-crypto.entity.ts.Migration
Per
CONTRIBUTING.md, the schema migration must be generated locally:```bash
cd ~/Documents/GitHub/dfx/api
git pull
git checkout feat/mros-person-overrides
npm run migration AddMrosPersonOverrides
git add migration/*-AddMrosPersonOverrides.js
git commit -m "feat: add migration for mros personOverrides"
git push
```
Roadmap
Test plan