@Test @SuppressWarnings("unchecked") public void test_should_set_complainant_user_id_when_logged_in_citizen_creates_complaint() { final HashMap<String, Object> sevaRequestMap = SevaRequestMapFactory.create(); final HashMap<String, Object> requestInfo = (HashMap<String, Object>) sevaRequestMap.get("RequestInfo"); final HashMap<String, Object> userInfo = (HashMap<String, Object>) requestInfo.get("userInfo"); userInfo.put("type", "CITIZEN"); userInfo.put("id", "4"); final SevaRequest sevaRequest = new SevaRequest(sevaRequestMap, objectMapper); final ServiceRequestRecord serviceRequestRecord = sevaRequest.toDomain(); assertNotNull(serviceRequestRecord); assertEquals(Long.valueOf(4), serviceRequestRecord.getLoggedInRequesterUserId()); }
public ServiceRequestRecord toDomain() { return ServiceRequestRecord.builder() .CRN(getCRN()) .latitude(getLatitude()) .longitude(getLongitude()) .description(this.getServiceRequest().getDetails()) .landmarkDetails(this.getServiceRequest().getLandmarkDetails()) .createdBy(this.getRequesterId()) .lastModifiedBy(this.getRequesterId()) .createdDate(this.getServiceRequest().getCreatedDate()) .lastModifiedDate(this.getServiceRequest().getLastModifiedDate()) .requesterName(this.getServiceRequest().getFirstName()) .requesterMobileNumber(this.getServiceRequest().getPhone()) .requesterEmail(this.getServiceRequest().getEmail()) .requesterAddress(this.getServiceRequest().getDynamicSingleValue(VALUES_COMPLAINANT_ADDRESS)) .loggedInRequesterUserId(getCitizenUserId()) .serviceRequestTypeCode(this.getServiceRequest().getComplaintTypeCode()) .serviceRequestStatus(this.getServiceRequest().getDynamicSingleValue(VALUES_STATUS)) .positionId(getPositionId()) .escalationDate(this.getServiceRequest().getEscalationDate()) .department(getDepartment()) .tenantId(this.getServiceRequest().getTenantId()) .attributeEntries(getAttributeEntries()) .build(); }
SevaRequest { public ServiceRequestRecord toDomain() { return ServiceRequestRecord.builder() .CRN(getCRN()) .latitude(getLatitude()) .longitude(getLongitude()) .description(this.getServiceRequest().getDetails()) .landmarkDetails(this.getServiceRequest().getLandmarkDetails()) .createdBy(this.getRequesterId()) .lastModifiedBy(this.getRequesterId()) .createdDate(this.getServiceRequest().getCreatedDate()) .lastModifiedDate(this.getServiceRequest().getLastModifiedDate()) .requesterName(this.getServiceRequest().getFirstName()) .requesterMobileNumber(this.getServiceRequest().getPhone()) .requesterEmail(this.getServiceRequest().getEmail()) .requesterAddress(this.getServiceRequest().getDynamicSingleValue(VALUES_COMPLAINANT_ADDRESS)) .loggedInRequesterUserId(getCitizenUserId()) .serviceRequestTypeCode(this.getServiceRequest().getComplaintTypeCode()) .serviceRequestStatus(this.getServiceRequest().getDynamicSingleValue(VALUES_STATUS)) .positionId(getPositionId()) .escalationDate(this.getServiceRequest().getEscalationDate()) .department(getDepartment()) .tenantId(this.getServiceRequest().getTenantId()) .attributeEntries(getAttributeEntries()) .build(); } }
SevaRequest { public ServiceRequestRecord toDomain() { return ServiceRequestRecord.builder() .CRN(getCRN()) .latitude(getLatitude()) .longitude(getLongitude()) .description(this.getServiceRequest().getDetails()) .landmarkDetails(this.getServiceRequest().getLandmarkDetails()) .createdBy(this.getRequesterId()) .lastModifiedBy(this.getRequesterId()) .createdDate(this.getServiceRequest().getCreatedDate()) .lastModifiedDate(this.getServiceRequest().getLastModifiedDate()) .requesterName(this.getServiceRequest().getFirstName()) .requesterMobileNumber(this.getServiceRequest().getPhone()) .requesterEmail(this.getServiceRequest().getEmail()) .requesterAddress(this.getServiceRequest().getDynamicSingleValue(VALUES_COMPLAINANT_ADDRESS)) .loggedInRequesterUserId(getCitizenUserId()) .serviceRequestTypeCode(this.getServiceRequest().getComplaintTypeCode()) .serviceRequestStatus(this.getServiceRequest().getDynamicSingleValue(VALUES_STATUS)) .positionId(getPositionId()) .escalationDate(this.getServiceRequest().getEscalationDate()) .department(getDepartment()) .tenantId(this.getServiceRequest().getTenantId()) .attributeEntries(getAttributeEntries()) .build(); } SevaRequest(HashMap<String, Object> sevaRequestMap,
                       ObjectMapper objectMapper); }
SevaRequest { public ServiceRequestRecord toDomain() { return ServiceRequestRecord.builder() .CRN(getCRN()) .latitude(getLatitude()) .longitude(getLongitude()) .description(this.getServiceRequest().getDetails()) .landmarkDetails(this.getServiceRequest().getLandmarkDetails()) .createdBy(this.getRequesterId()) .lastModifiedBy(this.getRequesterId()) .createdDate(this.getServiceRequest().getCreatedDate()) .lastModifiedDate(this.getServiceRequest().getLastModifiedDate()) .requesterName(this.getServiceRequest().getFirstName()) .requesterMobileNumber(this.getServiceRequest().getPhone()) .requesterEmail(this.getServiceRequest().getEmail()) .requesterAddress(this.getServiceRequest().getDynamicSingleValue(VALUES_COMPLAINANT_ADDRESS)) .loggedInRequesterUserId(getCitizenUserId()) .serviceRequestTypeCode(this.getServiceRequest().getComplaintTypeCode()) .serviceRequestStatus(this.getServiceRequest().getDynamicSingleValue(VALUES_STATUS)) .positionId(getPositionId()) .escalationDate(this.getServiceRequest().getEscalationDate()) .department(getDepartment()) .tenantId(this.getServiceRequest().getTenantId()) .attributeEntries(getAttributeEntries()) .build(); } SevaRequest(HashMap<String, Object> sevaRequestMap,
                       ObjectMapper objectMapper); ServiceRequestRecord toDomain(); Long getReceivingCenter(); }
SevaRequest { public ServiceRequestRecord toDomain() { return ServiceRequestRecord.builder() .CRN(getCRN()) .latitude(getLatitude()) .longitude(getLongitude()) .description(this.getServiceRequest().getDetails()) .landmarkDetails(this.getServiceRequest().getLandmarkDetails()) .createdBy(this.getRequesterId()) .lastModifiedBy(this.getRequesterId()) .createdDate(this.getServiceRequest().getCreatedDate()) .lastModifiedDate(this.getServiceRequest().getLastModifiedDate()) .requesterName(this.getServiceRequest().getFirstName()) .requesterMobileNumber(this.getServiceRequest().getPhone()) .requesterEmail(this.getServiceRequest().getEmail()) .requesterAddress(this.getServiceRequest().getDynamicSingleValue(VALUES_COMPLAINANT_ADDRESS)) .loggedInRequesterUserId(getCitizenUserId()) .serviceRequestTypeCode(this.getServiceRequest().getComplaintTypeCode()) .serviceRequestStatus(this.getServiceRequest().getDynamicSingleValue(VALUES_STATUS)) .positionId(getPositionId()) .escalationDate(this.getServiceRequest().getEscalationDate()) .department(getDepartment()) .tenantId(this.getServiceRequest().getTenantId()) .attributeEntries(getAttributeEntries()) .build(); } SevaRequest(HashMap<String, Object> sevaRequestMap,
                       ObjectMapper objectMapper); ServiceRequestRecord toDomain(); Long getReceivingCenter();  }