Commit d5fcd00
feat(rewards): add Ondo campaign participant outcome support (#29267)
## **Description**
Implement mechanics around Ondo GM participant outcome
## **Changelog**
CHANGELOG entry: null
## **Screenshots/Recordings**
- On details/stats page, showing that we're still working on it. Only if
you opted in and status is pending and no winner code from api response
<img width="473" height="406" alt="image"
src="https://github.com/user-attachments/assets/11e15e0b-4147-480e-b85a-f5e7bce2423b"
/>
<img width="500" height="510" alt="image"
src="https://github.com/user-attachments/assets/42bdef8a-ebf9-4cc4-a28f-c2f08d5d948a"
/>
Note that we're no longer showing the banners that were shown in this
section when the competition was active. (i.e. qualified, not eligible,
...)
- On details/stats page, showing that a user didn't win. Only if you
opted in and status is finalized and no winner code from api response
<img width="466" height="269" alt="image"
src="https://github.com/user-attachments/assets/7d958159-96ea-45c9-ab3a-4f1786df7377"
/>
<img width="476" height="445" alt="image"
src="https://github.com/user-attachments/assets/03b81970-b8f7-4178-8ab4-a83592235fd6"
/>
- Winning view that we auto show when a user visits the ondo gm details
page, the campaign is completed and the outcome status is pending & we
have a verification code
<img width="484" height="1046" alt="image"
src="https://github.com/user-attachments/assets/d249051a-5ff5-406a-b7dc-8457ab42532c"
/>
The bannner on the details page/stats page for these kind of users:
<img width="459" height="256" alt="image"
src="https://github.com/user-attachments/assets/ee89f377-55f1-471a-86ad-561f20fcd996"
/>
<img width="479" height="489" alt="image"
src="https://github.com/user-attachments/assets/a21fbb99-98cc-4d0b-94da-f2615df69aa1"
/>
- On details/stats page, showing that a user won & they'll receive their
reward shortly. Only if you opted in and status is finalized and winner
code from api response
<img width="450" height="240" alt="image"
src="https://github.com/user-attachments/assets/e3dcc506-e1b5-41bd-8cf7-6a8c7cbb48e5"
/>
<img width="481" height="431" alt="image"
src="https://github.com/user-attachments/assets/cd47643a-2f10-4833-87de-ad856a951745"
/>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Introduces a new authenticated/cached API flow
(`getOndoCampaignParticipantOutcome`) and rewires winner
navigation/banners across multiple Ondo screens, which could impact
post-campaign UX and routing. Data contract changes (new DTO/status) and
removed retry/error UI increase the chance of edge-case regressions if
the endpoint returns unexpected/null values.
>
> **Overview**
> Adds end-of-campaign *participant outcome* support for Ondo GM,
replacing the old “winner code”/leaderboard-based winner detection.
>
> The UI now fetches `useOndoCampaignParticipantOutcome` when a campaign
is complete and the user is opted in, shows new outcome banners
(`pending`/`finalized`, winner vs non-winner), and auto-navigates to the
winning screen only when the outcome is `pending` and a
`winnerVerificationCode` exists. The winning screen now derives the code
from the outcome, disables copy when absent, and redirects back to
details if the user has no winner code.
>
> On the backend, replaces `getOndoCampaignWinnerCode` with
`getOndoCampaignParticipantOutcome` end-to-end (controller action + data
service endpoint `/ondo-gm/:id/outcome/me`), adds a new outcome
DTO/status type, and caches non-null outcomes with a TTL.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
81c6f9a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 34a82a1 commit d5fcd00
27 files changed
Lines changed: 1286 additions & 988 deletions
File tree
- app
- components/UI/Rewards
- Views
- components/Campaigns
- hooks
- utils
- core/Engine
- controllers/rewards-controller
- services
- messengers/rewards-controller-messenger
- reducers/rewards
- locales/languages
Lines changed: 175 additions & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
200 | 216 | | |
201 | 217 | | |
202 | 218 | | |
| |||
260 | 276 | | |
261 | 277 | | |
262 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
263 | 293 | | |
264 | 294 | | |
265 | 295 | | |
| |||
561 | 591 | | |
562 | 592 | | |
563 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
564 | 599 | | |
565 | 600 | | |
566 | 601 | | |
| |||
1233 | 1268 | | |
1234 | 1269 | | |
1235 | 1270 | | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
1236 | 1359 | | |
1237 | 1360 | | |
1238 | 1361 | | |
| |||
1257 | 1380 | | |
1258 | 1381 | | |
1259 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
1260 | 1392 | | |
1261 | 1393 | | |
1262 | 1394 | | |
| |||
1279 | 1411 | | |
1280 | 1412 | | |
1281 | 1413 | | |
| 1414 | + | |
1282 | 1415 | | |
1283 | 1416 | | |
1284 | 1417 | | |
1285 | | - | |
1286 | 1418 | | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
1298 | 1449 | | |
1299 | | - | |
1300 | | - | |
| 1450 | + | |
1301 | 1451 | | |
1302 | 1452 | | |
1303 | 1453 | | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
| 1454 | + | |
1309 | 1455 | | |
1310 | 1456 | | |
1311 | 1457 | | |
| |||
1321 | 1467 | | |
1322 | 1468 | | |
1323 | 1469 | | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | 1470 | | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
1351 | | - | |
1352 | | - | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
1357 | 1474 | | |
1358 | 1475 | | |
1359 | | - | |
| 1476 | + | |
1360 | 1477 | | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | 1478 | | |
1369 | | - | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
1370 | 1484 | | |
1371 | 1485 | | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
| 1486 | + | |
1376 | 1487 | | |
1377 | 1488 | | |
1378 | 1489 | | |
| |||
0 commit comments