SIGN IN SIGN UP

feat(ads): wire-encode reward-verification events (#3891)

<!-- Thank you for contributing to Purchases! Before pressing the
"Create Pull Request" button, please provide the following: -->

### Description

This is a technical groundwork for ad reward tracking. It adds the
serialization wiring for the 4 new ad event classes which we added in
the previous branch of this stack.

<!-- Describe your changes in detail -->

<!-- Please describe in detail how you tested your changes -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Serialization and mapping only; no changes to reward verification
logic or entitlement granting at runtime.
> 
> **Overview**
> Extends the **ad backend event wire schema** and **stored-event
converters** so the four reward-verification `AdEvent` types can be
serialized and flushed like other ad events.
> 
> `BackendEvent.Ad` gains optional reward fields
(`reward_verification_enabled`, `reward_type`, virtual-currency and
entitlement details, `reward_failure_reason`). `BackendStoredEvent.kt`
adds `toBackendStoredEvent` for `RewardEarnedUnverified`,
`RewardVerified`, `RewardGranted`, and `RewardFailedToVerify`, mapping
`VerifiedReward` variants to the wire `reward_type` strings and
populating only the fields relevant to each event type.
> 
> Unit tests in `BackendStoredEventAdTest` cover each reward event path,
including virtual currency, entitlement, unsupported reward, and failed
verification.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a86bf804e8bcd235f281ac250debfb0797d2863a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
P
Peter Porfy committed
2ad838b542b6db08b875e1dd6fb687013d08c090
Parent: f53d2ce
Committed by GitHub <noreply@github.com> on 8/17/2026, 11:38:41 AM