"""
    schema: Observation Message sent by platforms when points of
    interest are found.
"""
from formats import abstract_schema

hits_schema = {
    "type": "object",
    "properties": {
        "latitude": {
            "type": "number",
            "format": "float",
            "description": "Identified x-coordinate of point of interest",
            "example": 178.2,
        },
        "longitude": {
            "type": "number",
            "format": "float",
            "description": "Identified y-coordinate of point of interest",
            "example": -10.122,
        },
        "quality_of_point": {
            "type": "number",
            "format": "float",
            "description": "Quality/strength of points from features of"
            + " interest identified by platform.",  # TODO: DEFINE FORMAT.
            "example": 0.98,
        },
    },
    "required": ["latitude", "longitude"],
}

observation_schema = {
    "type": "object",
    "properties": {
        "payload": {
            "type": "object",
            "properties": {
                "platform_ID": {
                    "type": "integer",
                    "description": "ID of platform to sending observations",
                    "example": 2,
                },
                "points_of_interest": {
                    "type": "array",
                    "items": hits_schema,
                    "description": "Points from features of interest identified by"
                    + " platform if any found.",  # TODO: DEFINE FORMAT.
                },
                "region_surveyed": {
                    # "type": "null",
                    "nullable": True,
                    "description": "Region surveyed by given platform."
                    + " GEOJSON",  # TODO: DEFINE FORMAT.
                    "example": "",
                },
                "additional_data": {
                    "description": "Placeholder field for any additional data",
                    "example": {"sensor_payload": False},
                },
            },
        },
    },
    "required": ["platform_ID"],
}

full_observation_schema = abstract_schema
full_observation_schema["properties"]["payload"] = observation_schema