Search in sources :

Example 26 with ClientPersonalDetailDto

use of org.mifos.dto.screen.ClientPersonalDetailDto in project head by mifos.

the class TestObjectFactory method createClient.

public static ClientBO createClient(final String customerName, final MeetingBO meeting, final CustomerStatus status) {
    ClientBO client;
    try {
        PersonnelBO systemUser = getPersonnel(PersonnelConstants.SYSTEM_USER);
        ClientNameDetailDto clientNameDetailDto = new ClientNameDetailDto(NameType.CLIENT.getValue(), SAMPLE_SALUTATION, customerName, "middle", customerName, "secondLast");
        clientNameDetailDto.setNames(ClientRules.getNameSequence());
        ClientNameDetailDto spouseNameDetailView = new ClientNameDetailDto(NameType.SPOUSE.getValue(), SAMPLE_SALUTATION, customerName, "middle", customerName, "secondLast");
        ClientPersonalDetailDto clientPersonalDetailDto = new ClientPersonalDetailDto(1, 1, 1, 1, 1, 1, Short.valueOf("1"), Short.valueOf("1"), Short.valueOf("41"));
        client = new ClientBO(TestUtils.makeUserWithLocales(), clientNameDetailDto.getDisplayName(), status, null, null, null, null, getFees(), null, systemUser, new OfficePersistence().getOffice(SAMPLE_BRANCH_OFFICE), meeting, systemUser, new DateTimeService().getCurrentJavaDateTime(), null, null, null, YesNoFlag.NO.getValue(), clientNameDetailDto, spouseNameDetailView, clientPersonalDetailDto, null);
        ApplicationContextProvider.getBean(LegacyClientDao.class).saveClient(client);
        StaticHibernateUtil.flushSession();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return client;
}
Also used : MifosRuntimeException(org.mifos.core.MifosRuntimeException) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) ClientNameDetailDto(org.mifos.dto.screen.ClientNameDetailDto) ClientBO(org.mifos.customers.client.business.ClientBO) ClientPersonalDetailDto(org.mifos.dto.screen.ClientPersonalDetailDto) LegacyClientDao(org.mifos.customers.client.persistence.LegacyClientDao) OfficePersistence(org.mifos.customers.office.persistence.OfficePersistence) DateTimeService(org.mifos.framework.util.DateTimeService) SystemException(org.mifos.framework.exceptions.SystemException) MifosRuntimeException(org.mifos.core.MifosRuntimeException) ProductDefinitionException(org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) CustomerException(org.mifos.customers.exceptions.CustomerException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) MeetingException(org.mifos.application.meeting.exceptions.MeetingException) OfficeException(org.mifos.customers.office.exceptions.OfficeException)

Aggregations

ClientNameDetailDto (org.mifos.dto.screen.ClientNameDetailDto)26 ClientPersonalDetailDto (org.mifos.dto.screen.ClientPersonalDetailDto)26 Test (org.junit.Test)13 CustomerException (org.mifos.customers.exceptions.CustomerException)12 ClientBO (org.mifos.customers.client.business.ClientBO)9 OfficePersistence (org.mifos.customers.office.persistence.OfficePersistence)8 ArrayList (java.util.ArrayList)7 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)7 InputStream (java.io.InputStream)5 LocalDate (org.joda.time.LocalDate)5 OfficeBO (org.mifos.customers.office.business.OfficeBO)5 AddressDto (org.mifos.dto.domain.AddressDto)5 ClientFamilyDetailDto (org.mifos.dto.screen.ClientFamilyDetailDto)5 Date (java.sql.Date)4 Date (java.util.Date)4 ApplicableAccountFeeDto (org.mifos.dto.domain.ApplicableAccountFeeDto)4 ClientCreationDetail (org.mifos.dto.domain.ClientCreationDetail)4 MeetingDto (org.mifos.dto.domain.MeetingDto)4 Address (org.mifos.framework.business.util.Address)4 SavingsOfferingBO (org.mifos.accounts.productdefinition.business.SavingsOfferingBO)3