Skip to content

Donation creation + blockchain confirmation #7

Description

@Martins0152

Description
Implement POST / (create donation, status PENDING) and POST /:id/confirm (verify the Stellar/Soroban transaction and mark CONFIRMED) under /api/v1/donations.

Acceptance Criteria

  • Creating a donation requires an active (ACTIVE status) campaign - rejects otherwise.
  • txHash is unique; duplicate confirmation attempts with the same hash are rejected.
  • Confirmation actually queries the Soroban/Stellar network (testnet acceptable) to verify the transaction exists and matches the claimed amount/currency before marking CONFIRMED.
  • On confirmation, the campaign's raisedAmount is incremented atomically (use a DB transaction to avoid race conditions).
  • Failed verification sets status to FAILED, not silently ignored.
  • Tests cover creation, successful confirmation, mismatched-amount rejection, and duplicate-hash rejection (blockchain calls mocked in tests).
  • Documented in openapi.yaml, including the Soroban transaction format per README's "Blockchain formats" section.

Suggested reward: $35-$45

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend/API workblockchainSoroban/Stellar integrationdonationsDonations flowmedium/hardHigher complexity, multiple systems

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions