55 lines
1.2 KiB
Python
55 lines
1.2 KiB
Python
|
|
"""
|
||
|
|
Pydantic models for organisation module
|
||
|
|
|
||
|
|
Models:
|
||
|
|
- List: Description
|
||
|
|
- Models: Description
|
||
|
|
"""
|
||
|
|
from typing import Optional
|
||
|
|
from pydantic import Json
|
||
|
|
|
||
|
|
from src.schemas import CustomBaseModel
|
||
|
|
from src.organisation.constants import Status, ContactType
|
||
|
|
|
||
|
|
|
||
|
|
class OrgOrgPostRequest(CustomBaseModel):
|
||
|
|
name: str
|
||
|
|
intake_questionnaire: Optional[Json] = None
|
||
|
|
|
||
|
|
billing_contact_id: Optional[int] = None
|
||
|
|
security_contact_id: Optional[int] = None
|
||
|
|
owner_contact_id: Optional[int] = None
|
||
|
|
|
||
|
|
class OrgQuestionnairePatchRequest(CustomBaseModel):
|
||
|
|
intake_questionnaire: Json
|
||
|
|
partial: bool
|
||
|
|
|
||
|
|
class OrgStatusPatchRequest(CustomBaseModel):
|
||
|
|
status: Status
|
||
|
|
|
||
|
|
class OrgContactPatchRequest(CustomBaseModel):
|
||
|
|
contact_id: int
|
||
|
|
contact_type: ContactType
|
||
|
|
|
||
|
|
class OrgUserPostRequest(CustomBaseModel):
|
||
|
|
user_id: int
|
||
|
|
is_admin: Optional[bool] = False
|
||
|
|
|
||
|
|
class OrgUserGetResponse(CustomBaseModel):
|
||
|
|
user_id: int
|
||
|
|
is_admin: bool
|
||
|
|
|
||
|
|
class OrgContactGetResponse(CustomBaseModel):
|
||
|
|
email: str
|
||
|
|
first_name: str
|
||
|
|
last_name: str
|
||
|
|
phonenumber: str
|
||
|
|
vat_number: Optional[str] = None
|
||
|
|
|
||
|
|
class OrgOrgGetResponse(CustomBaseModel):
|
||
|
|
name: str
|
||
|
|
status: Status
|
||
|
|
owner_contact: OrgContactGetResponse
|
||
|
|
billing_contact: OrgContactGetResponse
|
||
|
|
security_contact: OrgContactGetResponse
|