-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add support for custom confirmation email
- Loading branch information
1 parent
8e7cd1e
commit ed7f220
Showing
4 changed files
with
139 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,15 @@ | |
|
||
from pydantic.fields import Field | ||
|
||
|
||
class Status(str, Enum): | ||
active = "active" | ||
inactive = "inactive" | ||
|
||
def __str__(self): | ||
return self.value | ||
|
||
|
||
class Role(str, Enum): | ||
admin = "admin" | ||
member = "member" | ||
|
@@ -20,6 +22,7 @@ class Role(str, Enum): | |
def __str__(self): | ||
return self.value | ||
|
||
|
||
class MailPayload(BaseModel): | ||
""" | ||
Mail model used to define emails sent from server | ||
|
@@ -37,6 +40,7 @@ class MailPayload(BaseModel): | |
to: List[EmailStr] | ||
sent_by: str = "[email protected]" | ||
|
||
|
||
class AccessTokenPayload(BaseModel): | ||
exp: int | ||
iat: int | ||
|
@@ -60,6 +64,7 @@ class MemberInput(BaseModel): | |
graduated: bool | ||
phone: Optional[str] = None | ||
|
||
|
||
class AdminMemberUpdate(BaseModel): | ||
realName: Optional[str] = None | ||
role: Optional[Role] = None | ||
|
@@ -76,6 +81,7 @@ class MemberUpdate(BaseModel): | |
classof: Optional[str] = None | ||
phone: Optional[str] = None | ||
|
||
|
||
class MemberDB(BaseModel, use_enum_values=True): | ||
id: UUID4 | ||
realName: str | ||
|
@@ -137,7 +143,8 @@ class Participant(BaseModel): | |
|
||
|
||
class ParticipantPosUpdate(BaseModel): | ||
updateList: List[create_model('ParticipantPosUpdate', id=(UUID4, ...), pos=(int, ...))] | ||
updateList: List[create_model( | ||
'ParticipantPosUpdate', id=(UUID4, ...), pos=(int, ...))] | ||
|
||
|
||
class EventInput(BaseModel): | ||
|
@@ -190,6 +197,9 @@ class EventUpdate(BaseModel): | |
confirmed: Optional[bool] = None | ||
|
||
|
||
class EventConfirmMessage(BaseModel): | ||
msg: Optional[str] = None | ||
|
||
class EventDB(Event): | ||
participants: List[Participant] | ||
|
||
|
@@ -227,7 +237,7 @@ class JoinEventPayload(BaseModel): | |
class PenaltyInput(BaseModel): | ||
penalty: int = Field( | ||
ge=0, description="Penalty must be larger or equal to 0") | ||
|
||
|
||
class SetAttendancePayload(BaseModel): | ||
member_id: Optional[str] = None | ||
|
@@ -247,6 +257,7 @@ class JobItemPayload(BaseModel): | |
start_date: Optional[datetime] = None | ||
due_date: Optional[datetime] = None | ||
|
||
|
||
class UpdateJob(BaseModel): | ||
company: Optional[str] = None | ||
title: Optional[str] = None | ||
|
@@ -260,6 +271,7 @@ class UpdateJob(BaseModel): | |
start_date: Optional[datetime] = None | ||
due_date: Optional[datetime] = None | ||
|
||
|
||
class JobItem(JobItemPayload): | ||
id: UUID4 | ||
|
||
|
@@ -270,20 +282,24 @@ class UniqueVisitsStructure(BaseModel): | |
bloom_filter: bytes | ||
timestamps: List[date] | ||
|
||
|
||
class PageVisitsStructure(BaseModel): | ||
# tracks | ||
# tracks | ||
url_dict: Dict[str, int] | ||
|
||
|
||
class PageVisitStamp(BaseModel): | ||
pass | ||
|
||
|
||
class PageVisit(BaseModel): | ||
page: str | ||
|
||
|
||
class PageVisits(PageVisit): | ||
start: date | ||
end: date | ||
|
||
|
||
class Stats(BaseModel): | ||
date: date | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.