{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/autonomous-solutions/main/json-schema/autonomous-solutions-user-data-retrieve-schema.json",
  "title": "UserDataRetrieve",
  "x-generated": "2026-09-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/autonomous-solutions-openapi.json#/components/schemas/UserDataRetrieve",
  "properties": {
    "firebase_user_id": {
      "type": "string",
      "title": "Firebase User Id"
    },
    "first_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "First Name"
    },
    "last_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Name"
    },
    "birthday": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Birthday"
    },
    "country": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Country"
    },
    "state": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "State"
    },
    "city": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "City"
    },
    "postal_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Postal Code"
    },
    "street_address_1": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Street Address 1"
    },
    "street_address_2": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Street Address 2"
    },
    "email": {
      "anyOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "string",
          "const": ""
        },
        {
          "type": "null"
        }
      ],
      "title": "Email"
    },
    "phone_num": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Phone Num"
    },
    "image_url": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        {
          "type": "null"
        }
      ],
      "title": "Image Url"
    },
    "selected_hub_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Selected Hub Id"
    },
    "is_migrated": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Migrated",
      "default": false
    },
    "profile_complete": {
      "type": "boolean",
      "title": "Profile Complete",
      "default": false
    },
    "geojson_location": {
      "anyOf": [
        {
          "$ref": "#/$defs/GeoJsonLocation"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "current_order_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Order Id"
    },
    "loyalty_points": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Loyalty Points",
      "default": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "selected_hub": {
      "anyOf": [
        {
          "$ref": "#/$defs/HubUserCurrentResponse"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "firebase_user_id",
    "id",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "GeoJsonLocation": {
      "properties": {
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Type",
          "default": "Point"
        },
        "coordinates": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "title": "Coordinates"
        }
      },
      "type": "object",
      "required": [
        "coordinates"
      ],
      "title": "GeoJsonLocation"
    },
    "HubStatus": {
      "type": "string",
      "enum": [
        "active",
        "maintenance",
        "restocking",
        "hidden"
      ],
      "title": "HubStatus"
    },
    "HubUserCurrentResponse": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "geojson_location": {
          "anyOf": [
            {
              "$ref": "#/$defs/GeoJsonLocation"
            },
            {
              "type": "null"
            }
          ]
        },
        "country": {
          "type": "string",
          "title": "Country"
        },
        "state": {
          "type": "string",
          "title": "State"
        },
        "city": {
          "type": "string",
          "title": "City"
        },
        "postal_code": {
          "type": "string",
          "title": "Postal Code"
        },
        "street_address_1": {
          "type": "string",
          "title": "Street Address 1"
        },
        "street_address_2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Street Address 2"
        },
        "tax_rates": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tax Rates"
        },
        "timezone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timezone"
        },
        "approximate_order_limit": {
          "type": "integer",
          "title": "Approximate Order Limit"
        },
        "approximate_bin_opening_limit": {
          "type": "integer",
          "title": "Approximate Bin Opening Limit"
        },
        "max_cart_items": {
          "type": "integer",
          "title": "Max Cart Items"
        },
        "hub_status": {
          "$ref": "#/$defs/HubStatus"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "country",
        "state",
        "city",
        "postal_code",
        "street_address_1",
        "approximate_order_limit",
        "approximate_bin_opening_limit",
        "max_cart_items",
        "hub_status"
      ],
      "title": "HubUserCurrentResponse"
    }
  }
}