{
	"$schema": "http://json-schema.org/draft-03/schema#",
	"title": "Journals GET schema",
	"description": "A schema for fetching specific journal.",
	"type": "object",
	"restdocs": "http://restdocs.e-conomic.com/#get-journals-journalnumber",
	"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",
							"minimum": 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": {
							"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": {
							"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": {
							"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 on 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"
		},
		"self": {
			"type": "string",
			"format": "uri",
			"description": "The unique self reference of the jounrnals collection.",
			"required": true
		}
	}
}