2026-04-06 12:41:49 +01:00
|
|
|
"""
|
|
|
|
|
Pydantic models for organisation module
|
|
|
|
|
|
|
|
|
|
Models:
|
|
|
|
|
- List: Description
|
|
|
|
|
- Models: Description
|
|
|
|
|
"""
|
2026-05-19 12:10:06 +01:00
|
|
|
from typing import Optional, Any
|
2026-04-06 12:41:49 +01:00
|
|
|
from pydantic import Json
|
|
|
|
|
|
|
|
|
|
from src.schemas import CustomBaseModel
|
|
|
|
|
from src.organisation.constants import Status, ContactType
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OrgOrgPostRequest(CustomBaseModel):
|
|
|
|
|
name: str
|
2026-05-19 12:10:06 +01:00
|
|
|
intake_questionnaire: Optional[Json[Any]] = None
|
2026-04-06 12:41:49 +01:00
|
|
|
|
|
|
|
|
billing_contact_id: Optional[int] = None
|
|
|
|
|
security_contact_id: Optional[int] = None
|
|
|
|
|
owner_contact_id: Optional[int] = None
|
|
|
|
|
|
|
|
|
|
class OrgQuestionnairePatchRequest(CustomBaseModel):
|
2026-05-19 12:10:06 +01:00
|
|
|
intake_questionnaire: Json[Any]
|
2026-04-06 12:41:49 +01:00
|
|
|
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
|