Skip to content

feat: implement getBetsByAddress() with integration tests (#885) - #1177

Merged
Ehonrie merged 1 commit into
Netwalls:mainfrom
adewuyito:feat/issue-885-get-bets-by-address
Jul 29, 2026
Merged

feat: implement getBetsByAddress() with integration tests (#885)#1177
Ehonrie merged 1 commit into
Netwalls:mainfrom
adewuyito:feat/issue-885-get-bets-by-address

Conversation

@adewuyito

Copy link
Copy Markdown
Contributor

Summary

Implements getBetsByAddress() in the backend service with all acceptance criteria:

  • Queries Bet where bettor == address
  • Supports optional status filter: pending / won / lost / claimed
  • Supports optional marketId filter
  • Orders by placedAt descending
  • Returns empty array for unknown address

Changes

  • backend/src/services/bet.service.ts: getBetsByAddress() fully implemented
  • backend/__tests__/getBetsByAddress.integration.test.ts: 12 integration tests covering all filter combinations

Testing

All filter combinations tested:

  • No filters (all bets)
  • status: pending, won, lost, claimed
  • marketId filter
  • Combined status + marketId
  • Unknown address (empty result)

Resolves #885

- Query bets by bettor address
- Support optional status filter: pending / won / lost / claimed
- Support optional marketId filter
- Support combined status + marketId filtering
- Order results by placedAt descending
- Add integration test covering all filter combinations
@Ehonrie
Ehonrie merged commit ebd8b29 into Netwalls:main Jul 29, 2026
1 check failed
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.

[backend] Implement getBetsByAddress() service

2 participants