Files
notifications-api/app/organisation/organisation_schema.py

61 lines
1.8 KiB
Python
Raw Normal View History

from app.models import INVITED_USER_STATUS_TYPES, ORGANISATION_TYPES
2018-02-10 01:37:17 +00:00
from app.schema_validation.definitions import uuid
post_create_organisation_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST organisation schema",
"type": "object",
"properties": {
"name": {"type": "string"},
"active": {"type": ["boolean", "null"]},
"organisation_type": {"enum": ORGANISATION_TYPES},
},
"required": ["name", "organisation_type"]
}
post_update_organisation_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST organisation schema",
"type": "object",
"properties": {
"name": {"type": ["string", "null"]},
"active": {"type": ["boolean", "null"]},
"organisation_type": {"enum": ORGANISATION_TYPES},
},
"required": []
}
2018-02-10 01:37:17 +00:00
post_link_service_to_organisation_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
2018-02-10 01:37:17 +00:00
"description": "POST link service to organisation schema",
"type": "object",
"properties": {
"service_id": uuid
},
"required": ["service_id"]
}
2018-02-19 15:03:36 +00:00
post_create_invited_org_user_status_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
2018-02-19 15:03:36 +00:00
"description": "POST create organisation invite schema",
"type": "object",
"properties": {
"email_address": {"type": "string", "format": "email_address"},
"invited_by": uuid,
"invite_link_host": {"type": "string"}
},
"required": ["email_address", "invited_by"]
}
post_update_invited_org_user_status_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
2018-02-19 15:03:36 +00:00
"description": "POST update organisation invite schema",
"type": "object",
"properties": {
"status": {"enum": INVITED_USER_STATUS_TYPES}
2018-02-19 15:03:36 +00:00
},
"required": ["status"]
}