minor: ruff formatter
All changes are either: - Correcting tabs - Adding/removing line breaks - Adding trailing commas
This commit is contained in:
parent
b2e5dd2ebb
commit
c689ac1e10
91 changed files with 1710 additions and 689 deletions
|
|
@ -6,6 +6,7 @@ Models follow the nomenclature of:
|
|||
- Mixins: "<Attribute>Mixin"
|
||||
- Models: "<Module><Method><Resource><Opt:Resource><Direction>" ie "OrgPostOrgRequest"
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import EmailStr, ConfigDict, Field
|
||||
|
|
@ -20,11 +21,13 @@ from src.organisation.constants import Status, ContactType
|
|||
class OrgIDMixin(CustomBaseModel):
|
||||
organisation_id: int = Field(gt=0)
|
||||
|
||||
|
||||
class Questionnaire(CustomBaseModel):
|
||||
question_one: Optional[str] = None
|
||||
question_two: Optional[str] = None
|
||||
question_three: Optional[str] = None
|
||||
|
||||
|
||||
class OrgSchema(CustomBaseModel):
|
||||
id: int
|
||||
name: str
|
||||
|
|
@ -34,26 +37,32 @@ class OrgPostOrgRequest(CustomBaseModel):
|
|||
name: str
|
||||
intake_questionnaire: Optional[Questionnaire] = None
|
||||
|
||||
|
||||
class OrgPostOrgResponse(CustomBaseModel):
|
||||
name: str
|
||||
status: Status
|
||||
|
||||
|
||||
class OrgPatchQuestionnaireRequest(OrgIDMixin):
|
||||
intake_questionnaire: Questionnaire
|
||||
partial: bool
|
||||
|
||||
|
||||
class OrgPatchQuestionnaireResponse(CustomBaseModel):
|
||||
name: str
|
||||
intake_questionnaire: Questionnaire
|
||||
status: Status
|
||||
|
||||
|
||||
class OrgPatchStatusRequest(OrgIDMixin):
|
||||
status: Status
|
||||
|
||||
|
||||
class OrgPatchStatusResponse(CustomBaseModel):
|
||||
name: str
|
||||
status: Status
|
||||
|
||||
|
||||
class OrgPatchContactRequest(OrgIDMixin):
|
||||
contact_type: ContactType
|
||||
|
||||
|
|
@ -70,41 +79,51 @@ class OrgPatchContactRequest(OrgIDMixin):
|
|||
country_code: Optional[str] = None
|
||||
postal_code: Optional[str] = None
|
||||
|
||||
|
||||
class OrgPostUserRequest(OrgIDMixin, UserIDMixin):
|
||||
pass
|
||||
|
||||
|
||||
class OrgPostUserResponse(CustomBaseModel):
|
||||
users: list[str]
|
||||
|
||||
|
||||
class OrgDeleteUserRequest(OrgIDMixin, UserIDMixin):
|
||||
pass
|
||||
|
||||
|
||||
class OrgPatchRootRequest(OrgIDMixin, UserIDMixin):
|
||||
pass
|
||||
|
||||
|
||||
class OrgPatchRootResponse(CustomBaseModel):
|
||||
name: str
|
||||
root_user_email: str
|
||||
|
||||
|
||||
class OrgGetUserResponse(CustomBaseModel):
|
||||
users: list[str]
|
||||
organisation: OrgSchema
|
||||
|
||||
|
||||
class OrgGetGroupResponse(CustomBaseModel):
|
||||
groups: list[str]
|
||||
|
||||
|
||||
class OrgGetContactResponse(CustomBaseModel):
|
||||
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
||||
|
||||
contact: ContactModel
|
||||
organisation: OrgSchema
|
||||
|
||||
|
||||
class OrgPatchContactResponse(CustomBaseModel):
|
||||
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
||||
|
||||
contact: ContactModel
|
||||
organisation: OrgSchema
|
||||
|
||||
|
||||
class OrgGetOrgResponse(CustomBaseModel):
|
||||
id: int
|
||||
name: str
|
||||
|
|
@ -115,5 +134,6 @@ class OrgGetOrgResponse(CustomBaseModel):
|
|||
security_contact: Optional[str] = None
|
||||
intake_questionnaire: Optional[Questionnaire] = None
|
||||
|
||||
|
||||
class OrgDeleteOrgRequest(OrgIDMixin):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue