use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class IntegrationTestObjectMother method createClient.
public static void createClient(ClientBO client, MeetingBO meeting, AmountFeeBO fee) throws CustomerException {
UserContext userContext = TestUtils.makeUser();
client.setUserContext(userContext);
AccountFeesEntity accountFee = new AccountFeesEntity(null, fee, fee.getFeeAmount().getAmountDoubleValue());
List<AccountFeesEntity> accountFees = new ArrayList<AccountFeesEntity>();
accountFees.add(accountFee);
List<SavingsOfferingBO> selectedOfferings = new ArrayList<SavingsOfferingBO>();
customerService.createClient(client, meeting, accountFees, selectedOfferings);
}
use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class SavingsAccountRESTController method createSavingsAccount.
@RequestMapping(value = "/account/savings/create", method = RequestMethod.POST)
@ResponseBody
public Map<String, String> createSavingsAccount(@RequestParam String globalCustomerNum, @RequestParam(required = false) String amount, @RequestParam Integer productId) throws Throwable {
CustomerBO customer = validateGlobalCustNum(globalCustomerNum);
SavingsOfferingBO product = validateProductId(productId);
String recommendedAmount = null != amount ? amount : product.getRecommendedAmount().toString();
Integer customerId = customer.getCustomerId();
AccountState accountState = AccountState.SAVINGS_PENDING_APPROVAL;
SavingsAccountCreationDto savingsAccountCreation = new SavingsAccountCreationDto(productId, customerId, accountState.getValue(), recommendedAmount);
Long savings = savingsServiceFacade.createSavingsAccount(savingsAccountCreation);
SavingsAccountDetailDto details = savingsServiceFacade.retrieveSavingsAccountDetails(savings);
Map<String, String> map = new HashMap<String, String>();
map.put("customerName", customer.getDisplayName());
map.put("productName", product.getPrdOfferingName());
map.put("interesRate", details.getProductDetails().getInterestRate().toString());
map.put("interestRatePeriod", details.getProductDetails().getInterestCalculationFrequency().toString());
map.put("recommendedAmount", recommendedAmount);
return map;
}
use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class SavingsPrdBusinessServiceIntegrationTest method testGetAllSavingsProducts.
@Test
public void testGetAllSavingsProducts() throws Exception {
SavingsOfferingBO savingsOffering = createSavingsOfferingBO();
Assert.assertEquals(1, savingsProductDao.findAllSavingsProducts().size());
savingsOffering = null;
}
Aggregations