{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bronjoy-com/json-schema/bronjoy-com-appointment-resource-schema.json",
  "title": "AppointmentResource",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/bronjoy-com-api-spec-openapi.json#/components/schemas/AppointmentResource",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "startDate": {
      "type": [
        "string",
        "null"
      ]
    },
    "endDate": {
      "type": [
        "string",
        "null"
      ]
    },
    "start_time": {
      "type": [
        "string",
        "null"
      ]
    },
    "end_time": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string"
    },
    "payment_status": {
      "type": "string"
    },
    "price_snapshot": {
      "type": [
        "string",
        "null"
      ]
    },
    "currency": {
      "type": "string"
    },
    "cancellation_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "payment_expires_at": {
      "type": "string"
    },
    "color": {
      "type": "string",
      "enum": [
        "green",
        "yellow",
        "red",
        "blue",
        "orange",
        "gray"
      ]
    },
    "user": {
      "type": "object",
      "description": "Client info (for org dashboard)",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "enum": [
                "Unknown Client"
              ]
            }
          ]
        },
        "picturePath": {
          "type": "null"
        }
      },
      "required": [
        "id",
        "name",
        "picturePath"
      ]
    },
    "client": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "email",
        "phone"
      ]
    },
    "service": {
      "type": "object",
      "description": "Service info",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "duration": {
          "type": "integer"
        },
        "price": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "duration",
        "price",
        "currency"
      ]
    },
    "staff": {
      "type": [
        "object",
        "null"
      ],
      "description": "Staff info",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ]
    },
    "branch": {
      "type": [
        "object",
        "null"
      ],
      "description": "Branch info",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "latitude": {
          "type": [
            "string",
            "null"
          ]
        },
        "longitude": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "address",
        "city",
        "phone",
        "latitude",
        "longitude"
      ]
    },
    "organization": {
      "type": "object",
      "description": "Organization info (for client dashboard)",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": "string"
        },
        "logo": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO-3166 alpha-2 country code, e.g. \"UZ\""
        },
        "canonical_path": {
          "type": "string",
          "description": "The venue's canonical path, WITHOUT a locale prefix —\n`/tashkent/barber/britva` (ODI-182). Appointments are the one surface that links back to a\nvenue while holding nothing but a slug, and the flat\n`/{slug}` form 404s now. Rather than shipping the city\nand category separately and re-deriving the path in three\nclient components, the backend hands over the finished\npath it already computes for the venue page itself."
        }
      },
      "required": [
        "id",
        "name",
        "slug",
        "logo",
        "country",
        "canonical_path"
      ]
    },
    "review": {
      "type": [
        "object",
        "null"
      ],
      "description": "Review info (for client history)",
      "properties": {
        "id": {
          "type": "integer"
        },
        "rating": {
          "type": "integer"
        },
        "comment": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "rating",
        "comment"
      ]
    },
    "has_review": {
      "type": "boolean"
    },
    "can_cancel": {
      "type": "boolean"
    },
    "can_reschedule": {
      "type": "boolean"
    },
    "can_review": {
      "type": "boolean"
    },
    "cancellation_deadline": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 deadline for cancellation"
    },
    "reschedule_deadline": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 deadline for rescheduling"
    },
    "cancellation_policy": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "cancellation_min_hours": {
          "type": "integer"
        },
        "reschedule_min_hours": {
          "type": "integer"
        }
      },
      "required": [
        "cancellation_min_hours",
        "reschedule_min_hours"
      ]
    },
    "client_id": {
      "type": "integer",
      "description": "Legacy fields"
    },
    "service_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "staff_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "startDate",
    "endDate",
    "start_time",
    "end_time",
    "title",
    "description",
    "notes",
    "status",
    "payment_status",
    "price_snapshot",
    "currency",
    "cancellation_reason",
    "payment_expires_at",
    "color",
    "user",
    "has_review",
    "can_cancel",
    "can_reschedule",
    "can_review",
    "cancellation_deadline",
    "reschedule_deadline",
    "cancellation_policy",
    "client_id",
    "service_id",
    "staff_id",
    "created_at",
    "updated_at"
  ]
}