private TransactionEntity createTransaction()

in service/src/main/java/org/apache/fineract/cn/deposit/service/internal/service/TransactionService.java [389:422]


    private TransactionEntity createTransaction(TransactionRequestData request, TransactionTypeEnum txnType,
                                                LocalDateTime transactionDate, String tranType,
                                                TransactionEntity parent, String accountId,
                                                ProductInstanceEntity productInstanceEntity) {
        TransactionEntity txn = new TransactionEntity();
        UUID uuid=UUID.randomUUID();

        while(transactionRepository.findByIdentifier(uuid.toString()).isPresent()){
            uuid=UUID.randomUUID();
        }

        txn.setIdentifier(uuid.toString());
        txn.setRoutingCode(request.getRoutingCode());
        txn.setExternalId(request.getExternalId());
        txn.setTransactionType(txnType);
        txn.setAmount(request.getAmount().getAmount());
        //txn.setFeeAmount();
        txn.setState(ActionState.ACCEPTED);
        //txn.setCustomerAccountIdentifier();
        txn.setTransactionDate(transactionDate);
        txn.setExpirationDate(request.getExpiration());
        txn.setCreatedBy(getLoginUser());
        txn.setCreatedOn(getNow());
        /*txn.setLastModifiedBy();
        txn.setLastModifiedOn();*/
        markLastTransaction(accountId, transactionDate);
        txn.setAccountId(accountId);
        txn.setType(tranType);
        txn.setParentTransaction(parent);
        transactionRepository.save(txn);
        productInstanceEntity.setLastTransactionDate(transactionDate);
        this.productInstanceRepository.save(productInstanceEntity);
        return txn;
    }