using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PersonalFinance.Entity
{
public class BasePayment
{
public BasePayment() { }
public virtual User User { get; set; }
private int price;
///
/// Price of payment - must be positive number
///
public int Price
{
get { return price; }
set
{
if (value >= 0) { price = value; }
else { throw new ArgumentOutOfRangeException("Price cannot be negative."); }
}
}
private PaymentCurrency curr;
///
/// Payment currency
///
public PaymentCurrency Currency
{
get { return curr; }
set
{
if (PaymentCurrency.IsDefined(typeof(PaymentCurrency), value)) { this.curr = value; }
else { throw new ArgumentOutOfRangeException("Value is not defined enum from PaymentCurrency!"); }
}
}
///
/// Purpose of payment
///
public string Purpose { get; set; }
///
/// Note of payment
///
public string Note { get; set; }
private PaymentGroup group;
///
/// Type of payment (defines the visibility)
///
public PaymentGroup Group
{
get { return group; }
set
{
if (PaymentGroup.IsDefined(typeof(PaymentGroup), value)) { this.group = value; }
else { throw new ArgumentOutOfRangeException("Value is not defined enum from PaymentGroup!"); }
}
}
}
}