feat: optional customer phone field gated by global toggle (#322)

Adds a `customer_phone` column on events plus an `event_phone_field_enabled`
admin setting (default off) that surfaces the input in the create-event
and event-detail forms. Designed for downstream automation tooling — once
exposed via the upcoming public API, n8n / similar can pick it up to
deliver gallery links over WhatsApp, SMS, etc.

- Migration 080 adds the column + seeds the setting as false. Existing
  deployments see no UI change unless the admin opts in via
  Settings → Events.
- Backend strips the field server-side when the toggle is off (defence
  in depth against form bypass).
- Frontend renders the input only when the public-settings flag is true;
  always optional even then.
- publicSettings + EventSettings types extended; CreateEventPage and
  EventDetailsPage wired to read the toggle and submit the value.
This commit is contained in:
Paul Nothaft
2026-04-27 22:38:00 +02:00
parent 4f77905b87
commit be6cb28c80
8 changed files with 146 additions and 4 deletions
@@ -52,6 +52,7 @@ export interface EventSettings {
event_require_expiration: boolean;
event_default_require_password: boolean;
gallery_show_filter_bar: boolean;
event_phone_field_enabled: boolean;
}
export interface SeoSettings {
@@ -127,7 +128,8 @@ export function useSettingsState() {
event_require_event_date: true,
event_require_expiration: true,
event_default_require_password: true,
gallery_show_filter_bar: true
gallery_show_filter_bar: true,
event_phone_field_enabled: false
});
// SEO settings state
@@ -212,7 +214,8 @@ export function useSettingsState() {
event_require_event_date: toBoolean(settings.event_require_event_date, true),
event_require_expiration: toBoolean(settings.event_require_expiration, true),
event_default_require_password: toBoolean(settings.event_default_require_password, true),
gallery_show_filter_bar: toBoolean(settings.gallery_show_filter_bar, true)
gallery_show_filter_bar: toBoolean(settings.gallery_show_filter_bar, true),
event_phone_field_enabled: toBoolean(settings.event_phone_field_enabled, false)
});
setSeoSettings({