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
185 changes: 185 additions & 0 deletions schemas/reserve-company-name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"id": "reserve-company-name",
"name": "Reserve Company Name Application",
"description": "Request to reserve company name",
"fields": [
{
"name": "purposeOfNewCompanyName",
"type": "string",
"label": "What will this name be used for?",
"required": true,
"validations": {
"regex": "^(newCompany|nameChange|merger)$",
"message": "Must select an option"
}
},
{
"name": "companyPresentName",
"type": "string",
"label": "What is the present name of the company?",
"required": false,
"validations": {
"max": 100
}
},
{
"name": "companyName",
"type": "object",
"required": true,
"fields": [
{
"name": "firstChoice",
"type": "string",
"label": "First choice",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "First choice is required"
}
},
{
"name": "secondChoice",
"type": "string",
"label": "Second choice",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "Second choice is required"
}
},
{
"name": "thirdChoice",
"type": "string",
"label": "Third choice",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "Third choice is required"
}
},
{
"name": "reserveFirstAvailableName",
"type": "string",
"label": "Reserve First Available Name",
"required": false,
"validations": {
"regex": "^(yes|no)$",
"message": "Must select an option"
}
}
]
},
{
"name": "businessActivity",
"type": "array",
"label": "What type of business will use this name?",
"required": true,
"items": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
}
},
{
"name": "applicant",
"type": "object",
"required": true,
"fields": [
{
"name": "firstName",
"type": "string",
"label": "First name",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "First name is required"
}
},
{
"name": "lastName",
"type": "string",
"label": "Last name",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "Last name is required"
}
},
{
"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"
}
}
]
}
],
"processors": [
{
"type": "email",
"config": {
"to": "{{db:reserve-company-name:admin_email}}",
"subject": "New Request to Reserve Society Name - {{formData.applicant.firstName}} {{formData.applicant.lastName}}",
"template": "reserve-company-name"
}
}
]
}
126 changes: 126 additions & 0 deletions src/email/templates/reserve-company-name.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<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: #2563eb; 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: #2563eb; font-size: 18px; font-weight: bold;
margin-bottom: 15px; border-bottom: 2px solid #2563eb; padding-bottom:
5px; } .field { margin-bottom: 12px; } .field-label { font-weight: bold;
color: #4a5568; display: inline-block; width: 200px; } .field-value {
color: #1a202c; } .footer { margin-top: 30px; padding: 20px;
background-color: #edf2f7; border-radius: 5px; text-align: center;
font-size: 14px; color: #718096; } .financial-highlight {
background-color: #fef3c7; padding: 10px; border-radius: 5px; margin-top:
10px; border-left: 4px solid #f59e0b; }
</style>
</head>
<body>
<div class='header'>
<h1>Request to Reserve Company Name Application</h1>
</div>

<div class='content'>
<p>A new request to reserve a company name has been submitted.</p>

<div class='section'>
<div class='section-title'>Purpose of New Company Name</div>
<div class='field'>
<span class='field-label'>What will this name be used for?</span>
<span class='field-value'>{{purposeOfNewCompanyName}}</span>
</div>
{{#if companyPresentName}}
<div class='field'>
<span class='field-label'>What is the present name of the company?</span>
<span class='field-value'>{{companyPresentName}}</span>
</div>
{{/if}}
</div>

<div class='section'>
<div class='section-title'>Business Activities</div>
{{#each businessActivity}}
<div class='field'>
<span class='field-value'>• {{this.value}}</span>
</div>
{{/each}}
</div>

<div class='section'>
<div class='section-title'>Applicant 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'>Address:</span>
<span class='field-value'>{{applicant.addressLine1}}{{#if
applicant.addressLine2
}}, {{applicant.addressLine2}}{{/if}}</span>
</div>
<div class='field'>
<span class='field-label'>Parish:</span>
<span class='field-value'>{{applicant.parish}}</span>
</div>
{{#if applicant.postalCode}}
<div class='field'>
<span class='field-label'>Postal Code:</span>
<span class='field-value'>{{applicant.postalCode}}</span>
</div>
{{/if}}
<div class='field'>
<span class='field-label'>Email:</span>
<span class='field-value'>{{applicant.email}}</span>
</div>
<div class='field'>
<span class='field-label'>Phone:</span>
<span class='field-value'>{{applicant.telephoneNumber}}</span>
</div>

</div>

<div class='section'>
<div class='section-title'>Request Details</div>
<div class='field'>
<span class='field-label'>Purpose:</span>
<span class='field-value'>{{request.purpose}}</span>
</div>
{{#if request.currentSocietyName}}
<div class='field'>
<span class='field-label'>Current Society Name:</span>
<span class='field-value'>{{request.currentSocietyName}}</span>
</div>
{{/if}}
</div>

<div class='section'>
<div class='section-title'>Contact Information</div>
<div class='field'>
<span class='field-label'>Address:</span>
<span class='field-value'>{{applicant.addressLine1}}{{#if
applicant.addressLine2
}}, {{applicant.addressLine2}}{{/if}}</span>
</div>
<div class='field'>
<span class='field-label'>Parish:</span>
<span class='field-value'>{{applicant.parish}}</span>
</div>

</div>

<div class='footer'>
<p><strong>Application ID:</strong> {{submissionId}}</p>
<p>This is an automated notification from the Reserve a Company Name
System.</p>
<p>Please review this application and follow up as necessary.</p>
</div>
</div>
</body>
</html>