-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/org/ilgcc/app/submission/conditions/ProviderDOBRequired.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.ilgcc.app.submission.conditions; | ||
|
||
import formflow.library.config.submission.Condition; | ||
import formflow.library.data.Submission; | ||
import java.util.List; | ||
import org.ilgcc.app.utils.enums.ProviderType; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ProviderDOBRequired implements Condition { | ||
|
||
final static List providerTypesRequired = List.of( | ||
ProviderType.LICENSE_EXEMPT_RELATIVE_IN_PROVIDER_HOME.name(), | ||
ProviderType.LICENSE_EXEMPT_NONRELATIVE_IN_PROVIDER_HOME.name(), | ||
ProviderType.LICENSE_EXEMPT_RELATIVE_IN_CHILDS_HOME.name(), | ||
ProviderType.LICENSE_EXEMPT_NONRELATIVE_IN_CHILDS_HOME.name() | ||
); | ||
|
||
@Value("${il-gcc.allow-provider-registration-flow}") | ||
private boolean enableProviderRegistration; | ||
|
||
@Override | ||
public Boolean run(Submission submission) { | ||
return enableProviderRegistration && displayScreen(submission); | ||
} | ||
|
||
private Boolean displayScreen(Submission submission) { | ||
String providerType = (String) submission.getInputData().getOrDefault("providerType", ""); | ||
return providerTypesRequired.contains(providerType); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters