# Program

## Overview

Event programs represent scheduled segments within an event (e.g., talks, workshops, breaks). Programs are managed through the event update mutation and stored as an array in the event model.

### Data Model

```typescript
interface EventSession {
  _id: MongoID;
  title: String;              // Required
  description: String;        // Optional description
  start: DateTimeISO;        // Session start time
  end: DateTimeISO;          // Session end time
  broadcast: MongoID;        // Reference to broadcast
  photos: MongoID[];         // Session images
  photos_expanded: File[];   // Expanded photo data
  speaker_users: MongoID[];  // References to speakers
  speaker_users_expanded: User[]; // Expanded speaker data
}
```

### Managing programs

Programs are updated through the event mutation:

```graphql
mutation updateEvent($id: ID!, $input: UpdateEventInput!) {
  updateEvent(id: $id, input: {
    sessions: [
      {
        title: "Opening Keynote",
        start: "2024-05-01T09:00:00Z",
        end: "2024-05-01T10:00:00Z",
        speaker_users: ["speaker1Id", "speaker2Id"]
      }
    ]
  })
}
```

### Key Rules

* Programs must have title, start time, and end time
* The end time must be after the start time
* Programs can have multiple speakers
* Programs can be linked to a broadcast for virtual events
* Photos can be attached to individual programs

### Update Operation

* Use `updateEvent` mutation to modify programs
* Can update multiple programs in one operation
* Existing programs are replaced with the new array
* Program IDs are preserved for existing sessions

### Broadcast Creation

To link a broadcast to a program, create a broadcast using the `createEventBroadcast` mutation and reference its `_id` in the session. The broadcast requires a provider, provider ID, and optional metadata such as rooms and end time.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lemonade.gitbook.io/welcome-to-lemonade/events/program.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
