feat: complete select-winners API and align wallet APIs with Stellar sync model#288
Merged
3m1n3nc3 merged 2 commits intogeevapp:mainfrom Apr 25, 2026
Merged
Conversation
…sync model Closes geevapp#280 Closes geevapp#283
|
@boys-cyberhub 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! 🚀 |
3m1n3nc3
requested changes
Apr 24, 2026
Contributor
3m1n3nc3
left a comment
There was a problem hiding this comment.
Please resolve the conflicts
- Keep our strict per-method Zod schemas and all 4 selection modes - Add upstream's checkAndAwardBadges call (async, best-effort) after winner selection - Preserve our rich response shape (method, postId, postStatus, totalSelected, winners)
|
please review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #280
Closes #283
What changed
#280 — Complete select-winners API
zoddiscriminated union — each method gets its own validated shaperandom— Fisher-Yates shuffle, respectscountparam, capped atmaxWinnersmanual— accepts onlyentryIds(UUID array); validates all IDs belong to the post; rejects unknown IDs with clear error; deduplicates; caps atmaxWinnersmerit_based— ranks eligible entries by burn count desc, entry age asc as tiebreakerfirstcome— selects earliestcountentries (already ordered bycreatedAt asc)$transactionmarks entriesisWinner, upsertsPostWinnerrows, sets poststatus: completed, and createsgiveaway_winnotifications for each winner#283 — Align wallet APIs with Stellar sync model
GET /api/wallet/balance— normalized response:{ balance, assets, transactions, lastSync, simulated };?simulated=falseplaceholder for future on-chain Stellar asset fetchPOST /api/wallet/fund— acceptssimulatedflag (defaulttrue);simulated=falsereturns501stub for on-chain path; response includeslastSyncPOST /api/wallet/withdraw— samesimulatedflag pattern; response includeslastSyncGET /api/wallet/transactions— addslastSyncfield so clients can implement interval/focus refresh without blind polling