Policy Status
Overview
You can easily obtain a policy’s status in Socotra and listen on status updates. Socotra defines the following policy statuses:
Status |
Meaning |
---|---|
|
The policy has not yet reached its |
|
The policy’s |
|
The policy’s |
|
The transaction stack contains an issued cancellation that has an effective time in the past. It is removed when the policy is reinstated or the cancellation is reversed. |
|
The transaction stack contains an issued cancellation that has an effective time in the future. The status is removed when the policy is reinstated, the cancellation is reversed, or the cancellation effective time enters the past. |
|
The policy is not |
|
There is an active delinquency. This status is set when delinquency is |
|
The latest term’s auto-renewal object has |
Socotra does not attempt to impose a singular status in cases where a policy can be said to fulfill multiple state conditions. This is why the platform exposes statuses
, an array of enumerated values, on PolicyResponse. For example, a policy’s status can be [onRisk, cancelPending]
.
Note
The inGap
status will be implemented in a subsequent release.
Obtaining Policy Status
API
Policy status is provided as statuses
on the PolicyResponse
returned by endpoints such as Fetch Policy and supplied as inputs to plugins like the precommit plugin.
Event Stream
The event stream includes policy.status.update
, which is emitted on any change to policy status. The event body includes newStatuses
and removedStatuses
to indicate which statuses may have been added and which may have been removed, respectively. Both newStatuses
and removedStatuses
have ListPageResponsePolicyStatus
values:
requiredlistCompleted booleanitems Enum[] pending | inGap | expired | cancelled | cancelPending | onRisk | delinquent | doNotRenew
For example, when a new on-risk policy is issued, you should expect to see an event like this:
{
"locator": "...",
"requestId": "...",
"userLocator": "...",
"timestamp": "...",
"type": "policy.status.update",
"data": {
"removedStatuses": {
"listCompleted": true
},
"policyLocator": "...",
"newStatuses": {
"listCompleted": true,
"items": [
"onRisk"
]
}
}
}
If you were to then issue a cancellation effective now or in the past, a new event would be emitted:
{
"locator": "...",
"requestId": "...",
"userLocator": "...",
"timestamp": "...",
"type": "policy.status.update",
"data": {
"removedStatuses": {
"listCompleted": true,
"items": [
"onRisk"
]
},
"policyLocator": "...",
"newStatuses": {
"listCompleted": true,
"items": [
"cancelled"
]
}
}
}
As the event implies, statuses
in PolicyResponse
would be [cancelled]
.