Skip to content

Instantly share code, notes, and snippets.

@vertonghenb
Created May 31, 2019 14:34
Show Gist options
  • Save vertonghenb/87c597de9cd912725cbcd623820023b6 to your computer and use it in GitHub Desktop.
Save vertonghenb/87c597de9cd912725cbcd623820023b6 to your computer and use it in GitHub Desktop.
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