> ## 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.

# Content Schemas

> Detailed schema specifications for all content collections using Zod validation

All content collections in Dzaleka Online Services use [Zod](https://zod.dev/) schemas for type-safe validation and TypeScript support. These schemas are defined in `src/content.config.ts`.

## Understanding Schemas

Each content collection has a schema that defines:

* **Required fields** - Must be present in every entry
* **Optional fields** - Can be omitted (marked with `.optional()`)
* **Field types** - String, number, date, boolean, array, object
* **Enums** - Specific allowed values
* **Validation rules** - Format requirements and transformations

## Services Schema

<ParamField path="title" type="string" required>
  Service or business name
</ParamField>

<ParamField path="description" type="string" required>
  Brief description of the service
</ParamField>

<ParamField path="category" type="string" required>
  Service category (e.g., "Entrepreneurship & Business", "Education", "Healthcare")
</ParamField>

<ParamField path="featured" type="boolean">
  Whether to feature on homepage
</ParamField>

<ParamField path="verified" type="boolean">
  Verification status by platform administrators
</ParamField>

<ParamField path="logo" type="string">
  URL or path to service logo
</ParamField>

<ParamField path="image" type="string">
  Main service image
</ParamField>

<ParamField path="contact" type="object">
  Contact information

  <Expandable title="properties">
    <ParamField path="email" type="string">
      Contact email address
    </ParamField>

    <ParamField path="phone" type="string">
      Phone number
    </ParamField>

    <ParamField path="whatsapp" type="string">
      WhatsApp number
    </ParamField>

    <ParamField path="hours" type="string">
      Operating hours description
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="location" type="object">
  Physical location details

  <Expandable title="properties">
    <ParamField path="address" type="string" required>
      Street address
    </ParamField>

    <ParamField path="city" type="string" required>
      City/area
    </ParamField>

    <ParamField path="coordinates" type="object">
      GPS coordinates

      <Expandable title="properties">
        <ParamField path="lat" type="number" required>
          Latitude
        </ParamField>

        <ParamField path="lng" type="number" required>
          Longitude
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="socialMedia" type="object">
  Social media links

  <Expandable title="properties">
    <ParamField path="website" type="string">
      Official website URL
    </ParamField>

    <ParamField path="facebook" type="string">
      Facebook page URL
    </ParamField>

    <ParamField path="instagram" type="string">
      Instagram profile URL
    </ParamField>

    <ParamField path="twitter" type="string">
      Twitter/X profile URL
    </ParamField>

    <ParamField path="linkedin" type="string">
      LinkedIn page URL
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="tags" type="array">
  Array of string tags for categorization
</ParamField>

<ParamField path="businessHours" type="array">
  Structured business hours

  <Expandable title="array item properties">
    <ParamField path="day" type="string" required>
      Day of week
    </ParamField>

    <ParamField path="open" type="string" required>
      Opening time (e.g., "09:00")
    </ParamField>

    <ParamField path="close" type="string" required>
      Closing time (e.g., "17:00")
    </ParamField>

    <ParamField path="closed" type="boolean">
      Whether closed on this day
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="status" type="enum" default="active">
  Current status

  <Expandable title="allowed values">
    * `active` - Currently operating
    * `inactive` - Temporarily or permanently closed
  </Expandable>
</ParamField>

<ParamField path="lastUpdated" type="date">
  Last update timestamp
</ParamField>

***

## Events Schema

<ParamField path="title" type="string" required>
  Event name
</ParamField>

<ParamField path="description" type="string" required>
  Event description
</ParamField>

<ParamField path="date" type="date" required>
  Event start date and time (ISO 8601 format)
</ParamField>

<ParamField path="endDate" type="date">
  Event end date and time for multi-day events
</ParamField>

<ParamField path="location" type="string" required>
  Event venue or location description
</ParamField>

<ParamField path="category" type="string" required>
  Event category (e.g., "Festival", "Workshop", "Conference")
</ParamField>

<ParamField path="organizer" type="string" required>
  Organizing person or entity
</ParamField>

<ParamField path="status" type="enum" default="past">
  Event status

  <Expandable title="allowed values">
    * `upcoming` - Future event
    * `past` - Already occurred
  </Expandable>
</ParamField>

<ParamField path="featured" type="boolean">
  Highlight on homepage
</ParamField>

<ParamField path="image" type="string">
  Event poster or main image
</ParamField>

<ParamField path="contact" type="object">
  Organizer contact information

  <Expandable title="properties">
    <ParamField path="email" type="string" />

    <ParamField path="phone" type="string" />

    <ParamField path="whatsapp" type="string" />
  </Expandable>
</ParamField>

<ParamField path="registration" type="object">
  Registration details

  <Expandable title="properties">
    <ParamField path="required" type="boolean" required>
      Whether registration is required
    </ParamField>

    <ParamField path="url" type="string">
      Registration link
    </ParamField>

    <ParamField path="deadline" type="date">
      Registration deadline
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="panelists" type="array">
  Event speakers/panelists

  <Expandable title="array item properties">
    <ParamField path="name" type="string" required>
      Panelist name
    </ParamField>

    <ParamField path="role" type="string">
      Title or role
    </ParamField>

    <ParamField path="bio" type="string">
      Biography
    </ParamField>

    <ParamField path="image" type="string">
      Profile photo
    </ParamField>

    <ParamField path="organization" type="string">
      Affiliated organization
    </ParamField>

    <ParamField path="socialMedia" type="object">
      Social media links (twitter, instagram, linkedin, website)
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="tags" type="array">
  Array of string tags
</ParamField>

***

## Jobs Schema

<ParamField path="title" type="string" required>
  Job title
</ParamField>

<ParamField path="organization" type="string" required>
  Hiring organization
</ParamField>

<ParamField path="location" type="string" required>
  Job location
</ParamField>

<ParamField path="type" type="enum" required>
  Employment type

  <Expandable title="allowed values">
    * `full-time`
    * `part-time`
    * `contract`
    * `volunteer`
    * `internship`
  </Expandable>
</ParamField>

<ParamField path="category" type="enum" required>
  Job category

  <Expandable title="allowed values">
    * `education`
    * `healthcare`
    * `technology`
    * `community`
    * `business`
    * `arts`
    * `services`
    * `other`
  </Expandable>
</ParamField>

<ParamField path="salary" type="string">
  Salary information or range
</ParamField>

<ParamField path="deadline" type="date" required>
  Application deadline (automatically coerced from string)
</ParamField>

<ParamField path="posted" type="date" required>
  Date posted (automatically coerced from string)
</ParamField>

<ParamField path="status" type="enum" default="open">
  Job status

  <Expandable title="allowed values">
    * `open` - Accepting applications
    * `closed` - No longer accepting
    * `draft` - Not yet published
  </Expandable>
</ParamField>

<ParamField path="featured" type="boolean" default="false">
  Feature on jobs page
</ParamField>

<ParamField path="skills" type="array" required>
  Required skills (array of strings)
</ParamField>

<ParamField path="contact" type="object" required>
  Application contact information

  <Expandable title="properties">
    <ParamField path="email" type="string" required>
      Contact email (validated as email format)
    </ParamField>

    <ParamField path="phone" type="string">
      Contact phone
    </ParamField>

    <ParamField path="website" type="string">
      Application website (validated as URL)
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="description" type="string" required>
  Full job description (markdown content)
</ParamField>

***

## Photos Schema

<ParamField path="title" type="string" required>
  Photo title or story headline
</ParamField>

<ParamField path="description" type="string" required>
  Photo description or story
</ParamField>

<ParamField path="date" type="date" required>
  Date taken (accepts string, number, or Date - automatically transformed)
</ParamField>

<ParamField path="image" type="string" required>
  Image URL or path (must start with '/images/' or be a valid URL)
</ParamField>

<ParamField path="photographer" type="object" required>
  Photographer information

  <Expandable title="properties">
    <ParamField path="name" type="string" required>
      Photographer name
    </ParamField>

    <ParamField path="bio" type="string">
      Biography
    </ParamField>

    <ParamField path="instagram" type="string">
      Instagram username (without @)
    </ParamField>

    <ParamField path="website" type="string">
      Website URL (validated)
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="contributor" type="string">
  Content contributor identifier
</ParamField>

<ParamField path="tags" type="array">
  Photo tags (array of strings)
</ParamField>

<ParamField path="featured" type="boolean">
  Feature in galleries
</ParamField>

<ParamField path="location" type="string">
  Photo location
</ParamField>

<ParamField path="gallery" type="array">
  Additional gallery images (array of string URLs/paths)
</ParamField>

***

## Stores Schema

<ParamField path="name" type="string" required>
  Store name
</ParamField>

<ParamField path="description" type="string" required>
  Store description
</ParamField>

<ParamField path="type" type="enum" required>
  Store type

  <Expandable title="allowed values">
    * `restaurant`
    * `cafe`
    * `bakery`
    * `grocery`
    * `retail`
    * `salon`
    * `workshop`
    * `other`
  </Expandable>
</ParamField>

<ParamField path="logo" type="string">
  Store logo URL/path
</ParamField>

<ParamField path="coverImage" type="string">
  Cover/banner image
</ParamField>

<ParamField path="owner" type="object" required>
  Owner information

  <Expandable title="properties">
    <ParamField path="name" type="string" required>
      Owner name
    </ParamField>

    <ParamField path="phone" type="string" required>
      Contact phone
    </ParamField>

    <ParamField path="email" type="string">
      Contact email
    </ParamField>

    <ParamField path="whatsapp" type="string">
      WhatsApp number
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="location" type="object" required>
  Store location

  <Expandable title="properties">
    <ParamField path="address" type="string" required>
      Physical address
    </ParamField>

    <ParamField path="zone" type="string">
      Camp zone/area
    </ParamField>

    <ParamField path="landmark" type="string">
      Nearby landmark
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="menu" type="array">
  Menu items (for food establishments)

  <Expandable title="array item properties">
    <ParamField path="category" type="string" required>
      Menu category (e.g., "Main Dishes", "Beverages")
    </ParamField>

    <ParamField path="items" type="array" required>
      Items in this category

      <Expandable title="item properties">
        <ParamField path="name" type="string" required>
          Item name
        </ParamField>

        <ParamField path="description" type="string">
          Item description
        </ParamField>

        <ParamField path="price" type="string" required>
          Price (as string, e.g., "2,500")
        </ParamField>

        <ParamField path="image" type="string">
          Item image
        </ParamField>

        <ParamField path="popular" type="boolean">
          Mark as popular item
        </ParamField>

        <ParamField path="available" type="boolean" default="true">
          Item availability
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="services" type="array">
  Services offered (for service-based stores)

  <Expandable title="array item properties">
    <ParamField path="name" type="string" required>
      Service name
    </ParamField>

    <ParamField path="description" type="string">
      Service description
    </ParamField>

    <ParamField path="price" type="string" required>
      Service price
    </ParamField>

    <ParamField path="duration" type="string">
      Service duration
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="paymentMethods" type="array">
  Accepted payment methods (array of strings)
</ParamField>

<ParamField path="deliveryOptions" type="array">
  Delivery options (array of strings)
</ParamField>

<ParamField path="status" type="enum" default="pending">
  Store status

  <Expandable title="allowed values">
    * `active`
    * `pending`
    * `inactive`
  </Expandable>
</ParamField>

<ParamField path="dateJoined" type="date" required>
  Date joined platform (coerced from string)
</ParamField>

***

## Marketplace Schema

<ParamField path="title" type="string" required>
  Listing title
</ParamField>

<ParamField path="description" type="string" required>
  Item/service description
</ParamField>

<ParamField path="type" type="enum" required>
  Listing type

  <Expandable title="allowed values">
    * `product`
    * `service`
  </Expandable>
</ParamField>

<ParamField path="category" type="string" required>
  Product/service category
</ParamField>

<ParamField path="price" type="string">
  Price amount
</ParamField>

<ParamField path="priceType" type="enum" default="contact">
  Price type

  <Expandable title="allowed values">
    * `fixed`
    * `negotiable`
    * `free`
    * `contact`
  </Expandable>
</ParamField>

<ParamField path="images" type="array">
  Product images (array of URLs/paths)
</ParamField>

<ParamField path="vendor" type="object" required>
  Vendor information

  <Expandable title="properties">
    <ParamField path="name" type="string" required>
      Vendor name
    </ParamField>

    <ParamField path="phone" type="string">
      Contact phone
    </ParamField>

    <ParamField path="email" type="string">
      Contact email
    </ParamField>

    <ParamField path="whatsapp" type="string">
      WhatsApp number
    </ParamField>

    <ParamField path="location" type="string">
      Vendor location
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="status" type="enum" default="pending">
  Listing status

  <Expandable title="allowed values">
    * `active`
    * `sold`
    * `pending`
    * `inactive`
  </Expandable>
</ParamField>

<ParamField path="condition" type="enum">
  Item condition (for products)

  <Expandable title="allowed values">
    * `new`
    * `used`
    * `refurbished`
  </Expandable>
</ParamField>

<ParamField path="datePosted" type="date" required>
  Posting date (coerced from string)
</ParamField>

<ParamField path="externalLink" type="string">
  External purchase link (validated as URL)
</ParamField>

***

## Resources Schema

<ParamField path="title" type="string" required>
  Resource title
</ParamField>

<ParamField path="description" type="string" required>
  Resource description
</ParamField>

<ParamField path="category" type="string" required>
  Resource category
</ParamField>

<ParamField path="date" type="date" required>
  Publication/creation date
</ParamField>

<ParamField path="author" type="string">
  Resource author or creator
</ParamField>

<ParamField path="thumbnail" type="string">
  Thumbnail image
</ParamField>

<ParamField path="fileType" type="string">
  File type (e.g., "pdf", "doc", "video")
</ParamField>

<ParamField path="fileSize" type="string">
  File size (e.g., "748.24 KB")
</ParamField>

<ParamField path="downloadUrl" type="string">
  Direct download URL
</ParamField>

<ParamField path="resourceUrl" type="string">
  Resource page URL
</ParamField>

<ParamField path="languages" type="array">
  Available languages (array of strings)
</ParamField>

<ParamField path="featured" type="boolean">
  Feature on resources page
</ParamField>

***

## Additional Schemas

<AccordionGroup>
  <Accordion title="Courses Schema">
    Key fields: title, author, category (enum), duration, level (beginner/intermediate/advanced), videoUrl, externalLink, status
  </Accordion>

  <Accordion title="Profiles Schema">
    Key fields: name, skill, status, location, category, level, chargeType (free/paid), rate, paymentMethods array, shortDescription
  </Accordion>

  <Accordion title="Artists Schema">
    Key fields: artistName, medium, nationality, bio, artisticJourney, specialties array, achievements array, notableWorks array
  </Accordion>

  <Accordion title="Dancers Schema">
    Key fields: type (individual/group), danceStyles array, festivals array, members array (for groups)
  </Accordion>

  <Accordion title="Inspirational Stories Schema">
    Key fields: title, name, age, country, personImage, content, contact object with social media
  </Accordion>

  <Accordion title="News Schema">
    Category enum: business-spotlight, announcement, success-story, business-guide, news, education

    Additional fields: businessName, businessOwner, contactInfo
  </Accordion>

  <Accordion title="Rights Schema">
    Category enum: legislation, analysis, guide, resource

    Fields: source, related array
  </Accordion>
</AccordionGroup>

## Type Transformations

### Date Handling

Most date fields use `z.date()` or `z.coerce.date()` which:

* Accepts ISO 8601 date strings (e.g., `2025-10-30T09:00:00Z`)
* Accepts date-only formats (e.g., `2023-05-01`)
* Automatically converts to JavaScript Date objects

<CodeGroup>
  ```yaml ISO 8601 theme={null}
  date: 2025-10-30T09:00:00Z
  ```

  ```yaml Date only theme={null}
  date: 2023-05-01
  ```
</CodeGroup>

### Special Validations

<Warning>
  The photos collection has special image path validation:

  * Must start with `/images/` for local images, OR
  * Must be a valid URL for external images
</Warning>

## Working with Schemas

### TypeScript Support

Schemas automatically generate TypeScript types:

```typescript theme={null}
import { getCollection } from 'astro:content';

// Fully typed!
const services = await getCollection('services');
services[0].data.title; // string
services[0].data.featured; // boolean | undefined
```

### Validation Errors

Zod will throw detailed errors for invalid data:

```
ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": ["title"],
    "message": "Required"
  }
]
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Collections Overview" icon="folder" href="/collections">
    Learn about each collection's purpose
  </Card>

  <Card title="Contribution Guidelines" icon="pen" href="/guidelines">
    How to create properly formatted content
  </Card>
</CardGroup>
