{
	"$schema": "http://json-schema.org/draft-03/schema#",
	"title": "Journals schema",
	"description": "A schema for retrieving available endpoints of journals.",
	"type": "object",
	"restdocs": "http://restdocs.e-conomic.com/#get-journals",
	"properties": {
		"collection": {
			"type": "array",
			"description": "The array containing all journals on the agreement among with their settings.",
			"items": {
				"title": "Journal",
				"type": "object",
				"description": "A specific journal.",
				"properties": {
					"name": {
						"title": "Journal",
						"type": "string",
						"sortable": true,
						"filterable": true,
						"description": "The name of the journal"
					},
					"settings": {
						"type": "object",
						"description": "Settings of the journal.",
						"properties": {
							"voucherNumbers": {
								"type": "object",
								"description": "Settings connected with voucher numbering.",
								"properties": {
									"minimumVoucherNumber": {
										"type": "integer",
										"minimum": 0,
										"description": "Minimum voucher number defined in settings."
									},
									"maximumVoucherNumber": {
										"type": "integer",
										"maximum": 999999999,
										"description": "Maximum voucher number defined in settings."
									}
								}
							},
							"entryTypeRestrictedTo": {
								"enum": ["financeVoucher", "supplierInvoice", "supplierPayment", "customerPayment", "manualCustomerInvoice"],
								"description": "Allowed entry type on given journal."
							},
							"contraAccounts": {
								"type": "object",
								"description": "Default contra account for given entry type",
								"properties": {
									"customerPayments": {
										"type": "object",
										"description": "Default contra account for the customer payment",
										"properties": {
											"accountNumber": {
												"type": "integer",
												"description": "Account number used for registering customer payment entry type"
											},
											"self": {
												"type": "string",
												"format": "uri",
												"description": "The unique self reference of the account resource.",
												"required": true
											}
										}
									},
									"supplierPayments": {
										"type": "object",
										"description": "Default contra account for the supplier payment",
										"properties": {
											"accountNumber": {
												"type": "integer",
												"description": "Account number used for registering supplier payment entry type"
											},
											"self": {
												"type": "string",
												"format": "uri",
												"description": "The unique self reference of the account resource.",
												"required": true
											}
										}
									},
									"financeVouchers": {
										"type": "object",
										"description": "Default contra account for the finance voucher",
										"properties": {
											"accountNumber": {
												"type": "integer",
												"description": "Account number used for registering finance voucher entry type"
											},
											"self": {
												"type": "string",
												"format": "uri",
												"description": "The unique self reference of the account resource.",
												"required": true
											}
										}
									}
								}
							}
						}
					},
					"vouchers": {
						"type": "string",
						"format": "uri",
						"description": "A link to the collection of vouchers on the given journal, categorized according to the type."
					},
					"entries": {
						"type": "string",
						"format": "uri",
						"description": "A link to the collection of entries in the given journal, regardless of their type."
					},
					"templates": {
						"type": "object",
						"description": "Templates allowing easy entry creation.",
						"properties": {
							"financeVoucher": {
								"type": "string",
								"format": "uri",
								"description": "The unique reference to the finance voucher template"
							},
							"manualCustomerInvoice": {
								"type": "string",
								"format": "uri",
								"description": "The unique reference to the manual customer invoice template"
							},
							"self": {
								"type": "string",
								"format": "uri",
								"description": "A unique link reference to the templates resource.",
								"required": true
							}
						}
					},
					"journalNumber": {
						"type": "integer",
						"sortable": true,
						"filterable": true,
						"description": "Unique journal number"
					},
					"metaData": {
						"type": "object",
						"description": "Information about possible actions, endpoints and resource paths related to the endpoint."
					},
					"pagination": {
						"type": "object",
						"description": "Information about the pagination."
					},
					"self": {
						"type": "string",
						"format": "uri",
						"description": "The unique self reference of the jounrnals collection.",
						"required": true
					}
				}
			}
		},
		"metaData": {
			"type": "object",
			"description": "Information about possible actions, endpoints and resource paths related to the endpoint."
		},
		"pagination": {
			"type": "object",
			"description": "Information about the pagination."
		},
		"self": {
			"type": "string",
			"format": "uri",
			"description": "The unique self reference of the journals collection.",
			"required": true
		}
	}
}