Skip to content

fix: route splitRelease response through toPublicPayments - #125

Open
Gabrielcafens wants to merge 1 commit into
MergeFi:mainfrom
Gabrielcafens:fix/split-release-raw-payment-entities
Open

fix: route splitRelease response through toPublicPayments#125
Gabrielcafens wants to merge 1 commit into
MergeFi:mainfrom
Gabrielcafens:fix/split-release-raw-payment-entities

Conversation

@Gabrielcafens

Copy link
Copy Markdown

Fixes #91

EscrowController's fund, findOne, release, and refund all wrap their result in toPublicEscrow before it reaches an HTTP client. splitRelease was the one exception, returning the raw Payment[] entities straight from the ORM with no mapping step.

Payment doesn't carry anything as sensitive as Escrow.metadata today, so this wasn't an active leak — but it left the controller inconsistent with the pattern every other endpoint follows, per the issue.

  • Added toPublicPayment/toPublicPayments in a new payment-response.mapper.ts, thin passthrough today, same shape as toPublicEscrow
  • Routed splitRelease through it
  • Added payment-response.mapper.spec.ts following the same test pattern as escrow-response.mapper.spec.ts

nest build and the full src/escrow test suite (38 tests) pass.

EscrowController's fund/findOne/release/refund all wrap their result
in toPublicEscrow before it reaches an HTTP client. splitRelease was
the one exception, returning the raw Payment[] entities straight from
the ORM with no mapping step.

Payment doesn't carry anything as sensitive as Escrow.metadata today,
so this wasn't an active leak, but it left the same controller
inconsistent with the pattern every other endpoint follows -- any
field later added to Payment for internal bookkeeping would leak by
default here with nothing to catch it in review.

Adds toPublicPayment/toPublicPayments as a thin passthrough today,
matching toPublicEscrow's shape, and routes splitRelease through it.

Fixes MergeFi#91
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

@Gabrielcafens is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

EscrowController.splitRelease returns raw Payment[] entities, bypassing the toPublicEscrow response shaping every other escrow endpoint uses

1 participant