summaryrefslogtreecommitdiff
path: root/product/client/server/domain/payroll/Vest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'product/client/server/domain/payroll/Vest.cs')
-rw-r--r--product/client/server/domain/payroll/Vest.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/product/client/server/domain/payroll/Vest.cs b/product/client/server/domain/payroll/Vest.cs
new file mode 100644
index 0000000..82b796a
--- /dev/null
+++ b/product/client/server/domain/payroll/Vest.cs
@@ -0,0 +1,26 @@
+using Gorilla.Commons.Utility;
+
+namespace presentation.windows.server.domain.payroll
+{
+ public class Vest
+ {
+ Fraction portion;
+ Date vesting_date;
+
+ public Vest(Fraction portion, Date vesting_date)
+ {
+ this.portion = portion;
+ this.vesting_date = vesting_date;
+ }
+
+ public Units unvested_units(Units total_units, Date date)
+ {
+ return expires_before(date) ? Units.Empty : total_units.reduced_by(portion);
+ }
+
+ bool expires_before(Date date)
+ {
+ return vesting_date.is_before(date);
+ }
+ }
+} \ No newline at end of file