2024-01-15 16:45:55 -05:00
|
|
|
from app.enums import InvitedUserStatus, OrganizationType
|
2018-02-10 01:37:17 +00:00
|
|
|
from app.schema_validation.definitions import uuid
|
|
|
|
|
|
2023-07-10 11:06:29 -07:00
|
|
|
post_create_organization_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
2023-07-10 11:06:29 -07:00
|
|
|
"description": "POST organization schema",
|
2018-02-08 14:54:08 +00:00
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"name": {"type": "string"},
|
2019-07-03 14:53:20 +01:00
|
|
|
"active": {"type": ["boolean", "null"]},
|
2024-01-15 16:45:55 -05:00
|
|
|
"organization_type": {"enum": [e.value for e in OrganizationType]},
|
2018-02-08 14:54:08 +00:00
|
|
|
},
|
2023-08-29 14:54:30 -07:00
|
|
|
"required": ["name", "organization_type"],
|
2018-02-08 14:54:08 +00:00
|
|
|
}
|
|
|
|
|
|
2023-07-10 11:06:29 -07:00
|
|
|
post_update_organization_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
2023-07-10 11:06:29 -07:00
|
|
|
"description": "POST organization schema",
|
2018-02-08 14:54:08 +00:00
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"name": {"type": ["string", "null"]},
|
2019-07-03 14:53:20 +01:00
|
|
|
"active": {"type": ["boolean", "null"]},
|
2024-01-15 16:45:55 -05:00
|
|
|
"organization_type": {"enum": [e.value for e in OrganizationType]},
|
2018-02-08 14:54:08 +00:00
|
|
|
},
|
2023-08-29 14:54:30 -07:00
|
|
|
"required": [],
|
2018-02-08 14:54:08 +00:00
|
|
|
}
|
2018-02-10 01:37:17 +00:00
|
|
|
|
2023-07-10 11:06:29 -07:00
|
|
|
post_link_service_to_organization_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
2023-07-10 11:06:29 -07:00
|
|
|
"description": "POST link service to organization schema",
|
2018-02-10 01:37:17 +00:00
|
|
|
"type": "object",
|
2023-08-29 14:54:30 -07:00
|
|
|
"properties": {"service_id": uuid},
|
|
|
|
|
"required": ["service_id"],
|
2018-02-10 01:37:17 +00:00
|
|
|
}
|
2018-02-19 15:03:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
post_create_invited_org_user_status_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
2023-07-10 11:06:29 -07:00
|
|
|
"description": "POST create organization invite schema",
|
2018-02-19 15:03:36 +00:00
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"email_address": {"type": "string", "format": "email_address"},
|
|
|
|
|
"invited_by": uuid,
|
2023-08-29 14:54:30 -07:00
|
|
|
"invite_link_host": {"type": "string"},
|
2018-02-19 15:03:36 +00:00
|
|
|
},
|
2023-08-29 14:54:30 -07:00
|
|
|
"required": ["email_address", "invited_by"],
|
2018-02-19 15:03:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
post_update_invited_org_user_status_schema = {
|
2022-04-08 17:05:59 +01:00
|
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
2023-07-10 11:06:29 -07:00
|
|
|
"description": "POST update organization invite schema",
|
2018-02-19 15:03:36 +00:00
|
|
|
"type": "object",
|
2024-01-15 16:45:55 -05:00
|
|
|
"properties": {"status": {"enum": [e.value for e in InvitedUserStatus]}},
|
2023-08-29 14:54:30 -07:00
|
|
|
"required": ["status"],
|
2018-02-19 15:03:36 +00:00
|
|
|
}
|