> ## Documentation Index
> Fetch the complete documentation index at: https://dos.dzaleka.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Event Model

> Complete schema documentation for the Event model in Dzaleka Online Services

## Overview

The Event model represents community events, workshops, meetings, and gatherings in and around Dzaleka Refugee Camp. Events can be in-person or online, and may include registration requirements and panelist information.

## Schema Definition

The Event model is defined using Zod schema validation in `src/content.config.ts:97-132`.

### TypeScript Type

```typescript theme={null}
type Event = {
  title: string;
  description: string;
  date: Date;
  endDate?: Date;
  location: string;
  category: string;
  featured?: boolean;
  image?: string;
  organizer: string;
  status: 'upcoming' | 'past';
  contact?: {
    email?: string;
    phone?: string;
    whatsapp?: string;
  };
  registration?: {
    required: boolean;
    url?: string;
    deadline?: Date;
  };
  panelists?: Array<{
    name: string;
    role?: string;
    bio?: string;
    image?: string;
    organization?: string;
    socialMedia?: {
      twitter?: string;
      instagram?: string;
      linkedin?: string;
      website?: string;
    };
  }>;
  tags?: string[];
};
```

## Fields

### Core Fields

<ResponseField name="title" type="string" required>
  The name of the event.
</ResponseField>

<ResponseField name="description" type="string" required>
  A detailed description of what the event is about, its purpose, and what attendees can expect.
</ResponseField>

<ResponseField name="date" type="Date" required>
  The start date and time of the event in ISO 8601 format.
</ResponseField>

<ResponseField name="endDate" type="Date">
  The end date and time of the event (for multi-day events).
</ResponseField>

<ResponseField name="location" type="string" required>
  The location where the event takes place (e.g., "Online", "Dzaleka Community Center", "Zoom Meeting").
</ResponseField>

<ResponseField name="category" type="string" required>
  The type or category of event (e.g., "Zoom Meeting", "Workshop", "Conference", "Community Gathering").
</ResponseField>

<ResponseField name="organizer" type="string" required>
  The name of the individual or organization hosting the event (e.g., "Inua Advocacy").
</ResponseField>

<ResponseField name="status" type="enum" required>
  Current status of the event. Options: `'upcoming'` | `'past'`. Defaults to `'past'`.
</ResponseField>

<ResponseField name="featured" type="boolean">
  Whether this event should be featured prominently on the platform.
</ResponseField>

<ResponseField name="image" type="string">
  Path or URL to a promotional image for the event.
</ResponseField>

<ResponseField name="tags" type="string[]">
  Array of tags for categorization and searchability (e.g., \["Refugees", "Malawi", "Laws"]).
</ResponseField>

### Contact Information

<ResponseField name="contact" type="object">
  <Expandable title="properties">
    <ResponseField name="email" type="string">
      Contact email for event inquiries (e.g., "[info@inuaadvocacy.org](mailto:info@inuaadvocacy.org)").
    </ResponseField>

    <ResponseField name="phone" type="string">
      Contact phone number with country code (e.g., "+265 882 717 995").
    </ResponseField>

    <ResponseField name="whatsapp" type="string">
      WhatsApp number for quick communication.
    </ResponseField>
  </Expandable>
</ResponseField>

### Registration Information

<ResponseField name="registration" type="object">
  <Expandable title="properties">
    <ResponseField name="required" type="boolean" required>
      Whether registration is required to attend the event.
    </ResponseField>

    <ResponseField name="url" type="string">
      URL where attendees can register for the event.
    </ResponseField>

    <ResponseField name="deadline" type="Date">
      Registration deadline date and time.
    </ResponseField>
  </Expandable>
</ResponseField>

### Panelists

<ResponseField name="panelists" type="array">
  Array of speakers, panelists, or presenters for the event.

  <Expandable title="properties">
    <ResponseField name="name" type="string" required>
      Full name of the panelist.
    </ResponseField>

    <ResponseField name="role" type="string">
      The panelist's role or title (e.g., "Keynote Speaker", "Moderator").
    </ResponseField>

    <ResponseField name="bio" type="string">
      Brief biography or description of the panelist.
    </ResponseField>

    <ResponseField name="image" type="string">
      Path or URL to the panelist's profile photo.
    </ResponseField>

    <ResponseField name="organization" type="string">
      The organization the panelist represents.
    </ResponseField>

    <ResponseField name="socialMedia" type="object">
      <Expandable title="properties">
        <ResponseField name="twitter" type="string">
          Twitter/X profile URL.
        </ResponseField>

        <ResponseField name="instagram" type="string">
          Instagram profile URL.
        </ResponseField>

        <ResponseField name="linkedin" type="string">
          LinkedIn profile URL.
        </ResponseField>

        <ResponseField name="website" type="string">
          Personal or professional website URL.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

Here's a complete example of an Event object for a community discussion:

```json theme={null}
{
  "title": "Breaking Myths About Refugees: Truths That Change Perceptions",
  "description": "Refugees and migrants face misconceptions worldwide, but in this session, we focus on Malawi and the broader sub-Saharan Africa region.",
  "date": "2025-04-24T13:00:00.000Z",
  "endDate": "2025-04-24T14:30:00.000Z",
  "location": "Online",
  "category": "Zoom Meeting",
  "image": "https://alumni.creighton.edu/sites/default/files/externals/7fe45be3aa4b9a7e7698f971033cbcc6.jpg",
  "featured": true,
  "organizer": "Inua Advocacy",
  "status": "past",
  "contact": {
    "email": "info@inuaadvocacy.org",
    "phone": "+265 882 717 995",
    "whatsapp": "+265 882 717 995"
  },
  "registration": {
    "required": true,
    "url": "https://us06web.zoom.us/meeting/register/4PrLQ4aMSK6gzSDff2shWw",
    "deadline": "2025-04-24T13:00:00.000Z"
  },
  "tags": ["Refugees", "Malawi", "Laws", "Inua Advocacy"]
}
```

## Usage in Content

Events are stored as Markdown files in `src/content/events/` with YAML frontmatter:

```markdown theme={null}
---
title: "Breaking Myths About Refugees: Truths That Change Perceptions"
description: "Refugees and migrants face misconceptions worldwide..."
date: 2025-04-24T13:00:00Z
endDate: 2025-04-24
location: "Online"
category: "Zoom Meeting"
image: "https://alumni.creighton.edu/sites/default/files/externals/7fe45be3aa4b9a7e7698f971033cbcc6.jpg"
featured: true
organizer: "Inua Advocacy"
status: "past"
contact:
  email: "info@inuaadvocacy.org"
  phone: "+265 882 717 995"
  whatsapp: "+265 882 717 995"
registration:
  required: true
  url: "https://us06web.zoom.us/meeting/register/4PrLQ4aMSK6gzSDff2shWw"
  deadline: 2025-04-24
tags: ["Refugees", "Malawi", "Laws", "Inua Advocacy"]
---

## Event Overview

Markdown content describing the event in detail...
```

## Validation Rules

* `title`, `description`, `date`, `location`, `category`, and `organizer` are required fields
* `status` must be either `'upcoming'` or `'past'` (defaults to `'past'`)
* `date` and `endDate` must be valid Date objects or ISO 8601 strings
* If `registration.required` is `true`, it's recommended to provide a `registration.url`
* Panelist names are required if the panelists array is provided

## Status Management

The `status` field helps distinguish between:

* **upcoming**: Events that haven't occurred yet
* **past**: Events that have already taken place

This allows the platform to filter and display events appropriately in calendars and event listings.
