Comparing a job to its base policy

Comparing a job to its base policy in PolicyCenter

PolicyCenter supports the ability to compare an unbound job to the policy it is based on. In the base configuration, this information is shown in the user interface on the Policy Review step of the relevant job wizards. It appears on the Differences tab on a subtab whose label is "Comparing Existing Policy and <current job>".

The organization of LOB-specific information shown on this tab is determined by an LOB-specific "DiffTree" XML file. For example, the organization of information for Personal Auto policies is defined in the PADiffTree.XML file. For more information on DiffTree XML files and how to configure them, see the Configuration Guide.

Comparing a job to its base policy in Cloud API

To compare a job to its base policy in Cloud API, use the following endpoint:

  • POST /job/v1/jobs/{jobId}/review-diffs

The request does not require a body.

The /review-diffs endpoint returns a JobReviewDiffs resource, which details the differences between the job and its base policy.

Structure of the JobReviewDiffs resource

The JobReviewDiffs resource has the following structure:

  • basedOnJob
    • Information about the bound policy
  • diffTree
    • Hierarchical information about the differences between the bound policy and the current job

Within the diffTree section, some of the information may be LOB-agnostic. For example, there could be diffTree sections for "Policy Info" (changes at the policy level) or "Line Coverages". Other information may be LOB-specific. This information is defined by the DiffTree XML file for the line of business. For example, for a Personal Auto policy, there could be a diffTree section for "Vehicles".

Every node in the diffTree has a changeType field, which can have one of four values:

  • Add - The node defines an entity not present on the policy that is being added by the job.
  • Remove - The node defines an entity present on the policy that is being removed by the job.
  • Change - The node defines a field whose value is being changed by the job.
  • Window - The node defines an entity whose effective window is being changed.

In the base configuration, changes of type Add, Remove, and Change can be made through the user interface and can be done for any type of job. Changes of type Window cannot be made through the user interface (though they can be made through Gosu), and can only be done for certain types of jobs, such as General Liability and Worker's Compensation.

Example of a /review-diffs response

For example, suppose there is a PersonalAuto policy whose id is pc:818 and whose effective date is 05/23/2022. There is also an unbound policy change whose effective date is 05/25/2022. The job is making the following changes:

  • A 2003 Acura RSX vehicle is being added
  • A 2005 Buick LaCrosse vehicle is being removed
  • Line Coverage "Underinsured Motorist - Property Damage" is being added
  • Line Coverage "Mexico Coverage - Limited" is being removed

Overall structure of the response

At a high level, the structure of the response is as follows:

"attributes": {
    "basedOnJob": {
      ...
    },
    "diffTree": {
        "children": [
            {
                "children": [
                   ...
                ],
                "label": "Policy Info"
            },
            {
                "children": [
                   ...
                ],
                "label": "Vehicles"
            },
            {
                "children": [
                   ...
                ],
                "label": "Line Coverages"
            },
        ],
        "label": "Difference Tree Root"
    }
}

The first part of the response provides information about the original job that the current job is based on.

The second part of the response is the diffTree.

The basedOnJob section

For this example, the basedOnJob information would look like this:

"basedOnJob": {
    "displayName": "47586734721",
    "id": "pc:818",
    "type": "Job",
    "uri": "/job/v1/jobs/pc:818"
},

The diffTree Policy Info section

For this example, the first children node details changes at the policy level.

"children": [
    {
        "changeType": "Change",
        "entity": {
            "displayName": "P000143542, 04/23/2022, 10/23/2022, 0003800396",
            "id": "pc:S7YjIyCbFh-UcbMSCMlrZ",
            "type": "Job",
            "uri": "/job/v1/jobs/pc:S7YjIyCbFh-UcbMSCMlrZ"
        },
        "field": "writtenDate",
        "label": "Written Date",
        "value1": "05/23/2022",
        "value2": "05/25/2022"
    }
],
"label": "Policy Info"

In this example, value1 identifies the effective date of the underlying policy (05/23/2022) and value2 identifies the effective date of the policy change (05/25/2022).

The Vehicles section

For this example, there is a Vehicles node. For each vehicle, there is information about the vehicle itself and any of its child objects, such as coverages, modifiers, and drivers.

For the vehicle being added (the 2003 Acura RSX), the changeType fields are set to Add.

  {
    "children": [
      {
        "changeType": "Add",
        "children": [
          {
            "children": [
              {
                "changeType": "Add",
                "entity": {
                  "displayName": "Collision",
                  "id": "38"
                },
                "label": "Collision"
              },
              ...
            ],
            "label": "Coverages"
          },
          {
            "children": [
              {
                "changeType": "Add",
                "entity": {
                  "displayName": "Anti Theft Discount (California)",
                  "id": "57"
                },
                "label": "Anti Theft Discount (California)"
              },
              ...
            ],
            "label": "Modifiers"
          },
          {
            "changeType": "Add",
            "entity": {
              "displayName": "Ray Newton",
              "id": "11"
            },
            "label": "Assigned Driver: Ray Newton"
          }
        ],
        "entity": {
          "displayName": "2003 Acura RSX in California",
          "id": "19"
        },
        "label": "2003 Acura RSX in California"
      },
      ...

The Vehicles section continues with the vehicle being removed (the 2005 Buick LaCrosse). The changeType fields are set to Remove.

      {
        "changeType": "Remove",
        "children": [
          {
            "children": [
              {
                "changeType": "Remove",
                "entity": {
                  "displayName": "Collision",
                  "id": "4"
                },
                "label": "Collision"
              },
              ...
            ],
            "label": "Coverages"
          },
          {
            "children": [
              {
                "changeType": "Remove",
                "entity": {
                  "displayName": "Anti Theft Discount (California)",
                  "id": "6"
                },
                "label": "Anti Theft Discount (California)"
              },
              ...
            ],
            "label": "Modifiers"
          },
          {
            "changeType": "Remove",
            "entity": {
              "displayName": "Ray Newton",
              "id": "2"
            },
            "label": "Assigned Driver: Ray Newton"
          }
        ],
        "entity": {
          "displayName": "2005 Buick LaCrosse in California",
          "id": "2"
        },
        "label": "2005 Buick LaCrosse in California"
      }
    ],
    "label": "Vehicles"
  },

The Line Coverages section

The Line Coverages section identifies line-level coverages being added or removed. In this example:

  • "Underinsured Motorist - Property Damage" is being added
  • "Mexico Coverage - Limited" is being removed
  {
    "children": [
      {
        "children": [
          {
            "changeType": "Remove",
            "entity": {
              "displayName": "Mexico Coverage - Limited",
              "id": "5"
            },
            "label": "Mexico Coverage - Limited Coverage"
          }
        ],
        "label": "Mexico Coverage - Limited"
      },
      {
        "children": [
          {
            "changeType": "Add",
            "entity": {
              "displayName": "Underinsured Motorist - Property Damage",
              "id": "53"
            },
            "label": "Underinsured Motorist - Property Damage Coverage"
          }
        ],
        "label": "Underinsured Motorist - Property Damage"
      }
    ],
    "label": "Line Coverages"
  }