{
    "name": "bbWidget",
    "title": "bbWidget",
    "description": "High level widget configuration",
    "links": [
        {
            "title": "itemDefaults",
            "description": "Default parameters for basket item",
            "schema": {
                "$ref": "#/definitions/itemDefaults"
            }
        },
        {
            "title": "clientDefaults",
            "description": "Default parameters for client making the booking",
            "schema": {
                "$ref": "#/definitions/clientDefaults"
            }
        }
    ],
    "definitions": {
        "itemDefaults": {
            "type": "object",
            "properties": {
                "category": {
                    "type": "number",
                    "description": "The category id to preload the widget with"
                },
                "company": {
                    "type": "number",
                    "description": "The company id to preload the widget with",
                    "example": 37001
                },
                "clinic": {
                    "type": "number",
                    "description": "The clinic id to preload the widget with"
                },
                "duration": {
                    "type": "number",
                    "description": "The duration to preload the widget with",
                    "example": 120
                },
                "purchase_total_long_id": {
                    "type": "string",
                    "description": "The order id to preload the widget with",
                    "example": "Q1c339AdGCxakPkLMzYyODM"
                },
                "resource": {
                    "type": "number",
                    "description": "The resource id to preload the widget with"
                },
                "person": {
                    "type": "number",
                    "description": "The person id to preload the widget with"
                },
                "person_ref": {
                    "type": "string",
                    "description": "The external person reference id to preload the widget with"
                },
                "service": {
                    "type": "number",
                    "description": "The service id to preload the widget with"
                },
                "service_ref": {
                    "type": "string",
                    "description": "The external service reference id to preload the widget with"
                },
                "event_group": {
                    "type": "number",
                    "description": "The event group id to preload the widget with"
                },
                "event": {
                    "type": "number",
                    "description": "The event id to preload the widget with"
                },
                "event_chain": {
                    "type": "number",
                    "description": "The event chain id to preload the widget with"
                },
                "query": {
                    "type": "object",
                    "description": "Used to set item default values using the url parameters. These parameters can be named differently and the key would match to the correct objects",
                    "example": {
                        "company": "storeId",
                        "service": "appointmentTypeId"
                    }
                },
                "merge_resources": {
                    "type": "boolean",
                    "description": "",
                    "example": true
                },
                "merge_people": {
                    "type": "boolean",
                    "description": "",
                    "example": true
                }
            }
        },
        "clientDefaults": {
            "type": "object",
            "properties": {
                "membership_ref": {
                    "type": "string",
                    "description": "The default external client reference id to preload the widget with"
                },
                "name": {
                    "type": "string",
                    "description": "The client first and last name to preload the widget with",
                    "example": "Bob Smith"
                },
                "first_name": {
                    "type": "string",
                    "description": "The client first name to preload the widget with",
                    "example": "Bob"
                },
                "last_name": {
                    "type": "string",
                    "description": "The client last name to preload the widget with",
                    "example": "Smith"
                },
                "phone": {
                    "type": "number",
                    "description": "The client phone number to preload the widget with"
                },
                "mobile": {
                    "type": "number",
                    "description": "The client mobile number to preload the widget with"
                },
                "email": {
                    "type": "string",
                    "description": "The client email address to preload the widget with",
                    "example": "example@email.com"
                },
                "id": {
                    "type": "number",
                    "description": "The client id to preload the widget with"
                },
                "ref": {
                    "type": "string",
                    "description": "The client reference number to preload the widget with"
                },
                "comp_ref": {
                    "type": "string",
                    "description": "The client company reference number to preload the widget with"
                },
                "address1": {
                    "type": "string",
                    "description": "The client's first address line to preload the widget with",
                    "example": "3-7 Herbal Hill"

                },
                "address2": {
                    "type": "string",
                    "description": "The client's second address line to preload the widget with",
                    "example": "Farringdon"
                },
                "address3": {
                    "type": "string",
                    "description": "The client's third address line to preload the widget with",
                    "example": "London"
                },
                "address4": {
                    "type": "string",
                    "description": "The client's fourth address line to preload the widget with"
                },
                "address5": {
                    "type": "string",
                    "description": "The client's fifth address line to preload the widget with"
                },
                "postcode": {
                    "type": "string",
                    "description": "The client's postcode to preload the widget with",
                    "example": "EC1R 5EJ"
                },
                "country": {
                    "type": "string",
                    "description": "The client's country to preload the widget with",
                    "example": "England"
                },
                "answers": {
                    "type": "object",
                    "description": "The client question asnwers to preload the widget with",
                    "example": {
                        "1": "Answer to first question",
                        "2": "Answer to second question"
                    }  
                },
                "time_zone": {
                    "type": "string",
                    "description": "The client's timezone to preload the widget with",
                    "example": "GMT"
                },
                "extra_info": {
                    "type": "string",
                    "description": "Extra information about the client to preload the widget with"
                },
                "query": {
                    "type": "object",
                    "description": "Used to set client default values using the url parameters. These parameters can be named differently and the key would match to the correct objects",
                    "example": {
                        "company": "storeId",
                        "service": "appointmentTypeId"
                    }
                }
            }
        }
    },
    "properties": {
        "bbWidget": {
            "type": "object",
            "description": "High level configuration options for the public widget",
            "properties": {
                "itemDefaults": {
                    "$ref": "#/definitions/itemDefaults"
                },
                "clientDefaults": {
                    "$ref": "#/definitions/clientDefaults"
                }
            }
        }    
    }
}