Compare commits
No commits in common. "committees" and "master" have entirely different histories.
committees
...
master
@ -6,7 +6,6 @@ from .enums import Membership, OnlineAlmanacField
|
||||
from .submodels import Address, LoginInfo
|
||||
|
||||
class MemberModel(FormerMemberModel):
|
||||
# requires that Membership equals member
|
||||
membership: Annotated[Membership, Field(pattern="member")]
|
||||
|
||||
login: LoginInfo
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
from pydantic import BaseModel
|
||||
from fiber_package.util import EntityList, GroupList, GroupRef
|
||||
|
||||
from .enums import CommitteeType
|
||||
|
||||
'''
|
||||
A committee represents any group of members
|
||||
'''
|
||||
|
||||
class CommitteeModel(BaseModel):
|
||||
full_name_EN: str
|
||||
full_name_NL: str
|
||||
description_EN: str
|
||||
description_NL: str
|
||||
|
||||
active: bool = True
|
||||
|
||||
editions: GroupList("committee_edition", [])
|
||||
current_edition: GroupRef("committee_edition", None)
|
||||
|
||||
@model_validator(mode='after')
|
||||
def current_edition_in_editions(self) -> Self:
|
||||
uuid = self.current_edition.uuid
|
||||
if uuid is None:
|
||||
return self
|
||||
if uuid not in self.editions.uuids:
|
||||
raise ValueError("Current edition must be in list of editions")
|
||||
return self
|
||||
|
||||
class CommitteeEditionModel(BaseModel):
|
||||
members: EntityList = EntityList("member", [])
|
||||
functions: dict[UUID4, str]
|
||||
|
||||
@model_validator(mode='after')
|
||||
def functions_to_members_only(self) -> Self:
|
||||
for uuid in self.functions.keys():
|
||||
if uuid not in self.members.uuids:
|
||||
raise ValueError("Cannot only assign functions to members")
|
||||
return self
|
||||
@ -1,9 +0,0 @@
|
||||
from enum import StrEnum
|
||||
|
||||
class CommitteeType(StrEnum):
|
||||
board_committee: "Board committee"
|
||||
GMM_committee: "GMM committee"
|
||||
guild: "Guild"
|
||||
subassociation_board: "Subassociation board"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user