{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/soiloptix/json-schema/soiloptix-customer-schema.json",
  "title": "Customer",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/soiloptix-my-account-api-openapi.yml#/components/schemas/Customer",
  "properties": {
    "FirstName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Firstname"
    },
    "LastName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lastname"
    },
    "Id": {
      "type": "integer",
      "title": "Id"
    },
    "Email": {
      "anyOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "null"
        }
      ],
      "title": "Email"
    },
    "Businesses": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/CustomerBusinessRelationship"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Businesses"
    },
    "Contracts": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Contract"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Contracts"
    },
    "Invites": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Invite"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Invites"
    }
  },
  "type": "object",
  "required": [
    "Id"
  ],
  "$defs": {
    "BusinessPublic": {
      "properties": {
        "Name": {
          "type": "string",
          "title": "Name"
        },
        "ContactName": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Contactname"
        },
        "ContactEmail": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Contactemail"
        },
        "Phone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone"
        },
        "Address": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Address"
        },
        "City": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "PostalCode": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Postalcode"
        },
        "ProvinceState": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Provincestate"
        },
        "CountryId": {
          "type": "integer",
          "title": "Countryid"
        },
        "BusinessTypeId": {
          "type": "integer",
          "title": "Businesstypeid",
          "default": 1
        },
        "Id": {
          "type": "integer",
          "title": "Id"
        }
      },
      "type": "object",
      "required": [
        "Name",
        "CountryId",
        "Id"
      ],
      "title": "BusinessPublic"
    },
    "Contract": {
      "properties": {
        "Id": {
          "type": "integer",
          "title": "Id"
        },
        "Name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        }
      },
      "type": "object",
      "required": [
        "Id"
      ],
      "title": "Contract"
    },
    "CustomerBusinessRelationship": {
      "properties": {
        "Id": {
          "type": "integer",
          "title": "Id"
        },
        "Name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "Email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "BusinessTypeId": {
          "type": "integer",
          "title": "Businesstypeid",
          "default": 1
        },
        "IsAdmin": {
          "type": "boolean",
          "title": "Isadmin",
          "default": false
        },
        "IsSubscribed": {
          "type": "boolean",
          "title": "Issubscribed",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "Id"
      ],
      "title": "CustomerBusinessRelationship"
    },
    "Invite": {
      "properties": {
        "Id": {
          "type": "integer",
          "title": "Id"
        },
        "Email": {
          "anyOf": [
            {
              "type": "string",
              "format": "email"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "InvitedAsAdmin": {
          "type": "boolean",
          "title": "Invitedasadmin"
        },
        "Business": {
          "$ref": "#/$defs/BusinessPublic"
        }
      },
      "type": "object",
      "required": [
        "Id",
        "InvitedAsAdmin"
      ],
      "title": "Invite"
    }
  }
}