public CreditSatisfiesFreeCallAllowanceOffer(
     Guid aggrgateId,
     DateTime time,
     Minutes freeMinutes)
 {
     Id             = aggrgateId;
     OfferSatisfied = time;
     FreeMinutes    = freeMinutes;
 }
예제 #2
0
 public PhoneCall(
     PhoneNumber numberDialled,
     DateTime startTime,
     Minutes minutes)
 {
     StartTime     = startTime;
     Minutes       = minutes;
     NumberDialled = numberDialled;
 }
예제 #3
0
        public void Record(
            PhoneCall phoneCall,
            PhoneCallCosting phoneCallCosting,
            IClock clock)
        {
            var numberOfMinutesCoveredByAllowance = new Minutes();

            if (_freeCallAllowance != null)
            {
                numberOfMinutesCoveredByAllowance =
                    _freeCallAllowance.MinutesWhichCanCover(phoneCall, clock);
            }

            var numberOfMinutesToChargeFor =
                phoneCall.Minutes.Subtract(numberOfMinutesCoveredByAllowance);

            var costOfCall =
                phoneCallCosting.DetermineCostOfCall(
                    numberOfMinutesToChargeFor);

            Causes(new PhoneCallCharged(this.Id, phoneCall, costOfCall,
                                        numberOfMinutesCoveredByAllowance));
        }
예제 #4
0
 public void Subtract(Minutes minutes)
 {
     Allowance = Allowance.Subtract(minutes);
 }
예제 #5
0
 public FreeCallAllowance(Minutes allowance, DateTime dateStarted)
 {
     Allowance   = allowance;
     DateStarted = dateStarted;
 }