Skip to content

fix: recalculateCampaignStats now decrements raisedAmount after refund#37

Open
iyanumajekodunmi756 wants to merge 1 commit into
OrbitChainLabs:mainfrom
iyanumajekodunmi756:fix/issue-8-refund-recalculate-stats
Open

fix: recalculateCampaignStats now decrements raisedAmount after refund#37
iyanumajekodunmi756 wants to merge 1 commit into
OrbitChainLabs:mainfrom
iyanumajekodunmi756:fix/issue-8-refund-recalculate-stats

Conversation

@iyanumajekodunmi756

Copy link
Copy Markdown
Contributor

Issue #8 - When donations are refunded, the campaign raisedAmount was never decremented, permanently inflating the campaign total.

Changes:

Issue OrbitChainLabs#8 - When donations are refunded, the campaign raisedAmount was
never decremented, permanently inflating the campaign total.

Changes:
- recalculateCampaignStats wrapped in Prisma $transaction for atomicity
- Added POST /admin/donations/:id/refund endpoint (admin-only)
- AdminService.refundDonation uses atomic $transaction to update status
  and recalculate raisedAmount
- verifyDonationOnChain now recalculates stats when confirming donations
  and protects CONFIRMED donations from accidental FAILED transitions
- Regression tests covering all refund scenarios
@iyanumajekodunmi756

Copy link
Copy Markdown
Contributor Author

CI Issues have been resolved. Here is the PR link for the resolved CI issue. iyanumajekodunmi756#1

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.

[MEDIUM] — recalculateCampaignStats never decrements raisedAmount after a refund, permanently inflating the campaign total

1 participant