Created
May 31, 2019 14:34
-
-
Save vertonghenb/87c597de9cd912725cbcd623820023b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Travel | |
{ | |
public IList<Expense> Expenses { get; set; } = new List<Expense>(); | |
} | |
public class Cost | |
{ | |
public decimal Amount { get; set; } | |
public string Currency { get; set; } | |
public PaymentType Payment { get; set; } = PaymentType.Unknown; | |
} | |
public class Expense | |
{ | |
public int TravelId { get; set; } | |
public DateTime Date { get; set; } | |
public Cost Cost { get; set; } | |
public Tip Tip { get; set; } = new Tip(); | |
public ExpenseType Type { get; set; } = ExpenseType.Unknown; | |
public bool IsTaxFree { get; set; } = false; | |
public decimal TotalCost => Cost.Amount * + Tip.Cost.Amount; | |
} | |
public class Tip | |
{ | |
public Cost Cost { get; set; } = new Cost(); | |
} | |
public enum ExpenseType | |
{ | |
Unknown, | |
Food, | |
Souvenirs, | |
Museum | |
//... | |
} | |
public enum PaymentType | |
{ | |
Unknown, | |
Visa, | |
Cash, | |
Mastercard | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment