Skip to main content

SCPI Customers getting created without mandatory email

Tasks linked

Bug:

When onboarding Contacts with Customers in countries where email is a mandatory field. There are multiple scenarios that lead to the creation of an SCPI Customer without an email (Contact).

The issues causing this are as follows:

Root Causes

  1. Race condition on UI while loading Generic and SCPI Ruleset: FIXED and deployed in PROD. Earlier both the rules (SCPI and non-SCPI rules) were loaded from UI. But here if the generic ruleset loads last, it caused issues in the final step of customer creation, allowing the creation of a customer with the SCPI flag but without a contact.

  2. Workflows caused by ABN, VIES, and NZBN tax validations: An issue arises where the customer's workflow is not generated from the UI but is generated when the request reaches the backend. These workflows get generated from the backend but not from the UI. During tax validation, if Ingest Customer encounters any exceptions (e.g., service downtime) while calling the tax validation services, it generates a workflow. However, on the UI, the tax value has already been validated successfully, leading to misalignment. example:

  3. Contact Validation API not called from the UI: This issue occurs when working with phone numbers from different countries. Here the ISD Code entered and the phone number entered regex is not matching. example:

  4. Regex mismatch between backend and API: Discrepancies in regex patterns for fields like job title, department, etc., cause this issue. example:

Solutions Implemented

  1. Race condition on UI while loading Generic and SCPI Ruleset: The fix was to align the UI and ensure the correct ruleset is called at all possible places and entry points, effectively avoiding the race condition altogether.
  2. Regex mismatch between backend and API: Updated the regex on the UI to align with the backend patterns. Additionally, the validation API is now always called to ensure no validations are missed, except for the customer code validation discussed in the next section.

Solutions to be Implemented

  1. Workflows caused by ABN, VIES, and NZBN tax validations generated from the backend but not from the UI - To address this, a validation error will be triggered from the last stage of the Customer Ingest API if the following conditions are met:
    1. It’s a create scenario.
    2. The Customer Group Type is selected as SCPI.
    3. An email is required for the selected country.
    4. A workflow has been generated for customer creation.

Upon encountering this validation error, the UI will display a popup notifying the user that the customer is entering the workflow and the SCPI flag will be dropped. The user will be asked if they still want to proceed. If the user selects "Yes," the SCPI flag is dropped, and the request is sent to the Ingest Customer API again for customer creation. If the user selects "No," the customer journey ends at that point.

  1. Contact Validation API not called from the UI when working with phone numbers of different countries: To resolve this, it will be mandatory for the portal to call the Contact Validation API even when the customer code is not yet generated. A dummy customer code will be used in this scenario, which, when passed in the request body and path variable, will skip all customer-related validations but still check for other static and data-driven validations. This ensures the payload is validated before proceeding to the next step.
Was this page helpful?