NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/converter/ToMaintainPartyDetailsRequestConverter.java
/**
     * 
     * @param ndsSaveRegisteredRequest this represents an update to a registered user
     * @return the provided details converted to a MaintainPartyDetailsRequest object ready to send to the external
     *         service.
     */
@param ndsSaveRegisteredRequest this represents an update to a registered user
@return the provided details converted to a MaintainPartyDetailsRequest object ready to send to the external
service.
@param ndsSaveRegisteredRequest this represents an update to a registered user @return the provided details converted to a MaintainPartyDetailsRequest object ready to send to the external service .
@Converter
    public static MaintainPartyDetailsRequest converting(
            SaveRegisteredAccountDetailsNdsRequest ndsSaveRegisteredRequest) {
        logger.info("Starting Conversion For Save Registered Details Request");
        BeisAccountDetails ndsAccountDetails = null;
        BeisAddressDetail ndsContactAddressDetail = null;
        BeisUpdateUserDetails ndsUpdateUserDetails = null;
        String userType = null;
        String email = null;
        String userName = null;
        UpdateBeisRegistrationDetails ndsRegistrationDetails = ndsSaveRegisteredRequest.getRegisteredAccountDetails();
        ndsAccountDetails = ndsRegistrationDetails.getAccountDetails();
        ndsContactAddressDetail = ndsRegistrationDetails.getContactAddress();
        ndsUpdateUserDetails = ndsRegistrationDetails.getUpdateUserDetails();
        if (ndsUpdateUserDetails != null) {
            if(ndsUpdateUserDetails.getUserType()==UserType.LANDLORD){
                 userType="Landlord";
             }
             else{
                 userType="Agent";
             }      
            email = ndsUpdateUserDetails.getEmail();
            userName = ndsUpdateUserDetails.getUsername();
        }
        MaintainPartyDetailsRequest backOfficeMaintainPartyDetailsRequest = convertUserAccountAndAddressToAMaintainPartyDetailsRequest(
                ndsAccountDetails, ndsContactAddressDetail, userName, userType, email);
        logger.info("Finished Conversion For Save Registered Details Request");
        return backOfficeMaintainPartyDetailsRequest;
    }
@ Converter public static MaintainPartyDetailsRequest converting ( SaveRegisteredAccountDetailsNdsRequest ndsSaveRegisteredRequest ) { logger . info ( "Starting Conversion For Save Registered Details Request" ) ; BeisAccountDetails ndsAccountDetails = null ; BeisAddressDetail ndsContactAddressDetail = null ; BeisUpdateUserDetails ndsUpdateUserDetails = null ; String userType = null ; String email = null ; String userName = null ; UpdateBeisRegistrationDetails ndsRegistrationDetails = ndsSaveRegisteredRequest . getRegisteredAccountDetails ( ) ; ndsAccountDetails = ndsRegistrationDetails . getAccountDetails ( ) ; ndsContactAddressDetail = ndsRegistrationDetails . getContactAddress ( ) ; ndsUpdateUserDetails = ndsRegistrationDetails . getUpdateUserDetails ( ) ; if ( ndsUpdateUserDetails != null ) { if ( ndsUpdateUserDetails . getUserType ( ) == UserType . LANDLORD ) { userType = "Landlord" ; } else { userType = "Agent" ; } email = ndsUpdateUserDetails . getEmail ( ) ; userName = ndsUpdateUserDetails . getUsername ( ) ; } MaintainPartyDetailsRequest backOfficeMaintainPartyDetailsRequest = convertUserAccountAndAddressToAMaintainPartyDetailsRequest ( ndsAccountDetails , ndsContactAddressDetail , userName , userType , email ) ; logger . info ( "Finished Conversion For Save Registered Details Request" ) ; return backOfficeMaintainPartyDetailsRequest ; }
@param ndsSaveRegisteredRequest this represents an update to a registered user
 @return the provided details converted to a MaintainPartyDetailsRequest object ready to send to the external
         service.
@param ndsSaveRegisteredRequest this represents an update to a registered user @return the provided details converted to a MaintainPartyDetailsRequest object ready to send to the external service .
// Get local references to the objects in the request that we need to use. //back-office require user type in camel case // Convert what we can. Currently the UpdateBeisRegistrationDetails does not have a ndsUserDetails property.