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