{
  "Entities": [
    {
      "name": "Departments",
      "Fields": [
        {
          "name": "DepartmentId",
          "type": "string",
          "description": "ID/GUID to identify the department",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Name",
          "type": "string",
          "description": "The name of the department",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Status",
          "type": "string",
          "description": "The status of the department",
          "constraints": {
            "required": true,
            "value": [
              "General",
              "Hidden",
              "Restricted",
              "Disabled"
            ]
          }
        },
        {
          "name": "Description",
          "type": "string",
          "description": "Brief description of the department"
        },
        {
          "name": "DefaultReviewFrequency",
          "type": "integer",
          "description": "The default number of months after which documents from this department will require a new review",
          "default": 36
        }
      ]
    },
    {
      "name": "Sections",
      "Fields": [
        {
          "name": "SectionId",
          "type": "string",
          "description": "ID/GUID to identify the section",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Name",
          "type": "string",
          "description": "The name of the section",
          "constraints": {
            "required": true,
            "unique": "parent"
          }
        },
        {
          "name": "Status",
          "type": "string",
          "description": "The status of the section",
          "constraints": {
            "required": true,
            "value": [
              "General",
              "Hidden",
              "Restricted",
              "Disabled"
            ]
          }
        },
        {
          "name": "DepartmentId",
          "type": "string",
          "description": "The ID of the Department to which the section belongs",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "Description",
          "type": "string",
          "description": "Brief description of the section"
        },
        {
          "name": "DefaultReviewFrequency",
          "type": "integer",
          "description": "The default number of months after which documents from this section will require a new review",
          "default": "inherit"
        }
      ]
    },
    {
      "name": "Users",
      "Fields": [
        {
          "name": "UserId",
          "type": "string",
          "description": "ID/GUID to identify the User",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Email",
          "type": "string",
          "description": "Used to login to Prompt and to send email notifications - must be a valid email address",
          "constraints": {
            "required": true,
            "unique": "global"
          }
        },
        {
          "name": "DisplayName",
          "type": "string",
          "description": "The name of the user to be displayed when editing a document and in all reports",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "PrimaryDepartmentId",
          "type": "string",
          "description": "The ID of the user's primary department where they can access documents",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "PrimarySectionId",
          "type": "string",
          "description": "The ID of the user's primary section where they can access documents",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "PhoneNumber",
          "type": "string",
          "description": "The user's phone number - only used for reference purposes"
        },
        {
          "name": "OrganizationRole",
          "type": "string",
          "description": "Describes the user's role within the organization - only used for reference purposes"
        },
        {
          "name": "CanAccessReports",
          "type": "boolean",
          "description": "If true, allows a user to generate reports in their own organization",
          "default": false
        },
        {
          "name": "CanGlobalSearch",
          "type": "boolean",
          "description": "If true, allows a user to search for documents in other active organizations in Prompt",
          "default": false
        },
        {
          "name": "CanAccessAllDepartments",
          "type": "boolean",
          "description": "If true, allows a user to search for documents in Active departments within their organization - this will not assign a user to Hidden or Restricted departments",
          "default": false
        }
      ]
    },
    {
      "name": "UserPermissions",
      "Fields": [
        {
          "name": "UserId",
          "type": "string",
          "description": "ID/GUID to identify the User to assign the permission to",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "LocationLevel",
          "type": "string",
          "description": "The level in the organizational hierarchy in which the permissions are applied",
          "constraints": {
            "required": true,
            "value": [
              "Organization",
              "Department",
              "Section"
            ]
          }
        },
        {
          "name": "DepartmentId",
          "type": "string",
          "description": "The ID of the department where the permissions are applied - required if LocationLevel is 'Department'"
        },
        {
          "name": "SectionId",
          "type": "string",
          "description": "The ID of the section where the permissions are applied - required if LocationLevel is 'Section'"
        },
        {
          "name": "Permissions",
          "type": "string[]",
          "description": "A list of permissions to grant to the user in the specified location",
          "constraints": {
            "value": [
              "DocumentOwner",
              "DocumentAuthor",
              "UserAdmin"
            ]
          }
        }
      ]
    },
    {
      "name": "DocumentTypes",
      "Fields": [
        {
          "name": "DocumentTypeId",
          "type": "string",
          "description": "ID/GUID to identify the Document Type",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Name",
          "type": "string",
          "description": "The name of the document type",
          "constraints": {
            "required": true,
            "unique": "entity",
            "maxLength": 50
          }
        },
        {
          "name": "Order",
          "type": "integer",
          "description": "The positional index of the document type as displayed in the document types list"
        }
      ]
    },
    {
      "name": "TagSponsors",
      "Fields": [
        {
          "name": "TagSponsorId",
          "type": "string",
          "description": "ID/GUID to identify the executive sponsor tag",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Name",
          "type": "string",
          "description": "Name of the executive sponsor",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Order",
          "type": "integer",
          "description": "The positional index of the sponsor tag as displayed in the document tags list"
        }
      ]
    },
    {
      "name": "TagRiskRatings",
      "Fields": [
        {
          "name": "TagRiskRatingId",
          "type": "string",
          "description": "ID/GUID to identify the risk rating tag",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Name",
          "type": "string",
          "description": "Name of the risk rating",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Order",
          "type": "integer",
          "description": "The positional index of the risk rating tag as displayed in the document tags list"
        }
      ]
    },
    {
      "name": "TagLocations",
      "Fields": [
        {
          "name": "TagLocationId",
          "type": "string",
          "description": "ID/GUID to identify the location tag",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Name",
          "type": "string",
          "description": "Name of the location",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Order",
          "type": "integer",
          "description": "The positional index of the sponsor tag as displayed in the document tags list"
        },
        {
          "name": "IsMandatory",
          "type": "boolean",
          "description": "Whether the location is mandatory",
          "default": false
        }
      ]
    },
    {
      "name": "Documents",
      "Fields": [
        {
          "name": "DocumentId",
          "type": "string",
          "description": "ID/GUID to identify the Document",
          "constraints": {
            "required": true,
            "unique": "entity"
          }
        },
        {
          "name": "Name",
          "type": "string",
          "description": "The name of the document",
          "constraints": {
            "required": true,
            "unique": "parent",
            "minLength": 4
          }
        },
        {
          "name": "DocumentCreatorId",
          "type": "string",
          "description": "The ID of the user that initially created the document",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "DocumentTypeId",
          "type": "string",
          "description": "The ID of the document type that the document is categorized to",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "S3LocationKey",
          "type": "string",
          "description": "The key to be used for the document file in the S3 staging bucket",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "SectionId",
          "type": "string",
          "description": "The ID of the section to which the document belongs",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "VersionMajor",
          "type": "integer",
          "description": "The major version of the document",
          "constraints": {
            "required": true,
            "minValue": 0
          }
        },
        {
          "name": "VersionMinor",
          "type": "integer",
          "description": "The minor version of the document",
          "constraints": {
            "required": true,
            "minValue": 0
          }
        },
        {
          "name": "CreatedDate",
          "type": "string",
          "description": "The date/time that the document was created in UTC",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "UpdatedDate",
          "type": "string",
          "description": "The date/time that the document was last updated in UTC",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "SourceDownloadUrl",
          "type": "string",
          "description": "A URL used to download the document in the origin system"
        },
        {
          "name": "TagSponsorId",
          "type": "string",
          "description": "The ID of the Executive Sponsor tag to assign to the document"
        },
        {
          "name": "TagRiskRatingId",
          "type": "string",
          "description": "The ID of the Risk Rating tag to assign to the document"
        },
        {
          "name": "TagLocationId",
          "type": "string",
          "description": "The ID of the Location tag to assign to the document"
        },
        {
          "name": "ReviewsEnabled",
          "type": "boolean",
          "description": "Whether the review process is enabled for this document",
          "default": false
        },
        {
          "name": "NextReviewDate",
          "type": "string",
          "description": "The next date/time the document is due for review - required if ReviewsEnabled is true"
        },
        {
          "name": "LastReviewDate",
          "type": "string",
          "description": "The last date/time the document was reviewed - required if ReviewsEnabled is true"
        },
        {
          "name": "ReviewFrequencyMonths",
          "type": "integer",
          "description": "The frequency with which the document should be reviewed - required if ReviewsEnabled is true",
          "constraints": {
            "minValue": 1,
            "maxValue": 99
          },
          "default": "inherit"
        },
        {
          "name": "ShouldConvertPdf",
          "type": "boolean",
          "description": "Whether to attempt to convert the document file to PDF",
          "default": false
        },
        {
          "name": "ShouldConvertTags",
          "type": "boolean",
          "description": "Whether to attempt to process footer tags",
          "default": false
        },
        {
          "name": "IsPrivate",
          "type": "boolean",
          "description": "Whether the document is searchable for users of other organizations",
          "default": false
        }
      ]
    },
    {
      "name": "DocumentHistory",
      "Fields": [
        {
          "name": "DocumentHistoryId",
          "type": "string",
          "description": "ID/GUID to identify the Document History event",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "DocumentId",
          "type": "string",
          "description": "The ID of the parent document",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "S3LocationKey",
          "type": "string",
          "description": "The key to be used for the document history file in the S3 staging bucket",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "Comment",
          "type": "string",
          "description": "A comment describing the history event",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "EventDateTime",
          "type": "string",
          "description": "The date/time of the document history event",
          "constraints": {
            "required": true
          }
        },
        {
          "name": "ChangeType",
          "type": "string",
          "description": "The change type of the document history event",
          "constraints": {
            "required": true,
            "value": [
                "AddDocument",
                "ReactivateDocument",
                "ChangeDocument",
                "DisableDocument"
            ]
          }
        },
        {
          "name": "VersionMajor",
          "type": "integer",
          "description": "The historical major version of the document",
          "constraints": {
            "required": true,
            "minValue": 0
          }
        },
        {
          "name": "VersionMinor",
          "type": "integer",
          "description": "The historical minor version of the document",
          "constraints": {
            "required": true,
            "minValue": 0
          }
        },
        {
          "name": "UpdatedBy",
          "type": "string",
          "description": "The ID of the user that updated the document"
        }
      ]
    }
  ]
}