from jsonobject import JsonObject, StringProperty, DateProperty, ListProperty, DateTimeProperty, BooleanProperty


class Vulnerability(JsonObject):
    check_name = StringProperty()
    description = StringProperty()
    recommendation = StringProperty()
    proof = StringProperty()
    severity = StringProperty()
    app_key = StringProperty()
    app_name = StringProperty()
    date = DateProperty()


class VulnReport(JsonObject):
    vulns = ListProperty(Vulnerability)
    scanner = StringProperty()
    started_at = DateTimeProperty()
    ended_at = DateTimeProperty()
    scanned = ListProperty(StringProperty)
    errors = BooleanProperty()


class AppFailureReport(JsonObject):
    app_key = StringProperty()
    app_name = StringProperty()
    descriptor_url = StringProperty()
    date = DateProperty()
