Durations

Overview

Socotra Enterprise Core has a flexible notion of duration to prevent rigidity and difficulty for policies that aren’t month-based, such as event-based policies (travel insurance, e.g.), weekly/biweekly policies, and others.

Usage

The fundamental pricing equation in Socotra is amount = rate * duration. This equation holds as long as the rate and duration are based the same duration unit (for example, inverse days and days, respectively).

Given the unit, the system will be able to determine the duration of any segment, and elements that need to be priced (via the creation of charges) will implicitly have the same duration as the segment that contains them.

Configuration

The duration unit is specified within configuration as a tenant default and product-level override. The optional defaultDurationBasis property is be specified at the top-level of the configuration, and the default’s default will be months. There is an optional durationBasis property for each product. If the product’s durationBasis is not set, the tenant’s default will be used instead.

Like currency and timeZone, the durationBasis will be copied to the quote on creation. Therefore changing the duration unit in the configuration will have no effect on previously created quotes or policies.

Supported Duration Bases

These units are supported:

  • hours

  • days

  • weeks

  • months

  • years

Daylight Saving Time

Daylight Saving Time will not be considered for calculating durations. For example, a time segment that covers a shift from Daylight to Standard time, and starting and ending at midnight, and based on a unit of Days will result in an integer number of days, even though an hour may have been added or lost.