-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
Description
Description
Implement usage_events repository: create(event), findByUserId(userId, from, to, limit), findByApiId(apiId, from, to, limit), getTotalSpentByUser(userId, from, to), getTotalRevenueByApi(apiId, from, to). Support idempotency by request_id (unique constraint).
Requirements and context
- create must be idempotent on request_id to avoid double billing
- All amounts in consistent units (e.g. USDC smallest unit)
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/usage-events-repository- Implement changes
- Implement create (ON CONFLICT request_id DO NOTHING or return existing), aggregates
- Add unit tests
- Test and commit
- Run tests
- Example commit message:
feat: usage events repository with idempotency
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
- Project details: #
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program