{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/financekey/json-schema/financekey-finance-key-entity-credit-facility-pkg-v-credit-facility-document-schema.json",
  "title": "FinanceKey.Entity.CreditFacilityPkg.v_CreditFacilityDocument",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/financekey-credit-facilities-api-openapi.yml#/components/schemas/FinanceKey.Entity.CreditFacilityPkg.v_CreditFacilityDocument",
  "required": [
    "documentTypeId",
    "name"
  ],
  "type": "object",
  "properties": {
    "createdById": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The identity of the account that created the initial record.",
      "format": "int32",
      "readOnly": true
    },
    "createdOn": {
      "type": "string",
      "description": "The date and time the record was initially created.",
      "format": "date-time",
      "readOnly": true
    },
    "updatedById": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The identity of the account that last modified the record.",
      "format": "int32",
      "readOnly": true
    },
    "updateOn": {
      "type": "string",
      "description": "The date and time the record was last modified.",
      "format": "date-time",
      "readOnly": true
    },
    "closedById": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The identity of the account that deactivated and closed the record.",
      "format": "int32",
      "readOnly": true
    },
    "closedOn": {
      "type": "string",
      "description": "The date and time the record is to be considered as inactive and closed.",
      "format": "date-time",
      "readOnly": true
    },
    "active": {
      "type": "boolean",
      "description": "A flag that shows if the record is currently active. This values is calculated based on the current date and the record closed date.",
      "readOnly": true
    },
    "rowVersion": {
      "type": [
        "string",
        "null"
      ],
      "description": "A unique version stamp of the record.",
      "format": "byte",
      "readOnly": true
    },
    "sessionId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The identity of the session that last modified the record.",
      "readOnly": true
    },
    "documentId": {
      "type": "integer",
      "description": "DocumentId is an int data type field that is the Primary Key for the CreditFacilityDocument table. This field is used to uniquely identify each record in the table and can be used to join the CreditFacilityDocument table to other tables.",
      "format": "int32"
    },
    "name": {
      "minLength": 1,
      "type": "string",
      "description": "The Name of data type nvarchar field in the CreditFacilityDocument table is used to store user-entered text data of variable length up to a maximum of 4,000 characters long. This field can contain characters from all languages, including non-English characters."
    },
    "entityId": {
      "maxLength": 450,
      "type": [
        "string",
        "null"
      ],
      "description": "The EntityId field of the CreditFacilityDocument table is used to store a unique identifier for the corresponding credit facility in the form of a string with a maximum length of 450 characters. The value stored in the EntityId field should be unique for each credit facility, and must be supplied when creating a new record."
    },
    "creditFacilityId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The CreditFacilityId field in the CreditFacilityDocument table is an integer data type field that uniquely identifies each credit facility document in the system. It is used to associate a document with a single credit facility.",
      "format": "int32"
    },
    "entityKeyValue": {
      "type": [
        "string",
        "null"
      ],
      "description": "EntityKeyValue is an nvarchar field in the CreditFacilityDocument table which stores a unique identifier associated with the document in question. It is used to look up associated metadata and/or contents for the document."
    },
    "documentTypeId": {
      "maxLength": 450,
      "minLength": 1,
      "type": "string",
      "description": "DocumentTypeId is an nvarchar field of size 450 in the CreditFacilityDocument table that stores the unique identifier of the document type associated with a particular document."
    },
    "fileName": {
      "type": [
        "string",
        "null"
      ],
      "description": "The FileName field is a nvarchar data type within the CreditFacilityDocument table. It contains the full name and extension of a file, such as a .docx or .pdf, relevant to a particular credit facility document."
    }
  },
  "additionalProperties": false
}