diff --git a/schemas/reserve-company-name.json b/schemas/reserve-company-name.json new file mode 100644 index 0000000..f3df679 --- /dev/null +++ b/schemas/reserve-company-name.json @@ -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" + } + } + ] +} diff --git a/src/email/templates/reserve-company-name.hbs b/src/email/templates/reserve-company-name.hbs new file mode 100644 index 0000000..a798735 --- /dev/null +++ b/src/email/templates/reserve-company-name.hbs @@ -0,0 +1,126 @@ + + + + + + +
+

Request to Reserve Company Name Application

+
+ +
+

A new request to reserve a company name has been submitted.

+ +
+
Purpose of New Company Name
+
+ What will this name be used for? + {{purposeOfNewCompanyName}} +
+ {{#if companyPresentName}} +
+ What is the present name of the company? + {{companyPresentName}} +
+ {{/if}} +
+ +
+
Business Activities
+ {{#each businessActivity}} +
+ • {{this.value}} +
+ {{/each}} +
+ +
+
Applicant Information
+
+ Name: + {{applicant.title}} + {{applicant.firstName}} + {{applicant.lastName}} +
+
+ Address: + {{applicant.addressLine1}}{{#if + applicant.addressLine2 + }}, {{applicant.addressLine2}}{{/if}} +
+
+ Parish: + {{applicant.parish}} +
+ {{#if applicant.postalCode}} +
+ Postal Code: + {{applicant.postalCode}} +
+ {{/if}} +
+ Email: + {{applicant.email}} +
+
+ Phone: + {{applicant.telephoneNumber}} +
+ +
+ +
+
Request Details
+
+ Purpose: + {{request.purpose}} +
+ {{#if request.currentSocietyName}} +
+ Current Society Name: + {{request.currentSocietyName}} +
+ {{/if}} +
+ +
+
Contact Information
+
+ Address: + {{applicant.addressLine1}}{{#if + applicant.addressLine2 + }}, {{applicant.addressLine2}}{{/if}} +
+
+ Parish: + {{applicant.parish}} +
+ +
+ + +
+ + \ No newline at end of file