feat: add core report fields to Mros entity (PR 1.1)#3621
Merged
TaprootFreak merged 3 commits intodevelopfrom Apr 23, 2026
Merged
feat: add core report fields to Mros entity (PR 1.1)#3621TaprootFreak merged 3 commits intodevelopfrom
TaprootFreak merged 3 commits intodevelopfrom
Conversation
Extends the Mros entity with the core goAML SAR report-content fields that every MROS submission needs: - reportCode (default SAR) - reason (Sachverhalt long text) - action (Grund / Unternommen long text) - indicators (JSON-serialised array of goAML indicator codes) reason/action/indicators are nullable for backward compatibility with existing rows; the DTOs mark them optional so the UI can roll the fields out gradually.
To be replaced by a TypeORM-generated migration via npm run migration AddMrosReportFields so the DEFAULT/constraint names match TypeORM's deterministic hash naming (learned from PR #3613 / constraint-name drift).
Member
|
Migration was missing! |
3 tasks
Collaborator
Author
|
Fix in #3627. Migration constraint name computed via TypeORM's hash formula (sha1('mros_reportCode').substring(0,27)) — verified against AddMros's existing constraints, so no future drift. |
1 task
TaprootFreak
added a commit
that referenced
this pull request
Apr 27, 2026
Follow-up to PR #3621 — the entity columns reportCode/reason/action/ indicators were merged without a corresponding migration. Constraint names match TypeORM's auto-generated format (DF_ + sha1('mros_<column>').substring(0, 27)) so a future 'npm run migration' run on this schema doesn't see drift.
TaprootFreak
added a commit
that referenced
this pull request
Apr 27, 2026
…3628) Reality update from PR #3621: contributors / AI assistants without local DB setup couldn't run 'npm run migration', so they skipped the migration entirely (David caught it after merge). The strict ban on hand-writing didn't survive contact with that case. The new policy keeps 'npm run migration' as the preferred path but adds an explicit fallback: hand-written is allowed if the constraint names match TypeORM's deterministic algorithm. Documents the formula (prefix + sha1 substring + length per constraint type) and the many-to-many join-table conventions. Verifiable: every contributor can sanity-check their hashes against existing 'AddMros'-style constraints before pushing.
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
First of four small API PRs that prepare Mros for full goAML SAR export. This one adds the core report-content fields that appear in every goAML report:
reportCode(string, defaultSAR)reason(long text — Darstellung des Sachverhalts)action(long text — Grund für Verdacht / Was haben Sie bereits unternommen)indicators(JSON-serialisedstring[]of goAML indicator codes, e.g.["0002M","1004V","2008G","3004B","3005B","3007B"])Accessors on the entity expose
indicatorCodesas a typedstring[]so callers don't see the raw JSON string.reason,action,indicatorsare nullable so existing rows stay valid. DTO fields are optional; the create/edit flow on the frontend will enforce required semantics gradually.Files
mros.entity.ts— new columns +indicatorCodesgetter/settercreate-mros.dto.ts/update-mros.dto.ts— new optional fieldsmros.service.ts— mapsindicators: string[]DTO → entity via settermigration/1776957972101-AddMrosReportFields.jsRoadmap
personOverridesJSON columnTest plan
getByIdreturns row with indicators readable viaindicatorCodes