Skip to content
Open
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
254 changes: 254 additions & 0 deletions schemas/use-public-park-beach-for-activity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
{
"id": "use-public-park-beach-for-activity",
"name": "Use Public Park or Beach for Activity",
"description": "Use Public Park or Beach for Activity",
"fields": [
{
"name": "isIndividualOrBusiness",
"type": "string",
"label": "Is the applicant an individual or business?",
"required": true,
"validations": {
"regex": "^(individual|business)$",
"message": "Must select an option"
}
},
{
"name": "applicant",
"type": "object",
"required": false,
"fields": [
{
"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
},
{
"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": "postcode",
"type": "string",
"label": "Post 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": "mobilePhoneNumber",
"type": "string",
"label": "Mobile Number",
"required": true,
"validations": {
"regex": "^\\+?[0-9]{10,15}$",
"message": "Mobile number must be 10-15 digits"
}
},
{
"name": "workPhoneNumber",
"type": "string",
"label": "Work phone number",
"required": true,
"validations": {
"regex": "^\\+?[0-9]{10,15}$",
"message": "Work phone number must be 10-15 digits"
}
},
{
"name": "homePhoneNumber",
"type": "string",
"label": "Home phone number",
"required": true,
"validations": {
"regex": "^\\+?[0-9]{10,15}$",
"message": "Home phone number must be 10-15 digits"
}
}
]
},
{
"name": "business",
"type": "object",
"required": false,
"fields": [
{
"name": "businessName",
"type": "string",
"label": "Name of business",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "First name is required"
}
},
{
"name": "businessGeneralName",
"type": "string",
"label": "General name of business",
"required": true,
"validations": {
"min": 2,
"max": 100,
"message": "First name is required"
}
},
{
"name": "addressLine1",
"type": "string",
"label": "Address Line 1",
"required": false,
"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": "postcode",
"type": "string",
"label": "Post code",
"required": false,
"validations": {
"regex": "^BB\\d{5}$",
"message": "Enter a valid postal code (e.g., BB17004)"
}
}
]
},
{
"name": "activity",
"type": "object",
"required": true,
"fields": [
{
"name": "startDate",
"type": "date",
"label": "Start date",
"required": false,
"validations": {
"regex": "^\\d{4}-\\d{2}-\\d{2}$",
"message": "Start date is required and must be in YYYY-MM-DD format"
}
},
{
"name": "startTime",
"type": "date",
"label": "Start time",
"required": false,
"validations": {
"regex": "^\\d{1,2}:\\d{2} (AM|PM|am|pm)$",
"message": "Start time is required and must be in hh:mm AM/PM format"
}
},
{
"name": "endDate",
"type": "date",
"label": "End date",
"required": false,
"validations": {
"regex": "^\\d{4}-\\d{2}-\\d{2}$",
"message": "End date is required and must be in YYYY-MM-DD format"
}
},
{
"name": "endTime",
"type": "date",
"label": "End time",
"required": false,
"validations": {
"regex": "^\\d{1,2}:\\d{2} (AM|PM|am|pm)$",
"message": "End time is required and must be in hh:mm AM/PM format"
}
}
]
}
],
"processors": [
{
"type": "email",
"config": {
"to": "{{db:use-public-park-beach-for-activity:admin_email}}",
"subject": "Use Public Park or Beach for Activity - {{formData.applicant.firstName}} {{formData.applicant.lastName}}",
"template": "use-public-park-beach-for-activity-notice"
}
}
]
}
119 changes: 119 additions & 0 deletions src/email/templates/use-public-park-beach-for-activity.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<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>Request for Permission to Remove Protected Tree(s)</h1>
</div>

<div class='content'>
<p>A new request for permission to remove protected tree 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'>Address Line 1:</span>
<span class='field-value'>{{applicant.addressLine1}}</span>
</div>
{{#if applicant.addressLine2}}
<div class='field'>
<span class='field-label'>Address Line 2:</span>
<span class='field-value'>{{applicant.addressLine2}}</span>
</div>
{{/if}}
<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}}
{{#if applicant.email}}
<div class='field'>
<span class='field-label'>Email:</span>
<span class='field-value'>{{applicant.email}}</span>
</div>
{{/if}}
{{#if applicant.mobileNumber}}
<div class='field'>
<span class='field-label'>Mobile Number:</span>
<span class='field-value'>{{applicant.mobileNumber}}</span>
</div>
{{/if}}
{{#if applicant.homeNumber}}
<div class='field'>
<span class='field-label'>Home Number:</span>
<span class='field-value'>{{applicant.homeNumber}}</span>
</div>
{{/if}}
</div>

{{#if treesToRemove}}
<div class='section'>
<div class='section-title'>Trees to remove</div>
{{#each treesToRemove}}
<div>
<div class='field'>
<span class='field-label'>Type of Protected Tree:</span>
<span class='field-value'> {{this.typeOfProtectedTree}}</span>
</div>
<div class='field'>
<span class='field-label'>Reason for Removing Tree:</span>
<span class='field-value'> {{this.reasonForRemovingTree}}</span>
</div>
<div class='field'>
<span class='field-label'>Address Line 1:</span>
<span class='field-value'> {{this.addressLine1}}</span>
</div>
<div class='field'>
<span class='field-label'>Address Line 2:</span>
<span class='field-value'> {{this.addressLine2}}</span>
</div>
<div class='field'>
<span class='field-label'>Parish:</span>
<span class='field-value'> {{this.parish}}</span>
</div>
</div>
{{/each}}
</div>
{{/if}}

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