Esempio n. 1
0
        public static AccountType CreateSavingsAccountType()
        {
            AccountType accountType = new AccountType("SavingsAccount", "Savings Account");

            PositionType currentPosition         = accountType.AddPositionType("Current");
            PositionType interestAccruedPosition = accountType.AddPositionType("InterestAccrued");

            TransactionType depositTransaction = accountType.AddTransactionType("Deposit", false);

            depositTransaction.AddRule(currentPosition, TransactionOperation.Add);

            TransactionType withdrawalTransaction = accountType.AddTransactionType("Withdrawal", false);

            withdrawalTransaction.AddRule(currentPosition, TransactionOperation.Subtract);

            TransactionType interestAccruedTransaction = accountType.AddTransactionType("InterestAccrued", true);

            interestAccruedTransaction.AddRule(interestAccruedPosition, TransactionOperation.Add);

            TransactionType interestCapitalizedTransaction = accountType.AddTransactionType("InterestCapitalized", false);

            interestCapitalizedTransaction.AddRule(interestAccruedPosition, TransactionOperation.Subtract);
            interestCapitalizedTransaction.AddRule(currentPosition, TransactionOperation.Add);

            return(accountType);
        }