Resources for scheduled items

Different types of scheduled items require different properties

Every type of scheduled item is defined using a different set of properties.

For example, scheduled items for a homeowners HOPScheduledPersonalProperty coverage could require these properties:

  • Description (a string value)

  • Property type (a value from a set of choices defined in the product definition)

  • Date of appraisal (a dateOnly value)

  • Appraised value (a decimal value)

But, scheduled items for an Inland Marine IMScheduledEquipment coverage could require these properties:

  • Description (a string value)

  • Equipment type (a typecode value)

  • Purchase date (a dateOnly value)

  • Replacement price (a decimal value)

  • Covered by warranty (a Boolean value)

Normally, when different types of objects have different properties, Cloud API manages each object type with a different type of resource. However, it would be inefficient for Cloud API to generate a separate type of resource for every type of scheduled item across every LOB managed by the insurer.

To simplify endpoint architecture, Cloud API uses a single ScheduledItem resource for all types of scheduled items.

Structure of the ScheduledItem resource

The ScheduledItem resource has the following top-level attributes:

{
  "data": {
    "attributes": {
      "id": ...,
      "properties": ...
    }
  }
}

The properties field is a map. Every member of the map is a scheduled item property whose name is a ScheduledItemPropertyPattern (such as "Description"). The property is set to a JSON object that specifies the property's value, such as "Painting: Dutch sailboat".

The ScheduledItemPropertyPattern must be a ScheduledItemPropertyPattern from the product definition for this type of scheduled item. For example, suppose you have a scheduled item for the homeowners HOPScheduledPersonalProperty coverage from the previous example. The following table identifies the ScheduledItemPropertyPattern (and its data type) for each piece of information to specify about the scheduled item.

Information to specify ScheduledItemPropertyPattern Associated data type
Description Description string
Property type HOPScheduledPersonalProperty ItemType choice (from a set of choices in the product definition)
Date of appraisal DateOfAppraisal date only
Appraised value HOPScheduledPersonalProperty ItemAppraisedValue decimal

Each property would start like this:

{
  "data": {
    "attributes": {
      "properties": {
        "Description":
           ...,
        "HOPScheduledPersonalPropertyItemType":
           ...,
        "DateOfAppraisal":
           ...,
        "HOPScheduledPersonalPropertyItemAppraisedValue":
           ...
      }
    }
  }
}

Each ScheduledItemPropertyPattern must be set to a JSON object that specifies the pattern's value, such as "Painting: Dutch sailboat". The JSON object must contain one of the following "<X>value" fields:

  • booleanValue

  • choiceValue (for choice values defined in the product definition)

  • dateOnlyValue

  • dateTimeValue

  • decimalValue

  • integerValue

  • locationValue (for values set to a Location)

  • partyValue (for values set to an involved party, such as the insured)

  • stringValue

  • typekeyValue (for typecode values)

For each property, the "<X>value" field must correspond to the data type for the ScheduledItemPropertyPattern . For example, if the ScheduledItemPropertyPattern specifies a string value (such as for Description), then the JSON object must include the stringValue field. If the ScheduledItemPropertyPattern specifies a date value (such as for DateOfAppraisal), then the JSON object must include the dateOnlyValue field.

Suppose you have a scheduled item from the previous JSON payload with the following values:

  • Description: Painting: Dutch sailboat

  • Property type: Fine art

  • Date of appraisal: February 2, 2020

  • Appraised value: $40,000

The payload for the properties map would look like this:
{
  "data": {
    "attributes": {
      "properties": {
        "Description": {
          "stringValue": "Painting: Dutch sailboat"
        },
        "HOPScheduledPersonalPropertyItemType": {
          "choiceValue": {
            "code": "fine_arts"
          }
        },
        "DateOfAppraisal": {
          "dateOnlyValue": "2020-02-02"
        },
        "HOPScheduledPersonalPropertyItemAppraisedValue": {
          "decimalValue": "40000"
        }
    }
  }
}

For most of the "<X>value" fields, the value itself is specified in the JSON payload as a string. There are a few exceptions:

  • choiceValue and typekeyValue values are specified as JSON objects with a child code field

locationValue and partyValue values are specified as JSON objects with a child id value

Scheduled items in response payloads

In response payloads, properties in the properties map have two additional read-only fields:

  • displayValue lists a user-friendly version of the property's value.

  • valueType identifies the data type of the ScheduledItemPropertyPattern. The value of valueType is determined by which field was used to specify the value. (If the value was specified using the stringValue field, then valuetype is set to "string".)

For example, in a response payload, the first two elements from the previous example would appear as follows:

{
  "data": {
    "attributes": {
      "properties": {
        "Description": {
          "displayValue": "Painting: Dutch sailboat",
          "stringValue": "Painting: Dutch sailboat",
          "valueType": "string"
        },
        "HOPScheduledPersonalPropertyItemType": {
          "choiceValue": {
            "code": "fine_arts"
          },
          "displayValue": "Fine arts",
          "valueType": "choice"
        },
        ...