{
	"$schema": "http://json-schema.org/draft-03/schema#",
	"title": "Departmental Distribution Schema",
	"description": "A schema for retrieving a departmental distribution.",
	"type": "object",
	"restdocs": "http://restdocs.e-conomic.com/#get-departmental-distributions-departments",
	"properties": {
		"collection": {
			"type": "array",
			"description": "A collection of departmental distributions.",
			"items": {
				"title": "Departmental Distribution",
				"type": "object",
				"description": "Information about a departmental distribution.",
				"properties": {
					"departmentalDistributionNumber": {
						"type": "integer",
						"filterable": true,
						"sortable": true,
						"description": "A unique numeric identifier for the departmental distribution."
					},
					"name": {
						"type": "string",
						"maxLength": 250,
						"sortable": true,
						"filterable": true,
						"description": "A descriptive name of the departmental distribution."
					},
					"distributionType": {
						"type": "string",
						"enum": ["distribution", "department"],
						"description": "This property indicates whether the distribution is system generated from a departmentor if it is one created by a user. In order to make it easy to distribute everything to one department, the system generates a distribution for each department."
					},
					"barred": {
						"type": "boolean",
						"description": "Property indicating whether the departmental distribution is barred from being used."
					},
					"distributions": {
						"type": "array",
						"description": "A list of departments and their share of the distribution in percentage. The percentages always add up to 100%.",
						"items": {
							"title": "Distribution",
							"type": "object",
							"description": "Description of the distributions that make up a departmental distribution.",
							"properties": {
								"percentage": {
									"type": "number",
									"maximum": 100,
									"minimum": 0,
									"exclusiveMinimum": true,
									"description": "The percentage distributed to this department."
								},
								"department": {
									"type": "object",
									"description": "A reference to the department.",
									"properties": {
										"departmentNumber": {
											"type": "integer",
											"minimum": 1,
											"description": "A unique identifier of the department."
										},
										"self": {
											"type": "string",
											"format": "uri",
											"description": "The unique self reference of the department.",
											"required": true
										}
									}
								}
							}
						}
					},
					"self": {
						"type": "string",
						"format": "uri",
						"description": "The unique self reference of the departmental distribution.",
						"required": true
					}
				}
			}
		},
		"subCollections": {
			"type": "object",
			"description": "Links to the sub collections that make up this collection."
		},
		"self": {
			"type": "string",
			"format": "uri",
			"description": "The unique self reference of the departmental distribution collection.",
			"required": true
		}
	}
}