use of org.mifos.dto.screen.ClientNameDetailDto 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;
}
Aggregations