{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.refinitiv.com/schemas/refinitiv/screening-case.json",
  "title": "Refinitiv World-Check Screening Case",
  "description": "Represents a screening case in the World-Check One API, containing entity information, screening configuration, and matched results for KYC and due diligence workflows.",
  "type": "object",
  "required": ["groupId", "entityType", "name"],
  "properties": {
    "caseSystemId": {
      "type": "string",
      "description": "System-generated unique identifier for the case."
    },
    "caseId": {
      "type": ["string", "null"],
      "description": "Client-defined case identifier for tracking purposes.",
      "maxLength": 255
    },
    "groupId": {
      "type": "string",
      "description": "The group under which the case is created, defining screening parameters and resolution toolkit."
    },
    "entityType": {
      "type": "string",
      "description": "The type of entity being screened.",
      "enum": ["INDIVIDUAL", "ORGANISATION", "VESSEL"]
    },
    "providerTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["WATCHLIST", "CLIENT_WATCHLIST", "MEDIA_CHECK", "PASSPORT_CHECK"]
      },
      "description": "Provider types to screen against. WATCHLIST corresponds to World-Check risk intelligence data."
    },
    "name": {
      "type": "object",
      "description": "Name information for the entity being screened.",
      "properties": {
        "firstName": {
          "type": ["string", "null"],
          "description": "First name of the individual.",
          "maxLength": 255
        },
        "middleName": {
          "type": ["string", "null"],
          "description": "Middle name of the individual.",
          "maxLength": 255
        },
        "lastName": {
          "type": ["string", "null"],
          "description": "Last name of the individual.",
          "maxLength": 255
        },
        "fullName": {
          "type": ["string", "null"],
          "description": "Full name, used when parts are not available or for organization names.",
          "maxLength": 1000
        }
      }
    },
    "secondaryFields": {
      "type": ["object", "null"],
      "description": "Additional fields for improving match accuracy.",
      "properties": {
        "dateOfBirth": {
          "type": ["string", "null"],
          "format": "date",
          "description": "Date of birth for individual screening."
        },
        "countryLocation": {
          "type": ["string", "null"],
          "description": "Country of location, ISO 3166-1 alpha-2 code.",
          "pattern": "^[A-Z]{2}$"
        },
        "nationality": {
          "type": ["string", "null"],
          "description": "Nationality, ISO 3166-1 alpha-2 code.",
          "pattern": "^[A-Z]{2}$"
        },
        "gender": {
          "type": ["string", "null"],
          "description": "Gender of the individual.",
          "enum": ["MALE", "FEMALE", "UNSPECIFIED", null]
        },
        "placeOfBirth": {
          "type": ["string", "null"],
          "description": "Place of birth."
        },
        "registeredCountry": {
          "type": ["string", "null"],
          "description": "Registered country for organizations.",
          "pattern": "^[A-Z]{2}$"
        }
      }
    },
    "caseScreeningState": {
      "type": ["object", "null"],
      "description": "The screening state for each provider type.",
      "additionalProperties": {
        "type": "string",
        "enum": ["INITIAL", "ONGOING"]
      }
    },
    "creationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time the case was created."
    },
    "modificationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time the case was last modified."
    },
    "results": {
      "type": ["array", "null"],
      "items": {
        "$ref": "#/$defs/ScreeningResult"
      },
      "description": "Screening results matched against the entity."
    }
  },
  "$defs": {
    "ScreeningResult": {
      "type": "object",
      "description": "A single screening match result from the World-Check database.",
      "properties": {
        "resultId": {
          "type": "string",
          "description": "Unique identifier of the screening result."
        },
        "referenceId": {
          "type": "string",
          "description": "World-Check reference profile identifier."
        },
        "matchStrength": {
          "type": "string",
          "description": "Strength of the match between submitted and matched terms.",
          "enum": ["EXACT", "STRONG", "MEDIUM", "WEAK"]
        },
        "matchedTerm": {
          "type": "string",
          "description": "The name or term that was matched from the World-Check database."
        },
        "submittedTerm": {
          "type": "string",
          "description": "The original term submitted for screening."
        },
        "matchedNameType": {
          "type": "string",
          "description": "Type of name matched such as PRIMARY or ALIAS.",
          "enum": ["PRIMARY", "AKA", "DBA", "FKA", "MAIDEN"]
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Risk categories such as PEP, Sanctions, Adverse Media, or Law Enforcement."
        },
        "resolution": {
          "oneOf": [
            { "$ref": "#/$defs/Resolution" },
            { "type": "null" }
          ],
          "description": "The resolution status, null if unresolved."
        },
        "providerType": {
          "type": "string",
          "description": "The provider that generated the match.",
          "enum": ["WATCHLIST", "CLIENT_WATCHLIST", "MEDIA_CHECK", "PASSPORT_CHECK"]
        }
      }
    },
    "Resolution": {
      "type": "object",
      "description": "Resolution details for a screening result.",
      "properties": {
        "statusId": {
          "type": "string",
          "description": "The resolution status identifier from the resolution toolkit."
        },
        "statusLabel": {
          "type": ["string", "null"],
          "description": "Human-readable label for the resolution status."
        },
        "riskId": {
          "type": ["string", "null"],
          "description": "The risk level identifier."
        },
        "riskLabel": {
          "type": ["string", "null"],
          "description": "Human-readable label for the risk level."
        },
        "reasonId": {
          "type": ["string", "null"],
          "description": "The resolution reason identifier."
        },
        "reasonLabel": {
          "type": ["string", "null"],
          "description": "Human-readable label for the reason."
        },
        "remarks": {
          "type": ["string", "null"],
          "description": "Free-text remarks or notes."
        },
        "resolvedDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time the result was resolved."
        },
        "resolvedBy": {
          "type": ["string", "null"],
          "description": "The user who resolved the result."
        }
      }
    }
  }
}
