private void validateNoOtherFLWExistsWithSameMsisdnAndStatus(
     FrontLineWorkerVerificationRequest request, Errors errors) {
   List<FrontLineWorker> flwWithSameMsisdnAndWithSomeStatus =
       allFrontLineWorkers.getByMsisdnWithStatus(request.getMsisdn());
   if (flwWithSameMsisdnAndWithSomeStatus.size() == 1
       && !flwWithSameMsisdnAndWithSomeStatus.get(0).getFlwId().equals(request.getFlwId())
       && !request.isDummyFlwId())
     errors.add("Conflicting flw record exists. Please try again later.");
 }
 private void validateInvalidOtherRequest(
     FrontLineWorkerVerificationRequest request, Errors errors) {
   if (isBlank(request.getReason())) {
     errors.add("reason field has blank value");
   }
   if (request.getName() != null) {
     errors.add("name field should not be a part of the request");
   }
   if (request.getLocation() != null) {
     errors.add("location field should not be a part of the request");
   }
   if (request.getDesignation() != null) {
     errors.add("designation field should not be a part of the request");
   }
 }
  public Errors validate(FrontLineWorkerVerificationRequest request) {
    Errors errors = new Errors();
    if (VerificationStatus.SUCCESS == request.getVerificationStatus())
      validateSuccessfulVerification(request, errors);
    else validateInvalidOtherRequest(request, errors);

    validateNoOtherFLWExistsWithSameMsisdnAndStatus(request, errors);
    return errors;
  }
 private void validateSuccessfulVerification(
     FrontLineWorkerVerificationRequest request, Errors errors) {
   if (request.getDesignation() == null) {
     errors.add("designation field has invalid/blank value");
   }
   if (isBlank(request.getName()) || !Pattern.matches("[a-zA-Z0-9\\s\\.]*", request.getName())) {
     errors.add("name field has invalid/blank value");
   }
   new WebRequestValidator().validateLocation(request.getLocation(), errors);
   if (request.getReason() != null) {
     errors.add("reason field should not be a part of the request");
   }
   validateChangeMSISDNRequest(request.getChangeMsisdnRequest(), errors);
 }