Skip to content

RELEASE#91

Merged
phrogwrld merged 9 commits intoproductionfrom
develop
Feb 2, 2026
Merged

RELEASE#91
phrogwrld merged 9 commits intoproductionfrom
develop

Conversation

@phrogwrld
Copy link
Contributor

@phrogwrld phrogwrld commented Jan 30, 2026

Description

This PR merges improvements from the develop branch into production, including a new conditional validation system for form schemas, OpenCRVS token management improvements, email template enhancements, and schema updates for birth registration and sell goods forms.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changes Made

Core Validation Updates

  • Conditional required fields: Added support for required.when with all/any logic to conditionally require fields based on other field values
  • Conditional validations: Added support for validations.condition with then/else branches for dynamic validation rules
  • New operators: Support for exists, missing, null, empty, notEmpty, equals, notEquals, in, notIn

Files Changed

New Files

File Purpose
src/opencrvs/common/opencrvs.constants.ts Health facilities list and form-specific success/failure messages
src/opencrvs/common/opencrvs.utils.ts Helper functions for OpenCRVS success/failure messages

Modified Schema Files

File Changes
schemas/register-birth-form.json Added conditional required for father object, age fields for mother/father, health facility field, conditional parish/streetAddress validation
schemas/sell-goods-services-beach-park.json Added firstTestimonial and secondTestimonial objects with name, relationship, address, and testimonial fields

Modified OpenCRVS Files

File Changes
src/opencrvs/opencrvs.service.ts Use jwt-decode to calculate token expiry from JWT payload; removed localhost config option
src/opencrvs/opencrvs-cache.service.ts Changed token buffer from 5 minutes to 2 minutes
src/opencrvs/opencrvs.processor.ts Moved health facilities to constants file; code formatting cleanup
src/opencrvs/types/opencrvs.types.ts Added HealthFacility type export

Modified Email Templates

File Changes
src/email/templates/post-office-redirection-individual-receipt.hbs Updated "What happens next" with clearer steps: visit Post Office, sign form, verify ID with reference number
src/email/templates/sell-goods-services-beach-park-receipt.hbs Updated with NCC meeting process, licence collection steps, and pricing details (licence $117.50, watersports $176.25, etc.)

Modified Core Service Files

File Changes
src/forms/forms.service.ts Use form-specific success/failure messages from OpenCRVS utils
src/forms/interfaces/form-schema.interface.ts Added ConditionalRequired, ConditionalWhen, ConditionalRule interfaces; added condition to FieldValidation
src/validation/schema-builder.service.ts Major update: added superRefine for conditional required and conditional validation evaluation
src/processors/implementations/email.processor.ts Support for comma-separated email recipients

Infrastructure/Config

File Changes
src/config/configuration.ts Removed localhost option for OpenCRVS configuration
package.json Added jwt-decode ^4.0.0 dependency
package-lock.json Dependency lock file update

Notes

  • The conditional validation system enables complex form logic where fields can be required based on other field values
  • OpenCRVS token handling now uses JWT payload expiry instead of response expires_in for more accurate token refresh
  • Email templates updated to provide clearer next steps for applicants

Testing

  • Conditional required validation works correctly with all/any logic
  • Conditional field validations (then/else) apply correctly
  • OpenCRVS token refresh with JWT expiry works
  • Email templates render correctly with new content
  • Comma-separated email recipients send to all addresses
  • Birth registration form submits with new conditional fields
  • Sell goods form submits with testimonial fields

Related Github Issue(s)/Trello Ticket(s)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated

IsaiahSama and others added 9 commits January 30, 2026 16:33
* feat: implement conditional required and validation logic for form fields

* feat: enhance validation logic for father and mother fields in birth registration form

* feat: implement dynamic validation messages and health facility constants for OpenCRVS integration

* feat: change age field type to string and update validation logic for age range in register birth form

* feat: remove localhost URL handling from OpenCRVS service configuration

---------

Co-authored-by: Akinola Raphael <54055273+Ethical-Ralph@users.noreply.github.com>
chore: add testimonial fields to sell goods/services schema
* fix: adjust token expiration time from 1 hour to 10 minutes

* feat(opencrvs): integrate jwt-decode to dynamically set expiration time with a fallback of 10 minutes.

* refactor: imporve the calculation to expiry time
…mail

Chore (Forms): Updated receipt email template for Personal Mail
@phrogwrld phrogwrld marked this pull request as ready for review January 30, 2026 22:59
@phrogwrld phrogwrld requested a review from IsaiahSama January 30, 2026 23:17
Copy link
Contributor

@IsaiahSama IsaiahSama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@phrogwrld phrogwrld merged commit 62f26e9 into production Feb 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants