Release 0.74.0

Fields entryPoint, instantiationArgument and instantiationTime are combined

Relevant for all projects.

To organize the Contract object of the Deon API, three fields have been changed:

Old

New

entryPoint

instantiationDetails.entryPoint

instantiationArgument

instantiationDetails.argument

instantiationTime

instantiationDetails.time

Steps to migrate

  1. Replace the old field names with the new field names as shown in the table above.

The date and time types have been reorganized

Relevant for all projects.

The DateTime type has been renamed to Instant, and a new DateTime type has been defined that is different from the previous one. The APIs of Instant and DateTime are different, so most code that used the old type should fail to type check.

Steps to migrate

  • The Duration module has been modified to align the API with the rest of the date and time related modules:

    1. All uses of Float have been removed from the API. Any call of the form Duration::fromSeconds SSS.sss, where SSS stands for a number of seconds and sss stands for a number of milliseconds, must be changed to Duration::from SSS sss. Calls that do not pass a literal Float requires a non-local refactoring to split the seconds from the milliseconds.

      The function Duration::toSeconds has been removed and calls to it must be replaced by Duration::components.

    2. The function Duration::diffDateTimes has been removed and is replaced by Duration::betweenInstants. Note that the order of arguments is reversed.

    3. The function Duration::addSeconds has been removed and is replaced by Duration::add.

  • The DateTime module has been renamed to Instant and restructured:

    1. The functions DateTime::addSeconds and DateTime::addDays have been removed. They are replaced by Instant::addDuration.

    2. The function DateTime::dayOfWeek has been removed. There is no direct alternative as it does not make sense to talk about the day of week of an Instant. Use Date::dayOfWeek for the same functionality implemented for calendar dates.

    3. The function DateTime::dayCountFraction has been moved to the DayCount module and renamed to DayCount::yearFraction.

    4. The type DateTime::PaymentFrequency has been moved to DayCount::PaymentFrequency.

    5. The type DateTime::DayCountFraction has been renamed to DayCount::YearFraction. In the constructors every DateTime (i.e. Instant) has been replaced with a Date. Instant values were previously used to encode dates by tacitly using the calendar for UTC and ignoring the time component. Migrating to the new API requires the calling code to encode dates as proper Date values.