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
Duration
module has been modified to align the API with the rest of the date and time related modules:All uses of
Float
have been removed from the API. Any call of the formDuration::fromSeconds SSS.sss
, whereSSS
stands for a number of seconds andsss
stands for a number of milliseconds, must be changed toDuration::from SSS sss
. Calls that do not pass a literalFloat
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 byDuration::components
.The function
Duration::diffDateTimes
has been removed and is replaced byDuration::betweenInstants
. Note that the order of arguments is reversed.The function
Duration::addSeconds
has been removed and is replaced byDuration::add
.
The
DateTime
module has been renamed toInstant
and restructured:The functions
DateTime::addSeconds
andDateTime::addDays
have been removed. They are replaced byInstant::addDuration
.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 anInstant
. UseDate::dayOfWeek
for the same functionality implemented for calendar dates.The function
DateTime::dayCountFraction
has been moved to theDayCount
module and renamed toDayCount::yearFraction
.The type
DateTime::PaymentFrequency
has been moved toDayCount::PaymentFrequency
.The type
DateTime::DayCountFraction
has 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 properDate
values.