{
    "type": "object",
    "properties": {
        "timestamp": {
            "description": "Date and time of the input (ISO 8601 format)",
            "title": "Date and time of the input",
            "type": "string"
        },
        "tracker": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "Unique Identifer of the tracker",
                    "title": "Tracker ID",
                    "type": "string"
                },
                "label": {
                    "default": "",
                    "description": "Label of the tracker as entered on the platform",
                    "title": "Tracker Label",
                    "type": "string"
                },
                "slug": {
                    "default": "",
                    "description": "The tracker slug is the Serial Number of the device for IoT and Ubiqod Key",
                    "title": "Tracker Slug",
                    "type": "string"
                },
                "type": {
                    "default": "",
                    "description": "Tracker type: QOD, IOT or UBIQOD KEY",
                    "enum": [
                        "QOD",
                        "IOT",
                        "UBIQODKEY"
                    ],
                    "title": "Tracker Type",
                    "type": "string"
                },
                "model": {
                    "default": "",
                    "description": "Tracker Model for IoT",
                    "enum": [
                        "SMILIO_A",
                        "SMILIO_S",
                        "SMILIO_E",
                        "CLOCK_ST",
                        "CLOCK_R",
                        "CLOCK_S"
                    ],
                    "title": "Tracker Model",
                    "type": "string"
                }
            }
        },
        "site": {
            "default": null,
            "type":"object",
            "properties": {
                "id": {
                    "default": "",
                    "description": "Unique Identifier of the Site in the platform",
                    "title": "Site ID",
                    "type": "string"
                },
                "label": {
                    "default": "",
                    "description": "Label of the tracker as entered in the platform",
                    "title": "Site Label",
                    "type": "string"
                },
                "location": {
                    "default": "",
                    "description": "GPS coordinates of the site",
                    "title": "Site Location",
                    "anyOf": [
                        {"type":"string"},
                        {"type":"null"}
                    ]
                },
                "contacts": {
                    "default": [],
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "email": {
                                "default": "",
                                "title": "Contact Email",
                                "type": "string"
                            },
                            "phone": {
                                "default": "",
                                "title": "Contact Phone",
                                "type": "string"
                            },
                            "fullName": {
                                "default": "",
                                "title": "Contact Name",
                                "type": "string"
                            },
                            "type": {
                                "default": "",
                                "enum": [
                                    "CUSTOMER",
                                    "MANAGER"
                                ],
                                "title": "Contact Type",
                                "type": "string"
                            }
                        },
                        "additionalProperties": true
                    }
                },
                "externalReferences": {
                    "default": {},
                    "title": "Site: External References",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string",
                        "minLength": 1
                    }
                }
            },
            "additionalProperties": true
        },
        "location": {
            "default": "",
            "description": "For tracker type 'IOT', returns the GPS coordinates of the associated site. For tracker types 'QOD' and 'UBIQODKEY', returns the GPS coordinates of the user if applicable, or empty string if not",
            "title": "User Location",
            "type": "string"
        },
        "data": {
            "default": {},
            "type": "object",
            "properties": {
                "interfaceType": {
                    "default": "",
                    "description": "Type of interface linked to the tracker. Note: Trackers with type 'IOT' can send data without being linked to an interface, if they do then this value becomes null.",
                    "enum": [
                        null,
                        "BUTTON_SINGLE",
                        "BUTTON_MULTIPLE",
                        "DIGIT",
                        "FEEDBACK",
                        "SMILIO_A",
                        "SMILIO_S",
                        "SMILIO_E",
                        "CLOCK_ST",
                        "CLOCK_R",
                        "CLOCK_S"
                    ],
                    "title": "Interface Type",
                    "anyOf": [
                        {"type":"string"},
                        {"type":"null"}
                    ]
                },
                "reference": {
                    "default": "",
                    "description": "Reference of the input given by the user. If interface type is 'FEEDBACK', this value is undefined.",
                    "title": "Input Reference",
                    "type": "string"
                },
                "label": {
                    "default": "",
                    "description": "Label of the input corresponding to the reference. Can be an empty string if there is no correpondance. If interface type is 'FEEDBACK', this value is undefined.",
                    "title": "Input Label",
                    "type": "string"
                },
                "pressCount": {
                    "default": 1,
                    "description": "Number of button presses registered. If tracker type is not 'IOT', this value is undefined.",
                    "title": "IoT Press count",
                    "type": "integer"
                },
                "rate": {
                    "default": 1,
                    "description": "Rate of the feedback received. If interface type is not 'FEEDBACK', this value is undefined.",
                    "minimum": 1,
                    "maximum": 5,
                    "title": "Feedback Rate",
                    "type": "integer"
                },
                "message": {
                    "default": "",
                    "description": "Message sent in the user feedback. Can be an empty string. If interface type is not 'FEEDBACK', this value is undefined.",
                    "title": "Feedback Message",
                    "type": "string"
                },
                "email": {
                    "default": "",
                    "description": "Email given in the user feedback. Can be an empty string. If interface type is not 'FEEDBACK', this value is undefined.",
                    "title": "Feedback Email",
                    "type": "string"
                },
                "code": {
                    "default": null,
                    "type":"object",
                    "properties": {
                        "reference": {
                            "default": "",
                            "description": "Code as entered by the user or as read from the badge. It can be in numeric form with or without '0' paddings, or in hexadecimal form.",
                            "title": "Code Reference",
                            "type": "string"
                        },
                        "label": {
                            "$id": "#/properties/data/properties/code/properties/label",
                            "default": "",
                            "description": "Label of the Code corresponding to the reference. Copy of 'reference' if not found.",
                            "title": "Code Label",
                            "type": "string"
                        },
                        "externalReferences": {
                            "default": {},
                            "description": "An object containing all external references for the entered code. All values contained in this object will be of type string.",
                            "title": "Code: External References",
                            "type": "object",
                            "required": [],
                            "additionalProperties": {
                                "type": "string",
                                "minLength": 1
                            }
                        }
                    },
                    "additionalProperties": true
                },
                "photo": {
                    "default": null,
                    "description": "A JPEG photo taken by the user, encoded in Base64. The value is null for trackers of type 'IOT' or if the photo option is not enabled in the tracker's interface.",
                    "title": "User photo",
                    "anyOf": [
                        {"type":"string"},
                        {"type":"null"}
                    ]
                }
            },
            "additionalProperties": true
        },
        "ubiqodValidity": {
            "default": {},
            "type": "object",
            "properties": {
                "onSite": {
                    "default": false,
                    "description": "True if the user position is at the expected location (in the geofencing range of the site, or on an IOT device).",
                    "title": "Is on site",
                    "type": "boolean"
                },
                "badgeSwiped": {
                    "default": false,
                    "description": "Used for tracker of type 'IOT'. True if a badge was swiped or detected.",
                    "title": "Has swiped badge",
                    "type": "boolean"
                },
                "codeValid": {
                    "default": false,
                    "description": "True if the code entered by the user has a corresponding entry in it's code list.",
                    "title": "Has a valid code",
                    "type": "boolean"
                },
                "codeFromCookie": {
                    "default": false,
                    "description": "True if the code entered by the user was fetched from a cookie and not entered manually.",
                    "title": "Code from cookies",
                    "type": "boolean"
                },
                "scanToken": {
                    "default": false,
                    "description": "For trackers of type 'UBIQODKEY'. True if the Ubiqod Key scan token is valid.",
                    "title": "Has valid token",
                    "type": "boolean"
                },
                "withPhoto": {
                    "default": false,
                    "description": "For trackers of type 'QOD' or 'UBIQODKEY'. True if the user sent a photo.",
                    "title": "Has a photo attached",
                    "type": "boolean"
                }
            },
            "additionalProperties": true
        }
    },
    "additionalProperties": true
}