protected PlannedIncome(Guid id, string name, string description, decimal bill, DateTime transactionDateTime, IncomeType type) { Id = id; Name = name; Description = description; SetBill(bill); Type = type; TransactionDateTime = transactionDateTime; CreatedAt = DateTime.UtcNow; }
public void AddIncomeType(string name, string description) { var type = GetIncomeType(name); if (type != null) { throw new Exception(); // TODO } _incomeTypes.Add(IncomeType.Create(name, description)); }
public void AddPlannedIncome(Guid id, string name, string description, decimal bill, DateTime transactionDateTime, IncomeType type) { var income = GetPlannedIncome(id); if (income != null) { throw new Exception(); // TODO } _plannedIncomes.Add(PlannedIncome.Create(id, name, description, bill, transactionDateTime, type)); }
public static PlannedIncome Create(Guid id, string name, string description, decimal bill, DateTime transactionDateTime, IncomeType type) => new PlannedIncome(id, name, description, bill, transactionDateTime, type);