Example of handling preemptions

In the previous topic, there was an example of a personal auto policy with an Acura Integra. At roughly the same time, two policy changes are started:

  • First policy change:
    • Job number: 0004375724
    • Job id of pc:421
    • Effective date: 11/05/2021
    • Material changes: Adds a Honda Civic and associated coverages for driver Alicia Shirley
  • Second policy change:
    • Job number: 0004408964
    • Job id of pc:505
    • Effective date: 11/06/2021
    • Material changes: Adds a Toyota Prius and associated coverages for driver Alicia Shirley

The first policy change is bound, causing that job to preempt the second job. As a result, the second job now has a preemption.

Now, suppose you want to handle preemptions for the second job and then bind it. (For clarity sake, portions of the response payload have been omitted in the following examples.)

First, you must handle preemptions.
POST /job/v1/jobs/pc:505/handle-preemptions

{
  "data": {
    "attributes": {
      "job": {
        "id": "pc:505", 
        "isPreempted": false,
        "jobNumber": "0004408964",
        "jobStatus": {
            "code": "Draft",
            "name": "Draft"
          },
        "jobType": {
          "code": "PolicyChange",
          "name": "Policy Change"
        }
      }
    }
  }
}
Next, you must quote the job.
POST /job/v1/jobs/pc:505/quote

{
  "data": {
    "attributes": {
      "id": "pc:505",
      "isPreempted": false,
      "jobNumber": "0004408964",
      "jobStatus": {
        "code": "Quoted",
        "name": "Quoted"
      },
      "jobType": {
        "code": "PolicyChange",
        "name": "Policy Change"
      },
      "taxesAndSurcharges": {
        "amount": "94.00",
        "currency": "usd"
      },
      "totalCost": {
        "amount": "1396.00",
        "currency": "usd"
      },
      "totalPremium": {
        "amount": "1302.00",
        "currency": "usd"
      }
    }
  }
}
And finally, you can bind and issue the job.
POST /job/v1/jobs/pc:505/bind-and-issue

{
  "data": {
    "attributes": {
      "id": "pc:505",
      "isPreempted": false,
      "jobNumber": "0004408964",
      "jobStatus": {
        "code": "Bound",
        "name": "Bound"
      },
      "jobType": {
        "code": "PolicyChange",
        "name": "Policy Change"
      }
    }
  }
}