Add Organisations endpoints

As part of this we also needed to add:
- schemas for validation
- serialize method for Organisation model
This commit is contained in:
Katie Smith
2018-02-08 14:54:08 +00:00
parent 6a79eedbce
commit 269923ba28
6 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
post_create_organisation_schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "POST organisation schema",
"type": "object",
"properties": {
"name": {"type": "string"},
"active": {"type": ["boolean", "null"]}
},
"required": ["name"]
}
post_update_organisation_schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "POST organisation schema",
"type": "object",
"properties": {
"name": {"type": ["string", "null"]},
"active": {"type": ["boolean", "null"]}
},
"required": []
}