Skip to content

Commit

Permalink
Add _Expedited to XML filenames
Browse files Browse the repository at this point in the history
[#182300847]

Ken McCrary: kmccrary@codeforamerica.org
Co-authored-by: Eric M Johnson <eric.m.johnson@state.mn.us>
  • Loading branch information
kenmccrary authored and EricMN35Johnson committed May 27, 2022
1 parent 0e775d5 commit 3a5cd92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Expand Up @@ -81,9 +81,13 @@ public String generateUploadedDocumentName(Application application, int index, S
public String generateXmlFilename(Application application) {
String dhsProviderId = countyMap.get(application.getCounty()).getDhsProviderId();
String prefix = getSharedApplicationPrefix(application, CAF,
dhsProviderId);
dhsProviderId);
String programs = getProgramCodes(application);
return "%s%s.xml".formatted(prefix, programs);
String eligible = "";
if(decider.decide(application.getApplicationData()) == SnapExpeditedEligibility.ELIGIBLE) {
eligible = "_EXPEDITED";
}
return "%s%s%s.xml".formatted(prefix, programs, eligible);
}

@NotNull
Expand Down
Expand Up @@ -90,6 +90,7 @@ void shouldProduceAValidDocument() throws Exception {
case DATE -> List.of(LocalDate.ofEpochDay(0).plusDays(new Random().nextInt())
.format(DateTimeFormatter.ofPattern("MM/dd/yyyy")).split("/"));
case YES_NO -> List.of(String.valueOf(new Random().nextBoolean()));
case MONEY -> List.of(Integer.valueOf(0).toString());
default -> Optional.ofNullable(input.getValidators())
.filter(validators -> validators.size() == 1)
.map(validators -> switch (validators.get(0).getValidation()) {
Expand Down

0 comments on commit 3a5cd92

Please sign in to comment.