diff --git a/schemas/post-office-redirection-business.json b/schemas/post-office-redirection-business.json index fc5b706..bae3713 100644 --- a/schemas/post-office-redirection-business.json +++ b/schemas/post-office-redirection-business.json @@ -107,6 +107,23 @@ "message": "Last name is required" } }, + { + "name": "idNumber", + "type": "string", + "required": false, + "validations": { + "regex": "^\\d{6}[-]?\\d{4}$", + "message": "Must be in format XXXXXX-XXXX" + } + }, + { + "name": "passportNumber", + "type": "string", + "required": false, + "validations": { + "max": 50 + } + }, { "name": "email", "type": "email", @@ -122,12 +139,12 @@ ] }, { - "name": "permissionDetails", + "name": "positionDetails", "type": "string", - "label": "Tell us what permission you have to act for this business", + "label": "Tell us what position you hold in the business.", "required": true, "validations": { - "message": "Permission details required" + "message": "Position is required" } }, { @@ -175,38 +192,19 @@ "message": "Enter a valid postal code (e.g., BB17004)" } }, - { - "name": "isMovingPermanent", - "type": "string", - "label": "Are you moving permanently?", - "required": true, - "validations": { - "regex": "^(yes|no)$", - "message": "Must select an option" - } - }, { "name": "redirectionStartDate", "type": "date", "label": "Redirection Start Date", - "required": false + "required": true }, { "name": "redirectionEndDate", "type": "date", "label": "Redirection End Date", - "required": false + "required": true } ] - }, - { - "name": "uploadDocumentUrls", - "type": "array", - "label": "Uploaded Documents", - "required": true, - "items": { - "type": "string" - } } ], "processors": [ diff --git a/src/email/templates/post-office-redirection-notice.hbs b/src/email/templates/post-office-redirection-notice.hbs index 349f706..9916724 100644 --- a/src/email/templates/post-office-redirection-notice.hbs +++ b/src/email/templates/post-office-redirection-notice.hbs @@ -225,189 +225,166 @@ {{/if}} - + {{#if permissionDetails}}
Permission Details
- - {{#if deceased}} - Permission to Act on - Estate:{{ else }}Permission to Act for Business:{{/if}} - {{ permissionDetails }} + Permission to Act on Estate: + {{ permissionDetails }} +
+
+ {{/if}} + + {{#if positionDetails}} +
+
What position do you hold in the business?
+
+ Position: + {{ positionDetails }} +
+
+ {{/if}} + + {{#if newAddress}} +
+
New Address for Mail Redirection
+
+ Address Line 1: + {{ newAddress.addressLine1 }} +
+ {{#if newAddress.addressLine2}} +
+ Address Line 2: + {{ newAddress.addressLine2 }}
+ {{/if}} +
+ Parish: + {{ newAddress.parish }}
- {{/if}} - - {{#if newAddress}} -
-
New Address for Mail Redirection
+ {{#if newAddress.postcode}}
- Address Line 1: - {{ newAddress.addressLine1 }} + Postcode: + {{ newAddress.postcode }}
- {{#if newAddress.addressLine2}} -
- Address Line 2: - {{ newAddress.addressLine2 }} -
- {{/if}} + {{/if}} + {{#if newAddress.postalCode}}
- Parish: - {{ newAddress.parish }} + Postal Code: + {{ newAddress.postalCode }}
- {{#if newAddress.postcode}} -
- Postcode: - {{ newAddress.postcode }} -
- {{/if}} - {{#if newAddress.postalCode}} -
- Postal Code: - {{ newAddress.postalCode }} -
- {{/if}} - {{#if newAddress.redirectionStartDate}} -
- Redirection Start Date: - {{ newAddress.redirectionStartDate }} -
- {{/if}} - {{#if newAddress.redirectionEndDate}} -
- Redirection End Date: - {{ newAddress.redirectionEndDate }} -
- {{/if}} -
- {{/if}} - - {{#if anyMinorDependents}} -
-
Minor Dependents Information
+ {{/if}} + {{#if newAddress.isRedirectPermanent}}
- Any Minor Dependents: - {{ anyMinorDependents }} + Permanent Redirection: + {{ newAddress.isRedirectPermanent }}
- {{#if minorDetails}} -
- Minor Dependents: - {{#each minorDetails}} -
- {{#if this.firstName}} -
- First Name: - {{ this.firstName }} -
- {{/if}} - {{#if this.middleName}} -
- middle name: - {{ this.middleName }} -
- {{/if}} - {{#if this.lastName}} -
- Last Name: - {{ this.lastName }} -
- {{/if}} -
- {{/each}} -
- {{/if}} -
- {{/if}} - - {{#if anyAdults}} -
-
Adults Information
+ {{/if}} + {{#if newAddress.isMovingPermanent}}
- Any Adults: - {{ anyAdults }} + Moving Permanently: + {{ newAddress.isMovingPermanent }}
- {{#if minorDetails}} -
- Adults: - {{#each adultDetails}} -
- {{#if this.firstname}} -
- first name: - {{ this.firstName }} -
- {{/if}} - {{#if this.middlename}} -
- middle name: - {{ this.middleName }} -
- {{/if}} - {{#if this.lastName}} -
- Last Name: - {{ this.lastName }} -
- {{/if}} -
- {{/each}} -
- {{/if}} -
- {{/if}} - - {{#if uploadDocumentUrls}} -
-
Uploaded Documents
- {{#if uploadDocumentUrls.length}} - - {{ else }} -

No documents uploaded.

- {{/if}} -
- {{/if}} - - {{#if uploadDocumentUrls}} -
-
Uploaded Documents
- {{#if uploadDocumentUrls.length}} - - {{ else }} -

No documents uploaded.

- {{/if}} + {{/if}} + {{#if newAddress.redirectionStartDate}} +
+ Redirection Start Date: + {{ newAddress.redirectionStartDate }} +
+ {{/if}} + {{#if newAddress.redirectionEndDate}} +
+ Redirection End Date: + {{ newAddress.redirectionEndDate }} +
+ {{/if}} +
+ {{/if}} + + {{#if anyMinorDependents}} +
+
Minor Dependents Information
+
+ Any Minor Dependents: + {{ anyMinorDependents }}
- {{/if}} - + {{/if}} + + {{#if uploadDocumentUrls}} +
+
Uploaded Documents
+ {{#if uploadDocumentUrls.length}} +
    + {{#each uploadDocumentUrls}} +
  • + {{ this }} +
  • + {{/each}} +
+ {{ else }} +

No documents uploaded.

+ {{/if}} +
+ {{/if}} + + {{#if uploadDocumentUrls}} +
+
Uploaded Documents
+ {{#if uploadDocumentUrls.length}} +
    + {{#each uploadDocumentUrls}} +
  • + {{ this }} +
  • + {{/each}} +
+ {{ else }} +

No documents uploaded.

+ {{/if}} +
+ {{/if}} +
- - +
+ + + >>>>>>> 2342370 (Updated schema and email template to match changes)