feat(activities): notification config on event create + edit #69

Merged
padreug merged 1 commit from notification-config into dev 2026-05-23 21:19:06 +00:00
Owner

Summary

Exposes the buyer-notification fields the LNbits events extension
gained in v1.4.0 / v1.6.0 so organizers can opt buyers into email

  • NIP-04 Nostr DM ticket confirmations and customize the message
    text — without having to drop into the LNbits admin UI.
  • New collapsible "Buyer notifications" section at the bottom of
    the create + edit form (collapsed by default to keep the
    Lightning-only path uncluttered).
  • Two switches drive extra.email_notifications and
    extra.nostr_notifications. Both off → backend doesn't send
    anything (current behavior).
  • extra.notification_subject + extra.notification_body accept
    organizer-customized message text; empty falls through to the
    extension's defaults.
  • Submit-time extra is built by overlaying onto the existing
    event.extra so unrelated fields the LNbits admin UI sets
    (promo_codes, conditional, min_tickets) survive the
    round-trip through the webapp's create/edit.

This branch carries the v1.6.1 types/API alignment commit
(620919d) as its foundational dependency. The sibling
payment-rails-pattern PR carries the same commit; whichever
merges first lands it on dev, the other rebases trivially.

Test plan

  • npm run build clean.
  • Create Event → expand "Buyer notifications" → toggle email
    on → submit. Confirm backend stores extra.email_notifications = true.
  • Edit an existing event with extra.notification_subject set
    → the field is pre-populated; saving with an unrelated change
    preserves the subject.
  • Edit an event the LNbits admin UI added a promo_codes
    block to → save from the webapp → confirm promo_codes
    survives in extra.

🤖 Generated with Claude Code

## Summary Exposes the buyer-notification fields the LNbits events extension gained in v1.4.0 / v1.6.0 so organizers can opt buyers into email + NIP-04 Nostr DM ticket confirmations and customize the message text — without having to drop into the LNbits admin UI. - New collapsible "Buyer notifications" section at the bottom of the create + edit form (collapsed by default to keep the Lightning-only path uncluttered). - Two switches drive `extra.email_notifications` and `extra.nostr_notifications`. Both off → backend doesn't send anything (current behavior). - `extra.notification_subject` + `extra.notification_body` accept organizer-customized message text; empty falls through to the extension's defaults. - Submit-time `extra` is built by overlaying onto the existing `event.extra` so unrelated fields the LNbits admin UI sets (`promo_codes`, `conditional`, `min_tickets`) survive the round-trip through the webapp's create/edit. This branch carries the v1.6.1 types/API alignment commit (`620919d`) as its foundational dependency. The sibling `payment-rails-pattern` PR carries the same commit; whichever merges first lands it on `dev`, the other rebases trivially. ## Test plan - [ ] `npm run build` clean. - [ ] Create Event → expand "Buyer notifications" → toggle email on → submit. Confirm backend stores `extra.email_notifications = true`. - [ ] Edit an existing event with `extra.notification_subject` set → the field is pre-populated; saving with an unrelated change preserves the subject. - [ ] Edit an event the LNbits admin UI added a `promo_codes` block to → save from the webapp → confirm `promo_codes` survives in `extra`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The backend rebase brought in PR #50 (fiat checkout + email/Nostr
ticket notifications), v1.6.0 (custom notification subject/body), and
PR #51 (resend-email endpoint). The webapp types lagged.

Aligns the type surface in src/modules/activities/types/ticket.ts:

- EventExtra (with notification toggles + custom subject/body), promo
  codes, conditional event config.
- ActivityTicketExtra mirroring backend's TicketExtra (nostr_identifier,
  email/nostr notification_sent flags, refund state).
- TicketedEvent + CreateEventRequest gain allow_fiat, fiat_currency, extra.
- TicketPurchaseInvoice extended for fiat: paymentRequest now optional,
  fiatPaymentRequest + fiatProvider + isFiat added. **Closes a latent
  blocker**: a backend response with is_fiat=true would have lost the
  fiat URL during deserialization (silent crash on QR generation).
- New CreateTicketRequest type for the POST /tickets/{id} body, with
  the v1.6.1 payment_method + fiat_provider + nostr_identifier fields.

TicketApiService:
- requestTicket() accepts the new optional fields (paymentMethod,
  fiatProvider, promoCode, refundAddress, nostrIdentifier) and
  deserializes the full TicketPurchaseInvoice shape including fiat.
- fetchUserTickets() / validateTicket() / new resendTicketEmail()
  thread the extra metadata through.

useTicketPurchase composable rejects fiat responses with a clear
error (the QR-and-bolt11 path doesn't know fiat); the eventual UI
selector will live in PurchaseTicketDialog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CreateEventDialog gains a collapsible "Buyer notifications" section
exposing the EventExtra fields added upstream in v1.4.0 / v1.6.0:

- email_notifications + nostr_notifications switches — opt buyers
  into email and NIP-04 Nostr DM ticket confirmations.
- notification_subject + notification_body inputs — let organizers
  customize the message. Empty falls back to extension defaults.

Submit handler builds `extra` by overlaying onto the existing
event.extra so unrelated fields the LNbits admin UI sets
(promo_codes, conditional, min_tickets) survive the round-trip
through the webapp. Populate-from-event mirrors the same.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
padreug deleted branch notification-config 2026-05-23 21:19:07 +00:00
Sign in to join this conversation.
No description provided.