public PackageBill(IEnumerable <Subscription> subscriptions, Money total) { Check.Argument.ArrayLenghtIsNotZero(subscriptions, nameof(subscriptions)); Check.Argument.IsNotNull(total, nameof(total)); this.subscriptions = subscriptions; costings = new BillCostings(subscriptions.Sum(), total); }
public Bill(Statement statement, PackageBill package, CallChargesBill callCharges, SkyStoreBill skyStore, Money total) { Check.Argument.IsNotNull(statement, nameof(statement)); Check.Argument.IsNotNull(package, nameof(package)); this.statement = statement; this.package = package; this.callCharges = callCharges; this.skyStore = skyStore; costings = new BillCostings( package.Costings.Total .Add(callCharges?.Costings.Total ?? Money.Zero) .Add(skyStore?.Costings.Total ?? Money.Zero), total); }