{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://schema.twindev.org/documents/Document",
    "title": "Document",
    "description": "Interface describing a document.",
    "type": "object",
    "properties": {
        "@context": {
            "type": "array",
            "prefixItems": [
                {
                    "const": "https://schema.org"
                },
                {
                    "const": "https://schema.twindev.org/documents/"
                },
                {
                    "const": "https://schema.twindev.org/common/"
                }
            ],
            "items": {
                "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
            },
            "minItems": 3,
            "description": "JSON-LD Context."
        },
        "type": {
            "const": "Document",
            "description": "JSON-LD Type."
        },
        "id": {
            "type": "string",
            "description": "The full id of the document."
        },
        "documentRevision": {
            "type": "number",
            "description": "The revision of the document as a 0 based index."
        },
        "blobStorageId": {
            "type": "string",
            "description": "The blob storage id for the document."
        },
        "integrity": {
            "type": "string",
            "description": "The integrity of the blob data."
        },
        "attestationId": {
            "type": "string",
            "description": "The attestation for the document if one was created."
        },
        "dateCreated": {
            "type": "string",
            "description": "The date/time of when the document was created."
        },
        "dateModified": {
            "type": "string",
            "description": "The date/time of when the document was modified."
        },
        "dateDeleted": {
            "type": "string",
            "description": "The date/time of when the document was deleted, as we never actually remove items."
        },
        "organizationIdentity": {
            "type": "string",
            "description": "The organization which added the document to the graph."
        },
        "userIdentity": {
            "type": "string",
            "description": "The user who added the document to the graph."
        }
    },
    "required": [
        "@context",
        "type",
        "id",
        "documentRevision",
        "blobStorageId",
        "integrity",
        "dateCreated"
    ],
    "allOf": [
        {
            "$ref": "https://schema.twindev.org/documents/DocumentBase"
        }
    ]
}
