Storybooks for commit be9a02aa895f7cff23f2417a301869113edf05d8

Date
8/11/2026, 11:32:28 PM UTC
Summary
fix(payments): expand discount coupons on cached invoices and subscriptions
Description
Because:
* The SDK 22 upgrade rewrote discount reads to `discounts[0].source.coupon`
  without requesting the expansion, so a cached invoice holding a discount id
  threw `Cannot read properties of undefined (reading 'coupon')` on
  `/v1/account`.
* Expanding `discounts` does not expand the coupon under it, so reads asking
  only for `discounts` dropped promotion details.

This commit:
* Requests `discounts.source.coupon` on the reads and Firestore writes that
  asked only for `discounts`.
* Adds discountsNeedExpansion, and re-fetches a discount that arrives as an id
  rather than dropping it.
* Reports the discount amount with null coupon fields when a coupon is still
  unreadable.
* Types `source.coupon` as expanded or null, never an id.

Closes PAY-3893