public Billing(IEnumerable <ITariff> tariffs) { Data = new BillingUnit(); PhoneManagement = new PhoneManagement(Data); BalanceOperation = new BalanceOperation(PhoneManagement); CallManagement = new CallManagement(Data, PhoneManagement); Tariffs = tariffs; }
public void PutCallOnRecord(object sender, ICall call) { CallManagement.PutCallOnRecord(call); // checks if call was answered and then record information about it (start and end time, duration etc.) BalanceOperation.ReduceBalance(call.SenderPhoneNumber, CallManagement.CalculateCostOfCall(call)); // extract some ammout of money considering tariff and duration of a call }