public void CreateTransaction(LoanTransactionModel model) { model.CreationDate = DateTime.Now; model.Status = 0; var createTransaction = _mapper.Map <LoanTransaction>(model); _loanTransactionRepository.CreateTransaction(createTransaction); var loan = _loanRepository.GetById(createTransaction.LoansId); if (loan.LoanTransactions.Sum(x => x.Amount) >= loan.Amount) { loan.Status = 1; _loanRepository.UpdateLoan(loan); } }
public void Update(LoanTransactionModel shareTransaction) { _repository.Update(shareTransaction); }
public void Save(LoanTransactionModel shareTransaction) { _repository.Save(shareTransaction); }
public void Delete(LoanTransactionModel loanTransaction) { _repository.Delete(loanTransaction); }