Search in sources :

Example 11 with AccountCheckListBO

use of org.mifos.customers.checklist.business.AccountCheckListBO in project head by mifos.

the class IntegrationTestObjectMother method createAccountChecklist.

public static AccountCheckListBO createAccountChecklist(Short prdTypeId, AccountState accountState, Short checklistStatus, List<String> details) {
    try {
        StaticHibernateUtil.startTransaction();
        ProductTypeEntity productTypeEntity = (ProductTypeEntity) StaticHibernateUtil.getSessionTL().get(ProductTypeEntity.class, prdTypeId);
        AccountStateEntity accountStateEntity = new AccountStateEntity(accountState);
        AccountCheckListBO accountChecklist = new AccountCheckListBO(productTypeEntity, accountStateEntity, "productchecklist", checklistStatus, details, Short.valueOf("1"), PersonnelConstants.SYSTEM_USER);
        customerDao.save(accountChecklist);
        StaticHibernateUtil.commitTransaction();
        return accountChecklist;
    } catch (Exception e) {
        StaticHibernateUtil.rollbackTransaction();
        throw new RuntimeException(e);
    } finally {
        StaticHibernateUtil.closeSession();
    }
}
Also used : MifosRuntimeException(org.mifos.core.MifosRuntimeException) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) AccountStateEntity(org.mifos.accounts.business.AccountStateEntity) CustomerException(org.mifos.customers.exceptions.CustomerException) MifosRuntimeException(org.mifos.core.MifosRuntimeException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) AccountException(org.mifos.accounts.exceptions.AccountException) ProductTypeEntity(org.mifos.accounts.productdefinition.business.ProductTypeEntity)

Aggregations

AccountCheckListBO (org.mifos.customers.checklist.business.AccountCheckListBO)11 MifosRuntimeException (org.mifos.core.MifosRuntimeException)4 CustomerCheckListBO (org.mifos.customers.checklist.business.CustomerCheckListBO)4 CheckListPersistence (org.mifos.customers.checklist.persistence.CheckListPersistence)4 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)4 Test (org.junit.Test)3 AccountStateEntity (org.mifos.accounts.business.AccountStateEntity)3 ProductTypeEntity (org.mifos.accounts.productdefinition.business.ProductTypeEntity)3 CheckListBO (org.mifos.customers.checklist.business.CheckListBO)3 ChkListActionForm (org.mifos.customers.checklist.struts.actionforms.ChkListActionForm)3 ServiceException (org.mifos.framework.exceptions.ServiceException)3 ArrayList (java.util.ArrayList)2 ProductCategoryBusinessService (org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService)2 UserContextFactory (org.mifos.accounts.servicefacade.UserContextFactory)2 CheckListException (org.mifos.customers.checklist.exceptions.CheckListException)2 CheckListStatesView (org.mifos.dto.screen.CheckListStatesView)2 PersistenceException (org.mifos.framework.exceptions.PersistenceException)2 MifosUser (org.mifos.security.MifosUser)2 UserContext (org.mifos.security.util.UserContext)2 BusinessRuleException (org.mifos.service.BusinessRuleException)2