protected PlannedExpence(Guid id, string name, string description, decimal bill, DateTime transactionDateTime, ExpenceType type) { Id = id; Name = name; Description = description; SetBill(bill); Type = type; TransactionDateTime = transactionDateTime; CreatedAt = DateTime.UtcNow; }
public void AddExpenceType(string name, string description) { var type = GetExpenceType(name); if (type != null) { throw new Exception(); // TODO } _expenceTypes.Add(ExpenceType.Create(name, description)); }
public void AddPlannedExpence(Guid id, string name, string description, decimal bill, DateTime transactionDateTime, ExpenceType type) { var expence = GetPlannedExpence(id); if (expence != null) { throw new Exception(); // TODO } _plannedExpences.Add(PlannedExpence.Create(id, name, description, bill, transactionDateTime, type)); }
public static PlannedExpence Create(Guid id, string name, string description, decimal bill, DateTime transactionDateTime, ExpenceType type) => new PlannedExpence(id, name, description, bill, transactionDateTime, type);