-
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.
[CCAP-341] Create confirmation code for family applications (#598)
* [CCAP-341] Initial short code implementation * [CCAP-341] Initial short code implementation * [CCAP-341] Short code config stub * [CCAP-341] Short code config implementation * [CCAP-341] Short code config implementation * [CCAP-341] Updating readme * [CCAP-341] Updating readme, adding findByShortCode method * [CCAP-341] Cleanup * [CCAP-341] Cleanup * [CCAP-314] Moving short code generation to controller (#599) * [CCAP-314] Refactoring * [CCAP-314] Cleaning up documentation * [CCAP-314] Cleaning up documentation * [CCAP-341] More tests * [CCAP-341] More tests * [CCAP-341] Adding prefix and suffix * [CCAP-341] code cleanup
- Loading branch information
Showing
14 changed files
with
1,106 additions
and
524 deletions.
There are no files selected for viewing
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
44 changes: 44 additions & 0 deletions
44
src/main/java/formflow/library/config/submission/ShortCodeConfig.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,44 @@ | ||
package formflow.library.config.submission; | ||
|
||
import lombok.Getter; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Getter | ||
@Configuration | ||
public class ShortCodeConfig { | ||
|
||
public enum ShortCodeType { | ||
alphanumeric, alpha, numeric; | ||
} | ||
|
||
public enum ShortCodeCreationPoint { | ||
creation, submission | ||
} | ||
|
||
@Value("${form-flow.short-code.length:6}") | ||
private int codeLength; | ||
|
||
@Value("${form-flow.short-code.type:alphanumeric}") | ||
private ShortCodeType codeType; | ||
|
||
@Value("${form-flow.short-code.uppercase: true}") | ||
private boolean uppercase; | ||
|
||
@Value("${form-flow.short-code.creation-point:submission}") | ||
private ShortCodeCreationPoint creationPoint; | ||
|
||
@Value("${form-flow.short-code.prefix:#{null}}") | ||
private String prefix; | ||
|
||
@Value("${form-flow.short-code.suffix:#{null}}") | ||
private String suffix; | ||
|
||
public boolean isCreateShortCodeAtCreation() { | ||
return ShortCodeCreationPoint.creation.equals(creationPoint); | ||
} | ||
|
||
public boolean isCreateShortCodeAtSubmission() { | ||
return ShortCodeCreationPoint.submission.equals(creationPoint); | ||
} | ||
} |
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
Oops, something went wrong.