added associate membership status
This commit is contained in:
parent
c90813ed23
commit
1c50509082
16
src/fiber_package/entity/associate.py
Normal file
16
src/fiber_package/entity/associate.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from pydantic import Field
|
||||||
|
|
||||||
|
from .person import PersonModel
|
||||||
|
from .submodels import Address, LoginInfo
|
||||||
|
from .enums import Study
|
||||||
|
|
||||||
|
# An associate is someone who frequents activities & receives weekly mailing
|
||||||
|
# However this person is not a full member, so no GMM rights
|
||||||
|
# Combines concepts of "Nano-science" from DLF and "Activity-goer" from Kaiser
|
||||||
|
|
||||||
|
class AssociateModel(PersonModel):
|
||||||
|
# optional fields are now required for associates & members
|
||||||
|
login: LoginInfo
|
||||||
|
address: Address
|
||||||
|
|
||||||
|
|
||||||
@ -8,3 +8,11 @@ class Gender(StrEnum):
|
|||||||
male = "m"
|
male = "m"
|
||||||
female = "f"
|
female = "f"
|
||||||
nonbinary = "n"
|
nonbinary = "n"
|
||||||
|
|
||||||
|
class Study(StrEnum):
|
||||||
|
bsc_math = "Bachelor Mathematics"
|
||||||
|
bsc_phys = "Bachelor Physics"
|
||||||
|
bsc_dsai = "Bachelor Data Science & AI"
|
||||||
|
msc_math = "Master Mathematics"
|
||||||
|
msc_phys = "Master Physics"
|
||||||
|
min_dsai = "Minor Data Science & AI"
|
||||||
@ -1,19 +1,16 @@
|
|||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
|
|
||||||
from .person import PersonModel
|
from .associate import AssociateModel
|
||||||
from .submodels import Address, LoginInfo
|
from .submodels import Address, LoginInfo
|
||||||
|
from .enums import Study
|
||||||
|
|
||||||
class MemberModel(PersonModel):
|
class MemberModel(AssociateModel):
|
||||||
login: LoginInfo
|
study: list[Study] = Field(default_factory=list)
|
||||||
address: Address
|
|
||||||
contribution_paid: bool = False
|
contribution_paid: bool = False
|
||||||
active_member: bool = False
|
active_member_override: bool = False
|
||||||
studying: bool = False
|
|
||||||
|
|
||||||
# preferences
|
# preferences
|
||||||
receive_company_mail: bool = True
|
receive_company_mail: bool = True
|
||||||
receive_spam_mail: bool = True
|
receive_physical_mail: bool = True
|
||||||
in_physical_almanac: bool = False
|
in_physical_almanac: bool = False
|
||||||
# IT stuff
|
|
||||||
shell: str = "/bin/bash" # TODO: support other shells?
|
|
||||||
mail_token: str | None = None
|
|
||||||
|
|||||||
@ -2,8 +2,7 @@
|
|||||||
from .person import PersonModel
|
from .person import PersonModel
|
||||||
|
|
||||||
class AlumnModel(PersonModel):
|
class AlumnModel(PersonModel):
|
||||||
graduated: bool = False
|
pass
|
||||||
receive_spam_mail: bool = True
|
|
||||||
|
|
||||||
class ExternalModel(PersonModel):
|
class ExternalModel(PersonModel):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -6,7 +6,7 @@ BARE_TAGS = ["public"]
|
|||||||
|
|
||||||
class Membership(StrEnum):
|
class Membership(StrEnum):
|
||||||
member = "member"
|
member = "member"
|
||||||
activity_goer = "activity_goer"
|
associate = "associate"
|
||||||
alumn = "alumn"
|
alumn = "alumn"
|
||||||
# extern is linked to association A if they ever visisted an activity of association A
|
# extern is linked to association A if they ever visisted an activity of association A
|
||||||
extern = "extern"
|
extern = "extern"
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
from fiber_package.base import FiberBaseModel
|
|
||||||
from fiber_package.refs import AssociationRefList, EntityRefList
|
|
||||||
|
|
||||||
class RootGroupModel(FiberBaseModel):
|
|
||||||
sys_admins: EntityRefList
|
|
||||||
Loading…
x
Reference in New Issue
Block a user