Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module plus.models.common;
- import std.datetime;
- enum InterpolationType {
- Linear,
- Step,
- Cubic
- }
- enum PaymentFrequencyType {
- Monthly,
- Annual,
- Semiannual,
- Once
- }
- struct DateRange {
- Date start;
- Date end;
- }
- struct DateValue {
- Date date;
- double value = 0.0;
- }
- struct AcquiredRetired {
- Date acquired;
- Date retired;
- }
- struct Point {
- double x = 0.0;
- double y = 0.0;
- }
- struct QuantityBin {
- InterpolationType interpolationType;
- immutable(Point)[] data;
- }
- struct RateCurve {
- immutable(DateValue)[] curveData;
- }
- struct CFlowSequenceSpec {
- Date startDate;
- Date endDate;
- PaymentFrequencyType paymentFrequencyType;
- double value = 0.0;
- double growthRate = 0.0;
- RateCurve growthCurve;
- }
- struct FlowSpec {
- string descr;
- string source;
- CFlowSequenceSpec cFlowSequenceSpec;
- }
- struct IncomeSpec {
- string incomeType;
- FlowSpec flowSpec;
- }
- struct ExpenseSpec {
- string expenseType;
- FlowSpec flowSpec;
- }
- struct FlowModel {
- IncomeSpec[string] incomeModel;
- ExpenseSpec[string] expenseModel;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement