{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nogpets-com/json-schema/nogpets-com-biz-overview-schema.json",
  "title": "BizOverview",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nogpets-com-openapi.json#/components/schemas/BizOverview",
  "type": "object",
  "required": [
    "business"
  ],
  "properties": {
    "business": {
      "$ref": "#/$defs/BizRef"
    },
    "today": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "bookings": {
          "type": "integer"
        },
        "value": {
          "$ref": "#/$defs/Money"
        }
      }
    },
    "thisWeek": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "bookings": {
          "type": "integer"
        },
        "value": {
          "$ref": "#/$defs/Money"
        },
        "waitingForYou": {
          "type": "integer",
          "description": "Pending: waiting for the business to accept."
        },
        "unpaid": {
          "type": "integer"
        }
      }
    },
    "next": {
      "oneOf": [
        {
          "$ref": "#/$defs/BizBooking"
        },
        {
          "type": "null"
        }
      ]
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paused": {
            "type": "boolean"
          },
          "pausedReason": {
            "type": "string"
          }
        }
      }
    },
    "timeOff": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "timeOffId"
          },
          "who": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      }
    },
    "areas": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "APPROVED, or PENDING review by NogPets."
          }
        }
      }
    },
    "scheduledPriceChanges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      }
    },
    "money": {
      "type": "string"
    },
    "note": {
      "type": "string"
    }
  },
  "$defs": {
    "BizBooking": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "when": {
          "type": "string",
          "description": "Local day and time."
        },
        "start": {
          "type": "string",
          "format": "date-time"
        },
        "end": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "$ref": "#/$defs/BookingStatus"
        },
        "category": {
          "type": "string"
        },
        "resourceId": {
          "type": "string"
        },
        "resource": {
          "type": "string"
        },
        "client": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "clientId for get_client."
            },
            "name": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            }
          }
        },
        "what": {
          "type": "string",
          "description": "Pets and services."
        },
        "address": {
          "type": "string"
        },
        "mapUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "The address on Google Maps."
        },
        "notes": {
          "type": "string"
        },
        "paymentMethod": {
          "type": "string"
        },
        "paymentStatus": {
          "$ref": "#/$defs/PaymentStatus"
        },
        "total": {
          "type": "string"
        },
        "totalCents": {
          "type": "integer"
        },
        "unpaid": {
          "type": "boolean"
        },
        "source": {
          "type": "string"
        }
      }
    },
    "BizRef": {
      "type": "object",
      "properties": {
        "bizId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "description": "owner, manager or crew (staff)."
        },
        "country": {
          "type": "string"
        },
        "countryName": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "canTakeBookings": {
          "type": "boolean",
          "description": "False outside South Africa for now: bookings there aren't taken through NogPets."
        }
      }
    },
    "BookingStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "ACCEPTED",
        "REJECTED",
        "CANCELLED",
        "COMPLETED"
      ]
    },
    "Money": {
      "type": "object",
      "properties": {
        "cents": {
          "type": "integer",
          "description": "Minor units of the business's currency."
        },
        "text": {
          "type": "string",
          "description": "Formatted, e.g. R650 or US$85."
        }
      }
    },
    "PaymentStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "PAID",
        "CASH_DUE",
        "CASH_RECEIVED",
        "REFUND_REQUESTED",
        "REFUNDED",
        "FAILED"
      ]
    }
  }
}