public override RulePaymentLine CalculatePayment(CadEvent cadEvent, Dictionary <string, double> supplierAgreementRates) { double rate; supplierAgreementRates.TryGetValue("AfterMiddayRate", out rate); return(new RulePaymentLine(this.Name, rate)); }
public Payment CalculatePayments(IEnumerable <IRule> rules, CadEvent cadEvent, Dictionary <string, double> agreementRates) { Payment payment = new Payment(); foreach (IRule rule in rules) { if (rule.IsMatchFor(cadEvent)) { payment.AddPaymentLine(rule.CalculatePayment(cadEvent, agreementRates)); } } return(payment); }
public override bool IsMatchFor(CadEvent cadEvent) { TimeSpan noon = new TimeSpan(12, 0, 0); return(cadEvent.JobTime.TimeOfDay > noon); }
public abstract RulePaymentLine CalculatePayment(CadEvent cadEvent, Dictionary <string, double> supplierAgreementRates);
public abstract bool IsMatchFor(CadEvent cadEvent);