Skip to content

Business API: Add Missing Contact Point Email Validation #32906

Closed

Description

@meawong

Description:

As an API user posting a filing, I want to get appropriate validation errors if I try and put in a contact point email address that would not pass the frontend validation, so that my saved data is accurate and reliable and will not cause issues if used again through the frontend.

On the frontend, the Contact Point email field is validated for proper email format and leading/trailing whitespace before submission. Ex: "a@b.c", " test@example.com" (leading space), or "test@example.com " (trailing space) all pass the amalgamation API but would be rejected by the frontend. (pls ignore the req for leading/trailing spaces in this ticket)

List of filings where contactPoint is required but email is not validated:

  • Alteration
  • Amalgamation Application
  • Change of Registration
  • Continuation In
  • Correction
  • Incorporation Application
  • Registration
  • Restoration

QA Notes

  • Ensure regression of amalgamation application through the frontend — ensure email address saves properly
  • Posting an amalgamation application through the API works as expected
  • Posting email address formats that would not pass the frontend cause the API to return an appropriate error message about invalid format:

Activity

  1. added
    Entities Team
    on Mar 19, 2026
  2. changed the title [-]Business API: Add Missing Email Validation for Contact Point[/-] [+]Business API: Add Missing Contact Point Email Validation[/+] on Mar 19, 2026
  3. kialj876 commented on Jul 27, 2026

    @kialj876
    Collaborator

    We will be handling spacing separately (discussing in refinement tomorrow). @vikas-gov we are validating the email format in the schema so we may not need to do anything - what is the format requirement for this ticket?
    This ticket just says not 'invalid format: a@b.c', should we be following whatever rules we see in the front end or is there some specific requirements written for it somewhere?

  4. mstanton1 commented on Jul 29, 2026

    @mstanton1
    Collaborator

    @benjamin-bc-gov with the outstanding requirement above please follow the same rule as is applied in the UI. Let us know if you need help locating / verifying the rules.

  5. benjamin-bc-gov commented on Jul 29, 2026

    @benjamin-bc-gov
    Collaborator

    the regex for the front is below , i will use the same for API CC @kialj876 @mstanton1

    const pattern = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

  6. mstanton1 commented on Jul 29, 2026

    @mstanton1
    Collaborator
  7. benjamin-bc-gov commented on Jul 29, 2026

    @benjamin-bc-gov
    Collaborator

    `

    All cases match the frontend behaviour exactly.
    `

  8. benjamin-bc-gov commented on Aug 4, 2026

    @benjamin-bc-gov
    Collaborator

    so my code changes is a duplicate validation of the schema validation , but below are some of the wrong email patterns that will pass through the validation
    `
    test@-example.com # hyphen at start of domain label
    test@example-.com # hyphen at end of domain label
    test@[999.999.999.999] # IP octet out of range (0-255)
    "hello world"@example.com # quoted local part allows anything inside quotes
    tëst@example.com # unicode characters in local part
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@example.com # no length limit

    `

    @kialj876 @mstanton1

  9. self-assigned this
    on Oct 5, 2026
  10. mstanton1 commented on Oct 16, 2026

    @mstanton1
    Collaborator

    Let's leave the additional validations for now. The core goal was to ensure the FE and BE aligned.

    At a later time we can bring in additional validations (FE/BE).

  11. rsagpariya commented on Oct 19, 2026

    @rsagpariya
    Collaborator

    Verified on TEST:

    • Verified that both frontend (FE) and backend (BE) email validations return appropriate errors for invalid email formats and successfully accept and save valid email addresses.
    • Tested email validation across different filing types, including company creation, restoration, Continuation In (CON IN), amalgamation, alteration, etc..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Entities TeamPriority2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions