public static Portfolio Open(PortfolioId id, AccountType accountType, Money initialDeposit)
        {
            if (initialDeposit < MinimumPortfolioBalance)
            {
                throw new InvalidOperationException(String.Format("The intial deposit of {0} is lower than the require a minimum of {1}", initialDeposit, MinimumPortfolioBalance));
            }

            var portfolio = new Portfolio(id);
            portfolio.OpenAccount(accountType);
            portfolio.CreditAccount(accountType, initialDeposit);

            return portfolio;
        }
 public Account(Portfolio portfolio, AccountId accountId)
     : base(portfolio, accountId)
 {
     transactions = new List<Transaction>();
 }
Example #3
0
 public Account(Portfolio portfolio, AccountId accountId)
     : base(portfolio, accountId)
 {
     transactions = new List <Transaction>();
 }