fix: import localized topics and flattened Sessionize speakers

This commit is contained in:
Lago committed 2026-10-10 01:50:08 +02:00
1 parent 5c93d4a0cb
commit 648daa0794
6 files changed
+226 -88

No files matched your search

+25 -6
View File
@@ -5,8 +5,9 @@ The **sidecar** is a small Node HTTP service that syncs an event's agenda from
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))
- Code: [`apps/sidecar/`](../../apps/sidecar/), HTTP service in
[`src/server.js`](../../apps/sidecar/src/server.js), pure Excel transform in
[`src/transform-excel.js`](../../apps/sidecar/src/transform-excel.js)
- Image: [`apps/sidecar/Dockerfile`](../../apps/sidecar/Dockerfile)
(`node:20-alpine`; runtime dependencies **`xlsx`** (parse the Sessionize Excel
export) and **`pdfkit`** (render the PDF report) — everything else is built-in
@@ -34,9 +35,12 @@ speaker emails, so this path imports sessions + agenda but **skips speakers**
> registered **staff** member as a speaker.
**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
`.xlsx` export (generated on the fly by any organizer with admin access to the
event). Supported formats are the legacy **"Sessions and speakers (advanced)"**
export (two sheets: *Accepted sessions* + *Accepted speakers*, with plural
**Speaker Ids**) and the flattened **Accepted sessions and speakers** sheet
(one session/speaker pair per row, with singular **Speaker Id**). The sidecar
parses it 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 the
@@ -47,6 +51,21 @@ registration for every speaker** (create, or update `attendee`→`speaker`; neve
overrides `staff`/`sponsor`). This is the path that creates the missing speaker
contacts + registrations.
Excel rows are grouped by **Session Id** into one session with all distinct
speaker emails; repeated speakers are emitted once by email. Separate session
and speaker sheets take precedence over a combined sheet if both are present.
Sessions without a title, ID, or scheduled time are skipped as before.
Topic classification uses the first nonempty value of **Themenfeld / Area of
Topic**, **Area**, then **Topic**. Headers are trimmed and matched
case-insensitively; unrelated category headers are not inferred. Values are
trimmed but otherwise preserved as a single string, including comma-separated
topics in their original order. **Level** remains an optional free-text value.
For repeated session rows, the first row supplies session metadata; a later
nonempty topic can fill an initially empty topic, and speaker links are merged.
See [Excel transform tests](./tests.md#sessionize-excel-transform) for the
database-free regression command.
Linking a speaker to a session fires the `session_speakers_speaker_promote`
trigger, which promotes an existing registration to `speaker`.
@@ -104,7 +123,7 @@ transforms, calls the RPC, and returns the summary. The admin's "Sync" button an
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
`xlsx`), transforms either supported format 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.