# Coursings

Multi-course meal sequencing

## GET /api/v1/coursings

List coursings

List coursings with optional filtering

**Permissions:** 🔵 `coursings.read`

Query parameters:
- `locationId` (number, optional) — Filter by location ID
- `page` (number, optional) — Page number
- `limit` (number, optional) — Items per page

Response 200 — Default Response

```ts
{
  status: "success"
  data: {
    coursings: Array<{
        id: string
        locationId: number
        title: string
        order: number
        color: string | null
        isInherited?: boolean
        sourceLocationId?: number
        inheritToChildren?: boolean
        createdAt: string // date-time
        updatedAt: string // date-time
      }>
    pagination: {
      page: number
      limit: number
      total: number
      totalPages: number
    }
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## POST /api/v1/coursings

Create coursing

Create a new coursing

**Permissions:** 🟢 `coursings.create`

Request body:

```ts
{
  locationId: number
  title: string
  order: number
  color?: string | null
}
```

Response 201 — Default Response

```ts
{
  status: "success"
  data: {
    id: string
    locationId: number
    title: string
    order: number
    color: string | null
    isInherited?: boolean
    sourceLocationId?: number
    inheritToChildren?: boolean
    createdAt: string // date-time
    updatedAt: string // date-time
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## GET /api/v1/coursings/{id}

Get coursing

Get a single coursing by ID

**Permissions:** 🔵 `coursings.read`

Path parameters:
- `id` (string, required) — Coursing ID (UUID)

Response 200 — Default Response

```ts
{
  status: "success"
  data: {
    id: string
    locationId: number
    title: string
    order: number
    color: string | null
    isInherited?: boolean
    sourceLocationId?: number
    inheritToChildren?: boolean
    createdAt: string // date-time
    updatedAt: string // date-time
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## PUT /api/v1/coursings/{id}

Update coursing

Update an existing coursing

**Permissions:** 🟠 `coursings.update`

Path parameters:
- `id` (string, required) — Coursing ID (UUID)

Request body:

```ts
{
  title?: string
  order?: number
  color?: string | null
}
```

Response 200 — Default Response

```ts
{
  status: "success"
  data: {
    id: string
    locationId: number
    title: string
    order: number
    color: string | null
    isInherited?: boolean
    sourceLocationId?: number
    inheritToChildren?: boolean
    createdAt: string // date-time
    updatedAt: string // date-time
  }
  meta: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```

## DELETE /api/v1/coursings/{id}

Delete coursing

Delete a coursing

**Permissions:** 🔴 `coursings.delete`

Path parameters:
- `id` (string, required) — Coursing ID (UUID)

Response 200 — Coursing successfully deleted

```ts
{
  status?: "success"
  data?: {
    deleted?: boolean
  }
  meta?: {
    requestId: string
    timestamp: string // date-time
    executionTimeMs: number
  }
}
```
