public GetLoanResponse createLoan(CreateLoanRequest createLoanRequest) {
        String loanId = UUID.randomUUID().toString();
        LoanDto loanDto = new LoanDto(
                loanId,
                createLoanRequest.term(),
                createLoanRequest.originatedAmount(),
                createLoanRequest.currency(),
                createLoanRequest.targetInterestRate(),
                createLoanRequest.effectiveInterestRate(),
                createLoanRequest.externalReference(),
                createLoanRequest.startDate(),
                createLoanRequest.endDate(),
                LoanStatus.CREATED,
                createLoanRequest.timezone(),
                createLoanRequest.region(),
                createLoanRequest.state()
        );
        List<Installment> newInstallments = calculator.newInstallments(LoanTransformer.transformForNewInstallments(createLoanRequest));
        List<LoanInstallmentDto> loanInstallmentDtos = LoanInstallmentTransformer.transform(newInstallments, loanId);
        // TODO(hubert): Add transactions
        loanInstallmentDtos.forEach(loanInstallmentDao::insert);
        loanDao.insert(loanDto);
        loanInstallmentDtos = loanInstallmentDao.findByLoanId(loanId);
        LOGGER.info("Creating new Loan: %s\nInstallments: %s".formatted(loanDto, loanInstallmentDtos));

        return new GetLoanResponse(
                LoanTransformer.transformToLoanInfo(
                        loanDto,
                        loanInstallmentDtos
                ));

    }
@Test
    public void testCreateLoan_InterestBearing() {
        int term = 4;
        BigDecimal originatedAmount = BigDecimal.valueOf(100.0);
        String currency = "USD";
        BigDecimal targetInterestRate = BigDecimal.valueOf(0.1);
        BigDecimal effectiveInterestRate = BigDecimal.valueOf(0.1);
        String externalReference = UUID.randomUUID().toString();
        LocalDate startDate = LocalDate.of(2023, 1, 1);
        LocalDate endDate = startDate;
        String timezone = "America/Los_Angeles";
        String region = "USA";
        String state = "CA";

        CreateLoanRequest createLoanRequest = new CreateLoanRequest(
            term,
            originatedAmount,
            currency,
            targetInterestRate,
            effectiveInterestRate,
            externalReference,
            startDate,
            endDate,
            timezone,
            region,
            state
        );

        GetLoanResponse loanResponse = loanResourceManager.createLoan(createLoanRequest);

        // Verify that all expected fields are set correctly in the response
        assertEquals(loanResponse.loanInfo().term(), term);
        assertEquals(loanResponse.loanInfo().targetInterestRate(), targetInterestRate);
        assertEquals(loanResponse.loanInfo().effectiveInterestRate(), effectiveInterestRate);
        assertEquals(loanResponse.loanInfo().currency(), currency);
        assertEquals(loanResponse.loanInfo().externalReference(), externalReference);
        assertEquals(loanResponse.loanInfo().startDate(), startDate);
        assertEquals(loanResponse.loanInfo().endDate(), endDate);
        assertEquals(loanResponse.loanInfo().timezone(), timezone);
        assertEquals(loanResponse.loanInfo().region(), region);
        assertEquals(loanResponse.loanInfo().state(), state);

        // Verify that the installment schedule is correct
        List<LoanInstallmentInfo> loanInstallmentInfoList = loanResponse.loanInfo().loanInstallments();
        assertEquals(loanInstallmentInfoList.size(), 4);

        loanInstallmentInfoList.forEach(loanInstallmentInfo -> {
            assertEquals(loanInstallmentInfo.loanId(), loanResponse.loanInfo().loanId());
            assertEquals(loanInstallmentInfo.status(), InstallmentStatus.OWED);
        });

        LoanInstallmentInfo installment1 = loanInstallmentInfoList.get(0);
        assertEquals(installment1.principalAmount(), BigDecimal.valueOf(24.67));
        assertEquals(installment1.interestAmount(), BigDecimal.valueOf(0.85));

        LoanInstallmentInfo installment2 = loanInstallmentInfoList.get(1);
        assertEquals(installment2.principalAmount(), BigDecimal.valueOf(24.94));
        assertEquals(installment2.interestAmount(), BigDecimal.valueOf(0.58));

        LoanInstallmentInfo installment3 = loanInstallmentInfoList.get(2);
        assertEquals(installment3.principalAmount(), BigDecimal.valueOf(25.09));
        assertEquals(installment3.interestAmount(), BigDecimal.valueOf(0.43));

        LoanInstallmentInfo installment4 = loanInstallmentInfoList.get(3);
        assertEquals(installment4.principalAmount(), BigDecimal.valueOf(25.3).setScale(2));
        assertEquals(installment4.interestAmount(), BigDecimal.valueOf(0.21));
    }