Example #1
0
 public void InviteUser(User user, Email email)
 {
     DefaultAggregateSpecifications.AggregateIsCreated.ThrowDomainErrorIfNotSatisfied(this);
     OwnedAggregateSpecifications.AggregateIsOwnedByUser(this).ThrowDomainErrorIfNotSatisfied(user);
     this.Invitations.UserHasNotBeenInvitedYet().ThrowDomainErrorIfNotSatisfied(email);
     this.Emit(new InvitationAdded(InvitationId.NewComb(), email));
 }
Example #2
0
 public void DeleteInvitation(User user, InvitationId id)
 {
     DefaultAggregateSpecifications.AggregateIsCreated.ThrowDomainErrorIfNotSatisfied(this);
     OwnedAggregateSpecifications.AggregateIsOwnedByUser(this).ThrowDomainErrorIfNotSatisfied(user);
     this.Invitations.UserHasBeenInvited().ThrowDomainErrorIfNotSatisfied(id);
     this.Emit(new InvitationDeleted(id));
 }
Example #3
0
 public void Delete(string user)
 {
     DefaultAggregateSpecifications.AggregateIsCreated.ThrowDomainErrorIfNotSatisfied(this);
     OwnedAggregateSpecifications.AggregateIsOwnedByUser(this).ThrowDomainErrorIfNotSatisfied(new User(user));
     this.Emit(new CarDeleted());
 }
Example #4
0
 public void Edit(string name, int batteryCapacity, string user)
 {
     DefaultAggregateSpecifications.AggregateIsCreated.ThrowDomainErrorIfNotSatisfied(this);
     OwnedAggregateSpecifications.AggregateIsOwnedByUser(this).ThrowDomainErrorIfNotSatisfied(new User(user));
     this.Emit(new CarEdited(name, new BatteryCapacity(batteryCapacity)));
 }
Example #5
0
 public void Edit(string name, string address, Latitude latitude, Longitude longitude, decimal pricePerKw, User user)
 {
     DefaultAggregateSpecifications.AggregateIsCreated.ThrowDomainErrorIfNotSatisfied(this);
     OwnedAggregateSpecifications.AggregateIsOwnedByUser(this).ThrowDomainErrorIfNotSatisfied(user);
     this.Emit(new LocationEdited(name, address, latitude, longitude, pricePerKw));
 }