Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 247 additions & 0 deletions schemas/conductor-licence.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
{
"id": "apply-for-conductor-licence",
"name": "Conductor Licence Application",
"description": "Conductor Licence Application",
"fields": [
{
"name": "applicant",
"type": "object",
"required": true,
"fields": [
{
"name": "title",
"type": "string",
"label": "Title",
"required": true,
"validations": {
"regex": "^(mr|ms|mrs)$",
"message": "Must select a valid title"
}
},
{
"name": "firstName",
"type": "string",
"label": "First name",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "First name is required"
}
},
{
"name": "middleName",
"type": "string",
"label": "Middle name",
"required": false,
"validations": {
"max": 100,
"message": "Middle name is required"
}
},
{
"name": "lastName",
"type": "string",
"label": "Last name",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "Last name is required"
}
},
{
"name": "dateOfBirth",
"type": "date",
"label": "Date of birth",
"required": false,
"validations": {
"regex": "^\\d{4}-\\d{2}-\\d{2}$",
"message": "Date of birth is required and must be in YYYY-MM-DD format"
}
}
]
},
{
"name": "contactDetails",
"type": "object",
"required": true,
"fields": [
{
"name": "addressLine1",
"type": "string",
"label": "Address Line 1",
"required": true,
"validations": {
"min": 5,
"max": 200,
"message": "Address must be at least 5 characters"
}
},
{
"name": "addressLine2",
"type": "string",
"label": "Address Line 2",
"required": false,
"validations": {
"max": 200
}
},
{
"name": "parish",
"type": "string",
"label": "Parish",
"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"
}
},
{
"name": "postalCode",
"type": "string",
"label": "Postal Code",
"required": false,
"validations": {
"regex": "^BB\\d{5}$",
"message": "Enter a valid postal code (e.g., BB17004)"
}
},
{
"name": "email",
"type": "email",
"label": "Email Address",
"required": true
},
{
"name": "telephoneNumber",
"type": "string",
"label": "Telephone Number",
"required": true,
"validations": {
"regex": "^\\+?[0-9]{10,15}$",
"message": "Telephone number must be 10-15 digits"
}
}
]
},
{
"name": "licenceHistory",
"type": "object",
"required": true,
"fields": [
{
"name": "hasPreviousLicence",
"type": "string",
"label": "Do you have any previous licence(s)?",
"required": true,
"validations": {
"regex": "^(yes|no)$",
"message": "Must select an option"
}
},
{
"name": "licenceNumber",
"type": "string",
"label": "Provide your licence number",
"required": false
},
{
"name": "dateOfIssue",
"type": "date",
"label": "Date of issue",
"required": false,
"validations": {
"regex": "^\\d{4}-\\d{2}-\\d{2}$",
"message": "Date of issue is required and must be in YYYY-MM-DD format"
}
}
]
},
{
"name": "hasEndorsements",
"type": "string",
"label": "Do you have any endorsements?",
"required": true,
"validations": {
"regex": "^(yes|no)$",
"message": "Must select an option"
}
},
{
"name": "endorsementDetails",
"type": "array",
"label": "Your endorsements",
"required": false,
"items": {
"type": "object",
"properties": {
"typeOfEndorsement": {
"type": "string"
},
"dateOfEndorsement": {
"type": "date"
},
"duration": {
"type": "string"
}
}
}
},
{
"name": "disqualifications",
"type": "object",
"required": true,
"fields": [
{
"name": "hasDisqualifications",
"type": "string",
"label": "Have you ever been disqualified?",
"required": true,
"validations": {
"regex": "^(yes|no)$",
"message": "Must select an option"
}
},
{
"name": "courtName",
"type": "string",
"label": "Court name",
"required": false
},
{
"name": "dateOfDisqualification",
"type": "string",
"label": "Date of disqualification",
"required": false
},
{
"name": "lengthOfDisqualification",
"type": "string",
"label": "Length of disqualification",
"required": false
}
]
},
{
"name": "hasCriminalConvictions",
"type": "string",
"label": "Have you ever had any criminal convictions?",
"required": true,
"validations": {
"regex": "^(yes|no)$",
"message": "Must select an option"
}
}
],
"processors": [
{
"type": "email",
"config": {
"to": "{{db:apply-for-conductor-licence:admin_email}}",
"subject": "Apply for conductor licence - {{formData.applicant.firstName}} {{formData.applicant.lastName}}",
"template": "apply-for-conductor-licence"
}
}
]
}
133 changes: 133 additions & 0 deletions src/email/templates/apply-for-conductor-licence.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<html>
<head>
<meta charset='utf-8' />
<style>
body { font-family: Arial, sans-serif; line-height: 1.6; color: #333;
max-width: 800px; margin: 0 auto; padding: 20px; } .header {
background-color: #2c5282; color: white; padding: 20px; text-align:
center; border-radius: 5px 5px 0 0; } .content { background-color:
#f7fafc; padding: 30px; border: 1px solid #e2e8f0; border-top: none; }
.section { margin-bottom: 25px; background-color: white; padding: 20px;
border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.section-title { color: #2c5282; font-size: 18px; font-weight: bold;
margin-bottom: 15px; border-bottom: 2px solid #2c5282; padding-bottom:
5px; } .field { margin-bottom: 12px; } .field-label { font-weight: bold;
color: #4a5568; display: inline-block; width: 200px; } .field-value {
color: #1a202c; } .address-comparison { display: flex; gap: 20px; }
.address-box { flex: 1; border: 1px solid #e2e8f0; padding: 15px;
border-radius: 5px; } .old-address { background-color: #fed7d7; }
.new-address { background-color: #c6f6d5; } .footer { margin-top: 30px;
padding: 20px; background-color: #edf2f7; border-radius: 5px; text-align:
center; font-size: 14px; color: #718096; }
</style>
</head>
<body>
<div class='header'>
<h1>📮 Post Office Redirection Notice Request</h1>
</div>

<div class='content'>
<p>A new post office redirection notice request has been submitted.</p>

<div class='section'>
<div class='section-title'>Personal Information</div>
<div class='field'>
<span class='field-label'>Name:</span>
<span class='field-value'>{{applicant.title}}
{{applicant.firstName}}
{{applicant.lastName}}</span>
</div>
<div class='field'>
<span class='field-label'>Date of Birth:</span>
<span class='field-value'>{{applicant.dateOfBirth}}</span>
</div>
<div class='field'>
<span class='field-label'>ID Number:</span>
<span class='field-value'>{{applicant.idNumber}}</span>
</div>
{{#if applicant.passportNumber}}
<div class='field'>
<span class='field-label'>Passport Number:</span>
<span class='field-value'>{{applicant.passportNumber}}</span>
</div>
{{/if}}
{{#if applicant.email}}
<div class='field'>
<span class='field-label'>Email:</span>
<span class='field-value'>{{applicant.email}}</span>
</div>
{{/if}}

</div>

<div class='section'>
<div class='section-title'>Contact Details</div>
<div class='address-comparison'>
<div class='address-box'>
<div class='field'>
<span class='field-label'>Address Line 1:</span>
<span class='field-value'>{{contactDetails.addressLine1}}</span>
</div>
{{#if contactDetails.addressLine2}}
<div class='field'>
<span class='field-label'>Address Line 2:</span>
<span class='field-value'>{{contactDetails.addressLine2}}</span>
</div>
{{/if}}
<div class='field'>
<span class='field-label'>Parish:</span>
<span class='field-value'>{{contactDetails.parish}}</span>
</div>
{{#if contactDetails.postalCode}}
<div class='field'>
<span class='field-label'>Postal Code:</span>
<span class='field-value'>{{contactDetails.postalCode}}</span>
</div>
{{/if}}

{{#if contactDetails.email}}
<div class='field'>
<span class='field-label'>Email:</span>
<span class='field-value'>{{contactDetails.email}}</span>
</div>
{{/if}}
{{#if contactDetails.telephoneNumber}}
<div class='field'>
<span class='field-label'>Phone Number:</span>
<span
class='field-value'
>{{contactDetails.telephoneNumber}}</span>
</div>
{{/if}}
</div>
</div>
</div>

<div class='section'>
<div class='section-title'>House Member Information</div>
<div class='field'>
<span class='field-label'>Member Name:</span>
<span class='field-value'>{{houseMembers.firstName}}
{{houseMembers.lastName}}</span>
</div>
<div class='field'>
<span class='field-label'>Member ID Number:</span>
<span class='field-value'>{{houseMembers.idNumber}}</span>
</div>
{{#if houseMembers.addAnother}}
<div class='field'>
<span class='field-label'>Add Another Member:</span>
<span class='field-value'>{{houseMembers.addAnother}}</span>
</div>
{{/if}}
</div>

<div class='footer'>
<p><strong>Submission ID:</strong> {{submissionId}}</p>
<p>This is an automated notification from the Postal Address Change
System.</p>
<p><em>Please review and process this address change request.</em></p>
</div>
</div>
</body>
</html>