Skip to content

Phase 2.2 [Backend]: Document uploads and joined hosts/related for event extras #299

Done

Description

@Flapjacck

Overview

The data functions for hosts, documents and related events exist (lib/data/event-hosts.ts, event-documents.ts, event-related.ts), but two things block the UI:

  1. Documents can't upload non-images. addDocument goes through uploadImage with a CheckedImage, which only accepts JPEG, PNG, WebP or GIF up to 5 MB. Event docs are mostly PDFs and slides. The event-media bucket already allows PDF and PowerPoint up to 20 MB.
  2. Hosts come back as ids. The manager needs each host's name, title and photo, whether they're a team member or a guest.

Replaces the backend half of #281 (photos moved to 2.4). Part of #201.

What to do

  • lib/ui/files.ts (or extend images.ts): checkDocument(file) accepts PDF, PPT, PPTX and images up to 20 MB, and returns a CheckedFile with its extension. Clear rejection messages, like the image ones.
  • lib/server/storage.ts: a general uploadFile(bucket, file, folder) that uploadImage can reuse. Documents go to event-media/<event_id>/docs/<random>.<ext>.
  • addDocument uses it. Check that updateDocument (title) and reorderDocuments work with sort_order.
  • listHosts(eventId) selects the joined person (team(id, name, role, department, picture_path) and guests(id, name, title, picture_path, companies(name, colour))) and returns one EventHost shape with kind: 'team' | 'guest', name, subtitle and picture URL, ordered by sort_order.
  • listRelated(eventId) returns the related event's title, date and category for the list.
  • An eventOptions(excludeId) helper for the related-event picker (title + date, newest first).
  • Hooks for each, if they aren't covered by the existing useEventHosts, useEventDocuments and useEventRelated.

Tests

  • Document check (accepted types, size, rejections).
  • Upload path, joined hosts mapping, and related events mapping.

Done when

  • PDFs and slides upload as event documents
  • Hosts and related events come back ready to display
  • Tests pass

Activity

  1. added
    admin
    backend
    v2-migration
    phase-2
    data-layer
    on Nov 28, 2026
  2. Flapjacck commented on Nov 30, 2026

    @Flapjacck
    MemberAuthor

    Progress check against main:

    Done:

    Still to do:

  3. self-assigned this
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

adminbackenddata-layerphase-2v2-migration

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions