use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class PersonnelBuilder method build.
public PersonnelBO build() {
final PersonnelBO personnel = new PersonnelBO();
personnel.setUserName(username);
personnel.setStatus(status);
personnel.setPersonnelDetails(null);
personnel.setPreferredLocale(null);
personnel.setLevel(new PersonnelLevelEntity(level));
personnel.setOffice(office);
personnel.setDisplayName(displayName);
personnel.setUserContext(userContext);
personnel.setCreateDetails();
personnel.setPersonnelRoles(personnelRoles);
return personnel;
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class CustSearchActionStrutsTest method testLoadMainSearchNonLoBoUser.
@Test
public void testLoadMainSearchNonLoBoUser() throws Exception {
OfficeBO officeBO = TestObjectFactory.getOffice(TestObjectFactory.SAMPLE_BRANCH_OFFICE);
PersonnelBO personnelBO = TestObjectFactory.createPersonnel(PersonnelLevel.NON_LOAN_OFFICER, officeBO, Integer.valueOf("1"), Short.valueOf("1"), "1234", "raj", null, null, null, new Name("abe", null, null, null), null, new Date(), null, Integer.valueOf("1"), null, null, null, new Date(), new HashSet());
userContext.setId(personnelBO.getPersonnelId());
addActionAndMethod(Methods.loadMainSearch.toString());
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(CustomerSearchConstants.LOADFORWARDNONLOANOFFICER_SUCCESS);
List<PersonnelBO> personnelList = (List<PersonnelBO>) SessionUtils.getAttribute(CustomerSearchConstants.LOANOFFICERSLIST, request);
Assert.assertNotNull(personnelList);
Assert.assertEquals(1, personnelList.size());
Assert.assertEquals(officeBO.getOfficeName(), SessionUtils.getAttribute(CustomerSearchConstants.OFFICE, request));
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class TestObjectFactory method getUserContext.
/**
* Also see {@link TestUtils#makeUser()} which should be faster (this method involves several database accesses).
*/
private static UserContext getUserContext() throws SystemException, ApplicationException {
byte[] password = EncryptionService.getInstance().createEncryptedPassword("mifos");
PersonnelBO user = getPersonnel(PersonnelConstants.SYSTEM_USER);
user.setEncryptedPassword(password);
updateObject(user);
user.login("mifos");
UserContext userContext = new UserContext();
userContext.setPreferredLocale(Locale.UK);
userContext.setLocaleId(Localization.ENGLISH_LOCALE_ID);
userContext.setId(user.getPersonnelId());
userContext.setName(user.getDisplayName());
userContext.setLevel(user.getLevelEnum());
userContext.setRoles(user.getRoles());
userContext.setLastLogin(user.getLastLogin());
userContext.setPasswordChanged(user.getPasswordChanged());
userContext.setBranchId(user.getOffice().getOfficeId());
userContext.setBranchGlobalNum(user.getOffice().getGlobalOfficeNum());
userContext.setOfficeLevelId(user.getOffice().getLevel().getId());
return userContext;
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class TestObjectFactory method createPersonnel.
public static PersonnelBO createPersonnel(final PersonnelLevel level, final OfficeBO office, final Integer title, final Short preferredLocale, final String password, final String userName, final String emailId, final List<RoleBO> personnelRoles, final List<CustomFieldDto> customFields, final Name name, final String governmentIdNumber, final Date dob, final Integer maritalStatus, final Integer gender, final Date dateOfJoiningMFI, final Date dateOfJoiningBranch, final Address address, Date passwordExpirationDate, Set<PersonnelUsedPasswordEntity> usedPasswords) throws Exception {
PersonnelBO personnelBO = new PersonnelBO(level, office, title, preferredLocale, password, userName, emailId, personnelRoles, customFields, name, governmentIdNumber, dob, maritalStatus, gender, dateOfJoiningMFI, dateOfJoiningBranch, address, Short.valueOf("1"), passwordExpirationDate, usedPasswords);
IntegrationTestObjectMother.createPersonnel(personnelBO);
return IntegrationTestObjectMother.findPersonnelById(personnelBO.getPersonnelId());
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class TestObjectFactory method createInstanceForTest.
public static GroupBO createInstanceForTest(final UserContext userContext, final GroupTemplate template, final CenterBO center, final Date customerActivationDate) {
PersonnelBO formedBy = null;
DateTime mfiJoiningDate = new DateTime().toDateMidnight().toDateTime();
DateTime activationDate = new DateTime().toDateMidnight().toDateTime();
GroupBO group = GroupBO.createGroupWithCenterAsParent(userContext, template.getDisplayName(), formedBy, center, template.getAddress(), template.getExternalId(), template.isTrained(), new DateTime(template.getTrainedDate()), template.getCustomerStatus(), mfiJoiningDate, activationDate);
group.setCustomerActivationDate(customerActivationDate);
return group;
}
Aggregations