WIP billing
This commit is contained in:
parent
96b304a7a9
commit
0c254b805d
5 changed files with 68 additions and 0 deletions
6
Yavsc/Interfaces/IBillingClause.cs
Normal file
6
Yavsc/Interfaces/IBillingClause.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
public interface IBillingClause {
|
||||||
|
string Description {get; set;}
|
||||||
|
IBillingImpacter Impacter { get; }
|
||||||
|
}
|
||||||
|
|
||||||
14
Yavsc/Model/Billing/FixedImpacter.cs
Normal file
14
Yavsc/Model/Billing/FixedImpacter.cs
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
Yavsc/Model/Billing/IBillingImpacter.cs
Normal file
6
Yavsc/Model/Billing/IBillingImpacter.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
public interface IBillingImpacter {
|
||||||
|
decimal Impact(decimal orgValue);
|
||||||
|
|
||||||
|
}
|
||||||
11
Yavsc/Model/Billing/ProportionalImpacter.cs
Normal file
11
Yavsc/Model/Billing/ProportionalImpacter.cs
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
31
Yavsc/Model/Billing/ReductionCode.cs
Normal file
31
Yavsc/Model/Billing/ReductionCode.cs
Normal file
|
|
@ -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…
Add table
Add a link
Reference in a new issue