I have this domain model (simplified), that represents a product that has a basic price and attached has numerous suppliers that provide a specific discount percentage against the basic price:
public class CarDerivative
{
public string Name { get; set; } e.g. StackOverflow Supercar 3.0L Petrol
public double BasicPrice { get; set; } e.g. 10,000
public double Delivery { get; set; } e.g. 500
public IList<SupplierDiscount> { get; set; } // has 3 various suppliers
}
public class SupplierDiscount
{
public string SupplierName; { get; set; }
//public SupplierInformation SupplierDetails { get; set; } // maybe later
public double BasicDiscount { get; set; }
public double DeliveryDiscount { get; set; } // e.g. 0.10 = 10%
}
Now, I'm thinking about where stuff should sit that does stuff with this:
For example, where best does BasicDiscountedPrice (stable formula) sit, should it ideally sit on SupplierDiscount which is furnished with a reference to the parent CarDerivative via constructor injection?
Where in your opinion should an unstable formula sit? Such as SupplierPriceForDerivative (basic + delivery + tax +++) ?