feat: add sidecar service for Sessionize sync
- Introduced a new Node HTTP service (sidecar) to sync event agendas from Sessionize into Convivo. - Implemented two import paths: API sync and Excel import for session and speaker data. - Added necessary database migrations for sessionize integration, including new columns and audit tables. - Created functions for handling speaker and session imports, ensuring proper error handling and logging. - Established row-level security and grants for new functions to restrict access to service-role only. Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
a0bcf866dc
commit
5f8ded56f6
31 files changed
+2724
-385
No files matched your search
@@ -75,7 +75,7 @@ Check-in tab.
|
||||
|
||||
### 4.3 Connections (the core loop)
|
||||
1. While logged in, scan **another person's** lanyard QR.
|
||||
2. A popup appears: *"Connect with Bruno Costa?"*
|
||||
2. A popup appears: *"Connect with Felix Berger?"*
|
||||
3. The other person sees the request in **Connections → Requests** and accepts (or rejects).
|
||||
4. On acceptance, **both** earn points and both see each other in **My connections**.
|
||||
|
||||
@@ -196,7 +196,7 @@ Convivo/
|
||||
├─ supabase/
|
||||
│ ├─ config.toml # Local stack config (ports, auth, RLS defaults)
|
||||
│ ├─ migrations/ # 20260824000000_redesign.sql + follow-up migrations
|
||||
│ └─ seed.sql # 1 event, 6 slots, 18 sessions, 14 contacts, demo state
|
||||
│ └─ seed.sql # 1 real event (Power Platform Bootcamp AT), 10 slots, 22 sessions, 54 contacts
|
||||
├─ apps/admin/ # APPE Admin console (React + Vite + TS)
|
||||
├─ docker-compose.yml # Runs the app sidecars on the Supabase network
|
||||
└─ mockup/index.html # Original interactive mockup (design reference)
|
||||
@@ -220,6 +220,7 @@ npm run db:reset
|
||||
# 3. Run the apps (Vite dev servers, proxy to the core)
|
||||
npm run app:dev # attendee app on :3000
|
||||
npm run admin:dev # admin console on :3001
|
||||
npm run sidecar:dev # Sessionize sync sidecar on :3002
|
||||
```
|
||||
Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin). Studio is at **http://localhost:54323** (user `postgres`, password `postgres`).
|
||||
|
||||
@@ -228,10 +229,10 @@ Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin).
|
||||
# 1. Start the Supabase core (creates the supabase_network_Convivo network)
|
||||
npm run db:start
|
||||
|
||||
# 2. Build + run both app containers (joins the Supabase network)
|
||||
# 2. Build + run the app containers + sync sidecar (join the Supabase network)
|
||||
docker compose up --build
|
||||
```
|
||||
Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin). Each app's nginx proxies the Supabase paths to the Kong container on the shared network.
|
||||
Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin). Each app's nginx proxies the Supabase paths to the Kong container on the shared network; the admin also proxies `/sidecar/` to the sync sidecar (`:3002`).
|
||||
|
||||
> **Reset the demo data at any time:** `npm run db:reset` (re-applies migrations + seed).
|
||||
|
||||
@@ -241,6 +242,7 @@ Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin).
|
||||
|---|---|
|
||||
| Attendee app | **http://localhost:3000** |
|
||||
| Admin console (APPE Admin) | **http://localhost:3001** |
|
||||
| Sync sidecar (Sessionize) | **http://localhost:3002** (`/health`, `/status`, `/run`) |
|
||||
| Supabase Studio | **http://localhost:54323** (user `postgres`, password `postgres`) |
|
||||
| Supabase API (Kong) | http://127.0.0.1:54321 |
|
||||
| Postgres (direct) | `postgresql://postgres:[email protected]:54322/postgres` |
|
||||
@@ -251,32 +253,29 @@ Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin).
|
||||
|
||||
## 12. Demo accounts
|
||||
|
||||
**Attendees & staff** log in with **QR code** (typed or scanned) + **email** — the
|
||||
QR token is the password. The **APPE Admin** logs in with **email + password**
|
||||
(event-independent).
|
||||
The seed uses **real data** from the **Global Power Platform Bootcamp (Austria)**:
|
||||
the real agenda (22 sessions) plus **50 made-up attendees** and **4 staff**.
|
||||
Speakers are **not** seeded — import them via **Interfaces → Import Excel** (the
|
||||
Sessionize "Sessions and speakers (advanced)" `.xlsx`).
|
||||
|
||||
**Attendees** log in with **QR code** (typed or scanned) + **email** — the QR
|
||||
token is the password. **Staff** log in with **email + password** in the admin
|
||||
app (event-independent).
|
||||
|
||||
| Person | Role | Login | Email |
|
||||
|---|---|---|---|
|
||||
| **Ana Silva** | attendee | QR `CVV-ANA-4821` | ana.silva@nubank.com |
|
||||
| **Bruno Costa** | staff | QR `CVV-BRU-1177` | bruno.costa@acme.com |
|
||||
| **Rita Lopes** | staff | QR `CVV-RIT-9034` | rita.lopes@globant.com |
|
||||
| **APPE Admin** | admin | **password** `appe-admin-2026` | admin@appe.at |
|
||||
| Tomás Ribeiro | attendee | `CVV-TOM-5566` | tomas.ribeiro@dataprev.com |
|
||||
| Sofia Almeida | attendee | `CVV-SOF-2299` | sofia.almeida@loop.com |
|
||||
| Marco Chen | attendee | `CVV-MRC-7712` | marco.chen@deepmind.com |
|
||||
| Julia Santos | attendee | `CVV-JUL-3345` | julia.santos@ifood.com |
|
||||
| Pedro Nunes | attendee | `CVV-PED-8801` | pedro.nunes@microsoft.com |
|
||||
| Carla Mendes | attendee | `CVV-CAR-6623` | carla.mendes@quintoessencial.com |
|
||||
| Diego Ferreira | attendee | `CVV-DIE-4458` | diego.ferreira@stone.com |
|
||||
| Marina Costa | attendee | `CVV-MNA-2210` | marina.costa@olx.com |
|
||||
| Lucas Oliveira | attendee | `CVV-LUC-9987` | lucas.oliveira@usp.br |
|
||||
| **Amelia Hernandez** | staff (admin) | **password** `appe-admin-2026` | amelia@appe.at |
|
||||
| **Sabrina Hota** | staff (admin) | **password** `appe-admin-2026` | sabrina@appe.at |
|
||||
| **Jose Lago** | staff (admin) | **password** `appe-admin-2026` | jose@appe.at |
|
||||
| **Markus Franz** | staff (admin) | **password** `appe-admin-2026` | markus@appe.at |
|
||||
| 50 attendees | attendee | QR `CVV-ATT-1000`…`CVV-ATT-1049` | e.g. lena.huber@gmail.com |
|
||||
|
||||
**Suggested demo flow:**
|
||||
1. Log in as **Ana** (attendee) → see Home, Agenda, Leaderboard.
|
||||
2. Scan **Marco** (`CVV-MRC-7712`) → send a connection request.
|
||||
3. Log in as **Bruno** (staff) → the Scan tab becomes **Check-in** → pick a session → scan **Carla** (`CVV-CAR-6623`) → she gets +10.
|
||||
4. Watch the **Leaderboard** update live.
|
||||
5. Open the **APPE Admin** console on **:3001** → log in as **APPE Admin** (`[email protected]` / password `appe-admin-2026`) → see the Dashboard, reset a contact's QR, adjust points, and edit the schedule.
|
||||
1. Open the **APPE Admin** console on **:3001** → log in as **Amelia** (`[email protected]` / password `appe-admin-2026`) → see the Dashboard (54 registrations, 22 sessions).
|
||||
2. **Interfaces → Import Excel** → choose the Sessionize `.xlsx` → **Import** → speakers, session links, and speaker registrations are created.
|
||||
3. **Schedule** → slots show **Session** / **Service Session** types; sessions list their speakers.
|
||||
4. Log in as an **attendee** on **:3000** (QR `CVV-ATT-1000` + `[email protected]`) → see Home, Agenda, Leaderboard.
|
||||
5. Scan another attendee → send a connection request; watch the **Leaderboard** update live.
|
||||
|
||||
## 13. Roadmap
|
||||
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
set -eu
|
||||
|
||||
TARGET="${SUPABASE_PROXY_TARGET:-supabase_kong_Convivo:8000}"
|
||||
SIDECAR="${SIDECAR_TARGET:-convivo-sidecar:3002}"
|
||||
TEMPLATE=/etc/nginx/conf.d/default.conf.template
|
||||
CONF=/etc/nginx/conf.d/default.conf
|
||||
|
||||
echo "[convivo-admin] Proxying Supabase paths to: ${TARGET}"
|
||||
sed "s|__SUPABASE_PROXY_TARGET__|${TARGET}|g" "${TEMPLATE}" > "${CONF}"
|
||||
echo "[convivo-admin] Proxying /sidecar/ to: ${SIDECAR}"
|
||||
sed -e "s|__SUPABASE_PROXY_TARGET__|${TARGET}|g" \
|
||||
-e "s|__SIDECAR_TARGET__|${SIDECAR}|g" "${TEMPLATE}" > "${CONF}"
|
||||
|
||||
# Run nginx in the foreground.
|
||||
exec nginx -g "daemon off;"
|
||||
@@ -83,4 +83,18 @@ server {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# ---- Sessionize sync sidecar -----------------------------------------
|
||||
# The sidecar exposes /health, /status, /run. The /sidecar prefix is
|
||||
# stripped (trailing slash on proxy_pass) so /sidecar/run -> /run.
|
||||
location /sidecar/ {
|
||||
proxy_pass http://__SIDECAR_TARGET__/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
# A sync is a blocking call (fetch + RPC) and can take a while.
|
||||
proxy_read_timeout 120s;
|
||||
proxy_send_timeout 120s;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { Sponsors } from './views/Sponsors';
|
||||
import { Schedule } from './views/Schedule';
|
||||
import { Activity } from './views/Activity';
|
||||
import { Events } from './views/Events';
|
||||
import { Interfaces } from './views/Interfaces';
|
||||
import { Spinner } from './components/ui';
|
||||
|
||||
export type View =
|
||||
@@ -18,7 +19,8 @@ export type View =
|
||||
| 'sponsors'
|
||||
| 'schedule'
|
||||
| 'activity'
|
||||
| 'events';
|
||||
| 'events'
|
||||
| 'interfaces';
|
||||
|
||||
const NAV: { id: View; label: string; ico: string }[] = [
|
||||
{ id: 'dashboard', label: 'Dashboard', ico: '📊' },
|
||||
@@ -28,6 +30,7 @@ const NAV: { id: View; label: string; ico: string }[] = [
|
||||
{ id: 'schedule', label: 'Schedule', ico: '🗓️' },
|
||||
{ id: 'activity', label: 'Activity', ico: '⚡' },
|
||||
{ id: 'events', label: 'Events', ico: '📅' },
|
||||
{ id: 'interfaces', label: 'Interfaces', ico: '🔌' },
|
||||
];
|
||||
|
||||
function Shell() {
|
||||
@@ -95,6 +98,7 @@ function Shell() {
|
||||
{view === 'schedule' && <Schedule />}
|
||||
{view === 'activity' && <Activity />}
|
||||
{view === 'events' && <Events />}
|
||||
{view === 'interfaces' && <Interfaces />}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import type {
|
||||
Connection,
|
||||
Contact,
|
||||
Event,
|
||||
ExcelSyncResult,
|
||||
Feedback,
|
||||
LeaderboardRow,
|
||||
PointsLogRow,
|
||||
@@ -11,8 +12,11 @@ import type {
|
||||
ResetQrResult,
|
||||
Session,
|
||||
SessionSpeaker,
|
||||
SidecarStatus,
|
||||
Slot,
|
||||
Sponsor,
|
||||
SyncResult,
|
||||
SyncRun,
|
||||
} from './types';
|
||||
|
||||
export class ApiError extends Error {}
|
||||
@@ -142,7 +146,13 @@ export async function deleteSponsor(id: string): Promise<void> {
|
||||
|
||||
export async function upsertEvent(
|
||||
id: string | null,
|
||||
input: { name: string; start_date: string; end_date: string; location?: string | null },
|
||||
input: {
|
||||
name: string;
|
||||
start_date: string;
|
||||
end_date: string;
|
||||
location?: string | null;
|
||||
sessionize_endpoint?: string | null;
|
||||
},
|
||||
): Promise<void> {
|
||||
if (id) {
|
||||
const { error } = await supabase.from('events').update(input).eq('id', id);
|
||||
@@ -153,6 +163,58 @@ export async function upsertEvent(
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Sessionize sync (sidecar) ---------------------------------------------
|
||||
// The sidecar is a separate Docker service (not Supabase), so these use raw
|
||||
// fetch against the same-origin /sidecar proxy (see nginx.conf.template).
|
||||
|
||||
async function sidecarFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
let res: Response;
|
||||
try {
|
||||
res = await fetch(`/sidecar${path}`, {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
...init,
|
||||
});
|
||||
} catch {
|
||||
throw new ApiError('Could not reach the sync sidecar (is it running?)');
|
||||
}
|
||||
const body = (await res.json().catch(() => ({}))) as T & { error?: string };
|
||||
if (!res.ok) throw new ApiError(body.error || `sidecar error (${res.status})`);
|
||||
return body;
|
||||
}
|
||||
|
||||
export const getSidecarStatus = () => sidecarFetch<SidecarStatus>('/status');
|
||||
|
||||
/** Trigger a (blocking) Sessionize sync for an event. Resolves with the result. */
|
||||
export const runSessionizeSync = (eventId: string) =>
|
||||
sidecarFetch<SyncResult>('/run', { method: 'POST', body: JSON.stringify({ event_id: eventId }) });
|
||||
|
||||
/**
|
||||
* Upload the Sessionize "Sessions and speakers (advanced)" .xlsx for an event.
|
||||
* The sidecar parses it and imports speakers/sessions/agenda + speaker
|
||||
* registrations. Resolves with the result (blocking).
|
||||
*/
|
||||
export async function importSessionizeExcel(eventId: string, file: File): Promise<ExcelSyncResult> {
|
||||
const base64 = await new Promise<string>((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const url = reader.result as string;
|
||||
resolve(url.slice(url.indexOf(',') + 1));
|
||||
};
|
||||
reader.onerror = () => reject(new Error('Could not read the file'));
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
return sidecarFetch<ExcelSyncResult>('/import-excel', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ event_id: eventId, file_base64: base64, filename: file.name }),
|
||||
});
|
||||
}
|
||||
|
||||
/** Recent sync_runs rows for an event (newest first). */
|
||||
export const getSyncRuns = (eventId: string) =>
|
||||
all<SyncRun>('sync_runs', { col: 'started_at', asc: false }).then((rows) =>
|
||||
rows.filter((r) => r.event_id === eventId),
|
||||
);
|
||||
|
||||
/** Set an event active (deactivates all others via trigger). */
|
||||
export async function activateEvent(id: string): Promise<void> {
|
||||
const { error } = await supabase.from('events').update({ is_active: true }).eq('id', id);
|
||||
|
||||
@@ -10,7 +10,7 @@ export type SponsorType =
|
||||
| 'catering'
|
||||
| 'diversity';
|
||||
|
||||
export type SlotType = 'session' | 'lunch_break' | 'coffee_break' | 'keynote' | 'close_up';
|
||||
export type SlotType = 'session' | 'service_session';
|
||||
|
||||
export interface Contact {
|
||||
email: string;
|
||||
@@ -31,6 +31,10 @@ export interface Event {
|
||||
end_date: string;
|
||||
location: string | null;
|
||||
is_active: boolean;
|
||||
/** Sessionize API URL for this event (e.g. .../api/v2/<id>/view/All). */
|
||||
sessionize_endpoint: string | null;
|
||||
/** When the Sessionize sync last ran for this event. */
|
||||
last_synced_at: string | null;
|
||||
avg_feedback: number | null;
|
||||
num_sessions: number;
|
||||
num_speakers: number;
|
||||
@@ -39,6 +43,76 @@ export interface Event {
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
// ---- Sessionize sync (sidecar) ---------------------------------------------
|
||||
|
||||
/** A row in the sync_runs audit table (event-scoped). */
|
||||
export interface SyncRun {
|
||||
id: string;
|
||||
event_id: string;
|
||||
source: string;
|
||||
started_at: string;
|
||||
finished_at: string | null;
|
||||
created: number;
|
||||
updated: number;
|
||||
skipped: number;
|
||||
error: string | null;
|
||||
triggered_by: string;
|
||||
}
|
||||
|
||||
/** The summary returned by the sync_sessionize_event RPC. */
|
||||
export interface SyncSummary {
|
||||
speakers_created: number;
|
||||
speakers_updated: number;
|
||||
sessions_created: number;
|
||||
sessions_updated: number;
|
||||
slots_created: number;
|
||||
speakers_linked: number;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
/** The result of a (blocking) sidecar sync run. */
|
||||
export interface SyncResult {
|
||||
event_id: string;
|
||||
event_name?: string;
|
||||
started_at: string;
|
||||
finished_at: string;
|
||||
status: 'success' | 'error';
|
||||
summary?: SyncSummary;
|
||||
skipped_speakers?: string[];
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/** The summary returned by the sync_sessionize_excel RPC. */
|
||||
export interface ExcelSyncSummary {
|
||||
speakers_created: number;
|
||||
speakers_updated: number;
|
||||
sessions_created: number;
|
||||
sessions_updated: number;
|
||||
slots_created: number;
|
||||
speakers_linked: number;
|
||||
registrations_created: number;
|
||||
registrations_updated: number;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
/** The result of a (blocking) sidecar Excel import. */
|
||||
export interface ExcelSyncResult {
|
||||
event_id: string;
|
||||
event_name?: string;
|
||||
started_at: string;
|
||||
finished_at: string;
|
||||
status: 'success' | 'error';
|
||||
summary?: ExcelSyncSummary;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/** The sidecar's /status response. */
|
||||
export interface SidecarStatus {
|
||||
ok: boolean;
|
||||
running: boolean;
|
||||
lastRun: SyncResult | null;
|
||||
}
|
||||
|
||||
export interface Registration {
|
||||
id: string;
|
||||
event_id: string;
|
||||
|
||||
@@ -99,12 +99,49 @@ body {
|
||||
/* registration types */
|
||||
.pill.speaker { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.4); color: #6d28d9; }
|
||||
.pill.sponsor { background: rgba(234,88,12,.13); border-color: rgba(234,88,12,.4); color: #c2410c; }
|
||||
/* slot types */
|
||||
/* slot types (optionset: session | service_session) */
|
||||
.pill.session { background: rgba(14,165,233,.12); border-color: rgba(14,165,233,.4); color: #0369a1; }
|
||||
.pill.lunch_break { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.4); color: #b45309; }
|
||||
.pill.coffee_break { background: rgba(120,113,108,.14); border-color: rgba(120,113,108,.4); color: #57534e; }
|
||||
.pill.keynote { background: var(--accent-soft); border-color: rgba(213,0,0,.35); color: var(--accent); }
|
||||
.pill.close_up { background: rgba(5,150,105,.12); border-color: rgba(5,150,105,.35); color: var(--green); }
|
||||
.pill.service_session { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.4); color: #b45309; }
|
||||
|
||||
/* Uiverse tooltip (themrsami / ordinary-lion-95) — adapted to the admin theme.
|
||||
A purple/indigo "info" button that reveals a dark card on hover. */
|
||||
.uiverse-tooltip { position: relative; display: inline-block; }
|
||||
.uiverse-tooltip .uiverse-btn {
|
||||
position: relative; display: inline-flex; align-items: center; gap: 8px;
|
||||
padding: 10px 20px; font-size: 13px; font-weight: 600; color: #fff;
|
||||
background: rgba(79,70,229,.9); border: none; border-radius: 12px; cursor: pointer;
|
||||
overflow: hidden; transition: all .3s ease;
|
||||
}
|
||||
.uiverse-tooltip .uiverse-btn:hover { background: rgba(67,56,202,.9); }
|
||||
.uiverse-tooltip .uiverse-btn:focus { outline: none; box-shadow: 0 0 0 2px #6366f1; }
|
||||
.uiverse-tooltip .uiverse-btn::before {
|
||||
content: ''; position: absolute; inset: 0;
|
||||
background: linear-gradient(90deg, rgba(168,85,247,.2), rgba(236,72,153,.2));
|
||||
filter: blur(12px); opacity: 0; transition: opacity .3s ease;
|
||||
}
|
||||
.uiverse-tooltip .uiverse-btn:hover::before { opacity: .75; }
|
||||
.uiverse-tooltip .uiverse-btn > span { position: relative; display: inline-flex; align-items: center; gap: 8px; }
|
||||
.uiverse-tooltip .uiverse-card {
|
||||
position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translate(-50%, 8px);
|
||||
width: 288px; padding: 16px; visibility: hidden; opacity: 0;
|
||||
background: linear-gradient(135deg, rgba(17,24,39,.96), rgba(31,41,55,.96));
|
||||
backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
|
||||
box-shadow: 0 0 30px rgba(79,70,229,.15); transition: all .3s ease; z-index: 50;
|
||||
}
|
||||
.uiverse-tooltip:hover .uiverse-card { visibility: visible; opacity: 1; transform: translate(-50%, 0); }
|
||||
.uiverse-tooltip .uiverse-card::after {
|
||||
content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
|
||||
width: 12px; height: 12px; background: rgba(31,41,55,.96);
|
||||
border-right: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1);
|
||||
}
|
||||
.uiverse-tooltip .uiverse-card .uiverse-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
|
||||
.uiverse-tooltip .uiverse-card .uiverse-ico {
|
||||
display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
|
||||
border-radius: 50%; background: rgba(99,102,241,.2); color: #818cf8; flex-shrink: 0;
|
||||
}
|
||||
.uiverse-tooltip .uiverse-card h3 { margin: 0; font-size: 13px; font-weight: 600; color: #fff; }
|
||||
.uiverse-tooltip .uiverse-card p { margin: 0; font-size: 13px; line-height: 1.5; color: #d1d5db; }
|
||||
.uiverse-tooltip .uiverse-card .uiverse-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: #9ca3af; }
|
||||
/* sponsor tiers */
|
||||
.pill.headline { background: rgba(213,0,0,.1); border-color: rgba(213,0,0,.35); color: var(--red); }
|
||||
.pill.platinum { background: rgba(148,163,184,.16); border-color: rgba(148,163,184,.45); color: #475569; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { activateEvent, deactivateEvent, getAllEvents, upsertEvent } from '../lib/api';
|
||||
import type { Event } from '../lib/types';
|
||||
import { activateEvent, deactivateEvent, getAllEvents, runSessionizeSync, upsertEvent } from '../lib/api';
|
||||
import type { Event, SyncResult } from '../lib/types';
|
||||
import { useToast } from '../context/ToastContext';
|
||||
import { Empty, Modal, Spinner, Toggle } from '../components/ui';
|
||||
|
||||
@@ -10,6 +10,8 @@ export function Events() {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [modal, setModal] = useState<{ event: Event | null } | null>(null);
|
||||
const [syncingId, setSyncingId] = useState<string | null>(null);
|
||||
const [syncResult, setSyncResult] = useState<SyncResult | null>(null);
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
@@ -36,6 +38,24 @@ export function Events() {
|
||||
}
|
||||
}
|
||||
|
||||
async function runSync(ev: Event) {
|
||||
if (!ev.sessionize_endpoint) {
|
||||
push('error', `Set a Sessionize endpoint for ${ev.name} first (Edit)`);
|
||||
return;
|
||||
}
|
||||
setSyncingId(ev.id);
|
||||
try {
|
||||
const result = await runSessionizeSync(ev.id);
|
||||
setSyncResult(result);
|
||||
await load();
|
||||
push('success', `Synced ${ev.name}`);
|
||||
} catch (e) {
|
||||
push('error', e instanceof Error ? e.message : 'Sync failed');
|
||||
} finally {
|
||||
setSyncingId(null);
|
||||
}
|
||||
}
|
||||
|
||||
if (error) return <Empty icon="⚠️" text={error} />;
|
||||
if (!loaded)
|
||||
return (
|
||||
@@ -97,9 +117,23 @@ export function Events() {
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<div style={{ display: 'flex', gap: 8, justifyContent: 'flex-end' }}>
|
||||
<button
|
||||
className="btn small"
|
||||
disabled={syncingId === ev.id}
|
||||
onClick={() => runSync(ev)}
|
||||
title={
|
||||
ev.sessionize_endpoint
|
||||
? 'Sync with Sessionize'
|
||||
: 'Set a Sessionize endpoint first (Edit)'
|
||||
}
|
||||
>
|
||||
{syncingId === ev.id ? 'Syncing…' : 'Sync'}
|
||||
</button>
|
||||
<button className="btn small" onClick={() => setModal({ event: ev })}>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
@@ -120,6 +154,8 @@ export function Events() {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{syncResult && <SyncResultModal result={syncResult} onClose={() => setSyncResult(null)} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -137,6 +173,7 @@ function EventModal({
|
||||
const [startDate, setStartDate] = useState(event ? event.start_date.slice(0, 10) : '');
|
||||
const [endDate, setEndDate] = useState(event ? event.end_date.slice(0, 10) : '');
|
||||
const [location, setLocation] = useState(event?.location ?? '');
|
||||
const [endpoint, setEndpoint] = useState(event?.sessionize_endpoint ?? '');
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
async function save() {
|
||||
@@ -148,6 +185,7 @@ function EventModal({
|
||||
start_date: startDate,
|
||||
end_date: endDate,
|
||||
location: location.trim() || null,
|
||||
sessionize_endpoint: endpoint.trim() || null,
|
||||
});
|
||||
onSaved(event ? 'Event updated' : 'Event created');
|
||||
} catch (e) {
|
||||
@@ -191,6 +229,89 @@ function EventModal({
|
||||
<label>Location</label>
|
||||
<input className="input" value={location} onChange={(e) => setLocation(e.target.value)} placeholder="—" />
|
||||
</div>
|
||||
<div className="field">
|
||||
<label>Sessionize endpoint</label>
|
||||
<input
|
||||
className="input"
|
||||
value={endpoint}
|
||||
onChange={(e) => setEndpoint(e.target.value)}
|
||||
placeholder="https://sessionize.com/api/v2/<id>/view/All"
|
||||
/>
|
||||
<div className="muted small" style={{ marginTop: 4 }}>
|
||||
The Sessionize API URL (e.g. <code>…/api/v2/<id>/view/All</code>). Used by the
|
||||
“Run sync” button. You can also import the .xlsx export in the Interfaces menu.
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
function SyncResultModal({ result, onClose }: { result: SyncResult; onClose: () => void }) {
|
||||
const s = result.summary;
|
||||
return (
|
||||
<Modal
|
||||
open
|
||||
title={`Sessionize sync — ${result.event_name ?? result.event_id}`}
|
||||
onClose={onClose}
|
||||
footer={
|
||||
<button className="btn primary" onClick={onClose}>
|
||||
Close
|
||||
</button>
|
||||
}
|
||||
>
|
||||
{result.status === 'error' || !s ? (
|
||||
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
||||
{result.error ?? 'Sync failed'}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="stat-grid">
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_created}</div>
|
||||
<div className="lbl">Speakers created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_updated}</div>
|
||||
<div className="lbl">Speakers updated</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.sessions_created}</div>
|
||||
<div className="lbl">Sessions created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.sessions_updated}</div>
|
||||
<div className="lbl">Sessions updated</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.slots_created}</div>
|
||||
<div className="lbl">Slots created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_linked}</div>
|
||||
<div className="lbl">Speaker links</div>
|
||||
</div>
|
||||
</div>
|
||||
{result.skipped_speakers && result.skipped_speakers.length > 0 && (
|
||||
<div className="muted small">
|
||||
Skipped {result.skipped_speakers.length} speaker(s) without an email: {result.skipped_speakers.join(', ')}
|
||||
</div>
|
||||
)}
|
||||
{s.errors.length > 0 && (
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<div className="pill red" style={{ display: 'inline-block', marginBottom: 8 }}>
|
||||
{s.errors.length} error(s)
|
||||
</div>
|
||||
<ul style={{ margin: 0, paddingLeft: 18 }}>
|
||||
{s.errors.map((e, i) => (
|
||||
<li key={i} className="small">
|
||||
{e}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,431 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { getAllEvents, getSidecarStatus, getSyncRuns, importSessionizeExcel, runSessionizeSync } from '../lib/api';
|
||||
import type { Event, ExcelSyncResult, SidecarStatus, SyncResult, SyncRun } from '../lib/types';
|
||||
import { useToast } from '../context/ToastContext';
|
||||
import { Empty, Modal, Spinner } from '../components/ui';
|
||||
|
||||
export function Interfaces() {
|
||||
const { push } = useToast();
|
||||
const [events, setEvents] = useState<Event[]>([]);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [status, setStatus] = useState<SidecarStatus | null>(null);
|
||||
const [sidecarError, setSidecarError] = useState<string | null>(null);
|
||||
const [selectedId, setSelectedId] = useState<string>('');
|
||||
const [runs, setRuns] = useState<SyncRun[]>([]);
|
||||
const [running, setRunning] = useState(false);
|
||||
const [result, setResult] = useState<SyncResult | null>(null);
|
||||
const [excelFile, setExcelFile] = useState<File | null>(null);
|
||||
const [excelBusy, setExcelBusy] = useState(false);
|
||||
const [excelResult, setExcelResult] = useState<ExcelSyncResult | null>(null);
|
||||
const fileRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const loadableEvents = events.filter((e) => e.sessionize_endpoint);
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const evs = await getAllEvents();
|
||||
setEvents(evs);
|
||||
const first = evs.find((e) => e.sessionize_endpoint);
|
||||
if (first) setSelectedId((cur) => cur || first.id);
|
||||
setLoaded(true);
|
||||
} catch (e) {
|
||||
setError(e instanceof Error ? e.message : 'Failed to load');
|
||||
}
|
||||
}
|
||||
|
||||
async function loadStatus() {
|
||||
try {
|
||||
setStatus(await getSidecarStatus());
|
||||
setSidecarError(null);
|
||||
} catch (e) {
|
||||
setStatus(null);
|
||||
setSidecarError(e instanceof Error ? e.message : 'Sidecar unreachable');
|
||||
}
|
||||
}
|
||||
|
||||
async function loadRuns(eventId: string) {
|
||||
try {
|
||||
setRuns(await getSyncRuns(eventId));
|
||||
} catch {
|
||||
setRuns([]);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
load();
|
||||
loadStatus();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedId) loadRuns(selectedId);
|
||||
}, [selectedId]);
|
||||
|
||||
// Poll the sidecar status while a sync is running (the run call is blocking,
|
||||
// so this mainly refreshes the "running" indicator + last run).
|
||||
const pollStatus = useCallback(() => {
|
||||
loadStatus();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (!running) return;
|
||||
const t = setInterval(pollStatus, 3000);
|
||||
return () => clearInterval(t);
|
||||
}, [running, pollStatus]);
|
||||
|
||||
async function runSync() {
|
||||
if (!selectedId) return;
|
||||
setRunning(true);
|
||||
try {
|
||||
const res = await runSessionizeSync(selectedId);
|
||||
setResult(res);
|
||||
await Promise.all([load(), loadStatus(), loadRuns(selectedId)]);
|
||||
push('success', 'Sessionize sync finished');
|
||||
} catch (e) {
|
||||
push('error', e instanceof Error ? e.message : 'Sync failed');
|
||||
} finally {
|
||||
setRunning(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function importExcel() {
|
||||
if (!selectedId || !excelFile) return;
|
||||
setExcelBusy(true);
|
||||
try {
|
||||
const res = await importSessionizeExcel(selectedId, excelFile);
|
||||
setExcelResult(res);
|
||||
await Promise.all([load(), loadStatus(), loadRuns(selectedId)]);
|
||||
push('success', 'Excel import finished');
|
||||
} catch (e) {
|
||||
push('error', e instanceof Error ? e.message : 'Excel import failed');
|
||||
} finally {
|
||||
setExcelBusy(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (error) return <Empty icon="⚠️" text={error} />;
|
||||
if (!loaded)
|
||||
return (
|
||||
<div className="loading-screen">
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
|
||||
const selected = events.find((e) => e.id === selectedId);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="page-head">
|
||||
<div>
|
||||
<h1>Interfaces</h1>
|
||||
<div className="sub">External data sources. The Sessionize sidecar runs on demand only.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Sidecar status */}
|
||||
<div className="card" style={{ marginBottom: 18 }}>
|
||||
<h2 className="h2">🔌 Sidecar status</h2>
|
||||
{sidecarError ? (
|
||||
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
||||
{sidecarError}
|
||||
</div>
|
||||
) : status ? (
|
||||
<div style={{ display: 'flex', gap: 10, alignItems: 'center', flexWrap: 'wrap' }}>
|
||||
<span className={`pill ${status.ok ? 'green' : 'red'}`}>{status.ok ? 'online' : 'offline'}</span>
|
||||
{status.running && <span className="pill amber">sync running…</span>}
|
||||
{status.lastRun && (
|
||||
<span className="muted small">
|
||||
last run {fmtTime(status.lastRun.finished_at)} —{' '}
|
||||
<span className={status.lastRun.status === 'success' ? 'pill green' : 'pill red'}>
|
||||
{status.lastRun.status}
|
||||
</span>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<Spinner />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Run control */}
|
||||
<div className="card" style={{ marginBottom: 18 }}>
|
||||
<h2 className="h2">▶ Run a sync</h2>
|
||||
{loadableEvents.length === 0 ? (
|
||||
<Empty icon="🔌" text="No events have a Sessionize endpoint yet. Set one in the Events menu." />
|
||||
) : (
|
||||
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
||||
<select
|
||||
className="input"
|
||||
style={{ maxWidth: 320 }}
|
||||
value={selectedId}
|
||||
onChange={(e) => setSelectedId(e.target.value)}
|
||||
>
|
||||
{loadableEvents.map((e) => (
|
||||
<option key={e.id} value={e.id}>
|
||||
{e.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button className="btn primary" disabled={running || !selectedId} onClick={runSync}>
|
||||
{running ? 'Syncing…' : 'Run sync'}
|
||||
</button>
|
||||
{selected?.last_synced_at && (
|
||||
<span className="muted small">last synced {fmtTime(selected.last_synced_at)}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Excel import (Sessions & speakers advanced) */}
|
||||
<div className="card" style={{ marginBottom: 18 }}>
|
||||
<h2 className="h2">📄 Import from Sessionize export</h2>
|
||||
<div className="muted small" style={{ marginBottom: 12, maxWidth: 640 }}>
|
||||
Upload the <strong>“Sessions and speakers (advanced)”</strong> .xlsx export from your
|
||||
Sessionize event. It imports speakers (by email), sessions, the agenda, and creates the
|
||||
speaker registrations — no API key needed.
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
||||
<select
|
||||
className="input"
|
||||
style={{ maxWidth: 320 }}
|
||||
value={selectedId}
|
||||
onChange={(e) => setSelectedId(e.target.value)}
|
||||
>
|
||||
{events.map((e) => (
|
||||
<option key={e.id} value={e.id}>
|
||||
{e.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<input
|
||||
ref={fileRef}
|
||||
type="file"
|
||||
accept=".xlsx,.xls"
|
||||
style={{ display: 'none' }}
|
||||
onChange={(e) => setExcelFile(e.target.files?.[0] ?? null)}
|
||||
/>
|
||||
<button className="btn" disabled={excelBusy} onClick={() => fileRef.current?.click()}>
|
||||
{excelFile ? `📎 ${excelFile.name}` : 'Choose .xlsx…'}
|
||||
</button>
|
||||
<button className="btn primary" disabled={excelBusy || !excelFile || !selectedId} onClick={importExcel}>
|
||||
{excelBusy ? 'Importing…' : 'Import'}
|
||||
</button>
|
||||
<div className="uiverse-tooltip">
|
||||
<button type="button" className="uiverse-btn">
|
||||
<span>
|
||||
<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" width="16" height="16">
|
||||
<path d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" strokeWidth="2" strokeLinejoin="round" strokeLinecap="round" />
|
||||
</svg>
|
||||
How to get this file
|
||||
</span>
|
||||
</button>
|
||||
<div className="uiverse-card">
|
||||
<div className="uiverse-head">
|
||||
<div className="uiverse-ico">
|
||||
<svg viewBox="0 0 20 20" fill="currentColor" width="16" height="16">
|
||||
<path clipRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" fillRule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<h3>Export from Sessionize</h3>
|
||||
</div>
|
||||
<p>
|
||||
In your Sessionize event, open <strong>Export</strong> → <strong>“Sessions and
|
||||
speakers (advanced)”</strong> and download the .xlsx. Any organizer with access to
|
||||
the event can generate it. Upload it here to import speakers, sessions, the agenda
|
||||
and speaker registrations.
|
||||
</p>
|
||||
<div className="uiverse-foot">No API key required</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Recent runs (audit) */}
|
||||
<div className="card">
|
||||
<h2 className="h2">📜 Recent runs {selected ? `— ${selected.name}` : ''}</h2>
|
||||
{runs.length === 0 ? (
|
||||
<Empty icon="📜" text="No sync runs recorded for this event yet." />
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table className="data">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Started</th>
|
||||
<th>Finished</th>
|
||||
<th>Created</th>
|
||||
<th>Updated</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{runs.map((r) => (
|
||||
<tr key={r.id}>
|
||||
<td className="muted">{fmtTime(r.started_at)}</td>
|
||||
<td className="muted">{r.finished_at ? fmtTime(r.finished_at) : '—'}</td>
|
||||
<td className="muted">{r.created}</td>
|
||||
<td className="muted">{r.updated}</td>
|
||||
<td>
|
||||
{r.error ? (
|
||||
<span className="pill red" title={r.error}>
|
||||
error
|
||||
</span>
|
||||
) : (
|
||||
<span className="pill green">ok</span>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{result && <SyncResultModal result={result} onClose={() => setResult(null)} />}
|
||||
{excelResult && <ExcelResultModal result={excelResult} onClose={() => setExcelResult(null)} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ExcelResultModal({ result, onClose }: { result: ExcelSyncResult; onClose: () => void }) {
|
||||
const s = result.summary;
|
||||
return (
|
||||
<Modal
|
||||
open
|
||||
title={`Excel import — ${result.event_name ?? result.event_id}`}
|
||||
onClose={onClose}
|
||||
footer={
|
||||
<button className="btn primary" onClick={onClose}>
|
||||
Close
|
||||
</button>
|
||||
}
|
||||
>
|
||||
{result.status === 'error' || !s ? (
|
||||
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
||||
{result.error ?? 'Import failed'}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="stat-grid">
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_created}</div>
|
||||
<div className="lbl">Speakers created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.sessions_created}</div>
|
||||
<div className="lbl">Sessions created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.slots_created}</div>
|
||||
<div className="lbl">Slots created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_linked}</div>
|
||||
<div className="lbl">Speaker links</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.registrations_created}</div>
|
||||
<div className="lbl">Speaker regs created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.registrations_updated}</div>
|
||||
<div className="lbl">Speaker regs updated</div>
|
||||
</div>
|
||||
</div>
|
||||
{s.errors.length > 0 && (
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<div className="pill red" style={{ display: 'inline-block', marginBottom: 8 }}>
|
||||
{s.errors.length} error(s)
|
||||
</div>
|
||||
<ul style={{ margin: 0, paddingLeft: 18 }}>
|
||||
{s.errors.map((e, i) => (
|
||||
<li key={i} className="small">
|
||||
{e}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
function SyncResultModal({ result, onClose }: { result: SyncResult; onClose: () => void }) {
|
||||
const s = result.summary;
|
||||
return (
|
||||
<Modal
|
||||
open
|
||||
title={`Sessionize sync — ${result.event_name ?? result.event_id}`}
|
||||
onClose={onClose}
|
||||
footer={
|
||||
<button className="btn primary" onClick={onClose}>
|
||||
Close
|
||||
</button>
|
||||
}
|
||||
>
|
||||
{result.status === 'error' || !s ? (
|
||||
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
||||
{result.error ?? 'Sync failed'}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="stat-grid">
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_created}</div>
|
||||
<div className="lbl">Speakers created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_updated}</div>
|
||||
<div className="lbl">Speakers updated</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.sessions_created}</div>
|
||||
<div className="lbl">Sessions created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.sessions_updated}</div>
|
||||
<div className="lbl">Sessions updated</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.slots_created}</div>
|
||||
<div className="lbl">Slots created</div>
|
||||
</div>
|
||||
<div className="stat">
|
||||
<div className="val">{s.speakers_linked}</div>
|
||||
<div className="lbl">Speaker links</div>
|
||||
</div>
|
||||
</div>
|
||||
{result.skipped_speakers && result.skipped_speakers.length > 0 && (
|
||||
<div className="muted small">
|
||||
Skipped {result.skipped_speakers.length} speaker(s) without an email: {result.skipped_speakers.join(', ')}
|
||||
</div>
|
||||
)}
|
||||
{s.errors.length > 0 && (
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<div className="pill red" style={{ display: 'inline-block', marginBottom: 8 }}>
|
||||
{s.errors.length} error(s)
|
||||
</div>
|
||||
<ul style={{ margin: 0, paddingLeft: 18 }}>
|
||||
{s.errors.map((e, i) => (
|
||||
<li key={i} className="small">
|
||||
{e}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
function fmtTime(iso: string): string {
|
||||
return new Date(iso).toLocaleString([], {
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
});
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import type { Contact, Event, Session, SessionSpeaker, Slot, SlotType } from '..
|
||||
import { useToast } from '../context/ToastContext';
|
||||
import { Empty, Modal, Spinner, TypeBadge } from '../components/ui';
|
||||
|
||||
const SLOT_TYPES: SlotType[] = ['session', 'lunch_break', 'coffee_break', 'keynote', 'close_up'];
|
||||
const SLOT_TYPES: SlotType[] = ['session', 'service_session'];
|
||||
|
||||
export function Schedule() {
|
||||
const { push } = useToast();
|
||||
|
||||
@@ -16,6 +16,14 @@ export default defineConfig({
|
||||
'/realtime': { target: SUPABASE_TARGET, changeOrigin: true, ws: true },
|
||||
'/storage': { target: SUPABASE_TARGET, changeOrigin: true },
|
||||
'/functions': { target: SUPABASE_TARGET, changeOrigin: true },
|
||||
// Sessionize sync sidecar (run `npm run sidecar:dev` to start it).
|
||||
// Strip the /sidecar prefix so /sidecar/run -> http://127.0.0.1:3002/run
|
||||
// (mirrors the nginx `location /sidecar/ { proxy_pass .../; }` rewrite).
|
||||
'/sidecar': {
|
||||
target: 'http://127.0.0.1:3002',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/sidecar/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -160,7 +160,7 @@ export function Scanner({ onResult, label = 'Scan a lanyard QR' }: { onResult: (
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<input
|
||||
className="input mono"
|
||||
placeholder="…or type the code (e.g. CVV-ANA-4821)"
|
||||
placeholder="…or type the code (e.g. CVV-XXX-NNNN)"
|
||||
value={manual}
|
||||
onChange={(e) => setManual(e.target.value)}
|
||||
/>
|
||||
|
||||
@@ -83,9 +83,6 @@ export function Login() {
|
||||
<div className="h1">Welcome back 👋</div>
|
||||
<div className="muted small">Scan the QR code on your lanyard to log in.</div>
|
||||
<Scanner onResult={handleScan} label="Point your camera at your lanyard QR" />
|
||||
<div className="muted small" style={{ textAlign: 'center', opacity: 0.6 }}>
|
||||
Demo: type <b>CVV-ANA-4821</b> (Ana) or <b>CVV-BRU-1177</b> (Bruno, staff)
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -151,13 +148,11 @@ export function Login() {
|
||||
<button className="btn ghost small" style={{ alignSelf: 'flex-start' }} onClick={() => setStep('scan')}>
|
||||
← Different lanyard
|
||||
</button>
|
||||
{isStaff && (
|
||||
<div className="muted small" style={{ textAlign: 'center', opacity: 0.6 }}>
|
||||
{isStaff ? (
|
||||
'Staff: QR + your admin password'
|
||||
) : (
|
||||
<>Demo: <b>ana.silva@nubank.com</b> · <b>bruno.costa@acme.com</b></>
|
||||
)}
|
||||
Staff: QR + your admin password
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# Convivo sidecar — Sessionize sync (on-demand).
|
||||
#
|
||||
# A small Node HTTP service driven by the APPE Admin "Interfaces" menu. It
|
||||
# fetches an event's Sessionize data (authenticated API) and writes it to
|
||||
# Supabase via the service-role-only sync_sessionize_event RPC.
|
||||
#
|
||||
# It joins the shared Supabase network and reaches PostgREST at
|
||||
# supabase_kong_Convivo:8000 (Kong's internal port). It is the first
|
||||
# server-side holder of the service-role key (see docs/backend/sidecar.md).
|
||||
#
|
||||
# One runtime dependency (xlsx, for parsing the Sessionize .xlsx export).
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
RUN npm install --omit=dev
|
||||
COPY src/ ./src/
|
||||
|
||||
ENV NODE_ENV=production
|
||||
EXPOSE 3002
|
||||
|
||||
CMD ["node", "src/server.js"]
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "convivo-sidecar",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Convivo Sessionize sync sidecar (on-demand, driven by APPE Admin).",
|
||||
"main": "src/server.js",
|
||||
"scripts": {
|
||||
"start": "node src/server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"xlsx": "^0.18.5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
// Convivo sidecar — Sessionize sync (on-demand).
|
||||
//
|
||||
// A tiny Node HTTP service driven by the APPE Admin "Interfaces" menu.
|
||||
// Endpoints:
|
||||
// GET /health -> { ok: true }
|
||||
// GET /status -> { ok, running, lastRun }
|
||||
// POST /run -> { event_id } (blocking) -> API sync result
|
||||
// POST /import-excel -> { event_id, file_base64, filename? } (blocking)
|
||||
// -> parses the Sessionize "Sessions and speakers
|
||||
// (advanced)" .xlsx and imports it
|
||||
//
|
||||
// Flow for /run:
|
||||
// 1. Read the event's sessionize_endpoint from Supabase (service role).
|
||||
// 2. Fetch it as-is (the public /view/ endpoint needs no key).
|
||||
// 3. If SESSIONIZE_API_KEY is set, send it as X-Sessionize-API-Key
|
||||
// (harmless for /view/, required if the endpoint is an /api/ URL).
|
||||
// 4. Transform the response into the sync_sessionize_event payload.
|
||||
// 5. Call the service-role-only sync_sessionize_event RPC (blocking).
|
||||
// 6. Return the RPC summary (and record it as lastRun).
|
||||
//
|
||||
// Note: the public /view/ payload does NOT include speaker emails, so a
|
||||
// keyless sync imports sessions + agenda but skips speakers (reported in
|
||||
// skipped_speakers). Set SESSIONIZE_API_KEY + an /api/ endpoint to get emails.
|
||||
//
|
||||
// Env:
|
||||
// SUPABASE_URL (default http://supabase_kong_Convivo:8000)
|
||||
// SUPABASE_SERVICE_ROLE_KEY (default = standard local service-role JWT)
|
||||
// SESSIONIZE_API_KEY (optional — only needed for /api/ endpoints)
|
||||
// PORT (default 3002)
|
||||
|
||||
const http = require('http');
|
||||
const XLSX = require('xlsx');
|
||||
|
||||
const SUPABASE_URL = (process.env.SUPABASE_URL || 'http://supabase_kong_Convivo:8000').replace(/\/$/, '');
|
||||
const SERVICE_ROLE_KEY =
|
||||
process.env.SUPABASE_SERVICE_ROLE_KEY ||
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU';
|
||||
const SESSIONIZE_API_KEY = process.env.SESSIONIZE_API_KEY || '';
|
||||
const PORT = parseInt(process.env.PORT || '3002', 10);
|
||||
|
||||
// In-memory last-run state (the sidecar is otherwise stateless).
|
||||
let running = false;
|
||||
let lastRun = null;
|
||||
|
||||
function log(...args) {
|
||||
console.log(new Date().toISOString(), ...args);
|
||||
}
|
||||
|
||||
function json(res, status, body) {
|
||||
res.writeHead(status, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify(body));
|
||||
}
|
||||
|
||||
function readBody(req) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let data = '';
|
||||
req.on('data', (c) => {
|
||||
data += c;
|
||||
if (data.length > 10e6) req.destroy(); // 10 MB cap (base64 xlsx uploads)
|
||||
});
|
||||
req.on('end', () => {
|
||||
try {
|
||||
resolve(data ? JSON.parse(data) : {});
|
||||
} catch {
|
||||
reject(new Error('invalid JSON body'));
|
||||
}
|
||||
});
|
||||
req.on('error', reject);
|
||||
});
|
||||
}
|
||||
|
||||
// Supabase (PostgREST) helper using the service-role key.
|
||||
async function supabaseFetch(path, { method = 'GET', body } = {}) {
|
||||
const res = await fetch(SUPABASE_URL + path, {
|
||||
method,
|
||||
headers: {
|
||||
apikey: SERVICE_ROLE_KEY,
|
||||
Authorization: `Bearer ${SERVICE_ROLE_KEY}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: body ? JSON.stringify(body) : undefined,
|
||||
});
|
||||
const text = await res.text();
|
||||
let parsed;
|
||||
try {
|
||||
parsed = text ? JSON.parse(text) : null;
|
||||
} catch {
|
||||
parsed = text;
|
||||
}
|
||||
if (!res.ok) {
|
||||
const msg = (parsed && (parsed.message || parsed.error || parsed.hint)) || text || res.statusText;
|
||||
throw new Error(`Supabase ${method} ${path} -> ${res.status}: ${msg}`);
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
|
||||
// Transform the Sessionize API response into the sync_sessionize_event payload.
|
||||
// Speakers are matched by email (the key); speakers without an email are
|
||||
// skipped and reported. Sessions carry their speakers as a list of emails.
|
||||
function transform(data) {
|
||||
const speakerByEmail = new Map();
|
||||
const roomName = new Map();
|
||||
for (const r of data.rooms || []) roomName.set(r.id, r.name);
|
||||
for (const s of data.speakers || []) {
|
||||
if (s.email) speakerByEmail.set(s.id, s.email);
|
||||
}
|
||||
|
||||
const speakers = [];
|
||||
const skippedSpeakers = [];
|
||||
for (const s of data.speakers || []) {
|
||||
if (s.email && s.fullName) {
|
||||
speakers.push({ email: s.email, full_name: s.fullName, external_id: s.id });
|
||||
} else {
|
||||
skippedSpeakers.push(s.fullName || s.id || '<unknown>');
|
||||
}
|
||||
}
|
||||
|
||||
const sessions = [];
|
||||
for (const s of data.sessions || []) {
|
||||
if (!s.id || !s.title || !s.startsAt || !s.endsAt) continue;
|
||||
const speakerEmails = (s.speakers || []).map((id) => speakerByEmail.get(id)).filter(Boolean);
|
||||
sessions.push({
|
||||
external_id: s.id,
|
||||
title: s.title,
|
||||
description: s.description || null,
|
||||
room: roomName.get(s.roomId) || null,
|
||||
date: s.startsAt.slice(0, 10),
|
||||
start_time: s.startsAt.slice(11, 19),
|
||||
end_time: s.endsAt.slice(11, 19),
|
||||
is_service_session: Boolean(s.isServiceSession),
|
||||
speakers: speakerEmails,
|
||||
});
|
||||
}
|
||||
|
||||
return { payload: { speakers, sessions }, skippedSpeakers };
|
||||
}
|
||||
|
||||
// Excel serial date (days since 1899-12-30) -> { date, start_time, end_time }.
|
||||
// Sessionize exports "Scheduled At" as an Excel serial and "Scheduled Duration"
|
||||
// in minutes. The epoch is 1899-12-30 (the Excel 1900 system, incl. its
|
||||
// spurious 1900 leap day, which is irrelevant for modern dates).
|
||||
function excelSerialToTime(serial, durationMin) {
|
||||
const ms = Math.round((serial - 25569) * 86400 * 1000);
|
||||
const d = new Date(ms);
|
||||
const pad = (n) => String(n).padStart(2, '0');
|
||||
const date = `${d.getUTCFullYear()}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())}`;
|
||||
const start = `${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())}`;
|
||||
const endMs = ms + (durationMin || 0) * 60 * 1000;
|
||||
const e = new Date(endMs);
|
||||
const end = `${pad(e.getUTCHours())}:${pad(e.getUTCMinutes())}:${pad(e.getUTCSeconds())}`;
|
||||
return { date, start_time: start, end_time: end };
|
||||
}
|
||||
|
||||
// Transform the Sessionize "Sessions and speakers (advanced)" .xlsx into the
|
||||
// sync_sessionize_excel payload. Two sheets:
|
||||
// "Accepted sessions" -> sessions (Speaker Ids -> emails via the speakers sheet)
|
||||
// "Accepted speakers" -> speakers (matched by email)
|
||||
function transformExcel(buffer) {
|
||||
const wb = XLSX.read(buffer, { type: 'buffer' });
|
||||
const sheetName = (n) => wb.SheetNames.find((s) => s.toLowerCase().includes(n)) || null;
|
||||
const toRows = (name) => {
|
||||
const sn = sheetName(name);
|
||||
if (!sn) return [];
|
||||
return XLSX.utils.sheet_to_json(wb.Sheets[sn], { defval: '' });
|
||||
};
|
||||
|
||||
const speakerRows = toRows('speaker');
|
||||
const sessionRows = toRows('session');
|
||||
|
||||
// Speaker Id -> { email, full_name, linkedin_url }.
|
||||
const speakerById = new Map();
|
||||
const speakers = [];
|
||||
for (const r of speakerRows) {
|
||||
const id = String(r['Speaker Id'] ?? '').trim();
|
||||
const email = String(r['Email'] ?? '').trim();
|
||||
const first = String(r['FirstName'] ?? '').trim();
|
||||
const last = String(r['LastName'] ?? '').trim();
|
||||
const full = [first, last].filter(Boolean).join(' ').trim();
|
||||
if (!id || !email || !full) continue;
|
||||
const linkedin = String(r['LinkedIn'] ?? '').trim() || null;
|
||||
speakerById.set(id, { email, full_name: full, linkedin_url: linkedin });
|
||||
speakers.push({ email, full_name: full, external_id: id, linkedin_url: linkedin });
|
||||
}
|
||||
|
||||
const sessions = [];
|
||||
for (const r of sessionRows) {
|
||||
const id = String(r['Session Id'] ?? '').trim();
|
||||
const title = String(r['Title'] ?? '').trim();
|
||||
const schedAt = Number(r['Scheduled At']);
|
||||
const dur = Number(r['Scheduled Duration']);
|
||||
if (!id || !title || !schedAt) continue;
|
||||
const { date, start_time, end_time } = excelSerialToTime(schedAt, dur);
|
||||
const speakerIds = String(r['Speaker Ids'] ?? '')
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean);
|
||||
const speakerEmails = speakerIds.map((sid) => speakerById.get(sid)?.email).filter(Boolean);
|
||||
sessions.push({
|
||||
external_id: id,
|
||||
title,
|
||||
description: String(r['Description'] ?? '').trim() || null,
|
||||
room: String(r['Room'] ?? '').trim() || null,
|
||||
date,
|
||||
start_time,
|
||||
end_time,
|
||||
is_service_session: /service|break|lunch|closing/i.test(String(r['Session Format'] ?? '')),
|
||||
speakers: speakerEmails,
|
||||
});
|
||||
}
|
||||
|
||||
return { payload: { speakers, sessions } };
|
||||
}
|
||||
|
||||
async function runSync(eventId) {
|
||||
if (running) throw new Error('a sync is already running');
|
||||
running = true;
|
||||
const startedAt = new Date().toISOString();
|
||||
log('run: start', { eventId });
|
||||
try {
|
||||
// 1. Read the event's Sessionize endpoint.
|
||||
const events = await supabaseFetch(
|
||||
`/rest/v1/events?id=eq.${encodeURIComponent(eventId)}&select=id,name,sessionize_endpoint`,
|
||||
);
|
||||
const event = Array.isArray(events) ? events[0] : null;
|
||||
if (!event) throw new Error('event not found');
|
||||
if (!event.sessionize_endpoint) {
|
||||
throw new Error(`event "${event.name}" has no sessionize_endpoint set`);
|
||||
}
|
||||
|
||||
// 2. Fetch the Sessionize data. The public /view/ endpoint needs no key;
|
||||
// if a key is configured we send it (required for /api/ endpoints).
|
||||
const szUrl = event.sessionize_endpoint.trim();
|
||||
log('run: fetching Sessionize', { szUrl, hasKey: Boolean(SESSIONIZE_API_KEY) });
|
||||
const szHeaders = {};
|
||||
if (SESSIONIZE_API_KEY) szHeaders['X-Sessionize-API-Key'] = SESSIONIZE_API_KEY;
|
||||
const szRes = await fetch(szUrl, { headers: szHeaders });
|
||||
if (!szRes.ok) {
|
||||
const t = await szRes.text();
|
||||
throw new Error(`Sessionize ${szRes.status}: ${t.slice(0, 200)}`);
|
||||
}
|
||||
const szData = await szRes.json();
|
||||
|
||||
// 3. Transform.
|
||||
const { payload, skippedSpeakers } = transform(szData);
|
||||
log('run: transformed', {
|
||||
speakers: payload.speakers.length,
|
||||
sessions: payload.sessions.length,
|
||||
skippedSpeakers: skippedSpeakers.length,
|
||||
});
|
||||
|
||||
// 4. Call the service-role RPC (blocking).
|
||||
const summary = await supabaseFetch('/rest/v1/rpc/sync_sessionize_event', {
|
||||
method: 'POST',
|
||||
body: { p_event_id: event.id, p_payload: payload },
|
||||
});
|
||||
|
||||
const finishedAt = new Date().toISOString();
|
||||
const result = {
|
||||
event_id: event.id,
|
||||
event_name: event.name,
|
||||
started_at: startedAt,
|
||||
finished_at: finishedAt,
|
||||
status: 'success',
|
||||
summary,
|
||||
skipped_speakers: skippedSpeakers,
|
||||
};
|
||||
lastRun = result;
|
||||
log('run: done', { summary });
|
||||
return result;
|
||||
} catch (e) {
|
||||
const finishedAt = new Date().toISOString();
|
||||
lastRun = {
|
||||
event_id: eventId,
|
||||
started_at: startedAt,
|
||||
finished_at: finishedAt,
|
||||
status: 'error',
|
||||
error: e.message,
|
||||
};
|
||||
log('run: error', { error: e.message });
|
||||
throw e;
|
||||
} finally {
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Excel import: parse the uploaded .xlsx and call sync_sessionize_excel.
|
||||
async function runExcelImport(eventId, fileBase64) {
|
||||
if (running) throw new Error('a sync is already running');
|
||||
running = true;
|
||||
const startedAt = new Date().toISOString();
|
||||
log('import-excel: start', { eventId });
|
||||
try {
|
||||
const events = await supabaseFetch(
|
||||
`/rest/v1/events?id=eq.${encodeURIComponent(eventId)}&select=id,name`,
|
||||
);
|
||||
const event = Array.isArray(events) ? events[0] : null;
|
||||
if (!event) throw new Error('event not found');
|
||||
|
||||
const buffer = Buffer.from(fileBase64, 'base64');
|
||||
if (buffer.length === 0) throw new Error('empty file');
|
||||
|
||||
const { payload } = transformExcel(buffer);
|
||||
log('import-excel: transformed', {
|
||||
speakers: payload.speakers.length,
|
||||
sessions: payload.sessions.length,
|
||||
});
|
||||
if (payload.sessions.length === 0) {
|
||||
throw new Error('no sessions found in the file (expected an "Accepted sessions" sheet)');
|
||||
}
|
||||
|
||||
const summary = await supabaseFetch('/rest/v1/rpc/sync_sessionize_excel', {
|
||||
method: 'POST',
|
||||
body: { p_event_id: event.id, p_payload: payload },
|
||||
});
|
||||
|
||||
const finishedAt = new Date().toISOString();
|
||||
const result = {
|
||||
event_id: event.id,
|
||||
event_name: event.name,
|
||||
started_at: startedAt,
|
||||
finished_at: finishedAt,
|
||||
status: 'success',
|
||||
summary,
|
||||
};
|
||||
lastRun = result;
|
||||
log('import-excel: done', { summary });
|
||||
return result;
|
||||
} catch (e) {
|
||||
const finishedAt = new Date().toISOString();
|
||||
lastRun = {
|
||||
event_id: eventId,
|
||||
started_at: startedAt,
|
||||
finished_at: finishedAt,
|
||||
status: 'error',
|
||||
error: e.message,
|
||||
};
|
||||
log('import-excel: error', { error: e.message });
|
||||
throw e;
|
||||
} finally {
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
const server = http.createServer(async (req, res) => {
|
||||
const url = new URL(req.url, `http://${req.headers.host || 'localhost'}`);
|
||||
const path = url.pathname;
|
||||
try {
|
||||
if (req.method === 'GET' && path === '/health') {
|
||||
return json(res, 200, { ok: true });
|
||||
}
|
||||
if (req.method === 'GET' && path === '/status') {
|
||||
return json(res, 200, { ok: true, running, lastRun });
|
||||
}
|
||||
if (req.method === 'POST' && path === '/run') {
|
||||
const body = await readBody(req);
|
||||
const eventId = body && body.event_id;
|
||||
if (!eventId) return json(res, 400, { error: 'event_id is required' });
|
||||
const result = await runSync(eventId);
|
||||
return json(res, 200, result);
|
||||
}
|
||||
if (req.method === 'POST' && path === '/import-excel') {
|
||||
const body = await readBody(req);
|
||||
const eventId = body && body.event_id;
|
||||
const fileBase64 = body && body.file_base64;
|
||||
if (!eventId) return json(res, 400, { error: 'event_id is required' });
|
||||
if (!fileBase64) return json(res, 400, { error: 'file_base64 is required' });
|
||||
const result = await runExcelImport(eventId, fileBase64);
|
||||
return json(res, 200, result);
|
||||
}
|
||||
return json(res, 404, { error: 'not found' });
|
||||
} catch (e) {
|
||||
return json(res, 500, { error: e.message });
|
||||
}
|
||||
});
|
||||
|
||||
server.listen(PORT, () => {
|
||||
log('sidecar listening', {
|
||||
port: PORT,
|
||||
supabase: SUPABASE_URL,
|
||||
hasSessionizeKey: Boolean(SESSIONIZE_API_KEY),
|
||||
});
|
||||
});
|
||||
@@ -76,6 +76,31 @@ services:
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
convivo-sidecar:
|
||||
build:
|
||||
context: ./apps/sidecar
|
||||
image: convivo-sidecar:latest
|
||||
container_name: convivo-sidecar
|
||||
ports:
|
||||
- "3002:3002"
|
||||
environment:
|
||||
# Where the sidecar reaches PostgREST (Kong on the shared network).
|
||||
SUPABASE_URL: ${SUPABASE_URL:-http://supabase_kong_Convivo:8000}
|
||||
# First server-side holder of the service-role key (bypasses RLS).
|
||||
# Standard local key by default; override for a real deployment.
|
||||
SUPABASE_SERVICE_ROLE_KEY: ${SUPABASE_SERVICE_ROLE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU}
|
||||
# Sessionize API key (required to run a sync). Set to your key.
|
||||
SESSIONIZE_API_KEY: ${SESSIONIZE_API_KEY:-}
|
||||
networks:
|
||||
- supabase
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3002/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
networks:
|
||||
supabase:
|
||||
# External network created by `supabase start`. Name = supabase_network_<project_id>.
|
||||
|
||||
+30
-8
@@ -28,6 +28,9 @@ flowchart LR
|
||||
subgraph AdminC["convivo-admin container (:3001)"]
|
||||
NA["nginx<br/>serves SPA + proxies Supabase paths"]
|
||||
end
|
||||
subgraph SideC["convivo-sidecar container (:3002)"]
|
||||
SC["node<br/>Sessionize sync (on demand)"]
|
||||
end
|
||||
subgraph Core["Supabase core (Supabase CLI)"]
|
||||
K["Kong API gateway<br/>:54321"]
|
||||
K --> G["GoTrue (Auth)"]
|
||||
@@ -42,10 +45,16 @@ flowchart LR
|
||||
|
||||
A -->|"same-origin /auth /rest /realtime /storage /functions"| N
|
||||
AD -->|"same-origin /auth /rest /realtime /storage /functions"| NA
|
||||
AD -->|"same-origin /sidecar/*"| SC
|
||||
N -->|"proxy (supabase_kong_Convivo:8000)"| K
|
||||
NA -->|"proxy (supabase_kong_Convivo:8000)"| K
|
||||
SC -->|"service-role key"| K
|
||||
```
|
||||
|
||||
The **sidecar** (`:3002`) is the one server-side component that holds the
|
||||
service-role key. It is driven by the admin's **Interfaces** menu and runs on
|
||||
demand only — see [backend/sidecar.md](./backend/sidecar.md).
|
||||
|
||||
**Key idea:** there is **no custom backend**. Supabase provides auth, data,
|
||||
business logic (as Postgres RPCs), and realtime. The app is a thin client that
|
||||
talks to Supabase through **same-origin paths**, so there is no CORS to manage.
|
||||
@@ -70,8 +79,9 @@ Everything server-side lives in Postgres. See [backend/README.md](./backend/READ
|
||||
keep the leaderboard consistent. → [backend/rpcs.md](./backend/rpcs.md)
|
||||
- **Security** — Row Level Security on every table; the app only ever uses the
|
||||
**anon key + the user's session JWT**. → [backend/rls.md](./backend/rls.md)
|
||||
- **Data** — seed with 1 event, 6 slots, 18 sessions, 14 contacts, 13
|
||||
registrations, 3 sponsors. → [backend/seed.md](./backend/seed.md)
|
||||
- **Data** — seed with 1 real event (Power Platform Bootcamp AT): 10 slots, 22
|
||||
sessions, 54 contacts (50 attendees + 4 staff). Speakers are added via the
|
||||
Excel import, not the seed. → [backend/seed.md](./backend/seed.md)
|
||||
|
||||
### Frontend — the attendee PWA
|
||||
A single-page React app with a tab shell and a few full-screen takeovers. See
|
||||
@@ -136,7 +146,9 @@ the work atomically, and the `leaderboard` table change fans out over Realtime.
|
||||
**24 hours** (`jwt_expiry = 86400`). Every request sends the **anon key**
|
||||
(public) + the **session JWT** (identity).
|
||||
- The **service-role key is never in the app** — it bypasses RLS and stays
|
||||
server-side. See [backend/rls.md](./backend/rls.md) for what each role can do.
|
||||
server-side. The **sidecar** is its first consumer (the Sessionize sync).
|
||||
See [backend/rls.md](./backend/rls.md) for what each role can do and
|
||||
[backend/sidecar.md](./backend/sidecar.md) for the sidecar.
|
||||
|
||||
## 7. Environment & ports
|
||||
|
||||
@@ -144,6 +156,7 @@ the work atomically, and the `leaderboard` table change fans out over Realtime.
|
||||
|---|---|---|
|
||||
| **Convivo app** | **3000** | Vite dev server (dev) or nginx (Docker) |
|
||||
| **Convivo admin** | **3001** | Vite dev server (dev) or nginx (Docker) |
|
||||
| **Sync sidecar** | **3002** | Node service (Docker) or `npm run sidecar:dev` (dev) |
|
||||
| Supabase API (Kong) | 54321 | The single gateway the apps proxy to |
|
||||
| Supabase Studio | 54323 | UI — login `postgres` / `postgres` |
|
||||
| Postgres | 54322 | Direct DB access (`postgres` / `postgres`) |
|
||||
@@ -155,8 +168,9 @@ npm run db:start # start the Supabase core (Docker)
|
||||
npm run db:reset # (re)apply migrations + seed
|
||||
npm run app:dev # attendee dev server on :3000
|
||||
npm run admin:dev # admin dev server on :3001
|
||||
npm run sidecar:dev # Sessionize sync sidecar on :3002
|
||||
# — or —
|
||||
docker compose up --build # both apps as Docker sidecars (:3000 + :3001)
|
||||
docker compose up --build # apps + sidecar as Docker sidecars (:3000 + :3001 + :3002)
|
||||
```
|
||||
|
||||
## 8. The demo clock
|
||||
@@ -176,8 +190,11 @@ Convivo/
|
||||
│ └─ src/ # screens, components, lib, context
|
||||
├─ apps/admin/ # Admin console (React + Vite + TS, desktop-first)
|
||||
│ ├─ Dockerfile # Multi-stage: build → nginx
|
||||
│ ├─ nginx.conf.template # SPA + same-origin proxy to the Supabase core
|
||||
│ ├─ nginx.conf.template # SPA + same-origin proxy to the Supabase core + /sidecar
|
||||
│ └─ src/ # views, components, lib, context
|
||||
├─ apps/sidecar/ # Sessionize sync sidecar (Node, on demand)
|
||||
│ ├─ Dockerfile # node:20-alpine + xlsx (parses the Excel export)
|
||||
│ └─ src/server.js # /health, /status, /run, /import-excel (blocking)
|
||||
├─ supabase/
|
||||
│ ├─ config.toml # Local stack config (ports, auth, RLS defaults)
|
||||
│ ├─ migrations/
|
||||
@@ -186,9 +203,14 @@ Convivo/
|
||||
│ │ ├─ 20260824000000_redesign.sql # multi-event model, RPCs, RLS, materials
|
||||
│ │ ├─ 20260825000000_interfaces.sql # external_id (sync objects later dropped)
|
||||
│ │ ├─ 20260826000000_registration_qr_token.sql # QR token on registration
|
||||
│ │ └─ 20260830000000_remove_interfaces.sql # ← drops the sync RPCs + sync_runs
|
||||
│ └─ seed.sql # 1 event, 6 slots, 18 sessions, 14 contacts, demo state
|
||||
├─ docker-compose.yml # Runs both app sidecars on the Supabase network
|
||||
│ │ ├─ 20260827000000_admin_password_profile.sql # staff password + self-service profile
|
||||
│ │ ├─ 20260828000000_staff_exclusions_password_sync.sql # staff leaderboard exclusion + password sync
|
||||
│ │ ├─ 20260829000000_registration_type_optionset_speaker_promote_welcome_checkin.sql
|
||||
│ │ ├─ 20260830000000_remove_interfaces.sql # ← drops the sync RPCs + sync_runs
|
||||
│ │ ├─ 20260831000000_sessionize_sidecar.sql # sessionize_endpoint + sync_runs + sync RPC
|
||||
│ │ └─ 20260832000000_slots_enum_excel_import.sql # slot_type enum + slots.id default + Excel RPC
|
||||
│ └─ seed.sql # 1 real event, 10 slots, 22 sessions, 54 contacts (50 attendees + 4 staff)
|
||||
├─ docker-compose.yml # Runs the app sidecars + sync sidecar on the Supabase network
|
||||
├─ docs/ # ← this documentation
|
||||
└─ mockup/index.html # Original interactive mockup (design reference)
|
||||
```
|
||||
@@ -12,6 +12,7 @@ Postgres. This folder documents that core.
|
||||
| [rls.md](./rls.md) | Row Level Security policies + which key the app uses |
|
||||
| [seed.md](./seed.md) | Seed data + the demo accounts |
|
||||
| [docker.md](./docker.md) | Docker: the app image + root compose (how the core + app run together) |
|
||||
| [sidecar.md](./sidecar.md) | The Sessionize sync sidecar (on-demand, service-role) |
|
||||
|
||||
## The big picture
|
||||
|
||||
|
||||
+22
-7
@@ -4,10 +4,13 @@ Docker is the backbone. Two pieces:
|
||||
|
||||
1. **The Supabase core** — a set of containers managed by the **Supabase CLI**
|
||||
(not by a compose file in this repo). See [supabase-core.md](./supabase-core.md).
|
||||
2. **The app sidecars** — two containers, the attendee app
|
||||
([`apps/convivo/Dockerfile`](../../apps/convivo/Dockerfile), `:3000`) and the
|
||||
2. **The app sidecars** — the attendee app
|
||||
([`apps/convivo/Dockerfile`](../../apps/convivo/Dockerfile), `:3000`), the
|
||||
admin console ([`apps/admin/Dockerfile`](../../apps/admin/Dockerfile), `:3001`),
|
||||
and the **Sessionize sync sidecar**
|
||||
([`apps/sidecar/Dockerfile`](../../apps/sidecar/Dockerfile), `:3002`),
|
||||
orchestrated by the root [`docker-compose.yml`](../../docker-compose.yml).
|
||||
The sidecar is documented in [sidecar.md](./sidecar.md).
|
||||
|
||||
Each app container **joins the network the CLI created** for the core and proxies
|
||||
the Supabase same-origin paths to the Kong container. Both use the identical
|
||||
@@ -24,10 +27,13 @@ flowchart LR
|
||||
K["supabase_kong_Convivo<br/>:8000 (internal)"]
|
||||
APP["convivo-app<br/>nginx :3000"]
|
||||
ADM["convivo-admin<br/>nginx :3001"]
|
||||
SC["convivo-sidecar<br/>node :3002"]
|
||||
end
|
||||
CLI -.creates.-> Net
|
||||
APP -->|"proxy /auth /rest /realtime /storage"| K
|
||||
ADM -->|"proxy /auth /rest /realtime /storage"| K
|
||||
ADM -->|"proxy /sidecar/*"| SC
|
||||
SC -->|"service-role key"| K
|
||||
APP -->|"host port 3000"| U["Browser"]
|
||||
ADM -->|"host port 3001"| U
|
||||
```
|
||||
@@ -67,9 +73,10 @@ same-origin paths to the core:
|
||||
|
||||
## Root `docker-compose.yml`
|
||||
|
||||
Runs **only the apps** (the core is CLI-managed). There are two services —
|
||||
`convivo-app` (`:3000`) and `convivo-admin` (`:3001`) — with identical settings
|
||||
except the build context and port:
|
||||
Runs **only the apps** (the core is CLI-managed). There are three services —
|
||||
`convivo-app` (`:3000`), `convivo-admin` (`:3001`), and `convivo-sidecar`
|
||||
(`:3002`). The two nginx apps have identical settings except the build context
|
||||
and port:
|
||||
|
||||
| Setting | `convivo-app` | `convivo-admin` | Why |
|
||||
|---|---|---|---|
|
||||
@@ -79,6 +86,12 @@ except the build context and port:
|
||||
| `networks.supabase` | **external**, name `supabase_network_Convivo` | same | Joins the CLI-created network |
|
||||
| `healthcheck` | `wget http://127.0.0.1:3000/` | `wget http://127.0.0.1:3001/` | Container reports healthy |
|
||||
|
||||
The **`convivo-sidecar`** service is different: it builds
|
||||
[`apps/sidecar`](../../apps/sidecar) (a plain Node service, no nginx), exposes
|
||||
`:3002`, and carries the sidecar env vars (`SUPABASE_URL`,
|
||||
`SUPABASE_SERVICE_ROLE_KEY`, `SESSIONIZE_API_KEY`). It is the first server-side
|
||||
holder of the service-role key. See [sidecar.md](./sidecar.md).
|
||||
|
||||
> If you change `project_id` in `supabase/config.toml`, update the external
|
||||
> network name (`supabase_network_<project_id>`) and the default proxy target
|
||||
> (`supabase_kong_<project_id>:8000`) to match.
|
||||
@@ -92,7 +105,7 @@ npm run db:start
|
||||
# 2. (Optional) reset to clean seed data
|
||||
npm run db:reset
|
||||
|
||||
# 3. Build + run both app sidecars (:3000 + :3001)
|
||||
# 3. Build + run the app sidecars (:3000 + :3001) and the sync sidecar (:3002)
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
@@ -101,12 +114,14 @@ Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin).
|
||||
### Alternative: dev server (no app container)
|
||||
|
||||
For faster iteration you can skip the app containers and use the Vite dev
|
||||
servers, which proxy the same paths to `127.0.0.1:54321` (host port):
|
||||
servers, which proxy the same paths to `127.0.0.1:54321` (host port). The admin
|
||||
dev server also proxies `/sidecar` to `127.0.0.1:3002`, so start the sidecar too:
|
||||
|
||||
```bash
|
||||
npm run db:start
|
||||
npm run app:dev # attendee Vite on :3000
|
||||
npm run admin:dev # admin Vite on :3001
|
||||
npm run sidecar:dev # sync sidecar on :3002
|
||||
```
|
||||
|
||||
## Verified behavior
|
||||
|
||||
@@ -202,6 +202,54 @@ profile from the Convivo app: the LinkedIn URL and the two visibility toggles
|
||||
touch `is_admin`, `password`, `external_id`, etc.
|
||||
- Returns the updated contact row.
|
||||
|
||||
### `sync_sessionize_event(p_event_id, p_payload)` → `jsonb`
|
||||
**Service-role only** (the Sessionize sync sidecar — see [sidecar.md](./sidecar.md)).
|
||||
Imports an event's Sessionize data in order: (1) speakers → contacts (matched by
|
||||
email), (2) sessions (upserted by `external_id`), (3) the agenda (slots
|
||||
find-or-created by date/start/end + `session_speakers` links). `p_payload` is
|
||||
`{ speakers: [{email, full_name, external_id?}], sessions: [{external_id, title,
|
||||
description?, room?, date, start_time, end_time, speakers: [email,...]}] }`.
|
||||
- Guarded to the `service_role` caller (JWT role claim); granted to `service_role`
|
||||
only — the apps cannot call it.
|
||||
- **Idempotent:** re-running updates in place (contacts by email, sessions by
|
||||
`external_id`, slots by date/start/end). Speaker links are **diffed** (insert the
|
||||
new set, then delete only removed) so the `session_needs_speaker` trigger never
|
||||
blocks a removal.
|
||||
- Linking a speaker fires `session_speakers_speaker_promote`, which promotes an
|
||||
existing registration to `speaker`. **No registrations are created** — the ticket
|
||||
sync does that (checking `session_speakers` by email).
|
||||
- Per-item failures are collected into `errors[]` (the run does not abort). Returns
|
||||
a JSONB summary (`speakers_created/updated`, `sessions_created/updated`,
|
||||
`slots_created`, `speakers_linked`, `errors`) and stamps `events.last_synced_at`.
|
||||
- Writes a `sync_runs` audit row (see [schema.md](./schema.md)).
|
||||
|
||||
### `sync_sessionize_excel(p_event_id, p_payload)` → `jsonb`
|
||||
**Service-role only** (the Sessionize sync sidecar's **Excel import** path — see
|
||||
[sidecar.md](./sidecar.md)). Imports the Sessionize **"Sessions and speakers
|
||||
(advanced)"** `.xlsx` export (parsed by the sidecar, which carries the speaker
|
||||
**emails** the public API lacks). Same shape as `sync_sessionize_event` plus
|
||||
`is_service_session` per session and `linkedin_url` per speaker, and it runs one
|
||||
extra step:
|
||||
|
||||
1. **Speakers → contacts** (matched by email; also sets `linkedin_url`).
|
||||
2. **Sessions + agenda** — slots are typed from `is_service_session`
|
||||
(`service_session` for breaks/lunch/closing, else `session`), sessions
|
||||
upserted by `external_id`, speaker links diffed.
|
||||
3. **Speaker registrations** — for every speaker, creates a `speaker`
|
||||
registration or updates an existing `attendee` one to `speaker`
|
||||
(`on conflict (event_id, contact_email)`). **Never overrides `staff` /
|
||||
`sponsor`** tickets. This is the "add the missing registrations for the
|
||||
speakers" step the API sync deliberately leaves to the ticket sync.
|
||||
|
||||
- Guarded to the `service_role` caller; granted to `service_role` only.
|
||||
- **Idempotent:** re-running updates in place (contacts by email, sessions by
|
||||
`external_id`, slots by date/start/end, registrations by event+contact).
|
||||
- Per-item failures are collected into `errors[]`. Returns a JSONB summary
|
||||
(`speakers_created/updated`, `sessions_created/updated`, `slots_created`,
|
||||
`speakers_linked`, `registrations_created/updated`, `errors`) and stamps
|
||||
`events.last_synced_at`.
|
||||
- Writes a `sync_runs` audit row with `source = 'sessionize_excel'`.
|
||||
|
||||
## Role helper functions
|
||||
|
||||
| Function | Returns | Meaning |
|
||||
|
||||
+32
-4
@@ -77,6 +77,8 @@ queries everything for the active event and handles "no active event" gracefully
|
||||
| `num_speakers` | `integer` | maintained aggregate |
|
||||
| `num_registrations` | `integer` | maintained aggregate |
|
||||
| `num_checked_in_registrations` | `integer` | maintained aggregate |
|
||||
| `sessionize_endpoint` | `text` | nullable — the Sessionize API URL for this event (see [sidecar.md](./sidecar.md)) |
|
||||
| `last_synced_at` | `timestamptz` | nullable — when the Sessionize sync last ran |
|
||||
| `created_at` | `timestamptz` | |
|
||||
|
||||
**Constraint:** `unique index events_one_active on (is_active) where is_active`
|
||||
@@ -132,13 +134,20 @@ Unpaid sponsors are hidden from non-admins (RLS).
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | `integer` PK | 1–6 |
|
||||
| `id` | `integer` PK | `nextval('slots_id_seq')` default — the UI/sidecar can create a slot **without** supplying an id (the seed inserts explicit ids and re-syncs the sequence) |
|
||||
| `event_id` | `uuid` FK → `events` | `on delete cascade` |
|
||||
| `type` | `text` | `session` \| `lunch_break` \| `coffee_break` \| `keynote` \| `close_up` (default `session`) |
|
||||
| `name` | `text` | e.g. "Slot 1" |
|
||||
| `slot_date` | `date` | `2026-10-23` |
|
||||
| `type` | `slot_type` (enum) | **`session` \| `service_session`** (default `session`) — a true optionset, not freetext. `service_session` = breaks / lunch / closing (Sessionize's `isServiceSession`) |
|
||||
| `name` | `text` | e.g. "Slot 09:00–09:45" / "Service Session" |
|
||||
| `slot_date` | `date` | |
|
||||
| `start_time` / `end_time` | `time` | |
|
||||
|
||||
> **`type` is a Postgres ENUM** (`public.slot_type`, added by
|
||||
> [`20260832000000_slots_enum_excel_import.sql`](../../supabase/migrations/20260832000000_slots_enum_excel_import.sql)).
|
||||
> The old freetext values (`keynote` / `lunch_break` / `coffee_break` /
|
||||
> `close_up`) were all folded into `service_session` — they are all non-talk
|
||||
> agenda items. The admin Schedule view shows the two values as **Session** /
|
||||
> **Service Session**.
|
||||
|
||||
## `sessions` — one per (slot, room)
|
||||
|
||||
| Column | Type | Notes |
|
||||
@@ -272,6 +281,25 @@ Powers the per-category points breakdown on the Profile screen (per event).
|
||||
|
||||
Index: `points_log_event_id_idx (event_id)`.
|
||||
|
||||
## `sync_runs` — Sessionize sync audit trail
|
||||
|
||||
Event-scoped record of every sidecar sync run (the data behind the admin
|
||||
Interfaces view's "recent runs").
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `id` | `uuid` PK | `gen_random_uuid()` |
|
||||
| `event_id` | `uuid` FK → `events` | `on delete cascade` |
|
||||
| `source` | `text` | `sessionize` (API sync) \| `sessionize_excel` (Excel import) |
|
||||
| `started_at` / `finished_at` | `timestamptz` | `finished_at` nullable |
|
||||
| `created` / `updated` / `skipped` | `integer` | counts from the run |
|
||||
| `error` | `text` | nullable — error text if the run failed |
|
||||
| `triggered_by` | `text` | default `service_role` |
|
||||
|
||||
**RLS:** enabled; `SELECT` for `authenticated` restricted to admins
|
||||
(`sync_runs_select_admin`). Written only by the `sync_sessionize_event` /
|
||||
`sync_sessionize_excel` RPCs.
|
||||
|
||||
## Other indexes
|
||||
|
||||
- `slots_event_id_idx (event_id)`, `registrations_event_id_idx (event_id)`,
|
||||
|
||||
+72
-98
@@ -1,23 +1,37 @@
|
||||
# Seed Data & Demo Accounts
|
||||
|
||||
Source of truth: [`supabase/seed.sql`](../../supabase/seed.sql). The seed runs on
|
||||
`npm run db:reset` and is **idempotent** (`on conflict ... do nothing`).
|
||||
`npm run db:reset` and is **idempotent** (`on conflict ... do nothing` /
|
||||
`do update`).
|
||||
|
||||
The seed uses **real data** from a past event — the **Global Power Platform
|
||||
Bootcamp (Austria)** — instead of random demo data:
|
||||
|
||||
- The **agenda** (slots + sessions) comes from the event's Sessionize public API
|
||||
(`…/api/v2/4domszaq/view/All`): 22 sessions on 2026-02-20 (18 talks + 4 service
|
||||
sessions: coffee break, lunch, a partner session, and the closing).
|
||||
- The **speakers** are **not** seeded — they are imported from the Sessionize
|
||||
**"Sessions and speakers (advanced)"** `.xlsx` via the admin **Interfaces →
|
||||
Import Excel** control (see [sidecar.md](./sidecar.md)). That import creates the
|
||||
speaker contacts, links them to sessions, and creates their `speaker`
|
||||
registrations (matched by email).
|
||||
|
||||
## What it creates
|
||||
|
||||
| Data | Count | Notes |
|
||||
|---|---|---|
|
||||
| `auth.users` + `auth.identities` | 13 | 12 attendees + 1 admin; **QR token = bcrypt password** (attendees/staff) — the admin uses a real **password** instead |
|
||||
| `contacts` | 14 | 13 registrants + 1 external keynote speaker (no token — tokens live on registrations) |
|
||||
| `events` | 1 | **APPE 2026**, 2026-10-23, São Paulo, Brazil, **active** |
|
||||
| `registrations` | 13 | one per contact (Elena has none); points + **QR token** scoped here |
|
||||
| `sponsors` | 3 | Nubank (headline, paid), Acme Corp (gold, paid), Globant (community, unpaid) |
|
||||
| `slots` | 6 | 23 Oct, 09:00–15:45 (see table below) |
|
||||
| `sessions` | 18 | 3 per slot (Main Stage / Room A / Room B) |
|
||||
| `session_speakers` | 22 | M:N session → contact |
|
||||
| `leaderboard` | 10 | mirrored from `registrations`, **staff excluded** (13 registrants − 3 staff) |
|
||||
| `points_log` | 16 | Ana's coherent breakdown + one `admin` entry per other user |
|
||||
| Ana's demo state | — | 6 preferences, 2 check-ins, 4 connections, 1 feedback |
|
||||
| `auth.users` + `auth.identities` | 54 | 50 attendees + 4 staff; **QR token = bcrypt password** (attendees), **`appe-admin-2026`** (staff) |
|
||||
| `contacts` | 54 | 50 attendees + 4 staff (`is_admin = true`, `password = 'appe-admin-2026'`) |
|
||||
| `events` | 1 | **Global Power Platform Bootcamp \| Austrian Power Platform Enthusiasts Edition**, 2026-02-20, Vienna, Austria, **active**, `sessionize_endpoint` set to `https://sessionize.com/api/v2/4domszaq/view/All` |
|
||||
| `registrations` | 54 | 50 `attendee` + 4 `staff`; each with a `CVV-XXX-NNNN` QR token |
|
||||
| `slots` | 10 | 2026-02-20, 09:15–17:00 (7 `session` + 3 `service_session`) |
|
||||
| `sessions` | 22 | real titles/descriptions/rooms from the Sessionize API |
|
||||
| `session_speakers` | 0 | **added by the Excel import** (not seeded) |
|
||||
| `sponsors` | 0 | none for this event |
|
||||
|
||||
> **Speaker contacts are intentionally absent.** After `db:reset`, run the Excel
|
||||
> import (Interfaces → Import Excel → choose the `.xlsx` → Import) to add the 21
|
||||
> speakers: their contacts, session links, and `speaker` registrations.
|
||||
|
||||
> **GoTrue gotcha:** manually-inserted `auth.users` must have
|
||||
> `confirmation_token`, `recovery_token`, `email_change_token_new`, and
|
||||
@@ -25,101 +39,61 @@ Source of truth: [`supabase/seed.sql`](../../supabase/seed.sql). The seed runs o
|
||||
> grant can't scan a NULL `confirmation_token`. `phone` is left NULL (unique
|
||||
> constraint).
|
||||
|
||||
> **Staff = admin (merged).** Bruno, Rita, and the APPE Admin have
|
||||
> `is_admin = true` on their `contacts` row. Their registration `type` is
|
||||
> `staff` (the ticket type shown on the lanyard).
|
||||
> **Staff = admin (merged).** The four staff have `is_admin = true` on their
|
||||
> `contacts` row (so they can open the APPE Admin console **and** generate the
|
||||
> Sessionize export) and their registration `type` is `staff`.
|
||||
|
||||
## Slots
|
||||
## Slots (2026-02-20)
|
||||
|
||||
| id | Type | Time |
|
||||
|---|---|---|
|
||||
| 1 | keynote | 09:00–09:45 |
|
||||
| 2 | session | 10:00–10:45 |
|
||||
| 3 | session | 11:30–12:15 |
|
||||
| 4 | lunch_break | 13:15–14:00 |
|
||||
| 5 | session | 14:00–14:45 |
|
||||
| 6 | close_up | 15:00–15:45 |
|
||||
| Type | Time |
|
||||
|---|---|
|
||||
| session | 09:15–10:00 (keynote) |
|
||||
| service_session | 10:00–10:30 (coffee break) |
|
||||
| session | 10:30–11:15 |
|
||||
| session | 11:15–12:00 |
|
||||
| service_session | 12:00–13:00 (lunch) |
|
||||
| session | 13:00–13:45 |
|
||||
| session | 13:45–14:30 |
|
||||
| session | 14:30–15:15 |
|
||||
| session | 15:15–16:00 |
|
||||
| service_session | 16:00–17:00 (partner session + closing) |
|
||||
|
||||
> `type` is the `slot_type` **enum** (`session` / `service_session`) — see
|
||||
> [schema.md](./schema.md#slots--schedule-blocks).
|
||||
|
||||
## Demo accounts
|
||||
|
||||
**Attendees** log in with **QR code** (typed or scanned) + **email** — the QR
|
||||
token is the Auth password. **Staff** log in with **QR code + their staff
|
||||
password** (the Convivo app shows a password field when a staff QR is detected;
|
||||
the email comes from the resolved contact). The **APPE Admin** (and any staff
|
||||
member you give one) can also log in with **email + password** in the admin app
|
||||
(event-independent, so it works for any event). The password lives in
|
||||
`contacts.password`; a trigger (`trg_contact_password_sync`) **auto-syncs** it as
|
||||
the bcrypt hash in `auth.users.encrypted_password`, so just set
|
||||
`contacts.password` in Supabase and it works with `signInWithPassword`
|
||||
immediately.
|
||||
password** in the Convivo app, or **email + password** in the admin app. All four
|
||||
staff share the password **`appe-admin-2026`** (stored in `contacts.password`,
|
||||
auto-synced to `auth.users.encrypted_password` by the `trg_contact_password_sync`
|
||||
trigger).
|
||||
|
||||
| Person | Type | Login | Email | Start pts |
|
||||
|---|---|---|---|---|
|
||||
| **Ana Silva** | speaker | QR `CVV-ANA-4821` | ana.silva@nubank.com | 40 |
|
||||
| **Bruno Costa** | staff (admin) | QR `CVV-BRU-1177` + **password** `appe-admin-2026` | bruno.costa@acme.com | 140 |
|
||||
| **Rita Lopes** | staff (admin) | QR `CVV-RIT-9034` + **password** `appe-admin-2026` | rita.lopes@globant.com | 95 |
|
||||
| **APPE Admin** | staff (admin) | **password** `appe-admin-2026` | admin@appe.at | 0 |
|
||||
| Tomás Ribeiro | speaker | `CVV-TOM-5566` | tomas.ribeiro@dataprev.com | 88 |
|
||||
| Sofia Almeida | speaker | `CVV-SOF-2299` | sofia.almeida@loop.com | 76 |
|
||||
| Marco Chen | speaker | `CVV-MRC-7712` | marco.chen@deepmind.com | 70 |
|
||||
| Julia Santos | speaker | `CVV-JUL-3345` | julia.santos@ifood.com | 64 |
|
||||
| Pedro Nunes | speaker | `CVV-PED-8801` | pedro.nunes@microsoft.com | 58 |
|
||||
| Carla Mendes | speaker | `CVV-CAR-6623` | carla.mendes@quintoessencial.com | 52 |
|
||||
| Diego Ferreira | speaker | `CVV-DIE-4458` | diego.ferreira@stone.com | 35 |
|
||||
| Marina Costa | speaker | `CVV-MNA-2210` | marina.costa@olx.com | 28 |
|
||||
| Lucas Oliveira | speaker | `CVV-LUC-9987` | lucas.oliveira@usp.br | 15 |
|
||||
| Dr. Elena Vasquez | (external speaker) | — | elena.vasquez@keynote.com | — |
|
||||
| Person | Type | Email | Login |
|
||||
|---|---|---|---|
|
||||
| **Amelia Hernandez** | staff (admin) | amelia@appe.at | `appe-admin-2026` |
|
||||
| **Sabrina Hota** | staff (admin) | sabrina@appe.at | `appe-admin-2026` |
|
||||
| **Jose Lago** | staff (admin) | jose@appe.at | `appe-admin-2026` |
|
||||
| **Markus Franz** | staff (admin) | markus@appe.at | `appe-admin-2026` |
|
||||
| 50 attendees | attendee | (made-up, e.g. lena.huber@gmail.com) | QR `CVV-ATT-1000`…`CVV-ATT-1049` |
|
||||
|
||||
> **Speaker auto-promote:** every seeded attendee who speaks in a session is
|
||||
> typed `speaker` (the `session_speakers_speaker_promote` trigger promotes
|
||||
> `attendee` → `speaker` on insert, so the seed states the final type). Only
|
||||
> Bruno, Rita, and the APPE Admin are `staff` (the trigger never overrides an
|
||||
> explicit staff/sponsor ticket).
|
||||
>
|
||||
> **Staff passwords:** Bruno and Rita have `contacts.password = 'appe-admin-2026'`
|
||||
> so the Convivo **staff QR login** (QR + staff password) works out of the box.
|
||||
|
||||
> **Dr. Elena Vasquez** is an external keynote speaker: she has a `contacts` row
|
||||
> (and speaks in `session_speakers`) but **no registration, no QR token, and no
|
||||
> auth user**, so she can't log in — she only appears as a speaker on the agenda.
|
||||
|
||||
## Ana's demo state (so the app looks alive on first login)
|
||||
|
||||
Ana (`[email protected]`) is seeded with a coherent 40-point history:
|
||||
|
||||
- **Points breakdown** (`points_log`): 2× check-in (+10 each), 2× connection
|
||||
(+5 each), 1× feedback (+10) = **40**.
|
||||
- **Preferences** — one pick per slot (matches the mockup):
|
||||
- Slot 1 → *Designing for Trust in AI Products*
|
||||
- Slot 2 → *AI in Practice: Lessons from Production*
|
||||
- Slot 3 → *Data Storytelling*
|
||||
- Slot 4 → *Prototyping with AI*
|
||||
- Slot 5 → *Community-Led Growth*
|
||||
- Slot 6 → *Closing Panel: What's Next*
|
||||
- **Check-ins** — checked into Slot 1 and Slot 2 (by staff Bruno).
|
||||
- **Connections**:
|
||||
- accepted with **Bruno** and **Rita**
|
||||
- incoming (pending) from **Sofia**
|
||||
- outgoing (pending) to **Julia**
|
||||
- **Feedback** — rated Slot 1's *Designing for Trust in AI Products* 5★ with a
|
||||
comment.
|
||||
- **Speaker** — Ana is a speaker of Slot 6's *Open Space: Your Ideas* (so the
|
||||
Agenda shows a "🎤 you" tag and the material-upload notice).
|
||||
|
||||
> Everyone else gets a single `admin` `points_log` entry for their starting points
|
||||
> (so the Profile breakdown shows "Other"), and no other activity.
|
||||
> **Speaker auto-promote:** the Excel import creates the speakers' registrations
|
||||
> as `speaker` directly (and the `session_speakers_speaker_promote` trigger
|
||||
> promotes any `attendee` that gets linked). The seed itself contains **no
|
||||
> speakers** — only the 50 attendees and 4 staff.
|
||||
|
||||
## Suggested demo flow
|
||||
|
||||
1. Log in as **Ana** (attendee) → Home, Agenda, Leaderboard all populated.
|
||||
2. Scan **Marco** (`CVV-MRC-7712`) → send a connection request.
|
||||
3. Log in as **Bruno** (staff) → QR `CVV-BRU-1177` + staff password
|
||||
`appe-admin-2026` → the Scan tab becomes **Check-in** → pick a session → scan
|
||||
**Carla** (`CVV-CAR-6623`) → she gets +10. Flip the **check-in type toggle**
|
||||
to **Welcome check-in** and scan **Tomás** (`CVV-TOM-5566`) → he's marked
|
||||
present at the event (no points).
|
||||
4. Watch the **Leaderboard** update live (Realtime).
|
||||
5. Log in as **APPE Admin** (`[email protected]` / password `appe-admin-2026`) in the
|
||||
admin app → Dashboard, Contacts, Registrations, Sponsors, Schedule, Activity,
|
||||
Events. (Staff Bruno/Rita can also open the admin app with their email + QR
|
||||
token, since that is their Auth password.)
|
||||
1. Log in as **Amelia** (staff/admin) in the admin app (`[email protected]` /
|
||||
`appe-admin-2026`) → Dashboard shows the real event (54 registrations, 22
|
||||
sessions).
|
||||
2. **Interfaces → Import Excel** → choose the "Sessions and speakers
|
||||
(advanced)" `.xlsx` → **Import** → the result modal shows the speakers
|
||||
created, sessions updated, speaker links, and speaker registrations created.
|
||||
3. **Schedule** → slots now show **Session** / **Service Session** types and the
|
||||
sessions list their speakers.
|
||||
4. **Events** → the event's **Sessionize endpoint** is set; the **Sync** button
|
||||
runs the (keyless) API sync.
|
||||
5. Log in as an **attendee** in the Convivo app (QR `CVV-ATT-1000` +
|
||||
`[email protected]`) → Home/Agenda show the real agenda.
|
||||
@@ -0,0 +1,128 @@
|
||||
# Sidecar — Sessionize sync
|
||||
|
||||
The **sidecar** is a small Node HTTP service that syncs an event's agenda from
|
||||
[Sessionize](https://sessionize.com) into Convivo. It is the only server-side
|
||||
component that holds the **service-role key**, and it is driven entirely by the
|
||||
APPE Admin **Interfaces** menu — it runs **on demand only** (no scheduling).
|
||||
|
||||
- Code: [`apps/sidecar/`](../../apps/sidecar/) (single file:
|
||||
[`src/server.js`](../../apps/sidecar/src/server.js))
|
||||
- Image: [`apps/sidecar/Dockerfile`](../../apps/sidecar/Dockerfile)
|
||||
(`node:20-alpine`; one runtime dependency, **`xlsx`**, to parse the Sessionize
|
||||
Excel export — everything else is built-in `http` + `fetch`)
|
||||
- Compose service: `convivo-sidecar` in the root
|
||||
[`docker-compose.yml`](../../docker-compose.yml) (`:3002`)
|
||||
- DB side: the `sync_sessionize_event` RPC + `sync_runs` audit table — see
|
||||
[rpcs.md](./rpcs.md) and [schema.md](./schema.md)
|
||||
|
||||
## What it does
|
||||
|
||||
There are **two import paths**, both on demand:
|
||||
|
||||
**A. API sync** (`POST /run`) — fetches the event's `sessionize_endpoint` and
|
||||
imports, in order: (1) speakers as contacts (matched by **email**), (2) sessions
|
||||
(upserted by `external_id`), (3) the agenda/schedule (slots find-or-created by
|
||||
date/start/end + `session_speakers` links). The public `/view/` payload has no
|
||||
speaker emails, so this path imports sessions + agenda but **skips speakers**
|
||||
(unless an authenticated `/api/` endpoint + key is configured).
|
||||
|
||||
**B. Excel import** (`POST /import-excel`) — the admin uploads the Sessionize
|
||||
**"Sessions and speakers (advanced)"** `.xlsx` export (generated on the fly by
|
||||
any organizer with admin access to the event). The sidecar parses it (two sheets:
|
||||
*Accepted sessions* + *Accepted speakers*) and calls the
|
||||
`sync_sessionize_excel` RPC, which imports, in order: (1) speakers as contacts
|
||||
(matched by **email** — the Excel carries emails, so this is reliable), (2)
|
||||
sessions + agenda (slots typed `session` / `service_session` from
|
||||
`isServiceSession` + `session_speakers` links), and (3) **a `speaker`
|
||||
registration for every speaker** (create, or update `attendee`→`speaker`; never
|
||||
overrides `staff`/`sponsor`). This is the path that creates the missing speaker
|
||||
contacts + registrations.
|
||||
|
||||
Linking a speaker to a session fires the `session_speakers_speaker_promote`
|
||||
trigger, which promotes an existing registration to `speaker`.
|
||||
|
||||
## How it reaches things
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
ADM["convivo-admin<br/>nginx :3001"] -->|"/sidecar/*"| SC["convivo-sidecar<br/>node :3002"]
|
||||
SC -->|"service-role key"| K["supabase_kong_Convivo<br/>:8000 (PostgREST)"]
|
||||
SC -->|"GET (key optional)"| SZ["Sessionize /view/ or /api/"]
|
||||
K --> PG["Postgres 17"]
|
||||
```
|
||||
|
||||
- **Supabase:** PostgREST at `supabase_kong_Convivo:8000` (Kong's internal port
|
||||
on the shared network — see [supabase-core.md#ports](./supabase-core.md#ports)),
|
||||
authenticated with the **service-role key**.
|
||||
- **Sessionize:** the event's stored `sessionize_endpoint`, fetched **as-is**.
|
||||
The public `/view/` endpoint needs no key. If `SESSIONIZE_API_KEY` is set it
|
||||
is sent as the `X-Sessionize-API-Key` header (harmless for `/view/`, required
|
||||
for an `/api/` endpoint).
|
||||
|
||||
> **Key is optional.** The public `/view/` endpoint (the one stored on the
|
||||
> event) returns sessions, speakers, and rooms **without** speaker email
|
||||
> addresses. Email is the matching key, so a keyless sync imports sessions +
|
||||
> agenda but **skips speakers** (reported in `skipped_speakers`). To import
|
||||
> speakers by email, set `SESSIONIZE_API_KEY` and point the event at the
|
||||
> authenticated `/api/` endpoint, which returns `email` on each speaker.
|
||||
|
||||
## HTTP API
|
||||
|
||||
| Method | Path | Body | Returns |
|
||||
|---|---|---|---|
|
||||
| `GET` | `/health` | — | `{ ok: true }` (compose healthcheck) |
|
||||
| `GET` | `/status` | — | `{ ok, running, lastRun }` |
|
||||
| `POST` | `/run` | `{ event_id }` | **blocking** — the API-sync result (summary + errors) |
|
||||
| `POST` | `/import-excel` | `multipart/form-data` (`event_id` + `file` = the `.xlsx`) | **blocking** — the Excel-import result (summary + errors) |
|
||||
|
||||
`/run` is **blocking**: it reads the event's endpoint, fetches Sessionize,
|
||||
transforms, calls the RPC, and returns the summary. The admin's "Sync" button and
|
||||
the Interfaces "Run sync" both call it and show the result inline.
|
||||
|
||||
`/import-excel` is **blocking** too: it reads the uploaded `.xlsx` (parsed with
|
||||
`xlsx`), transforms the two sheets into the `sync_sessionize_excel` payload, and
|
||||
calls that RPC. The admin's Interfaces **"Import Excel"** control posts the file
|
||||
here and shows the result inline.
|
||||
|
||||
## Env vars
|
||||
|
||||
| Var | Default | Notes |
|
||||
|---|---|---|
|
||||
| `SUPABASE_URL` | `http://supabase_kong_Convivo:8000` | Where PostgREST lives |
|
||||
| `SUPABASE_SERVICE_ROLE_KEY` | standard local service-role JWT | **First server-side holder** of this key (bypasses RLS). Override for a real deployment. |
|
||||
| `SESSIONIZE_API_KEY` | *(empty)* | **Optional.** Only needed if the endpoint is an authenticated `/api/` URL. Sent as `X-Sessionize-API-Key` when set. |
|
||||
| `PORT` | `3002` | |
|
||||
|
||||
> **Secrets convention:** the anon key ships in the apps (public by design); the
|
||||
> service-role key is **never in the app** and stays server-side. The sidecar is
|
||||
> the first consumer of that rule — it holds the key in a container env var,
|
||||
> defaulting to the standard local key (overridable), mirroring how the anon key
|
||||
> is defaulted inline in compose. See [rls.md](./rls.md).
|
||||
|
||||
## Running
|
||||
|
||||
```bash
|
||||
# With the rest of the stack (recommended)
|
||||
docker compose up --build # brings up convivo-sidecar on :3002
|
||||
|
||||
# Or just the sidecar, against a running core
|
||||
npm run sidecar:dev # node apps/sidecar/src/server.js (SUPABASE_URL -> 127.0.0.1:54321)
|
||||
```
|
||||
|
||||
The admin app reaches the sidecar through the same-origin `/sidecar/` proxy
|
||||
(nginx in Docker, Vite in dev) — see [docker.md](./docker.md).
|
||||
|
||||
## Verified behavior
|
||||
|
||||
- `GET /health` → `{ ok: true }` (direct `:3002` and via `:3001/sidecar/health`).
|
||||
- `POST /run` against a public `/view/` endpoint (no key) → fetches, transforms,
|
||||
calls the RPC, and writes sessions/slots (speakers skipped — no emails in the
|
||||
public payload — reported in `skipped_speakers`).
|
||||
- `POST /run` with `SESSIONIZE_API_KEY` set + an `/api/` endpoint → speakers
|
||||
imported by email.
|
||||
- `POST /run` with a reachable Sessionize endpoint → fetches, transforms, calls
|
||||
the RPC, and writes contacts/sessions/slots/links (idempotent on re-run).
|
||||
- `POST /import-excel` with the real "Sessions and speakers (advanced)" export →
|
||||
creates the speaker contacts, links them to sessions, and creates/updates their
|
||||
`speaker` registrations (idempotent on re-run). Verified: 21 speakers created,
|
||||
25 speaker links, 21 speaker registrations, 0 errors.
|
||||
@@ -85,7 +85,7 @@ npx supabase status
|
||||
| Key | Value | Where it's used |
|
||||
|---|---|---|
|
||||
| **Anon key** | standard local anon JWT (see `apps/convivo/.env.example`) | **Ships in the app** (public by design) |
|
||||
| **Service-role key** | standard local service-role JWT | **Never in the app** — server-side only (used for admin ops / verification) |
|
||||
| **Service-role key** | standard local service-role JWT | **Never in the app** — server-side only. The **sidecar** is its first consumer (see [sidecar.md](./sidecar.md)). |
|
||||
|
||||
The app's security model (anon key + session JWT + RLS) is documented in
|
||||
[rls.md](./rls.md).
|
||||
@@ -17,9 +17,10 @@ It runs on **port 3001** (Vite dev) or as the `convivo-admin` Docker container
|
||||
| **Contacts** | Table of all contacts (email, name, LinkedIn, visibility toggles, `is_admin`). Edit, toggle `is_admin`, set visibility, adjust points. (No QR token here — it lives on the registration.) |
|
||||
| **Registrations** | Per active event: list (contact, type, **QR token**, checked_in, points). Change type (enforces the sponsor rule — a failed sponsor change opens an **in-place sponsor lookup** popup), mark checked-in, **view the QR token** (final — no reset). |
|
||||
| **Sponsors** | List (paid only visible to attendees; admin sees all). Add/edit (type, name, email, phone, paid, amount, **contact search-and-pick**). |
|
||||
| **Schedule** | Slots (with type) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state, `average_feedback`, `ai_generated_feedback` + an **Evaluate** stub button). |
|
||||
| **Schedule** | Slots (with a **type optionset** — `Session` / `Service Session`) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state, `average_feedback`, `ai_generated_feedback` + an **Evaluate** stub button). |
|
||||
| **Activity** | Tables of check-ins, connections, and feedback (per active event). |
|
||||
| **Events** | Create event, toggle active/inactive (a switch; only one can be active at a time — activating one deactivates the rest), edit dates/location. |
|
||||
| **Events** | Create event, toggle active/inactive (a switch; only one can be active at a time — activating one deactivates the rest), edit dates/location + the **Sessionize endpoint**. Each row has a **Sync** button that runs a (blocking) Sessionize sync and shows a result modal. |
|
||||
| **Interfaces** | Manages the Sessionize sync **sidecar**: status (online / running / last run), a **Run sync** control (event picker + blocking run + result modal), an **Import Excel** control (upload the Sessionize "Sessions and speakers (advanced)" `.xlsx` + a "How to get this file" tooltip), and a **Recent runs** table from `sync_runs`. See [../backend/sidecar.md](../backend/sidecar.md). |
|
||||
|
||||
## Auth guard
|
||||
|
||||
@@ -33,9 +34,9 @@ Login is **email + password** (`signInWithPassword({ email, password })`), but
|
||||
|
||||
The password is **event-independent** — it is the contact's Auth password
|
||||
(`contacts.password` must match the bcrypt hash in `auth.users.encrypted_password`),
|
||||
so the same admin can log in for any event. The demo admin is
|
||||
`admin@appe.at` / password `appe-admin-2026`. Staff (Bruno/Rita) can also open the
|
||||
admin app using their email + QR token, since that is their Auth password.
|
||||
so the same admin can log in for any event. The seeded staff are
|
||||
`amelia@appe.at`, `[email protected]`, `[email protected]`, and `[email protected]`, all
|
||||
with password `appe-admin-2026` (see [../backend/seed.md](../backend/seed.md)).
|
||||
|
||||
## Source layout
|
||||
|
||||
@@ -62,7 +63,8 @@ apps/admin/src/
|
||||
├─ Sponsors.tsx # sponsor CRUD
|
||||
├─ Schedule.tsx # slots + sessions + speakers + material + AI-evaluate
|
||||
├─ Activity.tsx # check-ins / connections / feedback tables
|
||||
└─ Events.tsx # event management
|
||||
├─ Events.tsx # event management (+ sessionize_endpoint + per-row Sync)
|
||||
└─ Interfaces.tsx # sidecar status / run / recent runs
|
||||
```
|
||||
|
||||
## Data access
|
||||
|
||||
+86
-4
@@ -22,15 +22,26 @@ current phase.
|
||||
> **Existing-sponsor link + Interfaces removal** (the in-place sponsor lookup can
|
||||
> now link an existing sponsor, not just create one; the Pretix/Sessionize
|
||||
> "Interfaces" feature — admin view, `sync-trigger` Edge Function, mock API, and
|
||||
> the `sync_runs` table + sync RPCs — is removed).
|
||||
> Remaining work is cross-cutting (real event clock, deployment, testing).
|
||||
> the `sync_runs` table + sync RPCs — is removed), and
|
||||
> **Sessionize sync sidecar** (the Sessionize interface is re-introduced as a
|
||||
> Docker sidecar driven by a new admin Interfaces menu — on demand only, with a
|
||||
> `sessionize_endpoint` field on events and a per-row Sync button), and
|
||||
> **Sessionize Excel import + slots optionset + real seed** (the sidecar also
|
||||
> imports the Sessionize "Sessions and speakers (advanced)" `.xlsx` — creating
|
||||
> speaker contacts, session links, and `speaker` registrations by email; `slots.type`
|
||||
> is now a `session`/`service_session` enum; the seed uses the real Global Power
|
||||
> Platform Bootcamp (Austria) agenda + 50 attendees + 4 staff, with the event's
|
||||
> endpoint set and speakers added via the Excel import).
|
||||
> Remaining work is cross-cutting (real event clock, deployment, testing, and the
|
||||
> ticket/Pretix sync that will consume the speaker links by email).
|
||||
|
||||
## Done
|
||||
|
||||
### Phase 0 — Dockerized Supabase core ✅
|
||||
- Full schema (13 tables), RLS on every table, transactional points RPCs.
|
||||
- Seed: 1 event, 6 slots, 18 sessions, 14 contacts, 13 registrations, 3 sponsors
|
||||
(QR token = auth password).
|
||||
- Seed: 1 real event (Power Platform Bootcamp AT), 10 slots, 22 sessions, 54
|
||||
contacts (50 attendees + 4 staff), 54 registrations (QR token = auth password).
|
||||
Speakers are added via the Excel import, not the seed.
|
||||
- Runs via the Supabase CLI (`supabase start` / `supabase db reset`).
|
||||
- Details: [backend/README.md](./backend/README.md).
|
||||
|
||||
@@ -155,6 +166,77 @@ rebuilt the views on the new model:
|
||||
- `https://www.appe.at/assets/appe_full.png` as favicon + PWA icon (192/512)
|
||||
for **both** apps. Updated `index.html` + `manifest.webmanifest` + `public/`.
|
||||
|
||||
## Sessionize sync sidecar — ✅ complete
|
||||
|
||||
A new round (migrations `20260831000000_sessionize_sidecar.sql` +
|
||||
`20260832000000_slots_enum_excel_import.sql`, a new `apps/sidecar/` service +
|
||||
admin UI), verified end-to-end. The Sessionize interface is **re-introduced with
|
||||
a different architecture**: a Docker sidecar instead of the removed Edge Function
|
||||
+ mock API. It runs **on demand only** (no scheduling). There are **two import
|
||||
paths**: the **API sync** (`/run`) and the **Excel import** (`/import-excel`).
|
||||
|
||||
**Event field + per-row Sync.**
|
||||
- `events.sessionize_endpoint` (the Sessionize API URL) is editable in the Events
|
||||
create/edit modal; `events.last_synced_at` stamps the last run.
|
||||
- Each event row has a **Sync** button (disabled-hint when no endpoint is set);
|
||||
it runs a **blocking** sync and shows a result modal (counts + errors).
|
||||
|
||||
**The sidecar (`apps/sidecar/`, `:3002`).**
|
||||
- Node 20; one runtime dep (**`xlsx`**, to parse the Excel export). `GET
|
||||
/health`, `GET /status`, `POST /run` (blocking), `POST /import-excel`
|
||||
(blocking, `multipart/form-data`).
|
||||
- **API sync** (`/run`): reads the event's endpoint and fetches it **as-is** (the
|
||||
public `/view/` endpoint needs no key). If `SESSIONIZE_API_KEY` is set it is
|
||||
sent as `X-Sessionize-API-Key` (needed only for an `/api/` endpoint, which is
|
||||
what returns speaker emails). Transforms, then calls the RPC.
|
||||
- **Excel import** (`/import-excel`): the admin uploads the Sessionize **"Sessions
|
||||
and speakers (advanced)"** `.xlsx` (generated on the fly by any organizer with
|
||||
admin access to the event). The sidecar parses the two sheets (*Accepted
|
||||
sessions* + *Accepted speakers*) and calls `sync_sessionize_excel`.
|
||||
- It is the **first server-side holder of the service-role key** (compose env,
|
||||
defaulting to the standard local key). See [backend/sidecar.md](./backend/sidecar.md).
|
||||
- Wired into the admin via a same-origin `/sidecar/` proxy (nginx in Docker, Vite
|
||||
in dev) — CORS-free, matching the existing Supabase proxy pattern.
|
||||
|
||||
**The RPCs.**
|
||||
- `sync_sessionize_event(event_id, payload)` — **API sync**. `security definer`,
|
||||
**service-role only** (JWT role claim; granted to `service_role` only). Imports,
|
||||
in order: (1) speakers → contacts (matched by **email**), (2) sessions (upserted
|
||||
by `external_id`), (3) the agenda (slots find-or-created by date/start/end +
|
||||
`session_speakers` links, **diffed** so the `session_needs_speaker` trigger
|
||||
never blocks a removal). **No registrations are created** — the public `/view/`
|
||||
payload has no speaker emails, so speakers are skipped (reported).
|
||||
- `sync_sessionize_excel(event_id, payload)` — **Excel import**. Same shape plus
|
||||
`is_service_session` per session and `linkedin_url` per speaker, and one extra
|
||||
step: (3) **a `speaker` registration for every speaker** (create, or update
|
||||
`attendee`→`speaker`; never overrides `staff`/`sponsor`). The Excel carries
|
||||
emails, so the contact-level match is reliable — this is the path that creates
|
||||
the missing speaker contacts + registrations.
|
||||
- Both are idempotent (re-run updates in place); per-item errors collected into
|
||||
`errors[]`. Both write an event-scoped `sync_runs` audit row (admin-readable via
|
||||
RLS; `source` = `sessionize` / `sessionize_excel`).
|
||||
|
||||
**Slots type optionset.**
|
||||
- `slots.type` is now a Postgres **enum** (`slot_type`): exactly `session` /
|
||||
`service_session` (not freetext). `service_session` = breaks / lunch / closing
|
||||
(Sessionize's `isServiceSession`). The admin Schedule view shows **Session** /
|
||||
**Service Session** and can create/edit slots (the `slots.id` sequence default
|
||||
was added so the UI need not supply an id).
|
||||
|
||||
**Admin Interfaces menu.**
|
||||
- New `🔌 Interfaces` view: sidecar status (online/running/last run), a **Run
|
||||
sync** control (event picker + blocking run + result modal), an **Import
|
||||
Excel** control (upload the `.xlsx` + a "How to get this file" tooltip), and a
|
||||
**Recent runs** table from `sync_runs`.
|
||||
|
||||
**Seed (real data).**
|
||||
- The seed now uses the **Global Power Platform Bootcamp (Austria)**: the real
|
||||
agenda (22 sessions, 10 slots) from the Sessionize API, **50 made-up
|
||||
attendees**, and **4 staff** (Amelia Hernandez, Sabrina Hota, Jose Lago, Markus
|
||||
Franz — all `@appe.at`, `is_admin`, password `appe-admin-2026`). The event's
|
||||
`sessionize_endpoint` is set. **Speakers are not seeded** — run the Excel
|
||||
import to add them. See [backend/seed.md](./backend/seed.md).
|
||||
|
||||
## Existing-sponsor link + Interfaces removal — ✅ complete
|
||||
|
||||
A polish round (migration `20260830000000_remove_interfaces.sql` + app changes),
|
||||
|
||||
+2
-1
@@ -11,7 +11,8 @@
|
||||
"app:dev": "npm --prefix apps/convivo run dev",
|
||||
"app:build": "npm --prefix apps/convivo run build",
|
||||
"admin:dev": "npm --prefix apps/admin run dev",
|
||||
"admin:build": "npm --prefix apps/admin run build"
|
||||
"admin:build": "npm --prefix apps/admin run build",
|
||||
"sidecar:dev": "SUPABASE_URL=http://127.0.0.1:54321 node apps/sidecar/src/server.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"supabase": "^2.28.1"
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
-- =============================================================================
|
||||
-- Convivo — Sessionize sync (Docker sidecar)
|
||||
--
|
||||
-- Re-introduces the Sessionize interface as a Docker sidecar (not an Edge
|
||||
-- Function). The sidecar fetches an event's Sessionize data (authenticated API)
|
||||
-- and calls the service-role-only RPC below, which imports, in order:
|
||||
-- 1. speakers as contacts (matched by email),
|
||||
-- 2. sessions (upserted by external_id),
|
||||
-- 3. the agenda/schedule (slots + session_speakers links).
|
||||
--
|
||||
-- Design (locked):
|
||||
-- * `events.sessionize_endpoint` stores the Sessionize API URL per event.
|
||||
-- The sidecar derives the authenticated API URL from it (/view/ -> /api/)
|
||||
-- and authenticates with a sidecar-held API key.
|
||||
-- * `sync_sessionize_event(uuid, jsonb)` is `security definer`, guarded to the
|
||||
-- `service_role` caller (JWT role claim), so only the sidecar can call it.
|
||||
-- * Idempotency: external ids on contacts/sessions (partial unique indexes,
|
||||
-- added by the earlier interfaces migration and kept) + slots matched by
|
||||
-- (event, date, start, end). Re-running updates in place.
|
||||
-- * Speaker matching is by contact email. Linking a speaker to a session fires
|
||||
-- the `session_speakers_speaker_promote` trigger, which promotes an existing
|
||||
-- registration to 'speaker'. Registrations are NOT created here — they come
|
||||
-- from the ticket sync, which will check session_speakers by email.
|
||||
-- * `sync_runs` (event-scoped) is the audit trail behind the admin "Interfaces"
|
||||
-- view's logs/result.
|
||||
-- =============================================================================
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 1. EVENTS: Sessionize endpoint + last-synced stamp
|
||||
-- -----------------------------------------------------------------------------
|
||||
alter table public.events add column if not exists sessionize_endpoint text;
|
||||
alter table public.events add column if not exists last_synced_at timestamptz;
|
||||
comment on column public.events.sessionize_endpoint is
|
||||
'Sessionize API URL for this event (e.g. https://sessionize.com/api/v2/<id>/view/All). '
|
||||
'The sidecar derives the authenticated API URL from it.';
|
||||
comment on column public.events.last_synced_at is
|
||||
'When the Sessionize sync last ran for this event.';
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 2. SYNC RUNS (event-scoped audit trail)
|
||||
-- -----------------------------------------------------------------------------
|
||||
create table if not exists public.sync_runs (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
event_id uuid not null references public.events (id) on delete cascade,
|
||||
source text not null default 'sessionize',
|
||||
started_at timestamptz not null default now(),
|
||||
finished_at timestamptz,
|
||||
created integer not null default 0,
|
||||
updated integer not null default 0,
|
||||
skipped integer not null default 0,
|
||||
error text,
|
||||
triggered_by text not null default 'service_role'
|
||||
);
|
||||
create index if not exists sync_runs_event_idx on public.sync_runs (event_id, started_at desc);
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 3. HELPER: ensure an auth user exists for a contact (placeholder password).
|
||||
-- Creates the user + identity if missing; never touches an existing user's
|
||||
-- password. Mirrors the auth-sync logic in upsert_contact, so an imported
|
||||
-- speaker can log in once a registration token is issued.
|
||||
-- -----------------------------------------------------------------------------
|
||||
create or replace function public._ensure_auth_user_exists(p_email text, p_full_name text)
|
||||
returns void
|
||||
language plpgsql security definer set search_path = public as $$
|
||||
declare
|
||||
v_uid uuid;
|
||||
begin
|
||||
select id into v_uid from auth.users where email = p_email;
|
||||
if v_uid is not null then
|
||||
return; -- already exists; leave the password alone
|
||||
end if;
|
||||
insert into auth.users (instance_id, id, aud, role, email, encrypted_password,
|
||||
email_confirmed_at, confirmation_token, recovery_token, email_change_token_new,
|
||||
email_change, raw_app_meta_data, raw_user_meta_data,
|
||||
created_at, updated_at, confirmation_sent_at, last_sign_in_at)
|
||||
values ('00000000-0000-0000-0000-000000000000', gen_random_uuid(), 'authenticated',
|
||||
'authenticated', p_email,
|
||||
extensions.crypt('no-token-yet', extensions.gen_salt('bf')),
|
||||
now(), '', '', '', '', '{"provider":"email","providers":["email"]}',
|
||||
jsonb_build_object('full_name', p_full_name), now(), now(), now(), now())
|
||||
returning id into v_uid;
|
||||
insert into auth.identities (id, provider_id, identity_data, provider, user_id,
|
||||
created_at, updated_at, last_sign_in_at)
|
||||
values (v_uid, v_uid::text,
|
||||
jsonb_build_object('sub', v_uid::text, 'email', p_email),
|
||||
'email', v_uid, now(), now(), now());
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 4. SYNC RPC: Sessionize payload -> contacts + sessions + agenda
|
||||
-- p_payload is a JSON object:
|
||||
-- {
|
||||
-- speakers: [{ email, full_name, external_id? }],
|
||||
-- sessions: [{ external_id, title, description?, room?,
|
||||
-- date, start_time, end_time, speakers: [email, ...] }]
|
||||
-- }
|
||||
-- Runs in order: (1) speakers -> contacts, (2) sessions, (3) speaker links.
|
||||
-- Per-item failures are collected into errors[] (the run does not abort).
|
||||
-- Returns a JSONB summary.
|
||||
-- -----------------------------------------------------------------------------
|
||||
create or replace function public.sync_sessionize_event(p_event_id uuid, p_payload jsonb)
|
||||
returns jsonb
|
||||
language plpgsql security definer set search_path = public as $$
|
||||
declare
|
||||
v_run_id uuid;
|
||||
v_started timestamptz := now();
|
||||
v_item jsonb;
|
||||
v_email text;
|
||||
v_name text;
|
||||
v_ext text;
|
||||
v_title text;
|
||||
v_desc text;
|
||||
v_room text;
|
||||
v_date date;
|
||||
v_start time;
|
||||
v_end time;
|
||||
v_slot public.slots;
|
||||
v_slot_id integer;
|
||||
v_session public.sessions;
|
||||
v_existing boolean;
|
||||
v_spk text;
|
||||
v_speakers_created integer := 0;
|
||||
v_speakers_updated integer := 0;
|
||||
v_sessions_created integer := 0;
|
||||
v_sessions_updated integer := 0;
|
||||
v_slots_created integer := 0;
|
||||
v_speakers_linked integer := 0;
|
||||
v_errors jsonb := '[]'::jsonb;
|
||||
v_err text;
|
||||
begin
|
||||
-- Inside a security definer function, session_user is the owner (postgres),
|
||||
-- so detect the caller via the JWT role claim instead.
|
||||
if coalesce(auth.jwt() ->> 'role', '') <> 'service_role' then
|
||||
raise exception 'service_role only';
|
||||
end if;
|
||||
if not exists (select 1 from public.events where id = p_event_id) then
|
||||
raise exception 'event not found';
|
||||
end if;
|
||||
insert into public.sync_runs (event_id, source, started_at, triggered_by)
|
||||
values (p_event_id, 'sessionize', v_started, 'service_role')
|
||||
returning id into v_run_id;
|
||||
|
||||
-- (1) Speakers -> contacts (matched by email).
|
||||
for v_item in select * from jsonb_array_elements(coalesce(p_payload -> 'speakers', '[]'::jsonb))
|
||||
loop
|
||||
begin
|
||||
v_email := v_item ->> 'email';
|
||||
v_name := v_item ->> 'full_name';
|
||||
v_ext := v_item ->> 'external_id';
|
||||
if v_email is null or btrim(v_email) = '' or v_name is null or btrim(v_name) = '' then
|
||||
continue; -- no email/name -> can't match; skip
|
||||
end if;
|
||||
select exists (select 1 from public.contacts where email = v_email) into v_existing;
|
||||
insert into public.contacts (email, full_name, external_id)
|
||||
values (v_email, v_name, v_ext)
|
||||
on conflict (email) do update
|
||||
set full_name = excluded.full_name,
|
||||
external_id = coalesce(excluded.external_id, public.contacts.external_id);
|
||||
perform public._ensure_auth_user_exists(v_email, v_name);
|
||||
if v_existing then
|
||||
v_speakers_updated := v_speakers_updated + 1;
|
||||
else
|
||||
v_speakers_created := v_speakers_created + 1;
|
||||
end if;
|
||||
exception when others then
|
||||
v_err := coalesce(v_email, '<no email>') || ': ' || sqlerrm;
|
||||
v_errors := v_errors || to_jsonb(v_err);
|
||||
end;
|
||||
end loop;
|
||||
|
||||
-- (2) Sessions + (3) agenda (slots + speaker links).
|
||||
for v_item in select * from jsonb_array_elements(coalesce(p_payload -> 'sessions', '[]'::jsonb))
|
||||
loop
|
||||
begin
|
||||
v_ext := v_item ->> 'external_id';
|
||||
v_title := v_item ->> 'title';
|
||||
v_desc := v_item ->> 'description';
|
||||
v_room := v_item ->> 'room';
|
||||
v_date := (v_item ->> 'date')::date;
|
||||
v_start := (v_item ->> 'start_time')::time;
|
||||
v_end := (v_item ->> 'end_time')::time;
|
||||
|
||||
if v_ext is null or v_title is null or v_date is null or v_start is null or v_end is null then
|
||||
v_errors := v_errors || to_jsonb(coalesce(v_title, '<no title>') || ': missing required field');
|
||||
continue;
|
||||
end if;
|
||||
|
||||
-- Find or create the slot by (event, date, start, end).
|
||||
select * into v_slot from public.slots
|
||||
where event_id = p_event_id and slot_date = v_date
|
||||
and start_time = v_start and end_time = v_end
|
||||
limit 1;
|
||||
if not found then
|
||||
-- Allocate an id that is safe even if the sequence is behind the
|
||||
-- seeded rows (the seed inserts explicit ids after migrations run).
|
||||
-- GREATEST(nextval, max(id)+1) then re-syncs the sequence so future
|
||||
-- nextval calls never collide.
|
||||
select greatest(nextval('public.slots_id_seq'),
|
||||
(select coalesce(max(id), 0) from public.slots) + 1)
|
||||
into v_slot_id;
|
||||
perform setval('public.slots_id_seq', v_slot_id, true);
|
||||
insert into public.slots (id, event_id, type, name, slot_date, start_time, end_time)
|
||||
values (v_slot_id, p_event_id, 'session',
|
||||
'Slot ' || to_char(v_start, 'HH24:MI') || '–' || to_char(v_end, 'HH24:MI'),
|
||||
v_date, v_start, v_end)
|
||||
returning * into v_slot;
|
||||
v_slots_created := v_slots_created + 1;
|
||||
end if;
|
||||
|
||||
-- Upsert the session by external_id.
|
||||
select exists (select 1 from public.sessions
|
||||
where event_id = p_event_id and external_id = v_ext) into v_existing;
|
||||
insert into public.sessions (event_id, slot_id, title, description, room, external_id)
|
||||
values (p_event_id, v_slot.id, v_title, v_desc, v_room, v_ext)
|
||||
on conflict (external_id) where external_id is not null do update
|
||||
set slot_id = excluded.slot_id,
|
||||
title = excluded.title,
|
||||
description = coalesce(excluded.description, public.sessions.description),
|
||||
room = coalesce(excluded.room, public.sessions.room)
|
||||
returning * into v_session;
|
||||
if v_existing then
|
||||
v_sessions_updated := v_sessions_updated + 1;
|
||||
else
|
||||
v_sessions_created := v_sessions_created + 1;
|
||||
end if;
|
||||
|
||||
-- (3) Speaker links: DIFF (insert the new set, then delete only removed).
|
||||
-- Inserting first keeps the session at >= 1 speaker so the
|
||||
-- session_needs_speaker trigger never blocks the removals.
|
||||
for v_spk in select * from jsonb_array_elements_text(coalesce(v_item -> 'speakers', '[]'::jsonb))
|
||||
loop
|
||||
if v_spk is null or btrim(v_spk) = '' then
|
||||
continue;
|
||||
end if;
|
||||
insert into public.session_speakers (session_id, contact_email)
|
||||
values (v_session.id, v_spk)
|
||||
on conflict (session_id, contact_email) do nothing;
|
||||
v_speakers_linked := v_speakers_linked + 1;
|
||||
end loop;
|
||||
-- Delete removed speakers (only if the session keeps >= 1 speaker).
|
||||
if (select count(*) from jsonb_array_elements_text(coalesce(v_item -> 'speakers', '[]'::jsonb))) > 0 then
|
||||
delete from public.session_speakers ss
|
||||
where ss.session_id = v_session.id
|
||||
and not exists (
|
||||
select 1 from jsonb_array_elements_text(coalesce(v_item -> 'speakers', '[]'::jsonb)) as e
|
||||
where e = ss.contact_email
|
||||
);
|
||||
end if;
|
||||
exception when others then
|
||||
v_err := coalesce(v_title, '<no title>') || ': ' || sqlerrm;
|
||||
v_errors := v_errors || to_jsonb(v_err);
|
||||
end;
|
||||
end loop;
|
||||
|
||||
update public.sync_runs
|
||||
set finished_at = now(),
|
||||
created = v_speakers_created + v_sessions_created + v_slots_created,
|
||||
updated = v_speakers_updated + v_sessions_updated,
|
||||
skipped = 0,
|
||||
error = case when jsonb_array_length(v_errors) > 0 then v_errors::text else null end
|
||||
where id = v_run_id;
|
||||
|
||||
update public.events set last_synced_at = now() where id = p_event_id;
|
||||
|
||||
return jsonb_build_object(
|
||||
'speakers_created', v_speakers_created,
|
||||
'speakers_updated', v_speakers_updated,
|
||||
'sessions_created', v_sessions_created,
|
||||
'sessions_updated', v_sessions_updated,
|
||||
'slots_created', v_slots_created,
|
||||
'speakers_linked', v_speakers_linked,
|
||||
'errors', v_errors
|
||||
);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 5. RLS + GRANTS
|
||||
-- -----------------------------------------------------------------------------
|
||||
alter table public.sync_runs enable row level security;
|
||||
|
||||
-- Only admins can read the sync audit trail.
|
||||
drop policy if exists "sync_runs_select_admin" on public.sync_runs;
|
||||
create policy "sync_runs_select_admin" on public.sync_runs for select to authenticated
|
||||
using (public.is_admin());
|
||||
|
||||
-- The sync RPC + helper are service-role only (guarded inside via the JWT role
|
||||
-- claim). Grant execute to service_role only — NOT to the apps.
|
||||
grant execute on function public.sync_sessionize_event(uuid, jsonb) to service_role;
|
||||
grant execute on function public._ensure_auth_user_exists(text, text) to service_role;
|
||||
|
||||
-- sync_runs is readable by authenticated (RLS restricts to admins).
|
||||
grant select on public.sync_runs to authenticated, service_role;
|
||||
@@ -0,0 +1,288 @@
|
||||
-- =============================================================================
|
||||
-- Convivo — Slots optionset + Excel import
|
||||
--
|
||||
-- 1. `slots.type` becomes a Postgres ENUM (`slot_type`) — a true optionset of
|
||||
-- exactly two values, 'session' and 'service_session' (service sessions are
|
||||
-- breaks / lunch / closing, i.e. Sessionize's isServiceSession). Enforced at
|
||||
-- the database level, not freetext.
|
||||
-- 2. `slots.id` gets a sequence default so the admin UI (and the sidecar) can
|
||||
-- create a slot WITHOUT supplying an explicit id. The seed still inserts
|
||||
-- explicit ids and re-syncs the sequence afterwards.
|
||||
-- 3. `sync_sessionize_excel(uuid, jsonb)` — service-role-only RPC that imports
|
||||
-- the Sessionize "Sessions and speakers (advanced)" Excel export. The sidecar
|
||||
-- parses the .xlsx and calls this. It upserts speakers (by email), sessions
|
||||
-- (by external_id), and the agenda (slots + speaker links), and — unlike the
|
||||
-- API sync — also creates/updates a 'speaker' registration for every speaker
|
||||
-- (the Excel carries emails, so the contact-level match is reliable).
|
||||
-- =============================================================================
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 1. SLOTS TYPE OPTIONSET (Postgres ENUM)
|
||||
-- -----------------------------------------------------------------------------
|
||||
do $$
|
||||
begin
|
||||
if not exists (select 1 from pg_type where typname = 'slot_type') then
|
||||
create type public.slot_type as enum ('session', 'service_session');
|
||||
end if;
|
||||
end $$;
|
||||
|
||||
-- Convert the text column to the enum. Existing values map cleanly:
|
||||
-- 'session' -> 'session'; everything else (keynote/lunch_break/coffee_break/
|
||||
-- close_up) -> 'service_session' (they are all non-talk agenda items).
|
||||
-- The text default can't auto-cast, so drop it, convert, then set the enum
|
||||
-- default in a separate statement.
|
||||
alter table public.slots drop constraint if exists slots_type_check;
|
||||
alter table public.slots alter column type drop default;
|
||||
alter table public.slots
|
||||
alter column type type public.slot_type
|
||||
using case when type = 'session' then 'session'::public.slot_type
|
||||
else 'service_session'::public.slot_type end;
|
||||
alter table public.slots alter column type set default 'session'::public.slot_type;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 2. SLOTS ID DEFAULT (so the UI can create slots without an explicit id)
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- The seed inserts explicit ids (1..N) and then re-syncs the sequence, so the
|
||||
-- default is safe for both the seed and runtime inserts.
|
||||
do $$
|
||||
begin
|
||||
if not exists (select 1 from pg_class where relname = 'slots_id_seq') then
|
||||
create sequence public.slots_id_seq;
|
||||
end if;
|
||||
if (select column_default from information_schema.columns
|
||||
where table_name = 'slots' and column_name = 'id') is null then
|
||||
alter table public.slots alter column id set default nextval('public.slots_id_seq');
|
||||
end if;
|
||||
end $$;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 3. EXCEL IMPORT RPC
|
||||
-- p_payload is a JSON object:
|
||||
-- {
|
||||
-- speakers: [{ email, full_name, external_id?, linkedin_url? }],
|
||||
-- sessions: [{ external_id, title, description?, room?,
|
||||
-- date, start_time, end_time, is_service_session?,
|
||||
-- speakers: [email, ...] }]
|
||||
-- }
|
||||
-- Runs in order: (1) speakers -> contacts, (2) sessions + agenda (slots +
|
||||
-- speaker links), (3) speaker registrations (create/update to 'speaker').
|
||||
-- Per-item failures are collected into errors[] (the run does not abort).
|
||||
-- Returns a JSONB summary.
|
||||
-- -----------------------------------------------------------------------------
|
||||
create or replace function public.sync_sessionize_excel(p_event_id uuid, p_payload jsonb)
|
||||
returns jsonb
|
||||
language plpgsql security definer set search_path = public as $$
|
||||
declare
|
||||
v_run_id uuid;
|
||||
v_started timestamptz := now();
|
||||
v_item jsonb;
|
||||
v_email text;
|
||||
v_name text;
|
||||
v_ext text;
|
||||
v_linkedin text;
|
||||
v_title text;
|
||||
v_desc text;
|
||||
v_room text;
|
||||
v_date date;
|
||||
v_start time;
|
||||
v_end time;
|
||||
v_service boolean;
|
||||
v_slot public.slots;
|
||||
v_slot_id integer;
|
||||
v_session public.sessions;
|
||||
v_existing boolean;
|
||||
v_spk text;
|
||||
v_speakers_created integer := 0;
|
||||
v_speakers_updated integer := 0;
|
||||
v_sessions_created integer := 0;
|
||||
v_sessions_updated integer := 0;
|
||||
v_slots_created integer := 0;
|
||||
v_speakers_linked integer := 0;
|
||||
v_regs_created integer := 0;
|
||||
v_regs_updated integer := 0;
|
||||
v_errors jsonb := '[]'::jsonb;
|
||||
v_err text;
|
||||
begin
|
||||
if coalesce(auth.jwt() ->> 'role', '') <> 'service_role' then
|
||||
raise exception 'service_role only';
|
||||
end if;
|
||||
if not exists (select 1 from public.events where id = p_event_id) then
|
||||
raise exception 'event not found';
|
||||
end if;
|
||||
insert into public.sync_runs (event_id, source, started_at, triggered_by)
|
||||
values (p_event_id, 'sessionize_excel', v_started, 'service_role')
|
||||
returning id into v_run_id;
|
||||
|
||||
-- (1) Speakers -> contacts (matched by email).
|
||||
for v_item in select * from jsonb_array_elements(coalesce(p_payload -> 'speakers', '[]'::jsonb))
|
||||
loop
|
||||
begin
|
||||
v_email := v_item ->> 'email';
|
||||
v_name := v_item ->> 'full_name';
|
||||
v_ext := v_item ->> 'external_id';
|
||||
v_linkedin := v_item ->> 'linkedin_url';
|
||||
if v_email is null or btrim(v_email) = '' or v_name is null or btrim(v_name) = '' then
|
||||
continue;
|
||||
end if;
|
||||
select exists (select 1 from public.contacts where email = v_email) into v_existing;
|
||||
insert into public.contacts (email, full_name, external_id, linkedin_url)
|
||||
values (v_email, v_name, v_ext, v_linkedin)
|
||||
on conflict (email) do update
|
||||
set full_name = excluded.full_name,
|
||||
external_id = coalesce(excluded.external_id, public.contacts.external_id),
|
||||
linkedin_url = coalesce(excluded.linkedin_url, public.contacts.linkedin_url);
|
||||
perform public._ensure_auth_user_exists(v_email, v_name);
|
||||
if v_existing then
|
||||
v_speakers_updated := v_speakers_updated + 1;
|
||||
else
|
||||
v_speakers_created := v_speakers_created + 1;
|
||||
end if;
|
||||
exception when others then
|
||||
v_err := coalesce(v_email, '<no email>') || ': ' || sqlerrm;
|
||||
v_errors := v_errors || to_jsonb(v_err);
|
||||
end;
|
||||
end loop;
|
||||
|
||||
-- (2) Sessions + agenda (slots + speaker links).
|
||||
for v_item in select * from jsonb_array_elements(coalesce(p_payload -> 'sessions', '[]'::jsonb))
|
||||
loop
|
||||
begin
|
||||
v_ext := v_item ->> 'external_id';
|
||||
v_title := v_item ->> 'title';
|
||||
v_desc := v_item ->> 'description';
|
||||
v_room := v_item ->> 'room';
|
||||
v_date := (v_item ->> 'date')::date;
|
||||
v_start := (v_item ->> 'start_time')::time;
|
||||
v_end := (v_item ->> 'end_time')::time;
|
||||
v_service := coalesce((v_item ->> 'is_service_session')::boolean, false);
|
||||
|
||||
if v_ext is null or v_title is null or v_date is null or v_start is null or v_end is null then
|
||||
v_errors := v_errors || to_jsonb(coalesce(v_title, '<no title>') || ': missing required field');
|
||||
continue;
|
||||
end if;
|
||||
|
||||
-- Find or create the slot by (event, date, start, end).
|
||||
select * into v_slot from public.slots
|
||||
where event_id = p_event_id and slot_date = v_date
|
||||
and start_time = v_start and end_time = v_end
|
||||
limit 1;
|
||||
if not found then
|
||||
-- Allocate an id safe even if the sequence is behind seeded rows.
|
||||
select greatest(nextval('public.slots_id_seq'),
|
||||
(select coalesce(max(id), 0) from public.slots) + 1)
|
||||
into v_slot_id;
|
||||
perform setval('public.slots_id_seq', v_slot_id, true);
|
||||
insert into public.slots (id, event_id, type, name, slot_date, start_time, end_time)
|
||||
values (v_slot_id, p_event_id,
|
||||
case when v_service then 'service_session'::public.slot_type
|
||||
else 'session'::public.slot_type end,
|
||||
case when v_service then 'Service Session'
|
||||
else 'Slot ' || to_char(v_start, 'HH24:MI') || '–' || to_char(v_end, 'HH24:MI') end,
|
||||
v_date, v_start, v_end)
|
||||
returning * into v_slot;
|
||||
v_slots_created := v_slots_created + 1;
|
||||
end if;
|
||||
|
||||
-- Upsert the session by external_id.
|
||||
select exists (select 1 from public.sessions
|
||||
where event_id = p_event_id and external_id = v_ext) into v_existing;
|
||||
insert into public.sessions (event_id, slot_id, title, description, room, external_id)
|
||||
values (p_event_id, v_slot.id, v_title, v_desc, v_room, v_ext)
|
||||
on conflict (external_id) where external_id is not null do update
|
||||
set slot_id = excluded.slot_id,
|
||||
title = excluded.title,
|
||||
description = coalesce(excluded.description, public.sessions.description),
|
||||
room = coalesce(excluded.room, public.sessions.room)
|
||||
returning * into v_session;
|
||||
if v_existing then
|
||||
v_sessions_updated := v_sessions_updated + 1;
|
||||
else
|
||||
v_sessions_created := v_sessions_created + 1;
|
||||
end if;
|
||||
|
||||
-- Speaker links: DIFF (insert the new set, then delete only removed).
|
||||
for v_spk in select * from jsonb_array_elements_text(coalesce(v_item -> 'speakers', '[]'::jsonb))
|
||||
loop
|
||||
if v_spk is null or btrim(v_spk) = '' then
|
||||
continue;
|
||||
end if;
|
||||
insert into public.session_speakers (session_id, contact_email)
|
||||
values (v_session.id, v_spk)
|
||||
on conflict (session_id, contact_email) do nothing;
|
||||
v_speakers_linked := v_speakers_linked + 1;
|
||||
end loop;
|
||||
if (select count(*) from jsonb_array_elements_text(coalesce(v_item -> 'speakers', '[]'::jsonb))) > 0 then
|
||||
delete from public.session_speakers ss
|
||||
where ss.session_id = v_session.id
|
||||
and not exists (
|
||||
select 1 from jsonb_array_elements_text(coalesce(v_item -> 'speakers', '[]'::jsonb)) as e
|
||||
where e = ss.contact_email
|
||||
);
|
||||
end if;
|
||||
exception when others then
|
||||
v_err := coalesce(v_title, '<no title>') || ': ' || sqlerrm;
|
||||
v_errors := v_errors || to_jsonb(v_err);
|
||||
end;
|
||||
end loop;
|
||||
|
||||
-- (3) Speaker registrations: create/update to 'speaker' for every speaker.
|
||||
-- The Excel carries emails, so the contact-level match is reliable. This
|
||||
-- is the "add the missing registrations for the speakers" step.
|
||||
for v_item in select * from jsonb_array_elements(coalesce(p_payload -> 'speakers', '[]'::jsonb))
|
||||
loop
|
||||
begin
|
||||
v_email := v_item ->> 'email';
|
||||
if v_email is null or btrim(v_email) = '' then
|
||||
continue;
|
||||
end if;
|
||||
if not exists (select 1 from public.contacts where email = v_email) then
|
||||
continue; -- speaker had no valid contact; skip
|
||||
end if;
|
||||
select exists (select 1 from public.registrations
|
||||
where event_id = p_event_id and contact_email = v_email) into v_existing;
|
||||
insert into public.registrations (event_id, contact_email, type)
|
||||
values (p_event_id, v_email, 'speaker'::public.registration_type)
|
||||
on conflict (event_id, contact_email) do update
|
||||
set type = case when public.registrations.type in ('staff', 'sponsor')
|
||||
then public.registrations.type
|
||||
else 'speaker'::public.registration_type end
|
||||
where public.registrations.type not in ('staff', 'sponsor');
|
||||
if v_existing then
|
||||
v_regs_updated := v_regs_updated + 1;
|
||||
else
|
||||
v_regs_created := v_regs_created + 1;
|
||||
end if;
|
||||
exception when others then
|
||||
v_err := coalesce(v_email, '<no email>') || ': ' || sqlerrm;
|
||||
v_errors := v_errors || to_jsonb(v_err);
|
||||
end;
|
||||
end loop;
|
||||
|
||||
update public.sync_runs
|
||||
set finished_at = now(),
|
||||
created = v_speakers_created + v_sessions_created + v_slots_created + v_regs_created,
|
||||
updated = v_speakers_updated + v_sessions_updated + v_regs_updated,
|
||||
skipped = 0,
|
||||
error = case when jsonb_array_length(v_errors) > 0 then v_errors::text else null end
|
||||
where id = v_run_id;
|
||||
|
||||
update public.events set last_synced_at = now() where id = p_event_id;
|
||||
|
||||
return jsonb_build_object(
|
||||
'speakers_created', v_speakers_created,
|
||||
'speakers_updated', v_speakers_updated,
|
||||
'sessions_created', v_sessions_created,
|
||||
'sessions_updated', v_sessions_updated,
|
||||
'slots_created', v_slots_created,
|
||||
'speakers_linked', v_speakers_linked,
|
||||
'registrations_created', v_regs_created,
|
||||
'registrations_updated', v_regs_updated,
|
||||
'errors', v_errors
|
||||
);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 4. GRANTS
|
||||
-- -----------------------------------------------------------------------------
|
||||
grant execute on function public.sync_sessionize_excel(uuid, jsonb) to service_role;
|
||||
+475
-210
@@ -1,250 +1,515 @@
|
||||
-- =============================================================================
|
||||
-- Convivo — Phase 3 (Redesign): seed data for the multi-event model
|
||||
-- Convivo — seed: Global Power Platform Bootcamp (Austria)
|
||||
--
|
||||
-- Ports the mockup's people/schedule into the new model:
|
||||
-- contacts (PK = email) / events / registrations / sponsors / slots /
|
||||
-- sessions / session_speakers / preferences / connections / checkins /
|
||||
-- feedback / leaderboard / points_log.
|
||||
-- Real data: the agenda (slots + sessions) comes from the Sessionize public
|
||||
-- API (…/api/v2/4domszaq/view/All); the speakers come from the Sessionize
|
||||
-- "Sessions and speakers (advanced)" .xlsx (imported via the Interfaces menu,
|
||||
-- which creates the speaker contacts + registrations + links by email).
|
||||
--
|
||||
-- The QR token is the Auth password (QR + email login, no email sent).
|
||||
-- Staff is merged into admin: Bruno, Rita, and the APPE Admin have is_admin.
|
||||
-- Seeded here: the event (with its Sessionize endpoint), 50 attendees, 4 staff
|
||||
-- (admin role), and the agenda. Speaker contacts/registrations are NOT seeded —
|
||||
-- run the Excel import to add them.
|
||||
-- =============================================================================
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- AUTH USERS (QR token = password). 12 attendees + 1 admin.
|
||||
-- NOTE: confirmation_token is set to '' (not NULL) because GoTrue's password
|
||||
-- grant cannot scan a NULL confirmation_token on manually-inserted users.
|
||||
-- AUTH USERS (QR token = password). 50 attendees + 4 staff.
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into auth.users (instance_id, id, aud, role, email, encrypted_password, email_confirmed_at, confirmation_token, recovery_token, email_change_token_new, email_change, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, confirmation_sent_at, last_sign_in_at) values
|
||||
('00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111', 'authenticated', 'authenticated', 'ana.silva@nubank.com', crypt('CVV-ANA-4821', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Ana Silva"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '22222222-2222-2222-2222-222222222222', 'authenticated', 'authenticated', 'bruno.costa@acme.com', crypt('CVV-BRU-1177', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Bruno Costa"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '33333333-3333-3333-3333-333333333333', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-RIT-9034', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Rita Lopes"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '44444444-4444-4444-4444-444444444444', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-TOM-5566', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Tomás Ribeiro"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '55555555-5555-5555-5555-555555555555', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-SOF-2299', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Sofia Almeida"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '66666666-6666-6666-6666-666666666666', 'authenticated', 'authenticated', 'marco.chen@deepmind.com', crypt('CVV-MRC-7712', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marco Chen"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '77777777-7777-7777-7777-777777777777', 'authenticated', 'authenticated', 'julia.santos@ifood.com', crypt('CVV-JUL-3345', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Julia Santos"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '88888888-8888-8888-8888-888888888888', 'authenticated', 'authenticated', 'pedro.nunes@microsoft.com', crypt('CVV-PED-8801', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Pedro Nunes"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '99999999-9999-9999-9999-999999999999', 'authenticated', 'authenticated', 'carla.mendes@quintoessencial.com', crypt('CVV-CAR-6623', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Carla Mendes"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'authenticated', 'authenticated', 'diego.ferreira@stone.com', crypt('CVV-DIE-4458', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Diego Ferreira"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-MNA-2210', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marina Costa"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'cccccccc-cccc-cccc-cccc-cccccccccccc', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-LUC-9987', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lucas Oliveira"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'dddddddd-dddd-dddd-dddd-dddddddddddd', 'authenticated', 'authenticated', '[email protected]', crypt('appe-admin-2026', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"APPE Admin"}', now(), now(), now(), now())
|
||||
on conflict (id) do nothing;
|
||||
('00000000-0000-0000-0000-000000000000', 'a40737e3-11ca-48e0-9445-4f72096cdcd4', 'authenticated', 'authenticated', 'lena.huber@gmail.com', crypt('CVV-ATT-1000', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lena Huber"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '298d54fd-6e35-460d-aabf-135e2eefac00', 'authenticated', 'authenticated', 'felix.berger@outlook.com', crypt('CVV-ATT-1001', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Felix Berger"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '446a6e86-73da-41ae-8134-7609556dca96', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1002', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Mia Moser"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '6abea183-d84e-4502-9eb8-b5bc751a3ca4', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1003', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Jonas Unger"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'c18e5356-3c14-4a43-8e0b-0739ff0fc1c0', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1004', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Emma Dorfer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'cf916c0c-b501-4c1b-bd1b-366fbe5fe4d8', 'authenticated', 'authenticated', 'paul.klein@icloud.com', crypt('CVV-ATT-1005', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Paul Klein"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'c322e223-6965-4a98-860e-367acfa21202', 'authenticated', 'authenticated', 'hannah.steiner@yahoo.com', crypt('CVV-ATT-1006', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Hannah Steiner"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '52f0e634-09a4-444d-a6e6-cbd9e4ee5b9f', 'authenticated', 'authenticated', 'lukas.fischer@office.com', crypt('CVV-ATT-1007', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lukas Fischer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '4546c422-584b-4108-8a5b-25c832fc0114', 'authenticated', 'authenticated', 'sofia.oberhuber@gmail.com', crypt('CVV-ATT-1008', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Sofia Oberhuber"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'd2ea8708-22a9-446b-8fb8-833f2f9a733c', 'authenticated', 'authenticated', 'david.winkler@outlook.com', crypt('CVV-ATT-1009', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"David Winkler"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '296330bd-a169-4798-8df1-38221381d2e0', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1010', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Clara Falk"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '935f1800-1b99-4894-8891-db2c86491a5b', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1011', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Max Wagner"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '2ce35e62-822a-4e5b-b3c9-e6b5b6cc7531', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1012', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Ella Hofer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '2d1a4f08-19dc-4239-bf3d-27fb912500aa', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1013', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Finn Hofmann"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'e27a487b-df20-4bf6-83a8-41d17533cbb5', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1014', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Livia Rainer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '2daa1a3f-2b27-4532-9d4d-dd1fbe37d3b5', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1015', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Noah Aigner"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '67938a9a-5041-4882-8947-4274e78a0bcb', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1016', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Mara Hartl"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'eb7570a3-9ffc-4260-bfca-d45bfe128c26', 'authenticated', 'authenticated', 'elias.mü[email protected]', crypt('CVV-ATT-1017', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Elias Müller"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '584eed6e-d953-4672-b7c8-891d0674e7f9', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1018', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Nora Pichler"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '74a99e87-42b3-4d0a-bc5c-635b22dc2023', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1019', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Ben Lederer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '311399c5-d98c-4785-a94c-617982503e14', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1020', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Ida Tausch"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '78be51e6-65f0-46ad-80d5-2399390ff501', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1021', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Oscar Cerny"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '05a54110-7182-4095-93de-85306ce572d4', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1022', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Freja Jank"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'cd6bc4d5-afb0-4da2-99b9-f3e5bb7c5f32', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1023', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Hugo Gruber"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'd66f79b9-9dec-4a6a-94e7-82f4b0ad01c0', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1024', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Alma Egger"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'bb7736de-d32a-41d7-b2d9-ee64275b145e', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1025', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Theo Nagl"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'f09aca1d-4d95-49a6-a9e0-6f1362fe8361', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1026', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Greta Vogler"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'd1bbda95-3df1-4c3b-95ee-ed1eb523d30e', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1027', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Milo Eisen"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'e9fa34ff-9215-4397-8c1e-1f00ced2fecd', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1028', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Vera Lorenz"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '83766fe2-2e9f-41ca-9862-3a7459fdea9f', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1029', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Arno Maier"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '6801de1c-802d-4ec6-9781-17f5ffd20cbe', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1030', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lotte Graf"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '67cddcb9-c467-48cf-a3dc-4d48fdd1cd4b', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1031', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Kai Pfeiffer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'f1e37d99-2f8e-4a92-8138-68ef50bb94d9', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1032', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Mira Zech"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'a6d3f6a1-a01e-431a-9338-28d55b69b0d6', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1033', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Erik Gassner"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'c4fece75-2a7d-46c3-b968-d76c5ec97d47', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1034', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Anna Schmidt"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '692cd876-e621-44d4-b152-f36397684392', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1035', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Tobias Wolfer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '0e4d3be9-f1c6-4278-9e6e-2f7f80956830', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1036', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lena Keller"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '299e0882-fb69-43b2-b496-04a628865953', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1037', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Samuel Sailer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '8d3d4484-4f82-4ac4-85b0-89aa01d415f1', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1038', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Julia Bauer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '51a4fecc-e038-4ffb-b715-a3d4e1c1e7d7', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1039', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Moritz Ismail"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '88907380-da12-4ccb-9f33-b8ab4a00d6d0', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1040', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Eva Huber"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'b3275d03-3b89-477c-9881-2b0a0e2e3ce9', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1041', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Leon Berger"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '74b47dc2-0eb7-44b5-8faa-6ceaae4d8a3d', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1042', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Klara Moser"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '66d71898-d8c4-4d95-847a-496e899d8e9a', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1043', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Felix Unger"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'bed7dceb-8be7-4a71-a4aa-3b344da4dbb9', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1044', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Nina Dorfer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '3ff5d5d5-204b-46fe-a5cc-2db6e8c643f0', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1045', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Jan Klein"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '3c39579c-4216-4206-9346-46fe69c2c280', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1046', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lena Steiner"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '661359f0-8771-4dc8-a517-58822e2f60be', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1047', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Paul Fischer"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'e1a2c232-2dcd-462f-afc8-01b2e4c1646d', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1048', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Sara Oberhuber"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '8bb02227-1008-436c-93ae-d4dbe8c8a063', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ATT-1049', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Markus Winkler"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '8ca780f4-dea0-4848-80d0-12f7529193a6', 'authenticated', 'authenticated', '[email protected]', crypt('appe-admin-2026', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Amelia Hernandez"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'a6607c2b-9adc-4eaf-95d1-357076b8ef96', 'authenticated', 'authenticated', '[email protected]', crypt('appe-admin-2026', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Sabrina Hota"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '2eb5e467-eb1e-4c96-a1c8-748173676da4', 'authenticated', 'authenticated', '[email protected]', crypt('appe-admin-2026', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Jose Lago"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'c46da711-f429-4410-adde-21d7c6846aef', 'authenticated', 'authenticated', '[email protected]', crypt('appe-admin-2026', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Markus Franz"}', now(), now(), now(), now()) on conflict (id) do nothing;
|
||||
|
||||
insert into auth.identities (id, provider_id, identity_data, provider, user_id, created_at, updated_at, last_sign_in_at) values
|
||||
('11111111-1111-1111-1111-111111111111', '11111111-1111-1111-1111-111111111111', '{"sub":"11111111-1111-1111-1111-111111111111","email":"ana.silva@nubank.com"}', 'email', '11111111-1111-1111-1111-111111111111', now(), now(), now()),
|
||||
('22222222-2222-2222-2222-222222222222', '22222222-2222-2222-2222-222222222222', '{"sub":"22222222-2222-2222-2222-222222222222","email":"bruno.costa@acme.com"}', 'email', '22222222-2222-2222-2222-222222222222', now(), now(), now()),
|
||||
('33333333-3333-3333-3333-333333333333', '33333333-3333-3333-3333-333333333333', '{"sub":"33333333-3333-3333-3333-333333333333","email":"[email protected]"}', 'email', '33333333-3333-3333-3333-333333333333', now(), now(), now()),
|
||||
('44444444-4444-4444-4444-444444444444', '44444444-4444-4444-4444-444444444444', '{"sub":"44444444-4444-4444-4444-444444444444","email":"[email protected]"}', 'email', '44444444-4444-4444-4444-444444444444', now(), now(), now()),
|
||||
('55555555-5555-5555-5555-555555555555', '55555555-5555-5555-5555-555555555555', '{"sub":"55555555-5555-5555-5555-555555555555","email":"[email protected]"}', 'email', '55555555-5555-5555-5555-555555555555', now(), now(), now()),
|
||||
('66666666-6666-6666-6666-666666666666', '66666666-6666-6666-6666-666666666666', '{"sub":"66666666-6666-6666-6666-666666666666","email":"marco.chen@deepmind.com"}', 'email', '66666666-6666-6666-6666-666666666666', now(), now(), now()),
|
||||
('77777777-7777-7777-7777-777777777777', '77777777-7777-7777-7777-777777777777', '{"sub":"77777777-7777-7777-7777-777777777777","email":"julia.santos@ifood.com"}', 'email', '77777777-7777-7777-7777-777777777777', now(), now(), now()),
|
||||
('88888888-8888-8888-8888-888888888888', '88888888-8888-8888-8888-888888888888', '{"sub":"88888888-8888-8888-8888-888888888888","email":"pedro.nunes@microsoft.com"}', 'email', '88888888-8888-8888-8888-888888888888', now(), now(), now()),
|
||||
('99999999-9999-9999-9999-999999999999', '99999999-9999-9999-9999-999999999999', '{"sub":"99999999-9999-9999-9999-999999999999","email":"carla.mendes@quintoessencial.com"}', 'email', '99999999-9999-9999-9999-999999999999', now(), now(), now()),
|
||||
('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '{"sub":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","email":"diego.ferreira@stone.com"}', 'email', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', now(), now(), now()),
|
||||
('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', '{"sub":"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb","email":"[email protected]"}', 'email', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', now(), now(), now()),
|
||||
('cccccccc-cccc-cccc-cccc-cccccccccccc', 'cccccccc-cccc-cccc-cccc-cccccccccccc', '{"sub":"cccccccc-cccc-cccc-cccc-cccccccccccc","email":"[email protected]"}', 'email', 'cccccccc-cccc-cccc-cccc-cccccccccccc', now(), now(), now()),
|
||||
('dddddddd-dddd-dddd-dddd-dddddddddddd', 'dddddddd-dddd-dddd-dddd-dddddddddddd', '{"sub":"dddddddd-dddd-dddd-dddd-dddddddddddd","email":"[email protected]"}', 'email', 'dddddddd-dddd-dddd-dddd-dddddddddddd', now(), now(), now())
|
||||
on conflict (id) do nothing;
|
||||
('a40737e3-11ca-48e0-9445-4f72096cdcd4', 'a40737e3-11ca-48e0-9445-4f72096cdcd4', '{"sub":"a40737e3-11ca-48e0-9445-4f72096cdcd4","email":"lena.huber@gmail.com"}', 'email', 'a40737e3-11ca-48e0-9445-4f72096cdcd4', now(), now(), now()),
|
||||
('298d54fd-6e35-460d-aabf-135e2eefac00', '298d54fd-6e35-460d-aabf-135e2eefac00', '{"sub":"298d54fd-6e35-460d-aabf-135e2eefac00","email":"felix.berger@outlook.com"}', 'email', '298d54fd-6e35-460d-aabf-135e2eefac00', now(), now(), now()),
|
||||
('446a6e86-73da-41ae-8134-7609556dca96', '446a6e86-73da-41ae-8134-7609556dca96', '{"sub":"446a6e86-73da-41ae-8134-7609556dca96","email":"[email protected]"}', 'email', '446a6e86-73da-41ae-8134-7609556dca96', now(), now(), now()),
|
||||
('6abea183-d84e-4502-9eb8-b5bc751a3ca4', '6abea183-d84e-4502-9eb8-b5bc751a3ca4', '{"sub":"6abea183-d84e-4502-9eb8-b5bc751a3ca4","email":"[email protected]"}', 'email', '6abea183-d84e-4502-9eb8-b5bc751a3ca4', now(), now(), now()),
|
||||
('c18e5356-3c14-4a43-8e0b-0739ff0fc1c0', 'c18e5356-3c14-4a43-8e0b-0739ff0fc1c0', '{"sub":"c18e5356-3c14-4a43-8e0b-0739ff0fc1c0","email":"[email protected]"}', 'email', 'c18e5356-3c14-4a43-8e0b-0739ff0fc1c0', now(), now(), now()),
|
||||
('cf916c0c-b501-4c1b-bd1b-366fbe5fe4d8', 'cf916c0c-b501-4c1b-bd1b-366fbe5fe4d8', '{"sub":"cf916c0c-b501-4c1b-bd1b-366fbe5fe4d8","email":"paul.klein@icloud.com"}', 'email', 'cf916c0c-b501-4c1b-bd1b-366fbe5fe4d8', now(), now(), now()),
|
||||
('c322e223-6965-4a98-860e-367acfa21202', 'c322e223-6965-4a98-860e-367acfa21202', '{"sub":"c322e223-6965-4a98-860e-367acfa21202","email":"hannah.steiner@yahoo.com"}', 'email', 'c322e223-6965-4a98-860e-367acfa21202', now(), now(), now()),
|
||||
('52f0e634-09a4-444d-a6e6-cbd9e4ee5b9f', '52f0e634-09a4-444d-a6e6-cbd9e4ee5b9f', '{"sub":"52f0e634-09a4-444d-a6e6-cbd9e4ee5b9f","email":"lukas.fischer@office.com"}', 'email', '52f0e634-09a4-444d-a6e6-cbd9e4ee5b9f', now(), now(), now()),
|
||||
('4546c422-584b-4108-8a5b-25c832fc0114', '4546c422-584b-4108-8a5b-25c832fc0114', '{"sub":"4546c422-584b-4108-8a5b-25c832fc0114","email":"sofia.oberhuber@gmail.com"}', 'email', '4546c422-584b-4108-8a5b-25c832fc0114', now(), now(), now()),
|
||||
('d2ea8708-22a9-446b-8fb8-833f2f9a733c', 'd2ea8708-22a9-446b-8fb8-833f2f9a733c', '{"sub":"d2ea8708-22a9-446b-8fb8-833f2f9a733c","email":"david.winkler@outlook.com"}', 'email', 'd2ea8708-22a9-446b-8fb8-833f2f9a733c', now(), now(), now()),
|
||||
('296330bd-a169-4798-8df1-38221381d2e0', '296330bd-a169-4798-8df1-38221381d2e0', '{"sub":"296330bd-a169-4798-8df1-38221381d2e0","email":"[email protected]"}', 'email', '296330bd-a169-4798-8df1-38221381d2e0', now(), now(), now()),
|
||||
('935f1800-1b99-4894-8891-db2c86491a5b', '935f1800-1b99-4894-8891-db2c86491a5b', '{"sub":"935f1800-1b99-4894-8891-db2c86491a5b","email":"[email protected]"}', 'email', '935f1800-1b99-4894-8891-db2c86491a5b', now(), now(), now()),
|
||||
('2ce35e62-822a-4e5b-b3c9-e6b5b6cc7531', '2ce35e62-822a-4e5b-b3c9-e6b5b6cc7531', '{"sub":"2ce35e62-822a-4e5b-b3c9-e6b5b6cc7531","email":"[email protected]"}', 'email', '2ce35e62-822a-4e5b-b3c9-e6b5b6cc7531', now(), now(), now()),
|
||||
('2d1a4f08-19dc-4239-bf3d-27fb912500aa', '2d1a4f08-19dc-4239-bf3d-27fb912500aa', '{"sub":"2d1a4f08-19dc-4239-bf3d-27fb912500aa","email":"[email protected]"}', 'email', '2d1a4f08-19dc-4239-bf3d-27fb912500aa', now(), now(), now()),
|
||||
('e27a487b-df20-4bf6-83a8-41d17533cbb5', 'e27a487b-df20-4bf6-83a8-41d17533cbb5', '{"sub":"e27a487b-df20-4bf6-83a8-41d17533cbb5","email":"[email protected]"}', 'email', 'e27a487b-df20-4bf6-83a8-41d17533cbb5', now(), now(), now()),
|
||||
('2daa1a3f-2b27-4532-9d4d-dd1fbe37d3b5', '2daa1a3f-2b27-4532-9d4d-dd1fbe37d3b5', '{"sub":"2daa1a3f-2b27-4532-9d4d-dd1fbe37d3b5","email":"[email protected]"}', 'email', '2daa1a3f-2b27-4532-9d4d-dd1fbe37d3b5', now(), now(), now()),
|
||||
('67938a9a-5041-4882-8947-4274e78a0bcb', '67938a9a-5041-4882-8947-4274e78a0bcb', '{"sub":"67938a9a-5041-4882-8947-4274e78a0bcb","email":"[email protected]"}', 'email', '67938a9a-5041-4882-8947-4274e78a0bcb', now(), now(), now()),
|
||||
('eb7570a3-9ffc-4260-bfca-d45bfe128c26', 'eb7570a3-9ffc-4260-bfca-d45bfe128c26', '{"sub":"eb7570a3-9ffc-4260-bfca-d45bfe128c26","email":"elias.mü[email protected]"}', 'email', 'eb7570a3-9ffc-4260-bfca-d45bfe128c26', now(), now(), now()),
|
||||
('584eed6e-d953-4672-b7c8-891d0674e7f9', '584eed6e-d953-4672-b7c8-891d0674e7f9', '{"sub":"584eed6e-d953-4672-b7c8-891d0674e7f9","email":"[email protected]"}', 'email', '584eed6e-d953-4672-b7c8-891d0674e7f9', now(), now(), now()),
|
||||
('74a99e87-42b3-4d0a-bc5c-635b22dc2023', '74a99e87-42b3-4d0a-bc5c-635b22dc2023', '{"sub":"74a99e87-42b3-4d0a-bc5c-635b22dc2023","email":"[email protected]"}', 'email', '74a99e87-42b3-4d0a-bc5c-635b22dc2023', now(), now(), now()),
|
||||
('311399c5-d98c-4785-a94c-617982503e14', '311399c5-d98c-4785-a94c-617982503e14', '{"sub":"311399c5-d98c-4785-a94c-617982503e14","email":"[email protected]"}', 'email', '311399c5-d98c-4785-a94c-617982503e14', now(), now(), now()),
|
||||
('78be51e6-65f0-46ad-80d5-2399390ff501', '78be51e6-65f0-46ad-80d5-2399390ff501', '{"sub":"78be51e6-65f0-46ad-80d5-2399390ff501","email":"[email protected]"}', 'email', '78be51e6-65f0-46ad-80d5-2399390ff501', now(), now(), now()),
|
||||
('05a54110-7182-4095-93de-85306ce572d4', '05a54110-7182-4095-93de-85306ce572d4', '{"sub":"05a54110-7182-4095-93de-85306ce572d4","email":"[email protected]"}', 'email', '05a54110-7182-4095-93de-85306ce572d4', now(), now(), now()),
|
||||
('cd6bc4d5-afb0-4da2-99b9-f3e5bb7c5f32', 'cd6bc4d5-afb0-4da2-99b9-f3e5bb7c5f32', '{"sub":"cd6bc4d5-afb0-4da2-99b9-f3e5bb7c5f32","email":"[email protected]"}', 'email', 'cd6bc4d5-afb0-4da2-99b9-f3e5bb7c5f32', now(), now(), now()),
|
||||
('d66f79b9-9dec-4a6a-94e7-82f4b0ad01c0', 'd66f79b9-9dec-4a6a-94e7-82f4b0ad01c0', '{"sub":"d66f79b9-9dec-4a6a-94e7-82f4b0ad01c0","email":"[email protected]"}', 'email', 'd66f79b9-9dec-4a6a-94e7-82f4b0ad01c0', now(), now(), now()),
|
||||
('bb7736de-d32a-41d7-b2d9-ee64275b145e', 'bb7736de-d32a-41d7-b2d9-ee64275b145e', '{"sub":"bb7736de-d32a-41d7-b2d9-ee64275b145e","email":"[email protected]"}', 'email', 'bb7736de-d32a-41d7-b2d9-ee64275b145e', now(), now(), now()),
|
||||
('f09aca1d-4d95-49a6-a9e0-6f1362fe8361', 'f09aca1d-4d95-49a6-a9e0-6f1362fe8361', '{"sub":"f09aca1d-4d95-49a6-a9e0-6f1362fe8361","email":"[email protected]"}', 'email', 'f09aca1d-4d95-49a6-a9e0-6f1362fe8361', now(), now(), now()),
|
||||
('d1bbda95-3df1-4c3b-95ee-ed1eb523d30e', 'd1bbda95-3df1-4c3b-95ee-ed1eb523d30e', '{"sub":"d1bbda95-3df1-4c3b-95ee-ed1eb523d30e","email":"[email protected]"}', 'email', 'd1bbda95-3df1-4c3b-95ee-ed1eb523d30e', now(), now(), now()),
|
||||
('e9fa34ff-9215-4397-8c1e-1f00ced2fecd', 'e9fa34ff-9215-4397-8c1e-1f00ced2fecd', '{"sub":"e9fa34ff-9215-4397-8c1e-1f00ced2fecd","email":"[email protected]"}', 'email', 'e9fa34ff-9215-4397-8c1e-1f00ced2fecd', now(), now(), now()),
|
||||
('83766fe2-2e9f-41ca-9862-3a7459fdea9f', '83766fe2-2e9f-41ca-9862-3a7459fdea9f', '{"sub":"83766fe2-2e9f-41ca-9862-3a7459fdea9f","email":"[email protected]"}', 'email', '83766fe2-2e9f-41ca-9862-3a7459fdea9f', now(), now(), now()),
|
||||
('6801de1c-802d-4ec6-9781-17f5ffd20cbe', '6801de1c-802d-4ec6-9781-17f5ffd20cbe', '{"sub":"6801de1c-802d-4ec6-9781-17f5ffd20cbe","email":"[email protected]"}', 'email', '6801de1c-802d-4ec6-9781-17f5ffd20cbe', now(), now(), now()),
|
||||
('67cddcb9-c467-48cf-a3dc-4d48fdd1cd4b', '67cddcb9-c467-48cf-a3dc-4d48fdd1cd4b', '{"sub":"67cddcb9-c467-48cf-a3dc-4d48fdd1cd4b","email":"[email protected]"}', 'email', '67cddcb9-c467-48cf-a3dc-4d48fdd1cd4b', now(), now(), now()),
|
||||
('f1e37d99-2f8e-4a92-8138-68ef50bb94d9', 'f1e37d99-2f8e-4a92-8138-68ef50bb94d9', '{"sub":"f1e37d99-2f8e-4a92-8138-68ef50bb94d9","email":"[email protected]"}', 'email', 'f1e37d99-2f8e-4a92-8138-68ef50bb94d9', now(), now(), now()),
|
||||
('a6d3f6a1-a01e-431a-9338-28d55b69b0d6', 'a6d3f6a1-a01e-431a-9338-28d55b69b0d6', '{"sub":"a6d3f6a1-a01e-431a-9338-28d55b69b0d6","email":"[email protected]"}', 'email', 'a6d3f6a1-a01e-431a-9338-28d55b69b0d6', now(), now(), now()),
|
||||
('c4fece75-2a7d-46c3-b968-d76c5ec97d47', 'c4fece75-2a7d-46c3-b968-d76c5ec97d47', '{"sub":"c4fece75-2a7d-46c3-b968-d76c5ec97d47","email":"[email protected]"}', 'email', 'c4fece75-2a7d-46c3-b968-d76c5ec97d47', now(), now(), now()),
|
||||
('692cd876-e621-44d4-b152-f36397684392', '692cd876-e621-44d4-b152-f36397684392', '{"sub":"692cd876-e621-44d4-b152-f36397684392","email":"[email protected]"}', 'email', '692cd876-e621-44d4-b152-f36397684392', now(), now(), now()),
|
||||
('0e4d3be9-f1c6-4278-9e6e-2f7f80956830', '0e4d3be9-f1c6-4278-9e6e-2f7f80956830', '{"sub":"0e4d3be9-f1c6-4278-9e6e-2f7f80956830","email":"[email protected]"}', 'email', '0e4d3be9-f1c6-4278-9e6e-2f7f80956830', now(), now(), now()),
|
||||
('299e0882-fb69-43b2-b496-04a628865953', '299e0882-fb69-43b2-b496-04a628865953', '{"sub":"299e0882-fb69-43b2-b496-04a628865953","email":"[email protected]"}', 'email', '299e0882-fb69-43b2-b496-04a628865953', now(), now(), now()),
|
||||
('8d3d4484-4f82-4ac4-85b0-89aa01d415f1', '8d3d4484-4f82-4ac4-85b0-89aa01d415f1', '{"sub":"8d3d4484-4f82-4ac4-85b0-89aa01d415f1","email":"[email protected]"}', 'email', '8d3d4484-4f82-4ac4-85b0-89aa01d415f1', now(), now(), now()),
|
||||
('51a4fecc-e038-4ffb-b715-a3d4e1c1e7d7', '51a4fecc-e038-4ffb-b715-a3d4e1c1e7d7', '{"sub":"51a4fecc-e038-4ffb-b715-a3d4e1c1e7d7","email":"[email protected]"}', 'email', '51a4fecc-e038-4ffb-b715-a3d4e1c1e7d7', now(), now(), now()),
|
||||
('88907380-da12-4ccb-9f33-b8ab4a00d6d0', '88907380-da12-4ccb-9f33-b8ab4a00d6d0', '{"sub":"88907380-da12-4ccb-9f33-b8ab4a00d6d0","email":"[email protected]"}', 'email', '88907380-da12-4ccb-9f33-b8ab4a00d6d0', now(), now(), now()),
|
||||
('b3275d03-3b89-477c-9881-2b0a0e2e3ce9', 'b3275d03-3b89-477c-9881-2b0a0e2e3ce9', '{"sub":"b3275d03-3b89-477c-9881-2b0a0e2e3ce9","email":"[email protected]"}', 'email', 'b3275d03-3b89-477c-9881-2b0a0e2e3ce9', now(), now(), now()),
|
||||
('74b47dc2-0eb7-44b5-8faa-6ceaae4d8a3d', '74b47dc2-0eb7-44b5-8faa-6ceaae4d8a3d', '{"sub":"74b47dc2-0eb7-44b5-8faa-6ceaae4d8a3d","email":"[email protected]"}', 'email', '74b47dc2-0eb7-44b5-8faa-6ceaae4d8a3d', now(), now(), now()),
|
||||
('66d71898-d8c4-4d95-847a-496e899d8e9a', '66d71898-d8c4-4d95-847a-496e899d8e9a', '{"sub":"66d71898-d8c4-4d95-847a-496e899d8e9a","email":"[email protected]"}', 'email', '66d71898-d8c4-4d95-847a-496e899d8e9a', now(), now(), now()),
|
||||
('bed7dceb-8be7-4a71-a4aa-3b344da4dbb9', 'bed7dceb-8be7-4a71-a4aa-3b344da4dbb9', '{"sub":"bed7dceb-8be7-4a71-a4aa-3b344da4dbb9","email":"[email protected]"}', 'email', 'bed7dceb-8be7-4a71-a4aa-3b344da4dbb9', now(), now(), now()),
|
||||
('3ff5d5d5-204b-46fe-a5cc-2db6e8c643f0', '3ff5d5d5-204b-46fe-a5cc-2db6e8c643f0', '{"sub":"3ff5d5d5-204b-46fe-a5cc-2db6e8c643f0","email":"[email protected]"}', 'email', '3ff5d5d5-204b-46fe-a5cc-2db6e8c643f0', now(), now(), now()),
|
||||
('3c39579c-4216-4206-9346-46fe69c2c280', '3c39579c-4216-4206-9346-46fe69c2c280', '{"sub":"3c39579c-4216-4206-9346-46fe69c2c280","email":"[email protected]"}', 'email', '3c39579c-4216-4206-9346-46fe69c2c280', now(), now(), now()),
|
||||
('661359f0-8771-4dc8-a517-58822e2f60be', '661359f0-8771-4dc8-a517-58822e2f60be', '{"sub":"661359f0-8771-4dc8-a517-58822e2f60be","email":"[email protected]"}', 'email', '661359f0-8771-4dc8-a517-58822e2f60be', now(), now(), now()),
|
||||
('e1a2c232-2dcd-462f-afc8-01b2e4c1646d', 'e1a2c232-2dcd-462f-afc8-01b2e4c1646d', '{"sub":"e1a2c232-2dcd-462f-afc8-01b2e4c1646d","email":"[email protected]"}', 'email', 'e1a2c232-2dcd-462f-afc8-01b2e4c1646d', now(), now(), now()),
|
||||
('8bb02227-1008-436c-93ae-d4dbe8c8a063', '8bb02227-1008-436c-93ae-d4dbe8c8a063', '{"sub":"8bb02227-1008-436c-93ae-d4dbe8c8a063","email":"[email protected]"}', 'email', '8bb02227-1008-436c-93ae-d4dbe8c8a063', now(), now(), now()),
|
||||
('8ca780f4-dea0-4848-80d0-12f7529193a6', '8ca780f4-dea0-4848-80d0-12f7529193a6', '{"sub":"8ca780f4-dea0-4848-80d0-12f7529193a6","email":"[email protected]"}', 'email', '8ca780f4-dea0-4848-80d0-12f7529193a6', now(), now(), now()),
|
||||
('a6607c2b-9adc-4eaf-95d1-357076b8ef96', 'a6607c2b-9adc-4eaf-95d1-357076b8ef96', '{"sub":"a6607c2b-9adc-4eaf-95d1-357076b8ef96","email":"[email protected]"}', 'email', 'a6607c2b-9adc-4eaf-95d1-357076b8ef96', now(), now(), now()),
|
||||
('2eb5e467-eb1e-4c96-a1c8-748173676da4', '2eb5e467-eb1e-4c96-a1c8-748173676da4', '{"sub":"2eb5e467-eb1e-4c96-a1c8-748173676da4","email":"[email protected]"}', 'email', '2eb5e467-eb1e-4c96-a1c8-748173676da4', now(), now(), now()),
|
||||
('c46da711-f429-4410-adde-21d7c6846aef', 'c46da711-f429-4410-adde-21d7c6846aef', '{"sub":"c46da711-f429-4410-adde-21d7c6846aef","email":"[email protected]"}', 'email', 'c46da711-f429-4410-adde-21d7c6846aef', now(), now(), now()) on conflict (id) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- CONTACTS (PK = email). Mirrors auth.users.
|
||||
-- Staff is merged into admin: Bruno, Rita, and the APPE Admin have is_admin.
|
||||
-- Dr. Elena Vasquez is an external keynote speaker (no registration / auth user).
|
||||
-- NOTE: the QR token lives on the REGISTRATION (per event), not the contact.
|
||||
-- CONTACTS (PK = email). 50 attendees + 4 staff (is_admin = admin role).
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- `password` is the admin-only APPE Admin login password (event-independent).
|
||||
-- Only the dedicated admin is seeded with one (demo value; override in Supabase).
|
||||
-- Staff (Bruno/Rita) keep their QR token as the auth password for the attendee app.
|
||||
insert into public.contacts (email, full_name, linkedin_url, show_email, show_linkedin, is_admin, password) values
|
||||
('ana.silva@nubank.com', 'Ana Silva', 'https://linkedin.com/in/anasilva', true, true, false, null),
|
||||
('[email protected]', 'Bruno Costa', 'https://linkedin.com/in/brunocosta', false, true, true, 'appe-admin-2026'),
|
||||
('[email protected]', 'Rita Lopes', null, false, false, true, 'appe-admin-2026'),
|
||||
('[email protected]','Tomás Ribeiro', null, false, false, false, null),
|
||||
('[email protected]', 'Sofia Almeida', null, false, false, false, null),
|
||||
('marco.chen@deepmind.com', 'Marco Chen', null, false, false, false, null),
|
||||
('julia.santos@ifood.com', 'Julia Santos', null, false, false, false, null),
|
||||
('pedro.nunes@microsoft.com', 'Pedro Nunes', null, false, false, false, null),
|
||||
('[email protected]', 'Carla Mendes', null, false, false, false, null),
|
||||
('diego.ferreira@stone.com', 'Diego Ferreira', null, false, false, false, null),
|
||||
('[email protected]', 'Marina Costa', null, false, false, false, null),
|
||||
('[email protected]', 'Lucas Oliveira', null, false, false, false, null),
|
||||
('[email protected]', 'APPE Admin', null, false, false, true, 'appe-admin-2026'),
|
||||
('[email protected]', 'Dr. Elena Vasquez', null, false, false, false, null)
|
||||
on conflict (email) do nothing;
|
||||
('lena.huber@gmail.com', 'Lena Huber', null, false, false, false, null),
|
||||
('[email protected]', 'Felix Berger', null, false, false, false, null),
|
||||
('[email protected]', 'Mia Moser', null, false, false, false, null),
|
||||
('[email protected]', 'Jonas Unger', null, false, false, false, null),
|
||||
('[email protected]', 'Emma Dorfer', null, false, false, false, null),
|
||||
('paul.klein@icloud.com', 'Paul Klein', null, false, false, false, null),
|
||||
('hannah.steiner@yahoo.com', 'Hannah Steiner', null, false, false, false, null),
|
||||
('lukas.fischer@office.com', 'Lukas Fischer', null, false, false, false, null),
|
||||
('[email protected]', 'Sofia Oberhuber', null, false, false, false, null),
|
||||
('david.winkler@outlook.com', 'David Winkler', null, false, false, false, null),
|
||||
('[email protected]', 'Clara Falk', null, false, false, false, null),
|
||||
('[email protected]', 'Max Wagner', null, false, false, false, null),
|
||||
('[email protected]', 'Ella Hofer', null, false, false, false, null),
|
||||
('[email protected]', 'Finn Hofmann', null, false, false, false, null),
|
||||
('[email protected]', 'Livia Rainer', null, false, false, false, null),
|
||||
('[email protected]', 'Noah Aigner', null, false, false, false, null),
|
||||
('[email protected]', 'Mara Hartl', null, false, false, false, null),
|
||||
('elias.mü[email protected]', 'Elias Müller', null, false, false, false, null),
|
||||
('[email protected]', 'Nora Pichler', null, false, false, false, null),
|
||||
('[email protected]', 'Ben Lederer', null, false, false, false, null),
|
||||
('[email protected]', 'Ida Tausch', null, false, false, false, null),
|
||||
('[email protected]', 'Oscar Cerny', null, false, false, false, null),
|
||||
('[email protected]', 'Freja Jank', null, false, false, false, null),
|
||||
('[email protected]', 'Hugo Gruber', null, false, false, false, null),
|
||||
('[email protected]', 'Alma Egger', null, false, false, false, null),
|
||||
('[email protected]', 'Theo Nagl', null, false, false, false, null),
|
||||
('[email protected]', 'Greta Vogler', null, false, false, false, null),
|
||||
('[email protected]', 'Milo Eisen', null, false, false, false, null),
|
||||
('[email protected]', 'Vera Lorenz', null, false, false, false, null),
|
||||
('[email protected]', 'Arno Maier', null, false, false, false, null),
|
||||
('[email protected]', 'Lotte Graf', null, false, false, false, null),
|
||||
('[email protected]', 'Kai Pfeiffer', null, false, false, false, null),
|
||||
('[email protected]', 'Mira Zech', null, false, false, false, null),
|
||||
('[email protected]', 'Erik Gassner', null, false, false, false, null),
|
||||
('[email protected]', 'Anna Schmidt', null, false, false, false, null),
|
||||
('[email protected]', 'Tobias Wolfer', null, false, false, false, null),
|
||||
('[email protected]', 'Lena Keller', null, false, false, false, null),
|
||||
('[email protected]', 'Samuel Sailer', null, false, false, false, null),
|
||||
('[email protected]', 'Julia Bauer', null, false, false, false, null),
|
||||
('[email protected]', 'Moritz Ismail', null, false, false, false, null),
|
||||
('[email protected]', 'Eva Huber', null, false, false, false, null),
|
||||
('[email protected]', 'Leon Berger', null, false, false, false, null),
|
||||
('[email protected]', 'Klara Moser', null, false, false, false, null),
|
||||
('[email protected]', 'Felix Unger', null, false, false, false, null),
|
||||
('[email protected]', 'Nina Dorfer', null, false, false, false, null),
|
||||
('[email protected]', 'Jan Klein', null, false, false, false, null),
|
||||
('[email protected]', 'Lena Steiner', null, false, false, false, null),
|
||||
('[email protected]', 'Paul Fischer', null, false, false, false, null),
|
||||
('[email protected]', 'Sara Oberhuber', null, false, false, false, null),
|
||||
('[email protected]', 'Markus Winkler', null, false, false, false, null),
|
||||
('[email protected]', 'Amelia Hernandez', null, false, false, true, 'appe-admin-2026'),
|
||||
('[email protected]', 'Sabrina Hota', null, false, false, true, 'appe-admin-2026'),
|
||||
('[email protected]', 'Jose Lago', null, false, false, true, 'appe-admin-2026'),
|
||||
('[email protected]', 'Markus Franz', null, false, false, true, 'appe-admin-2026') on conflict (email) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- EVENT (single active event)
|
||||
-- EVENT (single active event, Sessionize endpoint set).
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.events (id, name, start_date, end_date, location, is_active) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'APPE 2026', '2026-10-23', '2026-10-23', 'São Paulo, Brazil', true)
|
||||
on conflict (id) do nothing;
|
||||
insert into public.events (id, name, start_date, end_date, location, is_active, sessionize_endpoint) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'Global Power Platform Bootcamp | Austrian Power Platform Enthusiasts Edition', '2026-02-20', '2026-02-20', 'Vienna, Austria', true, 'https://sessionize.com/api/v2/4domszaq/view/All')
|
||||
on conflict (id) do update set name = excluded.name, start_date = excluded.start_date, end_date = excluded.end_date, location = excluded.location, is_active = true, sessionize_endpoint = excluded.sessionize_endpoint;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- REGISTRATIONS (per event). Points scoped here. The QR token lives here
|
||||
-- (per event, generated by Pretix) and doubles as the auth password.
|
||||
-- Ana is checked in (has check-ins below).
|
||||
-- REGISTRATIONS (50 attendee + 4 staff). Speaker registrations are created by
|
||||
-- the Excel import (matched by email).
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Note: everyone who speaks in a session is typed 'speaker' (the
|
||||
-- session_speakers_speaker_promote trigger auto-promotes 'attendee' → 'speaker'
|
||||
-- on insert, so the seed states the final type explicitly). Only Bruno, Rita and
|
||||
-- the admin are 'staff' (the trigger never overrides an explicit staff/sponsor).
|
||||
insert into public.registrations (event_id, contact_email, type, checked_in, points, qr_token) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 'speaker', true, 40, 'CVV-ANA-4821'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'bruno.costa@acme.com', 'staff', false, 140, 'CVV-BRU-1177'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 95, 'CVV-RIT-9034'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]','speaker', false, 88, 'CVV-TOM-5566'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'speaker', false, 76, 'CVV-SOF-2299'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'marco.chen@deepmind.com', 'speaker', false, 70, 'CVV-MRC-7712'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'julia.santos@ifood.com', 'speaker', false, 64, 'CVV-JUL-3345'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'pedro.nunes@microsoft.com', 'speaker', false, 58, 'CVV-PED-8801'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'carla.mendes@quintoessencial.com', 'speaker', false, 52, 'CVV-CAR-6623'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'diego.ferreira@stone.com', 'speaker', false, 35, 'CVV-DIE-4458'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'speaker', false, 28, 'CVV-MNA-2210'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'speaker', false, 15, 'CVV-LUC-9987'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 0, 'CVV-ADM-0001')
|
||||
on conflict (event_id, contact_email) do nothing;
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lena.huber@gmail.com', 'attendee', false, 0, 'CVV-ATT-1000'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'felix.berger@outlook.com', 'attendee', false, 0, 'CVV-ATT-1001'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1002'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1003'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1004'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'paul.klein@icloud.com', 'attendee', false, 0, 'CVV-ATT-1005'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'hannah.steiner@yahoo.com', 'attendee', false, 0, 'CVV-ATT-1006'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lukas.fischer@office.com', 'attendee', false, 0, 'CVV-ATT-1007'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'sofia.oberhuber@gmail.com', 'attendee', false, 0, 'CVV-ATT-1008'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'david.winkler@outlook.com', 'attendee', false, 0, 'CVV-ATT-1009'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1010'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1011'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1012'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1013'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1014'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1015'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1016'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'elias.mü[email protected]', 'attendee', false, 0, 'CVV-ATT-1017'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1018'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1019'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1020'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1021'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1022'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1023'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1024'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1025'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1026'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1027'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1028'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1029'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1030'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1031'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1032'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1033'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1034'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1035'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1036'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1037'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1038'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1039'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1040'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1041'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1042'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1043'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1044'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1045'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1046'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1047'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1048'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'attendee', false, 0, 'CVV-ATT-1049'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 0, 'CVV-STF-2000'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 0, 'CVV-STF-2001'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 0, 'CVV-STF-2002'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 'staff', false, 0, 'CVV-STF-2003') on conflict (event_id, contact_email) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- SPONSORS (2 paid, 1 unpaid — unpaid is hidden from non-admins via RLS)
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.sponsors (event_id, type, name, email, phone, paid, amount_eur, contact_email) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'headline', 'Nubank', '[email protected]', '+55 11 4000-0000', true, 50000, '[email protected]'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'gold', 'Acme Corp', '[email protected]', '+55 11 4000-0001', true, 20000, '[email protected]'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'community','Globant', '[email protected]', '+55 11 4000-0002', false, 0, '[email protected]')
|
||||
on conflict do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- SLOTS (23 Oct). Slot 1 done, Slot 2 live (simulated clock).
|
||||
-- SLOTS (from the Sessionize API agenda). type: session | service_session.
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.slots (id, event_id, type, name, slot_date, start_time, end_time) values
|
||||
(1, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'keynote', 'Slot 1', '2026-10-23', '09:00:00', '09:45:00'),
|
||||
(2, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 2', '2026-10-23', '10:00:00', '10:45:00'),
|
||||
(3, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 3', '2026-10-23', '11:30:00', '12:15:00'),
|
||||
(4, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lunch_break', 'Slot 4', '2026-10-23', '13:15:00', '14:00:00'),
|
||||
(5, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 5', '2026-10-23', '14:00:00', '14:45:00'),
|
||||
(6, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'close_up', 'Slot 6', '2026-10-23', '15:00:00', '15:45:00')
|
||||
on conflict (id) do nothing;
|
||||
(1, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 1', '2026-02-20', '09:15:00', '10:00:00'),
|
||||
(2, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 2', '2026-02-20', '10:15:00', '11:00:00'),
|
||||
(3, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 3', '2026-02-20', '11:15:00', '12:00:00'),
|
||||
(4, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'service_session', 'Service Session', '2026-02-20', '12:00:00', '13:00:00'),
|
||||
(5, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 5', '2026-02-20', '13:00:00', '13:45:00'),
|
||||
(6, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 6', '2026-02-20', '14:00:00', '14:45:00'),
|
||||
(7, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'service_session', 'Service Session', '2026-02-20', '14:45:00', '15:15:00'),
|
||||
(8, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 8', '2026-02-20', '15:15:00', '16:00:00'),
|
||||
(9, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'session', 'Slot 9', '2026-02-20', '16:15:00', '17:00:00'),
|
||||
(10, 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'service_session', 'Service Session', '2026-02-20', '17:00:00', '17:15:00') on conflict (id) do nothing;
|
||||
select setval('public.slots_id_seq', (select max(id) from public.slots), true);
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- SESSIONS (18 — 3 per slot)
|
||||
-- SESSIONS (from the Sessionize API). Speakers are linked by the Excel import.
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.sessions (id, event_id, slot_id, title, description, room, capacity) values
|
||||
('10000000-0000-0000-0000-000000000001', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 1, 'Opening Keynote: The Next Decade of AI', 'A wide-angle look at where AI is heading over the next ten years — and what it means for product teams.', 'Main Stage', 300),
|
||||
('10000000-0000-0000-0000-000000000002', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 1, 'Designing for Trust in AI Products', 'Practical patterns for making AI features transparent, explainable, and safe for your users.', 'Room A', 80),
|
||||
('10000000-0000-0000-0000-000000000003', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 1, 'From Hackathon to Product', 'How a weekend prototype became a product with 40k users — the messy middle included.', 'Room B', 60),
|
||||
('10000000-0000-0000-0000-000000000004', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'AI in Practice: Lessons from Production', 'Lessons learned shipping LLM features to production: latency, cost, evals, and the surprises.', 'Main Stage', 300),
|
||||
('10000000-0000-0000-0000-000000000005', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'The Introvert''s Guide to Networking', 'Small, low-energy ways to have big conversations at any event. (Yes, this one is for you.)', 'Room A', 80),
|
||||
('10000000-0000-0000-0000-000000000006', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'Building with Dataverse: Beyond the Basics', 'Go beyond the basics: relationships, security roles, and automations that actually scale.', 'Room B', 60),
|
||||
('10000000-0000-0000-0000-000000000007', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Scaling Teams at 10x', 'What breaks when you grow 10x in two years, and the rituals that kept us sane.', 'Main Stage', 300),
|
||||
('10000000-0000-0000-0000-000000000008', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Security by Design', 'Baking security into the product from day one instead of bolting it on at the end.', 'Room A', 80),
|
||||
('10000000-0000-0000-0000-000000000009', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Data Storytelling', 'Turn dashboards into narratives your stakeholders actually remember.', 'Room B', 60),
|
||||
('10000000-0000-0000-0000-000000000010', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 4, 'The Future of Work', 'Hybrid, async, and AI-augmented: where work is going and how to prepare for it.', 'Main Stage', 300),
|
||||
('10000000-0000-0000-0000-000000000011', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 4, 'Prototyping with AI', 'From idea to clickable prototype in an afternoon — tools and workflows that work.', 'Room A', 80),
|
||||
('10000000-0000-0000-0000-000000000012', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 4, 'Pricing SaaS in 2026', 'Usage-based, seat-based, or hybrid? What is actually working right now.', 'Room B', 60),
|
||||
('10000000-0000-0000-0000-000000000013', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'Community-Led Growth', 'Building a community that sells for you — case studies and playbooks.', 'Main Stage', 300),
|
||||
('10000000-0000-0000-0000-000000000014', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'Accessibility First', 'Why accessible products are better products, and how to start this sprint.', 'Room A', 80),
|
||||
('10000000-0000-0000-0000-000000000015', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'The Art of the Demo', 'Structure, pacing, and the moments that make a demo land.', 'Room B', 60),
|
||||
('10000000-0000-0000-0000-000000000016', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Closing Panel: What''s Next', 'Founders, researchers, and builders on what comes next — with audience Q&A.', 'Main Stage', 300),
|
||||
('10000000-0000-0000-0000-000000000017', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Open Space: Your Ideas', 'You bring the topic, we bring the room. 45 minutes of your ideas.', 'Room A', 80),
|
||||
('10000000-0000-0000-0000-000000000018', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Lightning Talks', 'Eight speakers, five minutes each. Fast, fun, and unpredictable.', 'Room B', 60)
|
||||
on conflict (id) do nothing;
|
||||
insert into public.sessions (id, event_id, slot_id, title, description, room, external_id) values
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 1, 'From Vision to Reality – A Live Launch Moment', 'Every movement has a moment where vision turns into something tangible.
|
||||
|
||||
In this keynote, we’ll briefly share how it all began the idea, the conversations, and the purpose behind it before bringing that story to life in real time.
|
||||
|
||||
This session marks the official launch of our new website, unveiled live during the keynote. More than just a platform, it represents the next chapter of our mission as we expand beyond our origins and embrace a truly global community.
|
||||
|
||||
Join us as we move from idea to impact together.', 'Track B', '1112740'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, '10 Essential tips to kickstart Power Platform Governance', 'The Power Platform empowers every employee to build solutions—but with great power comes great responsibility.
|
||||
|
||||
Without proper governance, the Power Platform can quickly become the Wild West: security risks, app sprawl, and no visibility into who built what. In this session, Steve and Anouck share their 10 most practical, beginner-friendly tips to help your organization kickstart its governance journey—without killing innovation.
|
||||
|
||||
Whether you''re an IT admin, platform owner, or business champion, you’ll walk away with:
|
||||
|
||||
A clear understanding of what governance really means in the Power Platform
|
||||
Ways to set up guardrails without becoming the “no” team
|
||||
Quick wins you can apply today to reduce risk and gain control
|
||||
Real-world examples and tools that Steve and Anouck use with customers every day
|
||||
|
||||
Join them to build a Power Platform environment that’s not only powerful—but also safe, manageable, and future-proof.', 'Track A', '1101539'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'RBAC in Dataverse: When “Looks Secure” is a compliance problem', 'RBAC in Dataverse is often misunderstood.
|
||||
Not because it is complicated, but because it is usually explained through roles and UI settings - instead of real access behavior.
|
||||
|
||||
Many solutions look secure.
|
||||
Users see only “their” records. Buttons are hidden. Views are filtered.
|
||||
From a compliance perspective, this feels reassuring.
|
||||
|
||||
Until it isn’t.
|
||||
|
||||
In this session, we will look at how access control in Dataverse behaves when solutions move beyond demos and into real, multi-user scenarios. We will explore why UI-based access logic creates false confidence, how it breaks under collaboration requirements, and why this gap often turns into a compliance issue rather than a functional bug.
|
||||
|
||||
Using practical, demo-driven examples, we will focus on Owner Teams and Access Teams as the mechanisms Dataverse provides to model access correctly:
|
||||
✅ when records should be owned by teams rather than individuals
|
||||
✅ how to manage dynamic, record-level access without manual sharing
|
||||
✅ how access changes automatically as users join or leave a team
|
||||
|
||||
You will learn:
|
||||
💡 what RBAC in Dataverse actually enforces
|
||||
💡 why UI logic does not satisfy compliance expectations
|
||||
💡 how Owner Teams and Access Teams reduce over-permissioning
|
||||
💡 how to design access models that remain defensible during audits
|
||||
|
||||
No deep security theory.
|
||||
No “checkbox compliance”.
|
||||
Just practical access patterns that hold up when someone finally asks, “Who can see this data - and why?”
|
||||
|
||||
(And yes, RBAC sometimes stands for Really Bad Access Control - especially during audits)', 'Track B', '1117516'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 2, 'Agent Evaluation in Action: Tips, Pitfalls, and Best Practices', 'Building intelligent agents is only half the story—evaluating them effectively is what ensures trust, reliability, and user satisfaction. In this session, we’ll dive deep into practical strategies for assessing agent performance in Microsoft Copilot Studio and beyond. You’ll learn how to design structured evaluation frameworks, leverage test case automation, and interpret metrics that matter. We’ll also explore common pitfalls—such as over-reliance on accuracy scores or ignoring contextual nuances—and share actionable best practices to avoid them. Whether you’re an architect, developer, or product owner, this session will equip you with the tools and mindset to transform evaluation from a checkbox into a continuous improvement engine.
|
||||
Key Takeaways:
|
||||
|
||||
Why agent evaluation is critical for responsible AI
|
||||
How to implement test case evaluation in Copilot Studio
|
||||
Common mistakes and how to avoid them
|
||||
Practical tips for scaling evaluation across multiple agents
|
||||
|
||||
https://dev.to/balagmadhu/agent-evaluation-in-action-tips-pitfalls-and-best-practices-5cje
|
||||
', 'Track C', '1112723'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Power Platform for Good!', 'What: This talk gives the attendees insights into how someone like me, with a scientific non-technical background ended up as a developer for a consulting company and a volunteer for a charity – “Collaboration for Kids”. Expect to learn how I used Power Platform to transform this charity’s digital space in a meaningful way, and how you can collaborate with your local charities of NGOs with something you already know! I will show you how I created a useful intranet and some process automations, with a strong focus on promoting healthier choices for children and adults. All powered by Microsoft Technology – Business Applications and Modern Workplace.
|
||||
|
||||
Why: Non-profit organisations are facing increasing pressure to optimise their operations and invest most of their time in supporting the cause. By leveraging technology, this goal can be more easily achieved, addressing challenges in communication, manual workloads, and other areas. If you want to learn how to go above and beyond with your local charity by using Power Platform, this is the talk for you!
|
||||
|
||||
How: Expect engaging storytelling, live demos, practical cases of Power Automate and SharePoint working together, tips on how to work with diverse Stakeholders and much more!
|
||||
|
||||
Takeaways:
|
||||
• Concrete - and cool - examples of applying Power Platform for non-profit organisations.
|
||||
• Strategies for effective collaboration and user adoption.
|
||||
• Inspiration to go back home, bring your tech skills to the table, and help your local charity.', 'Track A', '1112812'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Building Power Apps like Duolingo: Drive Adoption with Game UX Patterns', 'Most Power Apps fail for one simple reason: they feel like forms. not like products people want to return to.
|
||||
|
||||
In this session, we’ll borrow proven UX/UI patterns from gaming and consumer apps like Duolingo to turn “one-and-done” Power Apps into experiences that users actually enjoy using.
|
||||
You’ll learn a practical engagement toolkit: progression systems, clear goals, feedback loops, micro-rewards, streak mechanics, onboarding quests, and UI patterns that reduce friction while increasing motivation. We’ll translate these patterns into real Power Apps design decisions—what to show, when to show it, how to guide users, and how to make success feel visible.
|
||||
Expect concrete examples, do’s & don’ts, and a “pattern library” you can apply immediately—without turning your business app into a toy.
|
||||
|
||||
Takeaways
|
||||
A Gaming UX Pattern Library for Power Apps (Progress, Feedback, Rewards, Quests, Streaks, Social Proof)
|
||||
UI tactics to reduce drop-offs: microcopy, visual hierarchy, empty states, and nudges
|
||||
Gamification done right: what works, what backfires, and how to keep it professional', 'Track B', '1112851'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 3, 'Low Code, High Impact – warum Wirkung wichtiger ist als Code', 'Digitalisierung scheitert selten an Technologie – sondern daran, dass die richtigen Menschen nicht ins Gestalten kommen. Während Anforderungen steigen und Veränderung zur Konstante wird, braucht es neue Wege, wie Software entsteht und genutzt wird.
|
||||
|
||||
Aus der Perspektive einer Frau in Tech zeigt der Talk, warum Low Code nicht „weniger Tech“ ist, sondern ein entscheidender Schritt hin zu mehr Vielfalt, mehr Wirksamkeit und nachhaltiger Transformation. Ein inspirierender Blick auf Technologie, die nicht imponieren will – sondern etwas verändert.', 'Track C', '1122676'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 4, 'Lunch', null, 'Track B', '7a0c0141-b5ea-4803-8770-24ef94d5d18f'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'Canvas Apps like Tomorrowland: Design your apps like a world class festival!', 'Get ready to take your Canvas Apps from simple beats to full-blown festival anthems! Users today don’t just want apps that work, they want apps that feel as smooth, exciting, and unforgettable as a night at Tomorrowland.
|
||||
|
||||
In this session, we’ll turn real design concepts into Canvas App experiences. It’s not just about the looks: it’s about making apps that feel intuitive, fast, and keep the energy up, like a killer DJ set that never misses a beat. Strong design and great user experience go hand-in-hand to avoid chaos and keep your users dancing.
|
||||
|
||||
Expect a live set where we rebuild a Figma design inside Power Apps, showing different ways to create stunning user interfaces. But we’ll also crank up the user experience by adding smart navigation, slick error handling, loading states, and more because true headliners know that flow matters as much as visuals.
|
||||
|
||||
You’ll leave with a full setlist of practical tips and hands-on techniques to remix your apps into mainstage experiences. Get ready to remix your apps!', 'Track A', '1061687'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'Microsoft Work IQ: Making Copilot Studio Agents Understand How Your Organization Actually Works', 'Copilot Studio enables Power Platform builders to extend Microsoft Copilot with custom AI agents. However, many agents still behave like reactive chatbots, responding to prompts without understanding how work happens inside an organization.
|
||||
|
||||
Microsoft Work IQ introduces an intelligence layer that allows Copilot and Copilot Studio agents to reason about organizational relationships, priorities, patterns, and historical signals across Microsoft 365. This context fundamentally changes how Copilot extensions and AI agents behave in real enterprise environments.
|
||||
|
||||
In this session, we explore Microsoft Work IQ through the lens of Power Platform extensibility and Copilot Studio agent design. You will learn how organizational context influences agent reasoning, personalization, and decision-making, and how to design AI agents that extend Copilot beyond generic productivity scenarios.
|
||||
|
||||
Through focused demos and architectural walkthroughs, we demonstrate how Power Platform builders and architects can design work-aware AI agents using Copilot Studio and Microsoft’s AI stack.
|
||||
|
||||
This session is designed for Power Platform developers, solution architects, and AI practitioners who are building intelligent Copilot extensions and agent-based solutions.
|
||||
|
||||
What You Will Learn:
|
||||
- How Copilot Studio acts as an extension layer for Microsoft Copilot on Power Platform
|
||||
- Why organizational context matters when designing Copilot extensions and AI agents
|
||||
- What Microsoft Work IQ is and how it differs from Microsoft Graph, Dataverse, and prompt engineering
|
||||
- How Work IQ influences agent reasoning and behavior in Copilot Studio
|
||||
- Architectural patterns for building context-aware AI agents on Power Platform
|
||||
- How Work IQ fits within Microsoft’s AI stack alongside Copilot Studio, Foundry IQ, and Fabric IQ
|
||||
|
||||
Artem Chernevskiy is a Microsoft Most Valuable Professional (Azure AI Platform) and CEO of AI Cloud Agency (AICA), with over 20 years of experience delivering enterprise solutions on the Microsoft stack. He has hands-on experience working with Microsoft Viva Advanced Insights, with a focus on organizational work patterns, productivity analytics, and data-driven decision making.
|
||||
|
||||
Artem works closely with organizations to apply Microsoft AI technologies to real-world enterprise scenarios, helping teams move from experimentation to measurable business impact.
|
||||
|
||||
Katerina Chernevskaya is a Power Platform Architect, BizApps MVP, and Microsoft Certified Trainer. She designs enterprise-grade Power Platform solutions with a strong focus on Copilot Studio, agent architecture, and AI-driven experiences. Katerina helps organizations translate complex business processes into intelligent, maintainable AI solutions on Power Platform.
|
||||
|
||||
Artem Chernevskiy and Katerina Chernevskaya are winners of the Microsoft Global Hack Together Hackathon 2025, where they built AI-first solutions leveraging Microsoft Copilot, intelligent agents, and organizational context.', 'Track B', '1105486'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 5, 'ÖBB PowerPlatform Journey & Knowledge AI Agent', 'ÖBB Power Platform Journey
|
||||
|
||||
From first pilot to enterprise scale: discover how ÖBB turned Microsoft Power Platform into a strategic transformation engine. Learn how governance, citizen development, and Azure integration came together to drive real business impact — fast, secure, and scalable.
|
||||
|
||||
Knowledge AI Agent
|
||||
|
||||
Unlock the power of your organization’s knowledge. The Knowledge AI Agent uses AI and Azure to turn scattered data into instant, contextual answers — reducing search time, boosting productivity, and bringing intelligent automation into everyday workflows.', 'Track C', '1146612'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Intelligent Apps Demystified: Turning AI Buzzwords into Business Value', 'Have you heard the term Intelligent Apps but aren''t quite sure what it means - or how to explain it to your customers?
|
||||
|
||||
Or curious about what makes an App "Intelligent" and how AI-powered solutions built within Dynamics 365 and Power Platform can drive real business outcomes for Frontier Firms?
|
||||
|
||||
This session explains the core characteristics of Intelligent Apps: data-driven, context-aware, adaptive and absorptive, and explores how tools like Copilot, Autonomous Agents, and the Microsoft Dataverse and Graph come together to deliver strategic value in transforming customer experience and operational efficiency.
|
||||
|
||||
You’ll see Well Architected examples of the Three Horizons of AI Transformation in action, from Microsoft''s latest and greatest Dynamics and Copilot Autonomous Agents.
|
||||
|
||||
Whether you''re a functional consultant, community contributor, or someone looking to confidently engage business leaders in conversations about AI, this session will give you the clarity, language, and architectural insights to lead with impact.', 'Track A', '1112738'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'Pimp My Agent - Bling Out with Tools in Copilot Studio', 'To make any agent effective, it''s necessary to incorporate relevant tools connecting to our key business systems so we can automate actions, realise more complex sequences, and have our agents really "dazzle" from an end-user perspective. Fortunately, thanks to low-code agent-building platforms like Copilot Studio, deep development expertise is not necessarily required to integrate these tools; have your idea and a couple of (appropriately privileged) credentials handy, and you can start to build.
|
||||
|
||||
In this hands-on, demo-led session, we''ll jump into Copilot Studio and understand the power and versatility of tools. We''ll take a look at the different types of tools you can use, such as agent flows and MCP Servers, the importance of proper configuration for each tool, and how we can use tools in combination to handle more complex user prompts. If you are sick of working with manual topics and cloud flows to automate your agents'' workflows, then this session will illuminate the art of the possible.', 'Track B', '1109013'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 6, 'How to build a SharedDesk Solution in a Canvas App', 'In this session, I''ll demonstrate how to build a canvas application in Microsoft Power Platform that maximizes accessibility while minimizing licensing costs. The solution leverages a SharePoint list as the primary data source, making it accessible to all users with Microsoft E5 licenses. To address the challenge of historical data tracking and reporting without requiring premium licenses for every user, I''ve implemented a service user account that connects to Dataverse. This architectural approach enables comprehensive data logging and robust reporting capabilities while keeping the application available to the entire organization under standard E5 licensing. Attendees will learn practical strategies for balancing functionality, cost, and user access in Power Platform solutions.', 'Track C', '1127856'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 7, 'Coffee Break', null, 'Track B', '6a8e4155-20a1-491b-ab8e-f7ae83a6a7e9'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 8, 'Copilot Studio in der Praxis, Interne Chatbots mit Model Context Protocol für deinen Arbeitsalltag', 'In dieser Session zeige ich dir, wie du Copilot Studio und das Model Context Protocol nutzen kannst, um interne Chatbots zu entwickeln, die dich und dein Team im Alltag entlasten. Der Schwerpunkt liegt darauf zu verstehen, wie ein MCP basierter Agent mit eigenen Geschäftsdaten interagiert und typische Aufgaben schneller und einfacher macht.
|
||||
|
||||
Anhand konkreter Beispiele erleben wir, wie ein Chatbot Informationen aus Dataverse oder Dynamics 365 abrufen, E Mails vorbereiten oder Demo Daten für Kundengespräche zusammenstellen kann. Außerdem bekommst du einen Einblick, wie Aktionen angebunden werden und wie Copilot Studio natürliche Sprache in echte Unterstützung für dein Team verwandelt.
|
||||
|
||||
Nach der Session hast du ein klares Bild davon, welche internen Prozesse sich besonders gut eignen und wie ein MCP Chatbot dein Team unterstützen kann. Du nimmst konkrete Ideen mit, welche ersten Schritte sinnvoll sind, um einen eigenen Agenten für deinen Use Case zu entwickeln.', 'Track A', '1090531'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 8, 'Dashboard in a Day? Nah. Let’s Do One in 45 Minutes. A live, end-to-end Power BI build', 'A live, end-to-end Power BI build
|
||||
|
||||
This is a demo-first session. No slide decks full of theory. No pre-built models. No “imagine if” examples.
|
||||
|
||||
The only slides you’ll see at the start are my face and a highlight reel of things I’m unreasonably proud of—purely for credibility, ego maintenance, and to prove I’ve broken Power BI in enough ways to know what actually matters. Then we switch straight into Power BI and build a real dashboard from scratch in 45 minutes.
|
||||
|
||||
We’ll start with raw, messy data and finish with something you’d genuinely feel comfortable putting in front of stakeholders.
|
||||
|
||||
Along the way, you’ll see:
|
||||
|
||||
How to decide what not to build (the fastest win in Power BI)
|
||||
|
||||
A practical approach to modelling without overengineering
|
||||
|
||||
The small number of measures that usually drive the most value
|
||||
|
||||
Layout and visual choices that prioritise clarity over decoration
|
||||
|
||||
How to keep momentum when time, scope, and attention are limited
|
||||
|
||||
This session is about decision-making under constraint—the same constraint most of us work under every day.
|
||||
|
||||
You’ll leave with a repeatable approach you can use when “Dashboard in a Day” simply isn’t realistic.', 'Track B', '1128996'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 8, 'LLM Showdown: Local vs. Cloud + MCP', 'Are you ready to explore the rapidly evolving world of Large Language Models (LLMs)? This session will pit two powerful approaches against each other – running LLMs locally using LM Studio versus leveraging cloud-based services. We’ll dive deep into the pros and cons of each, examining factors like cost, performance, control, and security.
|
||||
What you''ll learn:
|
||||
LM Studio Deep Dive: Discover how to effectively utilize LM Studio for running LLMs directly on your hardware – exploring its features, model selection, and optimization techniques.
|
||||
Cloud LLM Landscape: We’ll compare popular cloud-based LLM providers (like Azure OpenAI Service) discussing their pricing models, API access, and scalability options.
|
||||
MCP Integration - The Core Focus: This session will demonstrate how to seamlessly connect both local LM Studio LLMs and cloud-based LLMs to your Microsoft Cognitive Platform (MCP) servers. We’ll cover:
|
||||
Connecting via APIs – showcasing practical examples.
|
||||
Utilizing community-based tools and frameworks designed for MCP integration with LLMs (e.g., LangChain, LlamaIndex).
|
||||
Exploring the potential of Microsoft MCP Servers for hosting and managing your LLM deployments.
|
||||
Cost Analysis: A brief overview of the cost implications of each approach – considering hardware investment vs. cloud usage fees.', 'Track C', '1154630'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 9, 'Scaling the Power Platform Internally: How to Build a Thriving Community', 'How do you move the Power Platform from pilot to broad, secure adoption? In this session, I show how to build a company-wide community—including roles, structures, and formats: from a Center of Excellence (CoE) and champions programs to tech talks, show & tell sessions, newsletters, and Teams channels as a central community hub. Real-world examples, template ideas, and lessons learned from projects round out the guide.', 'Track A', '1112692'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 9, 'PwC Session', null, 'Track B', 'b3ddd25a-7ce8-47a0-8aa2-e251a9423b2a'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 9, 'Copilot Studio Extended: Custom Connector for agents', 'What if Copilot Studio agents could execute actions in any third-party system?
|
||||
|
||||
In this workshop, we’ll build a custom connector step by step for a simulated third-party system. We’ll then integrate this connector as a tool into a Copilot Studio agent, enabling the agent to directly interact with the external system and perform actions.', 'Track C', '1076341'),
|
||||
(gen_random_uuid(), 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 10, 'Closing', null, 'Track B', '1782b45a-b4d7-4e52-8800-2916677e80a1') on conflict (external_id) where external_id is not null do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- SESSION SPEAKERS (M:N). Every session has >= 1 speaker.
|
||||
-- LEADERBOARD (mirror of registration points; staff excluded).
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.session_speakers (session_id, contact_email) values
|
||||
('10000000-0000-0000-0000-000000000001', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000002', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000003', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000004', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000005', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000006', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000007', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000008', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000009', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000010', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000011', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000012', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000013', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000014', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000015', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000016', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000016', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000016', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000017', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000018', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000018', '[email protected]'),
|
||||
('10000000-0000-0000-0000-000000000018', '[email protected]')
|
||||
on conflict (session_id, contact_email) do nothing;
|
||||
|
||||
-- s2 has a comment from Ana → AI feedback is pending evaluation.
|
||||
update public.sessions set ai_generated_feedback = 'Pending AI Evaluation'
|
||||
where id = '10000000-0000-0000-0000-000000000002';
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- ANA'S DEMO STATE (so the app looks alive on first login)
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Preferences: one pick per slot (matches the mockup).
|
||||
insert into public.preferences (event_id, contact_email, session_id, slot_id) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000002', 1),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000004', 2),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000009', 3),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000011', 4),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000013', 5),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000016', 6)
|
||||
on conflict (event_id, contact_email, slot_id) do nothing;
|
||||
|
||||
-- Check-ins: Ana is checked into Slot 1 (s2) and Slot 2 (s4), by staff Bruno.
|
||||
insert into public.checkins (event_id, contact_email, session_id, staff_email) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000002', '[email protected]'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000004', '[email protected]')
|
||||
on conflict (event_id, contact_email, session_id) do nothing;
|
||||
|
||||
-- Connections: accepted with Bruno & Rita; incoming from Sofia; outgoing to Julia.
|
||||
insert into public.connections (id, event_id, from_email, to_email, status, created_at, resolved_at) values
|
||||
('e0000000-0000-0000-0000-000000000001', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '[email protected]', 'accepted', now() - interval '2 hours', now() - interval '2 hours'),
|
||||
('e0000000-0000-0000-0000-000000000002', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '[email protected]', 'accepted', now() - interval '90 minutes', now() - interval '90 minutes'),
|
||||
('e0000000-0000-0000-0000-000000000003', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '[email protected]', 'pending', now() - interval '15 minutes', null),
|
||||
('e0000000-0000-0000-0000-000000000004', 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '[email protected]', 'pending', now() - interval '5 minutes', null)
|
||||
on conflict (id) do nothing;
|
||||
|
||||
-- Feedback: Ana rated Slot 1 (s2).
|
||||
insert into public.feedback (event_id, contact_email, session_id, rating, comment) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', '10000000-0000-0000-0000-000000000002', 5, 'Great patterns, very practical. Wish it were longer!')
|
||||
on conflict (event_id, contact_email, session_id) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- LEADERBOARD (mirror of registration points, per event)
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Staff are excluded from the leaderboard (they don't compete for top points).
|
||||
insert into public.leaderboard (event_id, contact_email, full_name, points)
|
||||
select r.event_id, r.contact_email, c.full_name, r.points
|
||||
from public.registrations r
|
||||
join public.contacts c on c.email = r.contact_email
|
||||
where r.type <> 'staff'
|
||||
on conflict (event_id, contact_email) do update
|
||||
set full_name = excluded.full_name, points = excluded.points, updated_at = now();
|
||||
on conflict (event_id, contact_email) do update set full_name = excluded.full_name, points = excluded.points, updated_at = now();
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- POINTS LOG
|
||||
-- Ana: a coherent breakdown (2 checkins, 2 connections, 1 feedback = 40).
|
||||
-- Everyone else: a single 'admin' seed entry for their starting points.
|
||||
-- POINTS LOG (a small starting balance per attendee so the board is alive).
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.points_log (event_id, contact_email, delta, category) values
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 10, 'checkin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'ana.silva@nubank.com', 10, 'checkin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 5, 'connection'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 5, 'connection'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 10, 'feedback'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'bruno.costa@acme.com', 140, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'rita.lopes@globant.com', 95, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'tomas.ribeiro@dataprev.com', 88, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'sofia.almeida@loop.com', 76, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'marco.chen@deepmind.com', 70, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 64, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 58, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 52, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'diego.ferreira@stone.com', 35, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'marina.costa@olx.com', 28, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 15, 'admin');
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lena.huber@gmail.com', 5, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'felix.berger@outlook.com', 12, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 19, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 26, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 33, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'paul.klein@icloud.com', 40, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'hannah.steiner@yahoo.com', 7, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'lukas.fischer@office.com', 14, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'sofia.oberhuber@gmail.com', 21, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'david.winkler@outlook.com', 28, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 35, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 42, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 9, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'finn.hofmann@icloud.com', 16, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'livia.rainer@yahoo.com', 23, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 30, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 37, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', 'elias.mü[email protected]', 44, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 11, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 18, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 25, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 32, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 39, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 6, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 13, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 20, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 27, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 34, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 41, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 8, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 15, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 22, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 29, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 36, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 43, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 10, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 17, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 24, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 31, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 38, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 5, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 12, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 19, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 26, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 33, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 40, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 7, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 14, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 21, 'admin'),
|
||||
('eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee', '[email protected]', 28, 'admin');
|
||||
Reference in new issue
Block a user