Ejemplo n.º 1
0
 public void AddSpouse(Commands.AddSpouseToBenefitsEstimate cmd)
 {
     if(this.Spouse.HasValue)
     {
         throw new InvalidOperationException("You must set an employee before you can add a spouse.");
     }
     else
     {
         var evt = new Events.SpouseAdded(this.Id, cmd.FirstName, cmd.LastName);
         this.Emit(evt);
         //var estimate = this.BroadcastEstimate();
     }
 }
Ejemplo n.º 2
0
 public void Apply(Events.SpouseAdded e)
 {
     this.Spouse = new Person(e.FirstName, e.LastName, Config.BaseAnnualDependentBenefitCost);
     this.MaritalStatus = MaritalStatus.Maried;
     this.InludeSpouse = true;
 }