initial commit v2

This commit is contained in:
2026-09-03 21:06:39 +01:00
commit 4228ccb030
27 changed files with 981 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
namespace OrderDomain;
public class OrderLine
{
public decimal UnitPrice { get; }
public int Quantity { get; }
public bool HasDiscount { get; private set; }
public decimal Value =>
HasDiscount ? UnitPrice * Quantity * 0.8m : UnitPrice * Quantity;
public OrderLine(decimal unitPrice, int quantity)
{
UnitPrice = unitPrice;
Quantity = quantity;
}
public void ApplyDiscount() => HasDiscount = true;
}