Skip to content

fix: cover untested settlement methods, thread admin identity, deduplicate settle logic, and adopt decimal-safe arithmetic - #273

Merged
martinzhames merged 2 commits into
dupdab:mainfrom
kelvin1john0901-blip:feature/issue-196-199
Sep 1, 2026
Merged

fix: cover untested settlement methods, thread admin identity, deduplicate settle logic, and adopt decimal-safe arithmetic#273
martinzhames merged 2 commits into
dupdab:mainfrom
kelvin1john0901-blip:feature/issue-196-199

Conversation

@kelvin1john0901-blip

Copy link
Copy Markdown

Summary

Changes

  • src/settlements/settlements.service.ts — big.js math, extracted settleSettlementPayments, added duplicate-callback guard, approveSettlement now accepts approvedBy
  • src/settlements/admin-settlements.controller.ts — passes req.user?.id to approveSettlement
  • src/payments/payments.service.ts — big.js for XLM/USDC conversion and refund ratio math
  • src/settlements/settlements.service.spec.ts — new test suites covering all five previously untested methods

Closes #196, Closes #197, Closes #198, Closes #199

…icate settle logic, and adopt decimal-safe arithmetic

- Add unit tests for executeFiatTransfer, handlePartnerCallback (including
  duplicate-callback idempotency), findAllAdmin, retrySettlement, and
  approveSettlement (closes dupdab#196)
- Thread authenticated admin identity from AdminSettlementsController through
  to approveSettlement, replacing hardcoded 'admin' approvedBy (closes dupdab#197)
- Extract shared settle-then-notify logic from executeFiatTransfer and
  handlePartnerCallback into private settleSettlementPayments helper (closes dupdab#198)
- Replace floating-point Number arithmetic with big.js in settlements.service.ts
  and payments.service.ts for all money calculations (closes dupdab#199)
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@kelvin1john0901-blip Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@martinzhames
martinzhames merged commit 6bc837d into dupdab:main Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants