main
1namespace solidware.financials.service.domain.payroll
2{
3 public class Vest
4 {
5 Fraction portion;
6 Date vesting_date;
7
8 public Vest(Fraction portion, Date vesting_date)
9 {
10 this.portion = portion;
11 this.vesting_date = vesting_date;
12 }
13
14 public Units unvested_units(Units total_units, Date date)
15 {
16 return expires_before(date) ? Units.Empty : total_units.reduced_by(portion);
17 }
18
19 bool expires_before(Date date)
20 {
21 return vesting_date.is_before(date);
22 }
23 }
24}