import { round } from '../../utilities/number-utility' ; export class Milestones { milestones : Milestone [ ] ; public constructor ( public fiNumber , public leanFiNumber , public eclipseNumber ) { this . milestones = this . calculateMilestones ( fiNumber , leanFiNumber , eclipseNumber ) ; } private calculateMilestones ( fiNumber , leanFiNumber , eclipseNumber ) { const milestones = [ new Milestone ( 'FU$' , round ( fiNumber * 0.1 ) ) , new Milestone ( 'Half FI' , round ( fiNumber * 0.5 ) ) , new Milestone ( 'FI' , round ( fiNumber ) ) , new Milestone ( 'Flex FI' , round ( fiNumber * 0.8 ) ) , new Milestone ( 'Fat FI' , round ( fiNumber * 1.2 ) ) , new Milestone ( '1.5x FI' , round ( fiNumber * 1.5 ) ) , ] ; if ( fiNumber !== leanFiNumber ) { milestones . push ( new Milestone ( 'Lean FI' , round ( leanFiNumber ) ) ) ; } if ( eclipseNumber ) { milestones . push ( new Milestone ( 'Contribution / Interest Eclipse' , round ( eclipseNumber ) ) ) ; } return milestones ; } } export class Milestone { constructor ( public label , public value ) { } }