Skip to content

Release: develop -> main#4250

Merged
Danswar merged 2 commits into
mainfrom
develop
Jul 17, 2026
Merged

Release: develop -> main#4250
Danswar merged 2 commits into
mainfrom
develop

Conversation

@github-actions

Copy link
Copy Markdown

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

…ings (#4245)

* feat(scorechain): add compliance endpoint listing a customer's screenings

Add GET /support/:id/scorechain (COMPLIANCE/DEBUG, ApiExcludeEndpoint) returning all
persisted Scorechain screenings for a userData as ScorechainScreeningDto[]. It derives
each of the user's tx screening keys (blockchain:objectId) exactly as the AML gate does
and returns only the rows the user actually produced, without ever re-running or billing
a screening.

- ScorechainScreeningDto + mapper: parsed riskIndicatorData/rawResponseData via the entity
  getters, plus isHighRisk and the related buyCrypto/buyFiat ids for deep-linking
- ScorechainScreeningService.getByObjectIds + repository finder (In(), created DESC, no DB
  hit on empty input)
- SupportService.getScorechainScreenings correlates screenings by objectId over the user's
  transactions (null-safe target-address resolution so an unscreenable tx cannot 500 the list)
- Centralize the ScorechainAnalysis* shapes in scorechain.dto.ts

* style(scorechain): apply prettier formatting to support.service.ts

* refactor(scorechain): drop the unnecessary intermediate variable in the DTO mapper

* refactor(scorechain): move the screening DTO mapper into its own *-dto.mapper.ts
…ening namespace against retry re-opens (#4253)

* fix(accounting): resolve cutover fiat marks through the currency's bank asset

openBuyFiatOwed looked a Fiat id up in the asset-keyed mark cache (fiat 2 =
EUR, asset 2 = DeFiChain/dBTC), so every foreign-currency owed opening missed
its mark and aborted the cutover. Resolve the mark through the currency's
representative tracked-bank asset instead — the same value the forward
consumers book — and let bankMark fall back to it for untracked or unmatched
banks, which would otherwise wedge the aggregated unattributed opening.

The three per-row buy_fiat opening namespaces are now mutually exclusive
across retries: their routing (outputAmount/fiatOutput) is mutable and
re-evaluated on every fail-loud retry while the snapshot stays pinned, so a
row that moved bucket between runs got a second opening under the new
sourceId and silently double-counted equity. Both directions are real paths,
so the guard checks all three namespaces before booking.

Also drop the claim that a failed run rolls the cutover back: per-row
openings commit in their own transactions and stay committed.

* fix(accounting): guard every source-row opening namespace against retry re-opens

The buy_crypto path carries the same defect as buy_fiat: :buy_crypto: and
:buy_crypto-owed: are disjoint sourceId namespaces routed by the mutable
outputAmount, so a row that moves bucket between two fail-loud retries gets a
second opening. There it is worse than a plain double-count — the forward
consumer skips seq0 and seq1 once an owed opening exists, leaving the
received opening permanently unclosed.

Generalise the guard over a namespace list and run it at the top of all four
loops, so an already-opened row is never re-pinned as unpriced either.

Also correct the rationale comments: the cutover routes on outputAmount and
cryptoInput.paymentLinkPayment, never on fiatOutput, and the method that
clears outputAmount is resetAmlCheck, not resetSendingInfo.

* fix(accounting): align the remaining fail-loud rationale with the code

Three sibling comments still claimed a missing mark rolls the cutover back —
the same false claim this branch already corrected on bookReceivedOwedOpening,
and the one that let the double-open gap go unnoticed. They also named a
no-bank-match as the miss condition, which the currency fallback now resolves.

* fix(accounting): state the real miss condition and consequence for a missing bank mark

The unattributed aggregate does not defer an unvaluable credit to
mark-to-market — it throws, and the CHF liability bucket it would have
written is never revalued. The miss condition also kept a live disjunct: a
tracked bank whose asset carries no mark at the snapshot date resolves no
mark either, and that branch has no currency fallback, mirroring the forward
consumer.
@Danswar
Danswar merged commit b73d82c into main Jul 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants