1+ import os
12from enum import Enum
23from typing import Optional
34
4- import os
5- from datetime import datetime
6- from pydantic import BaseModel , EmailStr , Extra , Field
5+ from pydantic import BaseModel , EmailStr , Field , HttpUrl , root_validator , validator
76from pynamodb .attributes import BooleanAttribute , NumberAttribute , UnicodeAttribute
8- from pynamodb .indexes import AllProjection , GlobalSecondaryIndex , LocalSecondaryIndex
97from pynamodb .models import Model
108
11- from pydantic import BaseModel , EmailStr , Field , HttpUrl , root_validator , validator
12-
139
1410class SocialMedia (BaseModel ):
1511 linkedIn : Optional [HttpUrl ] = Field (None , title = 'LinkedIn Profile URL' )
@@ -90,12 +86,13 @@ def check_shirt_availability(cls, values):
9086 raise ValueError ('If availTShirt is True, then shirtType and shirtSize must be provided.' )
9187 return values
9288
89+
9390class Registration (Model ):
9491 class Meta :
9592 table_name = os .getenv ('REGISTRATIONS_TABLE' )
9693 region = os .getenv ('REGION' )
9794 billing_mode = 'PAY_PER_REQUEST'
98-
95+
9996 registrationId = UnicodeAttribute (null = False )
10097 hashKey = UnicodeAttribute (hash_key = True )
10198 rangeKey = UnicodeAttribute (range_key = True )
@@ -104,23 +101,23 @@ class Meta:
104101 lastName = UnicodeAttribute (null = True )
105102 nickname = UnicodeAttribute (null = True )
106103 pronouns = UnicodeAttribute (null = True )
107-
104+
108105 email = UnicodeAttribute (null = True )
109106 contactNumber = UnicodeAttribute (null = True )
110107
111108 organization = UnicodeAttribute (null = True )
112109 jobTitle = UnicodeAttribute (null = True )
113110
114- socials = UnicodeAttribute (null = True )
111+ socials = UnicodeAttribute (null = True )
115112
116113 ticketType = UnicodeAttribute (null = True )
117- sprintDay = UnicodeAttribute (null = True )
118- availTShirt = UnicodeAttribute (null = True )
119- shirtType = UnicodeAttribute (null = True )
120- shirtSize = UnicodeAttribute (null = True )
114+ sprintDay = UnicodeAttribute (null = True )
115+ availTShirt = UnicodeAttribute (null = True )
116+ shirtType = UnicodeAttribute (null = True )
117+ shirtSize = UnicodeAttribute (null = True )
121118
122- communityInvolvement = UnicodeAttribute (null = True )
123- futureVolunteer = UnicodeAttribute (null = True )
119+ communityInvolvement = UnicodeAttribute (null = True )
120+ futureVolunteer = UnicodeAttribute (null = True )
124121
125122 dietaryRestrictions = UnicodeAttribute (null = True )
126123 accessibilityNeeds = UnicodeAttribute (null = True )
@@ -134,15 +131,15 @@ class Meta:
134131 referenceNumber = UnicodeAttribute (null = True )
135132 amountPaid = NumberAttribute (null = True )
136133 transactionId = UnicodeAttribute (null = True )
137-
134+
138135 registrationEmailSent = BooleanAttribute (default = False )
139136 confirmationEmailSent = BooleanAttribute (default = False )
140137
141138 createDate = UnicodeAttribute (null = False )
142139 updateDate = UnicodeAttribute (null = False )
143140
144- class PyconRegistrationIn (PyconRegistration ):
145141
142+ class PyconRegistrationIn (PyconRegistration ):
146143 gcashPayment = UnicodeAttribute (null = True )
147144 referenceNumber = UnicodeAttribute (null = True )
148145 amountPaid = NumberAttribute (null = True )
0 commit comments