For our registration, we want to have more specific fields regarding what our application data is like. As such, add these fields to the application
model under the registration
service. Change the field applicationData
from Mixed, to having these fields:
- adult (boolean, determines if they're 18 or older)
- occupation (string, enum, student or worker, determines if theyre a student or worker)
- school (string, school of person)
- graduationYear (number)
- major (string)
- shirtSize (string)
- dietaryRestrictions (string)
- phoneNumber (string)
- gender (string)
- ethnicity (string
- Address
- line1
- line2
- city
- state
- zip
- country
- website
- linkedIn
Additionally, to handle other info that can vary per hackathon, we have these fields
- extraInfo (is an array of objects, can be any other questions thats determined per hackathon)
- confirmChecks (an object, that has strings to booleans, has checks like "agreesToWaiver: true", "consentsToPhotos: true")
- essays (an array of objects, that contains extra essay info for each applicant)
Based on these changes, update the application
routes to handle this case. The input format for the /
POST route and the /:id
PATCH route should look like this:
- applicationStatus (string, required, either DRAFT or SUBMIT, determines if the application is being submitted or not)
- applicationData (an object containing all of the data as listed above)
- hexathon (an id field containing the id of the hexathon)
- branch (an id field containing the id of the branch to apply to)
Based on these fields, create/update an application. If it's a new application being submitted, set the applicationStartTime
field. And then, only if the applicationStatus
is SUBMIT, set the applicationSubmitTime
field.
Then, create a new route to handle the confirmation, as a POST to /:id/confirmation
. This data input should look like this:
- confirmationData
- hexathon
Based on this, set the confirmationStartTime
and confirmationSubmitTime
which will be the same value, as we won't allow them to save the status as a draft.