WIP billing

main
Paul Schneider 9 years ago
parent 02c7905b28
commit 167a9861a4
5 changed files with 68 additions and 0 deletions

@ -0,0 +1,6 @@
public interface IBillingClause { 
string Description {get; set;}
IBillingImpacter Impacter { get; }
}

@ -0,0 +1,14 @@
namespace Yavsc.Models.Billing   {
public class FixedImpacter : IBillingImpacter
{
public decimal ImpactedValue { get; set; }
public FixedImpacter (decimal impact)
{
ImpactedValue = impact;
}
public decimal Impact(decimal orgValue)
{
return orgValue + ImpactedValue;
}
}
}

@ -0,0 +1,6 @@
public interface IBillingImpacter { 
decimal Impact(decimal orgValue);
}

@ -0,0 +1,11 @@
namespace Yavsc.Models.Billing   {
public class ProportionalImpacter : IBillingImpacter
{
public decimal K { get; set; }
public decimal Impact(decimal orgValue)
{
return orgValue * K;
}
}
}

@ -0,0 +1,31 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Billing {
public class ReductionCode : IBillingClause
{
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
public ReductionCode(string descr, decimal impact) {
Description = descr;
impacter = new FixedImpacter(impact);
}
public string Description
{
get;
set;
}
IBillingImpacter impacter;
public IBillingImpacter Impacter
{
get
{
return impacter ;
}
private set {
impacter = value;
}
}
}
}
Loading…