Ejemplo n.º 1
0
 public static Expenses AsFlat(string name, Amount amount)
 {
     return(new Expenses(name, amount, false));
 }
Ejemplo n.º 2
0
 public static Expenses AsRate(string name, Amount amount)
 {
     return(new Expenses(name, amount, true));
 }
Ejemplo n.º 3
0
 private Expenses(string name, Amount amount, bool isRate)
 {
     this.Name   = name;
     this.Amount = amount;
     this.IsRate = isRate;
 }
Ejemplo n.º 4
0
 public Price CalculateFrom(Rate percentage)
 => new Price(Amount.CalculateFrom(percentage), Currency);
Ejemplo n.º 5
0
 public Price ApplyDiscount(Discount discount)
 => new Price(Amount.ApplyDiscount(discount), Currency);
Ejemplo n.º 6
0
 public Price ApplyTax(Tax tax)
 => new Price(Amount.ApplyTax(tax), Currency);