[Breaking] Simplified Named Excluded Driver Validation

We are introducing a simplified validation structure for Named Excluded Driver (NED). Today, once a prefill is complete, we automatically add any missing drivers to the quote as "status": "Undecided", which can be a confusing experience for both integrators and users. With this new change, we will be leveraging our existing require_exclusive requirement to give our integrators the power to choose when and where NED drivers are added to the quote.

Affected API Endpoints

What Changed

The current flow for adding prefill drivers to a quote looks something like:

  1. Create a quote
  2. Create a prefill request
  3. GET the quote
  4. Any prefill drivers that were not already on the quote will automatically be Undecided
    1. Note: if a driver was already on the quote and matched to a prefill driver, the status for that driver will not change. Only unmatched prefill drivers will get the Undecided status
{
  "quote": {
    "profile": {
      "drivers": [{
        ...
        "prefillDriverId": {
          "value": "abc-111"
          ...
        },
        "status": {
          "value": "Undecided"
          ...
        }
        ...
      }]
    }
  }
}

This can lead to an awkward situation where a driver who was already present on the quote and a prefill driver who should technically match are not matched. A simple example of this is QuoteDriverA has a Ohio drivers license number 123456789, but the prefill found QuoteDriverA with a Florida drivers license number 987654321. Your quote would then be in a state similar to this:

{
  "quote": {
    "profile": {
      "drivers": [{
        ...
        "prefillDriverId": {
          "value": "QuoteDriverA-OH-111"
          ...
        },
        "status": {
          "value": "Covered"
          ...
        },
        "state": {
          "value": "OH"
        },
        ...
      },{
        ...
        "prefillDriverId": {
          "value": "QuoteDriverA-FL-111"
          ...
        },
        "status": {
          "value": "Undecided"
          ...
        },
        "state": {
          "value": "FL"
        },
        ...
      }]
    }
  }
}

To address this, we have updated the requirements on the driver to include the required_exclusive validation which will let you know that there were drivers added from the prefill report and that action needs to be taken.

In the example below, both QuoteDriverA-FL-111 and QuoteDriverB-OH-222 are the prefillDriverId's for drivers added from the prefill report:

{
  "profile": {
    "drivers": [
      {
        "prefillDriverId": {
          "value": null,
          "inferredValue": null,
          "valid": false,
          "message": "The values QuoteDriverA-FL-111 and QuoteDriverB-OH-222 must each be present on exactly one driver",
          "requirements": [
            {
              "fulfilled": true,
              "kind": "uniqueness",
              "message": null,
              "metadata": {
                "set": []
              }
            },
            {
              "fulfilled": false,
              "kind": "required_exclusive",
              "message": "The values QuoteDriverA-FL-111 and QuoteDriverB-OH-222 must each be present on exactly one driver",
              "metadata": {
                "exclusiveValues": ["QuoteDriverA-FL-111", "QuoteDriverB-OH-222"],
                "set": []
              }
            }
          ]
        },
        "status": {
          "value": "Covered",
          ...
        },
        ...
      }
    ]
  }
}

To fulfill the requirement, each prefillDriverId will need to either be assigned to an existing driver, or added as a new driver.

To fullfill the requirement you can, for example, PATCH the Quote with the new prefill ID's and set the status for each:

PATCH /quoting/quote/:quoteId
{
  "profile": {
    "drivers": {
      "0": {
        "prefillDriverId": "QuoteDriverA-FL-111",
        "status": "Covered" // Driver 0 was already Covered, but you can change that status here
      },
      "1": {
        "prefillDriverId": "QuoteDriverB-OH-222",
        "status": "Excluded"        
      }
    }
  }
}