Example #1
0
 public void RegisterProduct(ProductId Id, IEnumerable<FareZone> FareZones)
 {
     Guard.Against<TooManyFareZonesException>(FareZones.Count() > 3);
     Guard.Against<DuplicateProductIdException>(Queries.IdExists(Id));
     if (Id == ProductId.Empty) Id = ProductIdGenerator.Next();
     Changes.ProductRegistered(Id);
 }
Example #2
0
 public void RegisterSubscription(ProductId Id, IEnumerable<FareZone> FareZones, PaymentSchedule Schedule)
 {
     Guard.With<PaymentScheduleRequiredException>(Schedule != PaymentSchedule.Empty);
     RegisterProduct(Id, FareZones);
 }
Example #3
0
 bool IQueryACatalog.IdExists(ProductId Id)
 {
     return RegisteredProductIds.Contains(Id);
 }
Example #4
0
 void IChangeACatalog.ProductRegistered(ProductId Id)
 {
     RegisteredProductIds.Add(Id);
 }