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
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
Durationmodule has been modified to align the API with the rest of the date and time related modules:All uses of
Floathave been removed from the API. Any call of the formDuration::fromSeconds SSS.sss, whereSSSstands for a number of seconds andsssstands for a number of milliseconds, must be changed toDuration::from SSS sss. Calls that do not pass a literalFloatrequires a non-local refactoring to split the seconds from the milliseconds.The function
Duration::toSecondshas been removed and calls to it must be replaced byDuration::components.The function
Duration::diffDateTimeshas been removed and is replaced byDuration::betweenInstants. Note that the order of arguments is reversed.The function
Duration::addSecondshas been removed and is replaced byDuration::add.
The
DateTimemodule has been renamed toInstantand restructured:The functions
DateTime::addSecondsandDateTime::addDayshave been removed. They are replaced byInstant::addDuration.The function
DateTime::dayOfWeekhas been removed. There is no direct alternative as it does not make sense to talk about the day of week of anInstant. UseDate::dayOfWeekfor the same functionality implemented for calendar dates.The function
DateTime::dayCountFractionhas been moved to theDayCountmodule and renamed toDayCount::yearFraction.The type
DateTime::PaymentFrequencyhas been moved toDayCount::PaymentFrequency.The type
DateTime::DayCountFractionhas been renamed toDayCount::YearFraction. In the constructors everyDateTime(i.e.Instant) has been replaced with aDate. 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 properDatevalues.