Skip to content

Commit

Permalink
Updates code based on recent library changes around
Browse files Browse the repository at this point in the history
field markers and annnotations
  • Loading branch information
bseeger committed Nov 2, 2023
1 parent 11d9027 commit a184283
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/formflowstartertemplate/app/inputs/Ubi.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.formflowstartertemplate.app.inputs;

import formflow.library.data.FlowInputs;
import formflow.library.data.validators.Money;
import formflow.library.data.validators.Phone;
import formflow.library.data.annotations.Money;
import formflow.library.data.annotations.Phone;
import formflow.library.utils.RegexUtils;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Max;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import formflow.library.config.submission.Condition;
import formflow.library.data.Submission;
import formflow.library.inputs.UnvalidatedField;
import formflow.library.inputs.FieldNameMarkers;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand All @@ -18,6 +18,7 @@ public Boolean run(Submission submission) {
return true;
}

return submission.getInputData().get(UnvalidatedField.VALIDATE_ADDRESS + "residentialAddress").equals("false");
return submission.getInputData().get(FieldNameMarkers.UNVALIDATED_FIELD_MARKER_VALIDATE_ADDRESS + "residentialAddress")
.equals("false");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

import formflow.library.config.submission.Condition;
import formflow.library.data.Submission;
import formflow.library.inputs.UnvalidatedField;
import formflow.library.inputs.FieldNameMarkers;
import org.springframework.stereotype.Component;

@Component
public class SmartySuggestionFound implements Condition {

@Override
public Boolean run(Submission submission) {
return submission.getInputData().get(UnvalidatedField.VALIDATE_ADDRESS + "residentialAddress").equals("true") &&
submission.getInputData().containsKey("residentialAddressStreetAddress1" + UnvalidatedField.VALIDATED);
return submission.getInputData().get(FieldNameMarkers.UNVALIDATED_FIELD_MARKER_VALIDATE_ADDRESS + "residentialAddress")
.equals("true") && submission.getInputData()
.containsKey("residentialAddressStreetAddress1" + FieldNameMarkers.UNVALIDATED_FIELD_MARKER_VALIDATED);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

import formflow.library.config.submission.Condition;
import formflow.library.data.Submission;
import formflow.library.inputs.UnvalidatedField;
import formflow.library.inputs.FieldNameMarkers;
import org.springframework.stereotype.Component;

@Component
public class SmartySuggestionNotFound implements Condition {

@Override
public Boolean run(Submission submission) {
return submission.getInputData().get(UnvalidatedField.VALIDATE_ADDRESS + "residentialAddress").equals("true") &&
!submission.getInputData().containsKey("residentialAddressStreetAddress1" + UnvalidatedField.VALIDATED);
return submission.getInputData().get(FieldNameMarkers.UNVALIDATED_FIELD_MARKER_VALIDATE_ADDRESS + "residentialAddress")
.equals("true") && !submission.getInputData()
.containsKey("residentialAddressStreetAddress1" + FieldNameMarkers.UNVALIDATED_FIELD_MARKER_VALIDATED);
}
}

0 comments on commit a184283

Please sign in to comment.