diff --git a/.gitignore b/.gitignore index ea48d65..00d593e 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,5 @@ lerna-debug.log* !.vscode/launch.json !.vscode/extensions.json -.env \ No newline at end of file +.env +.djlintrc diff --git a/schemas/temporary-teacher-application.json b/schemas/temporary-teacher-application.json new file mode 100644 index 0000000..2a01d8c --- /dev/null +++ b/schemas/temporary-teacher-application.json @@ -0,0 +1,422 @@ +{ + "id": "temporary-teacher-application", + "name": "Temporary Teacher Application", + "description": "Apply to be a temporary teacher", + "fields": [ + { + "name": "applicant", + "type": "object", + "required": true, + "fields": [ + { + "name": "firstName", + "type": "string", + "label": "First Name", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + { + "name": "middleName", + "type": "string", + "label": "Middle name(s)", + "required": false, + "validations": { + "max": 50 + } + }, + { + "name": "lastName", + "type": "string", + "label": "Last Name", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + { + "name": "dateOfBirth", + "type": "date", + "label": "Date of Birth", + "required": true, + "validations": { + "regex": "^\\d{4}-\\d{2}-\\d{2}$", + "message": "Date must be in YYYY-MM-DD format" + } + }, + { + "name": "placeOfBirth", + "type": "string", + "label": "Place of birth", + "required": true + }, + { + "name": "nationality", + "type": "string", + "label": "Nationality", + "required": true + }, + { + "name": "sex", + "type": "string", + "label": "Sex", + "required": true, + "validations": { + "regex": "^(male|female)$", + "message": "Must select a valid sex" + } + }, + { + "name": "maritalStatus", + "type": "string", + "label": "Marital status", + "required": true, + "validations": { + "regex": "^(single|married|divorced)$", + "message": "Must select a marital status" + } + }, + { + "name": "nationalIdNumber", + "type": "string", + "label": "National Identification (ID) number", + "required": false, + "validations": { + "regex": "^[0-9]{6}-[0-9]{4}$", + "message": "Invalid ID number." + } + }, + { + "name": "passportNumber", + "type": "string", + "label": "Passport Number (#)", + "required": false + }, + { + "name": "nationalInsuranceNumber", + "type": "string", + "label": "National Insurance number (NIS)", + "required": false + } + ] + }, + { + "name": "barbadosResidencyDuration", + "type": "object", + "required": false, + "fields": [ + { + "name": "residencyDuration", + "label": "How long have you lived in Barbados?", + "type": "string", + "required": true, + "validations": { + "min": 2, + "max": 20, + "message": "Input must be between 2 and 20 characters" + } + } + ] + }, + { + "name": "contact", + "type": "object", + "required": true, + "fields": [ + { + "name": "addressLine1", + "type": "string", + "label": "Address Line 1", + "required": true + }, + { + "name": "addressLine2", + "type": "string", + "label": "Address Line 2", + "required": false + }, + { + "name": "country", + "type": "string", + "label": "Country", + "required": true + }, + { + "name": "parish", + "type": "string", + "label": "Parish", + "required": false, + "validations": { + "regex": "^(christ-church|st-andrew|st-george|st-james|st-john|st-joseph|st-lucy|st-michael|st-peter|st-philip|st-thomas)$", + "message": "Must select a valid parish" + } + }, + { + "name": "postcode", + "type": "string", + "label": "Postcode", + "required": false, + "validations": { + "regex": "^BB\\d{5}$", + "message": "Enter a valid postal code (e.g., BB17004)" + } + }, + { + "name": "emailAddress", + "type": "email", + "label": "Email address", + "required": true + }, + { + "name": "telephoneNumber", + "type": "string", + "label": "Telephone Number", + "required": true + } + ] + }, + { + "name": "applicantEducation", + "type": "array", + "label": "Applicant Information", + "required": true, + "items": { + "type": "object", + "properties": { + "nameOfInstitution": { + "type": "string" + }, + "country": { + "type": "string", + "required": false + }, + "startYear": { + "type": "string", + "validations": { + "regex": "^[0-9]{4}$" + } + }, + "endYear": { + "type": "string", + "validations": { + "regex": "^[0-9]{4}$" + } + } + } + } + }, + { + "name": "qualifications", + "type": "array", + "label": "Applicant Qualifications", + "required": true, + "items": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "examiningBody": { + "type": "string", + "required": true + }, + "year": { + "type": "string", + "validations": { + "regex": "^[0-9]{4}$" + } + }, + "levelGrade": { + "type": "string", + "required": true + } + } + } + }, + { + "name": "workExperiences", + "required": true, + "type": "array", + "label": "Applicant Work Experience", + "items": { + "employerName": { + "type": "string", + "required": true + }, + "positionHeld": { + "type": "string", + "required": true + }, + "fromYear": { + "type": "string", + "required": true, + "validations": { + "regex": "^[0-9]{4}$" + } + }, + "toYear": { + "type": "string", + "required": false, + "validations": { + "regex": "^[0-9]{4}$" + } + }, + "currentlyWorking": { + "type": "boolean", + "required": false + }, + "tasks": { + "required": true, + "type": "string" + } + } + }, + { + "name": "skillsAndExperience", + "type": "object", + "required": true, + "fields": [ + { + "name": "athleticsGamesCraftSkills", + "label": "Athletics, games, or craft skills", + "type": "string", + "required": false + }, + { + "name": "youthCommunityVolunteerGroups", + "label": "Experience in youth, community, or volunteer groups", + "type": "string", + "required": false + }, + { + "name": "responsibilityPositions", + "label": "Positions of responsibility held", + "type": "string", + "required": false + }, + { + "name": "extraDetails", + "label": "Anything else relevant to your application?", + "type": "string", + "required": false + } + ] + }, + { + "name": "references", + "required": true, + "type": "array", + "label": "Tell us about your reference", + "items": { + "title": { + "required": true, + "type": "string", + "validations": { + "regex": "^(mr|ms|mrs)$", + "message": "Must select a valid title" + } + }, + "firstName": { + "type": "string", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + "lastName": { + "type": "string", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + "addressLine1": { + "type": "string", + "required": true + }, + "addressLine2": { + "type": "string", + "required": false + }, + "country": { + "type": "string", + "required": true, + "validations": { + "regex": "^(barbados)$", + "message": "Must select an option" + } + }, + "parish": { + "type": "string", + "required": true, + "validations": { + "regex": "^(christ-church|st-andrew|st-george|st-james|st-john|st-joseph|st-lucy|st-michael|st-peter|st-philip|st-thomas)$", + "message": "Must select a valid parish" + } + }, + "postcode": { + "type": "string", + "required": false, + "validations": { + "regex": "^BB\\d{5}$", + "message": "Enter a valid postal code (e.g., BB17004)" + } + }, + "occupation": { + "required": true, + "type": "string" + }, + "emailAddress": { + "type": "email", + "required": true + }, + "telephoneNumber": { + "type": "string", + "required": true + } + } + }, + { + "name": "documents", + "type": "object", + "required": true, + "fields": [ + { + "name": "certificateDiplomaTranscriptUrls", + "label": "Upload your certificates, diplomas, and transcripts", + "required": false, + "type": "string" + }, + { + "name": "testimonialsUrls", + "label": "Upload your two testimonials", + "required": false, + "type": "string" + } + ] + } + ], + "processors": [ + { + "type": "email", + "config": { + "to": "{{db:temporary-teacher-application:admin_email}}", + "subject": "New Temporary Teacher Application - {{formData.applicant.firstName}} {{formData.applicant.lastName}}", + "template": "temporary-teacher-application" + } + }, + { + "type": "email", + "config": { + "to": "{{formData.contact.emailAddress}}", + "subject": "Application Received - Government of Barbados", + "template": "temporary-teacher-application-receipt" + } + } + ] +} diff --git a/src/email/templates/temporary-teacher-application-receipt.hbs b/src/email/templates/temporary-teacher-application-receipt.hbs new file mode 100644 index 0000000..41271b0 --- /dev/null +++ b/src/email/templates/temporary-teacher-application-receipt.hbs @@ -0,0 +1,122 @@ + + + + + + +
+

Application Submitted: Temporary Teacher

+
+
+
+

+ Dear applicant, +
+ Your application to be a temporary teacher has been submitted. +
+ Your application reference number is {{ referenceNumber }}. +

+

+ We will review your application. +
+ If we need more information or supporting documents, we will contact you using the details you provided. +

+
+
+ + + diff --git a/src/email/templates/temporary-teacher-application.hbs b/src/email/templates/temporary-teacher-application.hbs new file mode 100644 index 0000000..8093058 --- /dev/null +++ b/src/email/templates/temporary-teacher-application.hbs @@ -0,0 +1,333 @@ + + + + + +
+

Temporary Teacher Application

+
+
+

A new Temporary Teacher Application has been submitted.

+
+
Applicant
+
+ Name: + {{ applicant.firstName }} + {{#if applicant.middleName}} + {{ applicant.middleName }} + {{/if}} + {{ applicant.lastName }} +
+
+ Date of Birth: + {{ applicant.dateOfBirth }} +
+
+ Place of birth: + {{ applicant.placeOfBirth }} +
+
+ Nationality: + {{ applicant.nationality }} +
+
+ Sex: + {{ applicant.sex }} +
+
+ Marital Status: + {{ applicant.maritalStatus }} +
+ {{#if applicant.nationalIdNumber}} +
+ National Identification (ID) Number: + {{ applicant.nationalIdNumber }} +
+ {{/if}} + {{#if applicant.passportNumber}} +
+ Passport Number (#): + {{ applicant.passportNumber }} +
+ {{/if}} + {{#if applicant.nationalInsuranceNumber}} +
+ National Insurance Number (NIS): + {{ applicant.nationalInsuranceNumber }} +
+ {{/if}} +
+
+
Barbados Residency Duration
+
+ How long have you lived in Barbados?: + {{ barbadosResidencyDuration.residencyDuration }} +
+
+
+
Contact
+
+ Address: + {{ contact.addressLine1 }} + {{#if contact.addressLine2}} + {{ contact.addressLine2 }} + {{/if}} + +
+
+ Country: + {{ contact.country }} +
+
+ Parish: + {{ contact.parish }} +
+ {{#if contact.postcode}} +
+ Postal Code: + {{ contact.postcode }} +
+ {{/if}} +
+ Email address: + {{ contact.emailAddress }} +
+
+ Telephone Number: + {{ contact.telephoneNumber }} +
+
+ {{#if applicantEducation }} +
+
Applicant Education
+ {{#each applicantEducation}} +
+ {{#if this.nameOfInstitution}} +
+ Name of Institution: + {{ this.nameOfInstitution }} +
+ {{/if}} + {{#if this.country}} +
+ Country: + {{ this.country }} +
+ {{/if}} + {{#if this.startYear}} +
+ Start Year: + {{ this.startYear }} +
+ {{/if}} + {{#if this.endYear}} +
+ End Year: + {{ this.endYear }} +
+ {{/if}} +
+ {{/each}} +
+ {{/if}} + {{#if qualifcations}} +
+
Applicant Qualification
+ {{#each qualifications}} +
+ {{#if this.subject}} +
+ Subject: + {{ this.subject }} +
+ {{/if}} + {{#if this.examiningBody}} +
+ Examining Body: + {{ this.examiningBody }} +
+ {{/if}} + {{#if this.year}} +
+ Year: + {{ this.year }} +
+ {{/if}} + {{#if this.levelGrade}} +
+ Level / Grade Obtained: + {{ this.levelGrade }} +
+ {{/if}} +
+ {{/each}} +
+ {{/if}} + {{#if workExperiences}} +
+
Applicant Work Experience
+ {{#each workExperiences}} +
+ {{#if this.employerName}} +
+ Name of employer or organization: + {{ this.employerName }} +
+ {{/if}} + {{#if this.positionHeld}} +
+ Position held: + {{ this.positionHeld }} +
+ {{/if}} + {{#if this.fromYear}} +
+ From (year): + {{ this.fromYear }} +
+ {{/if}} + {{#if this.toYear}} +
+ To (year): + {{ this.toYear }} +
+ {{/if}} + {{#if this.currentlyWorking}} +
+ I am currently working here: + {{ this.currentlyWorking }} +
+ {{/if}} + {{#if this.tasks}} +
+ Your main tasks: + {{ this.tasks }} +
+ {{/if}} +
+ {{/each}} +
+ {{/if}} +
+
Skills And Experience
+ {{#if skillsAndExperience.athleticsGamesCraftSkills}} +
+ Athletics, games, or craft skills: + {{ skillsAndExperience.athleticsGamesCraftSkills }} +
+ {{/if}} + {{#if skillsAndExperience.youthCommunityVolunteerGroups}} +
+ Experience in youth, community, or volunteer groups: + {{ skillsAndExperience.youthCommunityVolunteerGroups }} +
+ {{/if}} + {{#if skillsAndExperience.responsibilityPositions}} +
+ Positions of responsibility held: + {{ skillsAndExperience.responsibilityPositions }} +
+ {{/if}} + {{#if skillsAndExperience.extraDetails}} +
+ Anything else relevant to your application?: + {{ skillsAndExperience.extraDetails }} +
+ {{/if}} +
+ {{#if references}} +
+
References
+ {{#each references}} +
+ {{#if this.title}} +
+ Title: + {{ this.title }} +
+ {{/if}} + {{#if this.firstName}} +
+ First Name: + {{ this.firstName }} +
+ {{/if}} + {{#if this.lastName}} +
+ Last Name: + {{ this.lastName }} +
+ {{/if}} + {{#if this.addressLine1}} +
+ Address Line 1: + {{ this.addressLine1 }} +
+ {{/if}} + {{#if this.addressLine2}} +
+ Address Line 2: + {{ this.addressLine2 }} +
+ {{/if}} + {{#if this.country}} +
+ Country: + {{ this.country }} +
+ {{/if}} + {{#if this.parish}} +
+ Parish: + {{ this.parish }} +
+ {{/if}} + {{#if this.postcode}} +
+ Postal code: + {{ this.postcode }} +
+ {{/if}} + {{#if this.occupation}} +
+ Occupation: + {{ this.occupation }} +
+ {{/if}} + {{#if this.emailAddress}} +
+ Email address: + {{ this.emailAddress }} +
+ {{/if}} + {{#if this.telephoneNumber}} +
+ Telephone Number: + {{ this.telephoneNumber }} +
+ {{/if}} +
+ {{/each}} +
+ {{/if}} +
+
Documents
+
+ Upload your certificates, diplomas, and transcripts: + {{ documents.certificateDiplomaTranscript }} +
+
+ Upload your two testimonials: + {{ documents.testimonials }} +
+
+ +
+ +