Push Broadcasts
Push notifications to travel agents on the CRS app (issue #216). A broadcast goes to an audience picked by business category, then agent group or channel, then agents; it is sent in the background as soon as it is created, and its sent / received / clicked numbers are read back here. An optional banner shows on the CRS homepage of the agents it reached.
📄️ List broadcasts (paginated)
Newest first. `kind` is MANUAL (PMS broadcasts) or AUTOMATED (e.g. property live); omit it for both. 1-based `page`.
📄️ Send a broadcast
Validates and queues the broadcast; it goes out in the background within moments, in batches of 500 devices. `title` is the notification title and `subtitle` its body. `ctaText`/`ctaLink` go together; the link is an app route such as `/pdp/{listingId}` or `/bookings/{bookingId}`, or an https:// URL. Images must be https:// — upload them with `POST /image-upload-url` first. `bannerImageUrl` (optional) is shown on the CRS homepage until `bannerUntil` (UTC).
📄️ A broadcast with its numbers
The broadcast, its audience, and its success numbers two ways: by agent (targeted, sent, no device, failed, pending, received, clicked) and by notification (one per device: targeted, sent, received, clicks). Received and clicked are what the app reports back.
📄️ A broadcast's deliveries (paginated)
One row per agent: status (PENDING, SENDING, SENT, NO_DEVICE, FAILED), devices targeted and sent, and when it was received and clicked. Optional `status` filter.
📄️ Count an audience
How many active agents an audience reaches, before sending to it.
📄️ Presigned upload URL for a notification or banner image
`purpose` is NOTIFICATION (the image in the push) or BANNER (the CRS homepage banner). PUT the file to `uploadUrl` with the same Content-Type within 15 minutes, then send `objectUrl`. Firebase shows images up to about 1 MB.