From 286feea6099d245f8208e0e2c85640e13a649462 Mon Sep 17 00:00:00 2001 From: Shannon Clarke Date: Thu, 18 Dec 2025 07:40:41 -0500 Subject: [PATCH 1/3] chore: update schema for textbook grant form --- schemas/primary-school-textbook-grant.json | 650 +++++++++++++-------- 1 file changed, 404 insertions(+), 246 deletions(-) diff --git a/schemas/primary-school-textbook-grant.json b/schemas/primary-school-textbook-grant.json index a81cd0e..42bd6c3 100644 --- a/schemas/primary-school-textbook-grant.json +++ b/schemas/primary-school-textbook-grant.json @@ -1,248 +1,406 @@ { - "id": "primary-school-textbook-grant", - "name": "Primary School Textbook Grant Application", - "description": "Apply for a textbook grant for primary school students", - "fields": [ - { - "name": "beneficiaries", - "type": "object", - "label": "Student Information", - "required": true, - "fields": [ - { - "name": "firstName", - "type": "string", - "label": "Student First Name", - "required": true, - "validations": { - "min": 2, - "max": 50 - } - }, - { - "name": "lastName", - "type": "string", - "label": "Student Last Name", - "required": true, - "validations": { - "min": 2, - "max": 50 - } - }, - { - "name": "idNumber", - "type": "string", - "label": "Student ID Number", - "required": true, - "validations": { - "min": 2, - "max": 50 - } - }, - { - "name": "gender", - "type": "string", - "label": "Student Gender", - "required": true - }, - { - "name": "class", - "type": "string", - "label": "Student Class/Grade", - "required": true, - "validations": { - "regex": "^[1-6]$", - "message": "Class must be between 1 and 6" - } - } - ] - }, - { - "name": "guardian", - "type": "object", - "label": "Guardian Information", - "required": true, - "fields": [ - { - "name": "title", - "type": "string", - "label": "Title", - "required": false, - "validations": { - "max": 10 - } - }, - { - "name": "firstName", - "type": "string", - "label": "Guardian First Name", - "required": true, - "validations": { - "min": 2, - "max": 50 - } - }, - { - "name": "middleName", - "type": "string", - "label": "Guardian Middle Name", - "required": false, - "validations": { - "max": 50 - } - }, - { - "name": "lastName", - "type": "string", - "label": "Guardian Last Name", - "required": true, - "validations": { - "min": 2, - "max": 50 - } - }, - { - "name": "idNumber", - "type": "string", - "label": "Guardian ID Number", - "required": true, - "validations": { - "min": 2, - "max": 50 - } - }, - { - "name": "gender", - "type": "string", - "label": "Guardian Gender", - "required": false - }, - { - "name": "relationship", - "type": "string", - "label": "Relationship to Student", - "required": true, - "validations": { - "max": 50 - } - }, - { - "name": "email", - "type": "email", - "label": "Guardian Email Address", - "required": false - } - ] - }, - { - "name": "contact", - "type": "object", - "label": "Contact Information", - "required": true, - "fields": [ - { - "name": "addressLine1", - "type": "string", - "label": "Address Line 1", - "required": true, - "validations": { - "min": 5, - "max": 200 - } - }, - { - "name": "addressLine2", - "type": "string", - "label": "Address Line 2", - "required": false, - "validations": { - "max": 200 - } - }, - { - "name": "parish", - "type": "string", - "label": "Parish", - "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": "bankAccount", - "type": "object", - "label": "Bank Account Information", - "required": true, - "fields": [ - { - "name": "bank", - "type": "string", - "label": "Bank Name", - "required": true - }, - { - "name": "branch", - "type": "string", - "label": "Branch Location", - "required": true, - "validations": { - "max": 100 - } - }, - { - "name": "accountType", - "type": "string", - "label": "Account Type", - "required": true - }, - { - "name": "nameOnAccount", - "type": "string", - "label": "Name on Account", - "required": true, - "validations": { - "min": 2, - "max": 500 - } - }, - { - "name": "accountNumber", - "type": "string", - "label": "Account Number", - "required": true, - "validations": { - "regex": "^[0-9]{6,20}$", - "message": "Account number must be 6-20 digits" - } - } - ] - } - ], - "processors": [ - { - "type": "email", - "config": { - "to": "{{db:primary-school-textbook-grant:admin_email}}", - "subject": "New Textbook Grant Application - {{formData.beneficiaries.firstName}} {{formData.beneficiaries.lastName}}", - "template": "primary-school-textbook-grant" - } - }, - { - "type": "email", - "config": { - "to": "{{formData.guardian.email}}", - "subject": "Textbook Grant Application Received - Government of Barbados", - "template": "primary-school-textbook-grant-receipt" - } - } - ] + "id": "primary-school-textbook-grant", + "name": "Primary School Textbook Grant Application", + "description": "Apply for a textbook grant for primary school students", + "fields": [ + { + "name": "beneficiaries", + "type": "object", + "label": "Student Information", + "required": true, + "fields": [ + { + "name": "firstName", + "type": "string", + "label": "Student First Name", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + { + "name": "lastName", + "type": "string", + "label": "Student Last Name", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + { + "name": "idNumber", + "type": "string", + "label": "National Identification (ID) Number", + "required": false, + "validations": { + "min": 2, + "message": "ID Number must be at least 2 characters" + } + }, + { + "name": "passportNumber", + "type": "string", + "label": "Passport Number", + "required": false, + "validations": { + "message": "Passport number is required" + } + }, + { + "name": "class", + "type": "string", + "label": "What class are they currently in?", + "required": true, + "validations": { + "regex": "^[1-6]$", + "message": "Class must be between 1 and 6" + } + }, + { + "name": "relationshipToChild", + "type": "string", + "label": "Relationship to Child", + "required": true, + "validations": { + "min": 2, + "message": "Relationship to Child must be at least 2 characters" + } + } + ] + }, + { + "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": 1, + "max": 100, + "message": "First name is required" + } + }, + { + "name": "lastName", + "type": "string", + "label": "Last name", + "required": true, + "validations": { + "min": 1, + "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" + } + }, + { + "name": "idNumber", + "type": "string", + "label": "National Identification (ID) Number", + "required": false, + "validations": { + "min": 2, + "message": "ID Number must be at least 2 characters" + } + }, + { + "name": "passportNumber", + "type": "string", + "label": "Passport Number", + "required": false, + "validations": { + "message": "Passport number must be at least 6 characters" + } + }, + { + "name": "tamisNumber", + "type": "string", + "label": "TAMIS Number", + "required": false, + "validations": { + "message": "Tamis must be 10-15 digits" + } + } + ] + }, + { + "name": "guardianOrParentRelationship", + "type": "string", + "label": "Are you the parent or guardian?", + "required": true, + "validations": { + "regex": "^(yes|no)$", + "message": "Must select an option" + } + }, + { + "name": "guardian", + "type": "object", + "label": "Guardian Information", + "required": true, + "fields": [ + { + "name": "title", + "type": "string", + "label": "Title", + "required": false, + "validations": { + "max": 10 + } + }, + { + "name": "firstName", + "type": "string", + "label": "Guardian First Name", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + { + "name": "middleName", + "type": "string", + "label": "Guardian Middle Name", + "required": false, + "validations": { + "max": 50 + } + }, + { + "name": "lastName", + "type": "string", + "label": "Guardian Last Name", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + { + "name": "idNumber", + "type": "string", + "label": "Guardian ID Number", + "required": true, + "validations": { + "min": 2, + "max": 50 + } + }, + { + "name": "gender", + "type": "string", + "label": "Guardian Gender", + "required": false + }, + { + "name": "relationship", + "type": "string", + "label": "Relationship to Student", + "required": true, + "validations": { + "max": 50 + } + }, + { + "name": "email", + "type": "email", + "label": "Guardian Email Address", + "required": false + } + ] + }, + { + "name": "contact", + "type": "object", + "label": "Contact Information", + "required": true, + "fields": [ + { + "name": "addressLine1", + "type": "string", + "label": "Address Line 1", + "required": true, + "validations": { + "min": 5, + "max": 200 + } + }, + { + "name": "addressLine2", + "type": "string", + "label": "Address Line 2", + "required": false, + "validations": { + "max": 200 + } + }, + { + "name": "parish", + "type": "string", + "label": "Parish", + "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": "bankAccount", + "type": "object", + "label": "Bank Account Information", + "required": true, + "fields": [ + { + "name": "accountHolderName", + "type": "string", + "label": "Account Holder Name", + "required": true + }, + { + "name": "bankName", + "type": "string", + "label": "Bank Name", + "required": true + }, + { + "name": "accountNumber", + "type": "string", + "label": "Account Number", + "required": true, + "validations": { + "regex": "^[0-9]{6,20}$", + "message": "Account number must be 6-20 digits" + } + }, + { + "name": "branchLocation", + "type": "string", + "label": "Branch Location", + "required": true, + "validations": { + "max": 100 + } + }, + { + "name": "accountType", + "type": "string", + "label": "Account Type", + "required": true, + "validations": { + "regex": "^(savings|chequing)$", + "message": "Must select an option" + } + } + ] + } + ], + "processors": [ + { + "type": "payment", + "config": { + "provider": "ezpay", + "department": "education", + "paymentCode": "{{db:primary-school-textbook-grant:payment_code}}", + "amount": 25.0, + "description": "Processing Fee", + "required": true, + "timing": "after_validation" + } + }, + { + "type": "email", + "config": { + "to": "{{db:primary-school-textbook-grant:admin_email}}", + "subject": "New Textbook Grant Application - {{formData.beneficiaries.firstName}} {{formData.beneficiaries.lastName}}", + "template": "primary-school-textbook-grant" + } + }, + { + "type": "email", + "config": { + "to": "{{formData.guardian.email}}", + "subject": "Textbook Grant Application Received - Government of Barbados", + "template": "primary-school-textbook-grant-receipt" + } + } + ] } From ad0e5981178ff081683842bcd3f37785a40a0d79 Mon Sep 17 00:00:00 2001 From: Akinola Raphael <54055273+Ethical-Ralph@users.noreply.github.com> Date: Thu, 18 Dec 2025 21:38:48 +0100 Subject: [PATCH 2/3] Remove payment processor from grant schema Removed payment processor configuration from the grant schema. --- schemas/primary-school-textbook-grant.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/schemas/primary-school-textbook-grant.json b/schemas/primary-school-textbook-grant.json index 42bd6c3..bd40b52 100644 --- a/schemas/primary-school-textbook-grant.json +++ b/schemas/primary-school-textbook-grant.json @@ -374,18 +374,6 @@ } ], "processors": [ - { - "type": "payment", - "config": { - "provider": "ezpay", - "department": "education", - "paymentCode": "{{db:primary-school-textbook-grant:payment_code}}", - "amount": 25.0, - "description": "Processing Fee", - "required": true, - "timing": "after_validation" - } - }, { "type": "email", "config": { From b3c052c0c78d8bc695235dec5b1c4f1a2c23f9a6 Mon Sep 17 00:00:00 2001 From: EthicalRalph Date: Thu, 18 Dec 2025 21:43:07 +0100 Subject: [PATCH 3/3] feat: update applicant and guardian information fields in grant templates --- .../primary-school-textbook-grant-receipt.hbs | 10 +- .../primary-school-textbook-grant.hbs | 109 +++++++++++++++--- 2 files changed, 97 insertions(+), 22 deletions(-) diff --git a/src/email/templates/primary-school-textbook-grant-receipt.hbs b/src/email/templates/primary-school-textbook-grant-receipt.hbs index b0d7d55..37959a9 100644 --- a/src/email/templates/primary-school-textbook-grant-receipt.hbs +++ b/src/email/templates/primary-school-textbook-grant-receipt.hbs @@ -125,13 +125,15 @@

Class: Class {{beneficiaries.class}}

- Guardian: - {{guardian.firstName}} - {{guardian.lastName}} + Applicant: + {{applicant.title}} + {{applicant.firstName}} + {{applicant.lastName}}

Contact: {{contact.telephoneNumber}}

+

Email: {{applicant.email}}

{{#if guardian.email}} -

Email: {{guardian.email}}

+

Guardian Email: {{guardian.email}}

{{/if}} diff --git a/src/email/templates/primary-school-textbook-grant.hbs b/src/email/templates/primary-school-textbook-grant.hbs index d4c1726..bc39dd3 100644 --- a/src/email/templates/primary-school-textbook-grant.hbs +++ b/src/email/templates/primary-school-textbook-grant.hbs @@ -35,26 +35,99 @@ {{beneficiaries.firstName}} {{beneficiaries.lastName}} + {{#if beneficiaries.idNumber}} +
+ Student ID: + {{beneficiaries.idNumber}} +
+ {{/if}} + {{#if beneficiaries.passportNumber}} +
+ Passport Number: + {{beneficiaries.passportNumber}} +
+ {{/if}}
- Student ID: - {{beneficiaries.idNumber}} + Class/Grade: + Class {{beneficiaries.class}}
- Gender: - {{beneficiaries.gender}} + Relationship to Child: + {{beneficiaries.relationshipToChild}}
+ + +
+
Applicant Information
- Class/Grade: - Class {{beneficiaries.class}} + 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}} +
+ {{#if applicant.idNumber}} +
+ ID Number: + {{applicant.idNumber}} +
+ {{/if}} + {{#if applicant.passportNumber}} +
+ Passport Number: + {{applicant.passportNumber}} +
+ {{/if}} + {{#if applicant.tamisNumber}} +
+ TAMIS Number: + {{applicant.tamisNumber}} +
+ {{/if}} +
+ +
+
Parent/Guardian Relationship
+
+ Are you the parent or guardian? + {{guardianOrParentRelationship}}
Guardian Information
+ {{#if guardian.title}} +
+ Title: + {{guardian.title}} +
+ {{/if}}
Guardian Name: - {{guardian.title}} - {{guardian.firstName}} + {{guardian.firstName}} {{#if guardian.middleName}}{{guardian.middleName}} {{/if}}{{guardian.lastName}}
@@ -101,24 +174,24 @@
Bank Account Information
- Bank: - {{bankAccount.bank}} + Account Holder Name: + {{bankAccount.accountHolderName}}
- Branch: - {{bankAccount.branch}} + Bank Name: + {{bankAccount.bankName}}
- Account Type: - {{bankAccount.accountType}} + Account Number: + {{bankAccount.accountNumber}}
- Name on Account: - {{bankAccount.nameOnAccount}} + Branch Location: + {{bankAccount.branchLocation}}
- Account Number: - {{bankAccount.accountNumber}} + Account Type: + {{bankAccount.accountType}}