Example #1
0
        public async Task <HttpResponseMessage> AddLoanDetails(Guid owner, LoanAccountIn loan)
        {
            var input = new AccountAdd {
                CurrentAccount = Guid.Empty, Loan = loan
            };

            return(await this.ProcessActionAsync(owner, input, this.accountService.AddLoanAccount));
        }
Example #2
0
        /// <summary>
        /// The add.
        /// </summary>
        /// <param name="owner">
        /// The owner.
        /// </param>
        /// <param name="currentAccount">
        /// The current account.
        /// </param>
        /// <param name="code">
        /// The code.
        /// </param>
        /// <param name="input">
        /// The input.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <int> Add(Guid owner, Guid currentAccount, Guid code, LoanAccountIn input)
        {
            var account = GetLoans(owner, currentAccount, code, input);

            this.context.Accounts.Add(account);

            var myint = await this.context.SaveChangesAsync();

            return(myint);
        }
Example #3
0
 /// <summary>
 /// The add loan details.
 /// </summary>
 /// <param name="owner">
 /// The owner.
 /// </param>
 /// <param name="currentAccount">
 /// The current account.
 /// </param>
 /// <param name="account">
 /// The account.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public Task <HttpResponseMessage> AddLoanDetails(Guid owner, Guid currentAccount, LoanAccountIn account)
 {
     throw new NotImplementedException();
 }
Example #4
0
        /// <summary>
        /// The get loans.
        /// </summary>
        /// <param name="owner">
        /// The owner.
        /// </param>
        /// <param name="currentAccount">
        /// The current account.
        /// </param>
        /// <param name="code">
        /// The code.
        /// </param>
        /// <param name="input">
        /// The input.
        /// </param>
        /// <returns>
        /// The <see cref="LoanAccountEntity"/>.
        /// </returns>
        private static LoanAccountEntity GetLoans(Guid owner, Guid currentAccount, Guid code, LoanAccountIn input)
        {
            var output = new LoanAccountEntity
            {
                Code              = code,
                Owner             = owner,
                Holder            = input.Holder,
                IsArchived        = input.IsArchived,
                Bank              = input.Bank,
                Description       = input.Description,
                Amount            = input.Amount,
                Currency          = input.Currency,
                Number            = input.Number,
                StartDate         = input.StartDate,
                InitialAmount     = input.InitialAmount,
                InterestNetRate   = input.InterestNetRate,
                LoanInterestRate  = input.LoanInterestRate,
                PremiumPercentage = input.PremiumPercentage,
                LoanEndDate       = input.LoanEndDate
            };

            if (currentAccount != Guid.Empty)
            {
                output.LoanRelatedAccount = currentAccount;
            }

            return(output);
        }