UnitPeriod Module
an unambiguous way to represent regular date intervals and generate schedules based on them
note: unit-period definitions are based on US federal legislation but the definitions are universally applicable
Types and nested modules
Type/Module | Description |
functions for creating and handling unit-period configs |
|
unit period combined with a start date and multiple where appropriate |
|
direction in which to generate the schedule: forward works forwards from a given date and reverse works backwards |
|
defines the length of a payment schedule, either by the number of payments or by the maximum duration |
|
a transaction term is the length of a transaction (i.e. a financial product), from the start date to the final payment |
|
interval between payments |
Functions and values
Function or value |
Description
|
|
all unit-periods, excluding unlikely ones (opinionated!)
|
Full Usage:
commonLengths lengths
Parameters:
int array
Returns: (int * int) array
|
lengths that occur more than once
|
Full Usage:
detect direction interval transferDates
Parameters:
Direction
interval : UnitPeriod
transferDates : Date array
Returns: Config
|
for a given interval and array of dates, devise the unit-period config
|
Full Usage:
generatePaymentSchedule scheduleLength direction unitPeriodConfig
Parameters:
ScheduleLength
direction : Direction
unitPeriodConfig : Config
Returns: Date[]
|
generate a payment schedule based on a unit-period config
|
Full Usage:
maxPaymentCount maxDuration config
Parameters:
int<MeasureProduct<DurationDay, MeasureOne>>
config : Config
Returns: int
|
generates a suggested number of payments to constrain the loan within a certain duration
|
Full Usage:
nearest term advanceDates paymentDates
Parameters:
TransactionTerm
advanceDates : Date[]
paymentDates : Date[]
Returns: UnitPeriod
|
find the nearest unit-period according to the transaction term and transfer dates
|
|
|
|
approximate length of unit period in days, used e.g. as the denominator in unit-period fractions
|
Full Usage:
transactionTerm consummationDate firstFinanceChargeEarnedDate lastPaymentDueDate lastAdvanceScheduledDate
Parameters:
Date
firstFinanceChargeEarnedDate : Date
lastPaymentDueDate : Date
lastAdvanceScheduledDate : Date
Returns: TransactionTerm
|
calculate the transaction term based on specific events
|