{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnautical-com/json-schema/arcnautical-com-crew-check-schema.json",
  "title": "CrewCheck",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnautical-com-openapi.json#/components/schemas/CrewCheck",
  "type": "object",
  "required": [
    "id",
    "imo",
    "outcome",
    "label",
    "headline",
    "created_at",
    "record"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "imo": {
      "type": "string"
    },
    "vessel_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "crew_ship_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "outcome": {
      "type": "string",
      "enum": [
        "BLACKLISTED",
        "RESTRICTED",
        "INCOMPLETE",
        "CHECK",
        "NO_LISTING_FOUND"
      ]
    },
    "label": {
      "type": "string"
    },
    "headline": {
      "type": "string",
      "description": "The answer in one sentence, citing the order clause behind it."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_via": {
      "type": "string",
      "enum": [
        "app",
        "api",
        "monitor"
      ]
    },
    "customer_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "changes": {
      "type": [
        "array",
        "null"
      ],
      "description": "On a record the daily monitor wrote: what moved since the last read.",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "worse": {
            "type": "boolean"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "record": {
      "type": "object",
      "properties": {
        "sha256": {
          "type": "string"
        },
        "verify_url": {
          "type": "string",
          "format": "uri"
        },
        "pdf_url": {
          "type": "string"
        }
      }
    },
    "engine_version": {
      "type": "string"
    },
    "imo_check_digit_valid": {
      "type": "boolean"
    },
    "listing": {
      "type": "object",
      "properties": {
        "clause": {
          "type": [
            "string",
            "null"
          ]
        },
        "cite": {
          "type": [
            "string",
            "null"
          ],
          "description": "e.g. \"DGS Order 08 of 2026, clause 6.2\"."
        },
        "basis": {
          "type": [
            "string",
            "null"
          ]
        },
        "annexure_rows": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "ilo_cases": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "pandi": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "ig_entered",
            "ig_entered_unconfirmed",
            "not_found_in_checked",
            "partial",
            "not_checked"
          ]
        },
        "text": {
          "type": "string"
        },
        "clubs_asked": {
          "type": "integer"
        },
        "clubs_answered": {
          "type": "integer"
        },
        "entered": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "not_asked": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "weight": {
            "type": "string",
            "enum": [
              "decides",
              "check",
              "info"
            ]
          },
          "text": {
            "type": "string"
          },
          "clause": {
            "type": [
              "string",
              "null"
            ]
          },
          "as_of": {
            "type": [
              "string",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "must_still_verify": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "cite": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "as_of": {
      "type": "object",
      "properties": {
        "checked_at": {
          "type": "string",
          "format": "date-time"
        },
        "ilo_copy_read_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "orders_listing_read_at": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "agency": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "rpsl_no": {
          "type": "string"
        }
      }
    }
  }
}