private void ResolveCall(CallResolved callResolved) { var res = callResolved.Resolution; var violations = _activePolicies.GetViolations(callResolved.Resolution, new ResolvedCall(Purchase, _correctResolution, res)); if (violations.Any()) { World.Publish(new TechnicalMistakeOccurred(new PayPenalty(5), violations.First())); } if (res != _correctResolution && res == CallResolution.Reject && !violations.Any()) { World.Publish(new TechnicalMistakeOccurred(new PayPenalty(5), DefaultPolicy)); } if (res == _correctResolution) { var rating = CallerPatienceCallRatings.Get(Caller.Patience); World.Publish(new CallSucceeded(GetHashCode())); World.Publish(new CallRated(GetHashCode(), new CallerFeedback(rating, CallerReviews.Get(rating)))); } else { World.Publish(new CallFailed(new Fee(2))); World.Publish(new CallRated(GetHashCode(), new CallerFeedback(new CallRating(1), CallerReviews.Get(1)))); } Dispose(); }
private void CallResolved(CallResolved obj) { _numResolvedCallsInCurrentDay++; }