Search in sources :

Example 11 with ClientFamilyDetailDto

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

the class GroupServiceFacadeWebTierIntegrationTest method createClient.

private CustomerDetailsDto createClient(String parentGroupId) {
    MeetingBO meeting = new MeetingBuilder().withStartDate(new DateTime().minusWeeks(2)).build();
    MeetingDto meetingDto = meeting.toDto();
    String externalId = null;
    AddressDto addressDto = new AddressDto("here", "", "", "", "", "", "", "");
    PersonnelBO user = IntegrationTestObjectMother.findPersonnelById(Short.valueOf("1"));
    Short loanOfficerId = user.getPersonnelId();
    List<ApplicableAccountFeeDto> feesToApply = new ArrayList<ApplicableAccountFeeDto>();
    CustomerStatus.CLIENT_ACTIVE.getValue();
    boolean trained = false;
    // setup
    Short officeId = branch1.getOfficeId();
    DateTime mfiJoiningDate = new DateTime().minusWeeks(2);
    DateTime activationDate = new DateTime().minusWeeks(1);
    List<Short> selectedSavingProducts = new ArrayList<Short>();
    String clientName = "client";
    Short formedBy = loanOfficerId;
    Date dateOfBirth = new LocalDate(1990, 1, 1).toDateMidnight().toDate();
    String governmentId = "";
    Date trainedDate = new LocalDate(2000, 1, 1).toDateMidnight().toDate();
    ;
    // not in a group
    Short groupFlag = YesNoFlag.YES.getValue();
    Integer salutation = 1;
    String firstName = "first";
    String middleName = null;
    String lastName = "last";
    String secondLastName = null;
    ClientNameDetailDto clientNameDetailDto = new ClientNameDetailDto(NameType.CLIENT.getValue(), salutation, firstName, middleName, lastName, secondLastName);
    // magic numbers from default data
    Integer ethnicity = 218;
    Integer citizenship = 130;
    Integer handicapped = 138;
    Integer businessActivities = 225;
    Integer educationLevel = 226;
    Short numChildren = 0;
    Short gender = 49;
    Short povertyStatus = 41;
    Integer maritalStatus = ClientPersonalDetailDto.MARRIED;
    // active
    Short clientStatus = 3;
    ClientPersonalDetailDto clientPersonalDetailDto = new ClientPersonalDetailDto(ethnicity, citizenship, handicapped, businessActivities, maritalStatus, educationLevel, numChildren, gender, povertyStatus);
    ClientNameDetailDto spouseFatherName = new ClientNameDetailDto(NameType.SPOUSE.getValue(), salutation, firstName, middleName, lastName, secondLastName);
    InputStream picture = null;
    List<ClientNameDetailDto> familyNames = null;
    List<ClientFamilyDetailDto> familyDetails = null;
    ClientCreationDetail clientCreationDetail = new ClientCreationDetail(selectedSavingProducts, clientName, clientStatus, mfiJoiningDate.toDate(), externalId, addressDto, formedBy, dateOfBirth, governmentId, trained, trainedDate, groupFlag, clientNameDetailDto, clientPersonalDetailDto, spouseFatherName, picture, feesToApply, parentGroupId, familyNames, familyDetails, loanOfficerId, officeId, activationDate.toLocalDate());
    // exercise test
    List<SavingsDetailDto> allowedSavingProducts = new ArrayList<SavingsDetailDto>();
    CustomerDetailsDto newlyCreatedCustomerDetails = clientServiceFacade.createNewClient(clientCreationDetail, meetingDto, allowedSavingProducts);
    return newlyCreatedCustomerDetails;
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) LocalDate(org.joda.time.LocalDate) DateTime(org.joda.time.DateTime) ClientCreationDetail(org.mifos.dto.domain.ClientCreationDetail) ClientFamilyDetailDto(org.mifos.dto.screen.ClientFamilyDetailDto) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) ClientNameDetailDto(org.mifos.dto.screen.ClientNameDetailDto) CustomerDetailsDto(org.mifos.dto.domain.CustomerDetailsDto) SavingsDetailDto(org.mifos.dto.domain.SavingsDetailDto) InputStream(java.io.InputStream) ClientPersonalDetailDto(org.mifos.dto.screen.ClientPersonalDetailDto) AddressDto(org.mifos.dto.domain.AddressDto) ApplicableAccountFeeDto(org.mifos.dto.domain.ApplicableAccountFeeDto) Date(java.util.Date) LocalDate(org.joda.time.LocalDate) MeetingDto(org.mifos.dto.domain.MeetingDto) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder)

Aggregations

ClientFamilyDetailDto (org.mifos.dto.screen.ClientFamilyDetailDto)11 ClientNameDetailDto (org.mifos.dto.screen.ClientNameDetailDto)10 ArrayList (java.util.ArrayList)5 ClientPersonalDetailDto (org.mifos.dto.screen.ClientPersonalDetailDto)5 InputStream (java.io.InputStream)4 LocalDate (org.joda.time.LocalDate)4 AddressDto (org.mifos.dto.domain.AddressDto)4 ApplicableAccountFeeDto (org.mifos.dto.domain.ApplicableAccountFeeDto)4 ClientCreationDetail (org.mifos.dto.domain.ClientCreationDetail)4 MeetingDto (org.mifos.dto.domain.MeetingDto)4 Date (java.util.Date)3 MeetingBO (org.mifos.application.meeting.business.MeetingBO)3 ClientBO (org.mifos.customers.client.business.ClientBO)3 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)3 CustomerDetailsDto (org.mifos.dto.domain.CustomerDetailsDto)3 SavingsDetailDto (org.mifos.dto.domain.SavingsDetailDto)3 List (java.util.List)2 FormFile (org.apache.struts.upload.FormFile)2 DateTime (org.joda.time.DateTime)2 ClientCustActionForm (org.mifos.customers.client.struts.actionforms.ClientCustActionForm)2