feat(manager): the venue's identity (Settings -> Identity): name, slogan, named colours, logos, guest Wi-Fi, contact details

Set once (GET/PUT /api/identity, venue.name + venue.identity); every colour field
offers the venue's colours first (VenueColoursProvider in @xenia/ui); signage screens
get the identity and the venue's time zone with their venue and are told on a change;
logos are protected in the media library; wifiQr() for the join-the-network code.
Plan 6R.14, F-111.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 13:10:58 +02:00
co-authored by Claude Opus 5.5
parent 1c8d45e00c
commit 2a38602d45
25 changed files with 663 additions and 8 deletions
@@ -0,0 +1,20 @@
// The identity form's pure helpers (6R.14), unit-tested in tests/identity.test.mjs. The new
// colours' defaults are data (the venue's own colours), so this file is in the colour guard's DATA.
export const LOGOS = ['main', 'light', 'dark', 'icon']
export const CONTACT = ['phone', 'phone2', 'email', 'address', 'website', 'google', 'facebook', 'instagram', 'tiktok', 'tripadvisor', 'whatsapp', 'viber']
export const CONTACT_MAX = { phone: 40, phone2: 40, whatsapp: 40, viber: 40, email: 120, google: 300 } // else 200 (routers/identity.py)
export const MAX_COLOURS = 12
/** A new colour: the first a deep blue, the next ones white (the owner changes them). */
export const newColour = (n, name) => ({ name, colour: n === 0 ? '#1e3a8a' : '#ffffff' })
/** The identity as PUT /api/identity takes it (logos as media ids, empty texts as null). */
export function identityBody(d) {
return {
name: (d.name || '').trim(), slogan: (d.slogan || '').trim() || null,
colours: (d.colours || []).map(c => ({ name: (c.name || '').trim(), colour: c.colour })),
logos: Object.fromEntries(LOGOS.map(k => [k, d.logos?.[k]?.id ?? null])),
wifi: { ssid: d.wifi?.ssid || null, password: d.wifi?.password || null, security: d.wifi?.security || 'WPA', hidden: !!d.wifi?.hidden, note: d.wifi?.note || null },
contact: Object.fromEntries(CONTACT.map(k => [k, (d.contact?.[k] || '').trim() || null])),
}
}