{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dbt-se/json-schema/dbt-se-case-kyc-schema.json",
  "title": "CaseKyc",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dbt-se-identity-api-openapi.yml#/components/schemas/CaseKyc",
  "type": "object",
  "properties": {
    "organizations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/KycOrganization"
      },
      "description": "One per org, in request order."
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "section": {
            "$ref": "#/$defs/KycRoleSection"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/KycRoleEntry"
            },
            "minItems": 1,
            "description": "Those in the most orgs first, as they say the most about the group."
          }
        },
        "required": [
          "section",
          "entries"
        ]
      },
      "description": "Every person and company the registers connect to the orgs, by role section."
    },
    "orgIdsWithoutOwner": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The orgs the registers name alternative beneficial owners for, but no beneficial owner."
    },
    "contacts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CaseKycContact"
      }
    }
  },
  "required": [
    "organizations",
    "sections",
    "orgIdsWithoutOwner",
    "contacts"
  ],
  "$defs": {
    "ActiveCaseContact": {
      "type": "object",
      "properties": {
        "revokedAt": {
          "type": "null"
        },
        "isSignee": {
          "type": "boolean"
        },
        "isOfficialContact": {
          "type": "boolean"
        }
      },
      "required": [
        "revokedAt",
        "isSignee",
        "isOfficialContact"
      ]
    },
    "CaseContactMark": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            }
          },
          "required": [
            "id"
          ]
        },
        {
          "anyOf": [
            {
              "$ref": "#/$defs/ActiveCaseContact"
            },
            {
              "$ref": "#/$defs/RevokedCaseContact"
            }
          ]
        }
      ]
    },
    "CaseContactWithNationalId": {
      "type": "object",
      "properties": {
        "physicalPersonId": {
          "type": "string",
          "format": "uuid"
        },
        "maskedNationalIdentificationNumber": {
          "type": "string"
        },
        "nationalIdentificationNumber": {
          "type": "string"
        },
        "isIdentityVerified": {
          "type": "boolean"
        }
      },
      "required": [
        "physicalPersonId",
        "maskedNationalIdentificationNumber",
        "nationalIdentificationNumber",
        "isIdentityVerified"
      ]
    },
    "CaseContactWithoutNationalId": {
      "type": "object",
      "properties": {
        "nationalIdentificationNumber": {
          "type": "null"
        },
        "isIdentityVerified": {
          "type": "boolean",
          "enum": [
            false
          ]
        }
      },
      "required": [
        "nationalIdentificationNumber",
        "isIdentityVerified"
      ]
    },
    "CaseKycContact": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "caseId": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "format": "email"
            },
            "phoneNumber": {
              "type": [
                "string",
                "null"
              ]
            },
            "roles": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "representative",
                  "ceo",
                  "cfo",
                  "board-chair",
                  "board-member",
                  "deputy-board-member",
                  "authorized-signatory",
                  "shareholder",
                  "beneficial-owner",
                  "contact-person",
                  "proxy",
                  "auditor",
                  "accounting-consultant",
                  "legal-counsel",
                  "bookkeeping-data-contact",
                  "invoice-contact",
                  "other"
                ]
              }
            }
          },
          "required": [
            "id",
            "caseId",
            "name",
            "email",
            "phoneNumber",
            "roles"
          ]
        },
        {
          "anyOf": [
            {
              "$ref": "#/$defs/CaseContactWithNationalId"
            },
            {
              "$ref": "#/$defs/CaseContactWithoutNationalId"
            }
          ]
        },
        {
          "anyOf": [
            {
              "$ref": "#/$defs/ActiveCaseContact"
            },
            {
              "$ref": "#/$defs/RevokedCaseContact"
            }
          ]
        },
        {
          "type": "object",
          "properties": {
            "birthDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date",
              "description": "As the national identification number encodes it; null without one."
            },
            "mismatchedPersonName": {
              "type": [
                "string",
                "null"
              ],
              "description": "The person's known name when it differs from the contact's, compared without case or accents: the registers' name, else identity's; null when it matches or none is known."
            },
            "kycSubject": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "sections": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "section": {
                        "$ref": "#/$defs/KycRoleSection"
                      },
                      "orgIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "section",
                      "orgIds"
                    ]
                  }
                },
                "screening": {
                  "allOf": [
                    {
                      "$ref": "#/$defs/KycSubjectScreening"
                    },
                    {
                      "description": "A person's or organization's PEP and sanctions screening."
                    }
                  ]
                }
              },
              "required": [
                "sections",
                "screening"
              ],
              "description": "What the registers say of the contact, when they list the same person."
            },
            "invitations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "deliveryId": {
                    "type": "string"
                  },
                  "notificationId": {
                    "type": "string"
                  },
                  "topic": {
                    "type": "string",
                    "enum": [
                      "organization.data.ready",
                      "organization.erp.connected",
                      "organization.alert.critical",
                      "organization.risk.forecast.critical",
                      "organization.review.requested",
                      "organization.contact.identification.performed",
                      "sie-file.awaiting-acceptance",
                      "sie-file.failed-populating-monthly-account-balances",
                      "sie-file.parse-failed",
                      "review.summary.weekly",
                      "tech.alert.general",
                      "test",
                      "erp.integration.invite",
                      "identification.invite",
                      "bank-account.verification.invite",
                      "organization.consent.approved",
                      "meeting.booked.customer-confirmation",
                      "meeting.booked.staff-notification",
                      "meeting-prep.generated",
                      "payout-summary.generated"
                    ]
                  },
                  "targetType": {
                    "type": "string",
                    "enum": [
                      "email",
                      "slack_direct_message",
                      "slack_channel"
                    ]
                  },
                  "target": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "delivered",
                      "failed"
                    ]
                  },
                  "createdAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "deliveryId",
                  "notificationId",
                  "topic",
                  "targetType",
                  "target",
                  "status",
                  "createdAt"
                ]
              },
              "description": "The invitations sent to the contact's email, newest first."
            },
            "recentlySentTopics": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "erp.integration.invite",
                  "identification.invite"
                ]
              },
              "description": "The invitations sent within the cooldown, which are not sent again until it passes."
            }
          },
          "required": [
            "birthDate",
            "mismatchedPersonName",
            "kycSubject",
            "invitations",
            "recentlySentTopics"
          ]
        }
      ]
    },
    "DBTStaffMember": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "familyName": {
          "type": [
            "string",
            "null"
          ]
        },
        "givenName": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string"
        },
        "linkedInUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "organizationalUnitPath": {
          "type": "string"
        },
        "phoneNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "photoUrl": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "small": {
              "type": "string"
            },
            "medium": {
              "type": "string"
            },
            "large": {
              "type": "string"
            }
          },
          "required": [
            "small",
            "medium",
            "large"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "suspended",
            "deleted"
          ]
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "displayName",
        "email",
        "familyName",
        "givenName",
        "id",
        "linkedInUrl",
        "organizationalUnitPath",
        "phoneNumber",
        "photoUrl",
        "status",
        "updatedAt"
      ]
    },
    "KycBeneficialOwnerRegistration": {
      "type": "object",
      "properties": {
        "statusCode": {
          "type": "string"
        },
        "statusDescription": {
          "type": "string"
        },
        "changedOn": {
          "type": [
            "string",
            "null"
          ]
        },
        "registeredAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "suspicion": {
          "$ref": "#/$defs/KycRegistrationSuspicion"
        }
      },
      "required": [
        "statusCode",
        "statusDescription",
        "changedOn",
        "registeredAt",
        "suspicion"
      ],
      "description": "How the register holds an org's beneficial owners."
    },
    "KycCompany": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "company"
          ]
        },
        "subjectId": {
          "type": "string"
        },
        "organizationNumber": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "screening": {
          "allOf": [
            {
              "$ref": "#/$defs/KycSubjectScreening"
            },
            {
              "description": "Null when the company is in none of the orgs' latest finished fetches."
            }
          ]
        }
      },
      "required": [
        "type",
        "subjectId",
        "organizationNumber",
        "name",
        "screening"
      ]
    },
    "KycCompanyCheck": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "crimeHit": {
          "type": "boolean"
        },
        "checkedAt": {
          "type": "string",
          "format": "date-time"
        },
        "documents": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KycLegalDocument"
          },
          "description": "The court documents behind the check, as the source gives them."
        }
      },
      "required": [
        "crimeHit",
        "checkedAt",
        "documents"
      ],
      "description": "The newest company crime check."
    },
    "KycFetch": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "in-progress",
            "failed",
            "finished"
          ]
        },
        "requestedBy": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "backfill"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "deal-stage"
                  ]
                },
                "crmCompanyId": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "crmCompanyId"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "dbt-staff-member"
                  ]
                },
                "staffMember": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/DBTStaffMember"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The staff member who asked; null when they are no longer in the staff directory."
                }
              },
              "required": [
                "type",
                "staffMember"
              ]
            }
          ]
        },
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "completedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "status",
        "requestedBy",
        "startedAt",
        "completedAt"
      ]
    },
    "KycFetchFreshness": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "freshness": {
              "type": "string",
              "enum": [
                "missing"
              ]
            }
          },
          "required": [
            "freshness"
          ]
        },
        {
          "type": "object",
          "properties": {
            "freshness": {
              "type": "string",
              "enum": [
                "fetching"
              ]
            },
            "lastFetchedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "When the org's last KYC fetch from the registers finished."
            }
          },
          "required": [
            "freshness",
            "lastFetchedAt"
          ]
        },
        {
          "type": "object",
          "properties": {
            "freshness": {
              "type": "string",
              "enum": [
                "stale"
              ]
            },
            "lastFetchedAt": {
              "type": "string",
              "format": "date-time",
              "description": "When the org's last KYC fetch from the registers finished."
            }
          },
          "required": [
            "freshness",
            "lastFetchedAt"
          ]
        },
        {
          "type": "object",
          "properties": {
            "freshness": {
              "type": "string",
              "enum": [
                "fresh"
              ]
            },
            "lastFetchedAt": {
              "type": "string",
              "format": "date-time",
              "description": "When the org's last KYC fetch from the registers finished."
            }
          },
          "required": [
            "freshness",
            "lastFetchedAt"
          ]
        }
      ],
      "description": "How current the org's register data is: never fetched, being fetched, older than the refetch limit, or fresh."
    },
    "KycHit": {
      "oneOf": [
        {
          "$ref": "#/$defs/KycPepHit"
        },
        {
          "$ref": "#/$defs/KycRcaHit"
        },
        {
          "$ref": "#/$defs/KycSanctionHit"
        }
      ]
    },
    "KycLegalDocument": {
      "type": "object",
      "properties": {
        "concerns": {
          "type": "string",
          "enum": [
            "company",
            "person"
          ]
        },
        "court": {
          "type": [
            "string",
            "null"
          ]
        },
        "courtInstanceCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "courtNoticeDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "documentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "documentType": {
          "type": [
            "string",
            "null"
          ]
        },
        "recordDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "charges": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rolesInCompany": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "roleCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "isCurrent": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "roleCode",
              "isCurrent"
            ]
          }
        }
      },
      "required": [
        "concerns",
        "court",
        "courtInstanceCode",
        "courtNoticeDate",
        "documentId",
        "documentType",
        "recordDate",
        "charges",
        "rolesInCompany"
      ]
    },
    "KycOrgScreening": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "unscreened",
            "hits",
            "pending",
            "incomplete",
            "partial",
            "clean"
          ]
        }
      },
      "required": [
        "state"
      ],
      "description": "The org's screening, judged by the subjects of its latest finished fetch."
    },
    "KycOrganization": {
      "type": "object",
      "properties": {
        "orgId": {
          "type": "string"
        },
        "fetch": {
          "$ref": "#/$defs/KycFetchFreshness"
        },
        "screening": {
          "$ref": "#/$defs/KycOrgScreening"
        },
        "organizationScreening": {
          "$ref": "#/$defs/KycSubjectScreening"
        },
        "companyCheck": {
          "$ref": "#/$defs/KycCompanyCheck"
        },
        "beneficialOwnerRegistrations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KycBeneficialOwnerRegistration"
          },
          "description": "How the register holds the org's beneficial owners, as the latest fetch read it."
        },
        "fetches": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KycFetch"
          },
          "description": "The org's newest KYC fetches, newest first."
        }
      },
      "required": [
        "orgId",
        "fetch",
        "screening",
        "organizationScreening",
        "companyCheck",
        "beneficialOwnerRegistrations",
        "fetches"
      ]
    },
    "KycOwnershipStep": {
      "type": "object",
      "properties": {
        "ownership": {
          "type": "object",
          "properties": {
            "format": {
              "type": "object",
              "properties": {
                "maximumFractionDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "maximumIntegerDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "minimumFractionDigits": {
                  "type": "number",
                  "minimum": 0
                },
                "minimumIntegerDigits": {
                  "type": "number",
                  "minimum": 0
                }
              }
            },
            "percentageAsFraction": {
              "type": "number"
            },
            "type": {
              "type": "string",
              "enum": [
                "percent"
              ]
            }
          },
          "required": [
            "percentageAsFraction",
            "type"
          ]
        },
        "name": {
          "type": "string"
        },
        "organizationId": {
          "type": "string"
        }
      },
      "required": [
        "ownership",
        "name",
        "organizationId"
      ]
    },
    "KycPepHit": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "pep"
          ]
        },
        "names": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "countries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string"
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "from": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Year, year-month or full date, as Roaring gives it."
              },
              "through": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "active": {
                "type": "boolean"
              }
            },
            "required": [
              "description",
              "country",
              "from",
              "through",
              "active"
            ]
          }
        },
        "relations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "description"
            ]
          }
        }
      },
      "required": [
        "type",
        "names",
        "countries",
        "roles",
        "relations"
      ],
      "description": "The person is politically exposed."
    },
    "KycPerson": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "person"
          ]
        },
        "subjectId": {
          "type": "string"
        },
        "physicalPersonId": {
          "type": "string",
          "format": "uuid"
        },
        "maskedNationalIdentificationNumber": {
          "type": "string"
        },
        "nationalIdentificationNumber": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "birthDate": {
          "type": "string",
          "format": "date",
          "description": "As the registers give it, else as the national identification number encodes it."
        },
        "citizenship": {
          "type": [
            "string",
            "null"
          ]
        },
        "residenceCountry": {
          "type": [
            "string",
            "null"
          ]
        },
        "screening": {
          "allOf": [
            {
              "$ref": "#/$defs/KycSubjectScreening"
            },
            {
              "description": "Null when the person is in none of the orgs' latest finished fetches."
            }
          ]
        },
        "caseContact": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaseContactMark"
            },
            {
              "type": "null"
            }
          ],
          "description": "The person's contact on the case, matched on national id; null outside a case or when they are none."
        }
      },
      "required": [
        "type",
        "subjectId",
        "physicalPersonId",
        "maskedNationalIdentificationNumber",
        "nationalIdentificationNumber",
        "name",
        "birthDate",
        "citizenship",
        "residenceCountry",
        "screening",
        "caseContact"
      ]
    },
    "KycRcaHit": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "rca"
          ]
        },
        "names": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "countries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string"
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "from": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Year, year-month or full date, as Roaring gives it."
              },
              "through": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "active": {
                "type": "boolean"
              }
            },
            "required": [
              "description",
              "country",
              "from",
              "through",
              "active"
            ]
          }
        },
        "relations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "description"
            ]
          }
        }
      },
      "required": [
        "type",
        "names",
        "countries",
        "roles",
        "relations"
      ],
      "description": "The person is a relative or close associate of a politically exposed person."
    },
    "KycRegistrationSuspicion": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "grade": {
          "type": "number"
        },
        "gradeText": {
          "type": "string"
        },
        "cases": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "caseNumber": {
                "type": "string"
              },
              "registeredOn": {
                "type": "string"
              }
            },
            "required": [
              "caseNumber",
              "registeredOn"
            ]
          }
        },
        "isActive": {
          "type": "boolean",
          "description": "Whether the register still holds the suspicion; a dropped one stays on record."
        }
      },
      "required": [
        "grade",
        "gradeText",
        "cases",
        "isActive"
      ],
      "description": "The register's suspicion that the registration is wrong, with its grade."
    },
    "KycRole": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "role": {
              "type": "string"
            },
            "ownership": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "format": {
                  "type": "object",
                  "properties": {
                    "maximumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "maximumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    }
                  }
                },
                "percentageAsFraction": {
                  "type": "number"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "percent"
                  ]
                }
              },
              "required": [
                "percentageAsFraction",
                "type"
              ],
              "description": "The owner's share of the org, for owners."
            },
            "controlTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "control-through-shares-participations-memberships-agreements",
                  "board-member-or-equivalent-executive",
                  "foundation-trustee-representative",
                  "appoints-or-removes-majority-of-board",
                  "foundation-beneficiary",
                  "joint-control-with-close-relatives",
                  "control-through-other-companies-or-associations",
                  "trust-founder",
                  "trustee-or-trustee-representative",
                  "trust-patron"
                ]
              }
            },
            "fromDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "toDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "tag": {
              "type": "string",
              "enum": [
                "beneficial-owner"
              ]
            },
            "extentOfControl": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "at-most-25-percent",
                "over-25-at-most-50-percent",
                "over-50-at-most-75-percent",
                "over-75-below-100-percent",
                "100-percent",
                null
              ],
              "description": "The owner's share of control, as the register bands it."
            },
            "controlVia": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "controlType": {
                    "type": "string",
                    "enum": [
                      "control-through-shares-participations-memberships-agreements",
                      "board-member-or-equivalent-executive",
                      "foundation-trustee-representative",
                      "appoints-or-removes-majority-of-board",
                      "foundation-beneficiary",
                      "joint-control-with-close-relatives",
                      "control-through-other-companies-or-associations",
                      "trust-founder",
                      "trustee-or-trustee-representative",
                      "trust-patron"
                    ]
                  },
                  "organizationId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "controlType",
                  "organizationId",
                  "name"
                ]
              },
              "description": "The companies the owner controls the org through."
            }
          },
          "required": [
            "role",
            "ownership",
            "controlTypes",
            "fromDate",
            "toDate",
            "tag",
            "extentOfControl",
            "controlVia"
          ]
        },
        {
          "type": "object",
          "properties": {
            "role": {
              "type": "string"
            },
            "ownership": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "format": {
                  "type": "object",
                  "properties": {
                    "maximumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "maximumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    }
                  }
                },
                "percentageAsFraction": {
                  "type": "number"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "percent"
                  ]
                }
              },
              "required": [
                "percentageAsFraction",
                "type"
              ],
              "description": "The owner's share of the org, for owners."
            },
            "controlTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "control-through-shares-participations-memberships-agreements",
                  "board-member-or-equivalent-executive",
                  "foundation-trustee-representative",
                  "appoints-or-removes-majority-of-board",
                  "foundation-beneficiary",
                  "joint-control-with-close-relatives",
                  "control-through-other-companies-or-associations",
                  "trust-founder",
                  "trustee-or-trustee-representative",
                  "trust-patron"
                ]
              }
            },
            "fromDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "toDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "tag": {
              "type": "string",
              "enum": [
                "alternative-beneficial-owner"
              ]
            },
            "alternativeOwnerSource": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "owner",
                "board-member",
                "owner-and-board-member",
                null
              ],
              "description": "Why they are named: as owner, board member, or both."
            },
            "shareQuotas": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "path": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/KycOwnershipStep"
                    },
                    "description": "From the owner's direct holding down to the org itself."
                  },
                  "quota": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "format": {
                        "type": "object",
                        "properties": {
                          "maximumFractionDigits": {
                            "type": "number",
                            "minimum": 0
                          },
                          "maximumIntegerDigits": {
                            "type": "number",
                            "minimum": 0
                          },
                          "minimumFractionDigits": {
                            "type": "number",
                            "minimum": 0
                          },
                          "minimumIntegerDigits": {
                            "type": "number",
                            "minimum": 0
                          }
                        }
                      },
                      "percentageAsFraction": {
                        "type": "number"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "percent"
                        ]
                      }
                    },
                    "required": [
                      "percentageAsFraction",
                      "type"
                    ]
                  }
                },
                "required": [
                  "organizationId",
                  "name",
                  "path",
                  "quota"
                ]
              },
              "description": "Their holdings toward the org, with the chain of each."
            }
          },
          "required": [
            "role",
            "ownership",
            "controlTypes",
            "fromDate",
            "toDate",
            "tag",
            "alternativeOwnerSource",
            "shareQuotas"
          ]
        },
        {
          "type": "object",
          "properties": {
            "role": {
              "type": "string"
            },
            "ownership": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "format": {
                  "type": "object",
                  "properties": {
                    "maximumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "maximumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    }
                  }
                },
                "percentageAsFraction": {
                  "type": "number"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "percent"
                  ]
                }
              },
              "required": [
                "percentageAsFraction",
                "type"
              ],
              "description": "The owner's share of the org, for owners."
            },
            "controlTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "control-through-shares-participations-memberships-agreements",
                  "board-member-or-equivalent-executive",
                  "foundation-trustee-representative",
                  "appoints-or-removes-majority-of-board",
                  "foundation-beneficiary",
                  "joint-control-with-close-relatives",
                  "control-through-other-companies-or-associations",
                  "trust-founder",
                  "trustee-or-trustee-representative",
                  "trust-patron"
                ]
              }
            },
            "fromDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "toDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "tag": {
              "type": "string",
              "enum": [
                "beneficial-owner-representative"
              ]
            }
          },
          "required": [
            "role",
            "ownership",
            "controlTypes",
            "fromDate",
            "toDate",
            "tag"
          ]
        },
        {
          "type": "object",
          "properties": {
            "role": {
              "type": "string"
            },
            "ownership": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "format": {
                  "type": "object",
                  "properties": {
                    "maximumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "maximumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumFractionDigits": {
                      "type": "number",
                      "minimum": 0
                    },
                    "minimumIntegerDigits": {
                      "type": "number",
                      "minimum": 0
                    }
                  }
                },
                "percentageAsFraction": {
                  "type": "number"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "percent"
                  ]
                }
              },
              "required": [
                "percentageAsFraction",
                "type"
              ],
              "description": "The owner's share of the org, for owners."
            },
            "controlTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "control-through-shares-participations-memberships-agreements",
                  "board-member-or-equivalent-executive",
                  "foundation-trustee-representative",
                  "appoints-or-removes-majority-of-board",
                  "foundation-beneficiary",
                  "joint-control-with-close-relatives",
                  "control-through-other-companies-or-associations",
                  "trust-founder",
                  "trustee-or-trustee-representative",
                  "trust-patron"
                ]
              }
            },
            "fromDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "toDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            },
            "tag": {
              "type": "string",
              "enum": [
                "chairman",
                "commissioner",
                "deputy",
                "ceo",
                "vice-ceo",
                "external-ceo",
                "abroad-resident-in-the-eea",
                "abroad-resident-outside-the-eea",
                "other"
              ]
            },
            "roleCode": {
              "type": [
                "string",
                "null"
              ],
              "description": "The register's role code, as given."
            }
          },
          "required": [
            "role",
            "ownership",
            "controlTypes",
            "fromDate",
            "toDate",
            "tag",
            "roleCode"
          ]
        }
      ]
    },
    "KycRoleEntry": {
      "type": "object",
      "properties": {
        "subject": {
          "$ref": "#/$defs/KycSubject"
        },
        "qualifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KycRoleQualifier"
          },
          "description": "What sets the subject's roles here apart; empty when any of them has nothing to, since a CEO who is also vice CEO is a CEO."
        },
        "orgs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "orgId": {
                "type": "string"
              },
              "ownership": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "format": {
                    "type": "object",
                    "properties": {
                      "maximumFractionDigits": {
                        "type": "number",
                        "minimum": 0
                      },
                      "maximumIntegerDigits": {
                        "type": "number",
                        "minimum": 0
                      },
                      "minimumFractionDigits": {
                        "type": "number",
                        "minimum": 0
                      },
                      "minimumIntegerDigits": {
                        "type": "number",
                        "minimum": 0
                      }
                    }
                  },
                  "percentageAsFraction": {
                    "type": "number"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "percent"
                    ]
                  }
                },
                "required": [
                  "percentageAsFraction",
                  "type"
                ]
              },
              "roles": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/KycRole"
                }
              }
            },
            "required": [
              "orgId",
              "ownership",
              "roles"
            ]
          },
          "description": "The orgs the subject holds any of the section's roles in, in request order."
        }
      },
      "required": [
        "subject",
        "qualifiers",
        "orgs"
      ]
    },
    "KycRoleQualifier": {
      "type": "string",
      "enum": [
        "vice-ceo",
        "external-ceo",
        "in-the-eea",
        "outside-the-eea"
      ]
    },
    "KycRoleSection": {
      "type": "string",
      "enum": [
        "beneficialOwners",
        "alternativeBeneficialOwners",
        "management",
        "chair",
        "board",
        "deputies",
        "residentsAbroad",
        "otherRoles",
        "representatives"
      ]
    },
    "KycSanctionHit": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "sanction"
          ]
        },
        "list": {
          "type": [
            "string",
            "null"
          ],
          "description": "The sanctions list, e.g. EU or UN."
        },
        "score": {
          "type": [
            "number",
            "null"
          ]
        },
        "names": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "countries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "birthDates": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "type",
        "list",
        "score",
        "names",
        "countries",
        "birthDates"
      ],
      "description": "A sanctions list entry matched the person's name."
    },
    "KycSubject": {
      "oneOf": [
        {
          "$ref": "#/$defs/KycPerson"
        },
        {
          "$ref": "#/$defs/KycCompany"
        }
      ]
    },
    "KycSubjectScreening": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "outcome": {
              "type": "string",
              "enum": [
                "pending",
                "unscreened"
              ],
              "description": "Unscreened until staff ask for one, pending while it runs."
            },
            "screenedAt": {
              "type": "null"
            },
            "freshness": {
              "type": "string",
              "enum": [
                "missing",
                "screening",
                "stale",
                "fresh"
              ],
              "description": "How current the last result that ran is: none yet (or only failed), screening, older than the rescreen limit, or fresh."
            },
            "hits": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/KycHit"
              },
              "description": "The hits behind the subject's last known result, kept while a rescreen is pending or failed."
            }
          },
          "required": [
            "outcome",
            "screenedAt",
            "freshness",
            "hits"
          ]
        },
        {
          "type": "object",
          "properties": {
            "outcome": {
              "type": "string",
              "enum": [
                "clean",
                "hits",
                "failed"
              ],
              "description": "How the newest screening ended."
            },
            "screenedAt": {
              "type": "string",
              "format": "date-time"
            },
            "freshness": {
              "type": "string",
              "enum": [
                "missing",
                "screening",
                "stale",
                "fresh"
              ],
              "description": "How current the last result that ran is: none yet (or only failed), screening, older than the rescreen limit, or fresh."
            },
            "hits": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/KycHit"
              },
              "description": "The hits behind the subject's last known result, kept while a rescreen is pending or failed."
            }
          },
          "required": [
            "outcome",
            "screenedAt",
            "freshness",
            "hits"
          ]
        }
      ],
      "description": "The org's own sanctions screening, unscreened until staff ask for one."
    },
    "RevokedCaseContact": {
      "type": "object",
      "properties": {
        "revokedAt": {
          "type": "string",
          "format": "date-time"
        },
        "isSignee": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "isOfficialContact": {
          "type": "boolean",
          "enum": [
            false
          ]
        }
      },
      "required": [
        "revokedAt",
        "isSignee",
        "isOfficialContact"
      ]
    }
  }
}