Initial commit
This commit is contained in:
commit
376a7a9fe5
71 changed files with 2326 additions and 0 deletions
54
src/organisation/schemas.py
Normal file
54
src/organisation/schemas.py
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
"""
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue