{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://openwebcomics.comicopia.app/schema/comic-group.schema.json",
  "title": "ComicGroup",
  "description": "A named group of pages within a comic (chapter, act, arc, etc.).",
  "type": "object",
  "required": ["id", "comic_id", "group_id", "order_index", "page_count"],
  "properties": {
    "id": {
      "type": "integer",
      "description": "Auto-incrementing database ID.",
      "example": 1
    },
    "comic_id": {
      "type": "string",
      "description": "ID of the parent comic.",
      "example": "drivecomic"
    },
    "group_id": {
      "type": "string",
      "description": "Unique identifier for this group within its comic.",
      "example": "act-1"
    },
    "name": {
      "type": ["string", "null"],
      "description": "Human-readable name for the group.",
      "example": "Act 1"
    },
    "order_index": {
      "type": "integer",
      "description": "Sort order among groups in the same comic.",
      "example": 1
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp when this group was created."
    },
    "page_count": {
      "type": "integer",
      "description": "Number of pages assigned to this group.",
      "example": 180
    },
    "first_page": {
      "type": ["integer", "null"],
      "description": "Page number of the first page in this group.",
      "example": 1
    },
    "last_page": {
      "type": ["integer", "null"],
      "description": "Page number of the last page in this group.",
      "example": 180
    }
  },
  "additionalProperties": false
}
