Skip to content

Commit

Permalink
HACK: use production lower court codes
Browse files Browse the repository at this point in the history
The production lower court codes for MA courts are different than stage.

See GBLS/docassemble-MACourts#71 for full info.

All of this is undocumented, but it should likely be hosted on the E-file
server. We'll figure it out eventually.
  • Loading branch information
BryceStevenWilley committed Sep 13, 2023
1 parent 73ed434 commit f3f121e
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.suffolk.litlab.efspserver.ecf;

import static edu.suffolk.litlab.efspserver.StdLib.GetEnv;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.NullNode;
import edu.suffolk.litlab.efspserver.CaseServiceContact;
Expand Down Expand Up @@ -913,8 +915,17 @@ private static JAXBElement<AppellateCaseType> makeAppellateCaseType(
InterviewVariable lowerNameVar =
collector.requestVar("trial_court.name", "The lower court name", "text");
if (node.has("trial_court") && node.get("trial_court").isObject()) {
var maybeCodeText =
JsonHelpers.getStringMember(node.get("trial_court"), "tyler_lower_court_code");
Optional<String> maybeCodeText = Optional.empty();
// TODO(brycew): HACK HACK HACK! Should be a better way to handle lower court codes than
// this, but it's broken on prod
var tylerEnv = GetEnv("TYLER_ENV");
if (tylerEnv.orElse("").equalsIgnoreCase("prod")) {
maybeCodeText =
JsonHelpers.getStringMember(node.get("trial_court"), "tyler_prod_lower_court_code");
} else {
maybeCodeText =
JsonHelpers.getStringMember(node.get("trial_court"), "tyler_lower_court_code");
}
if (maybeCodeText.isPresent()) {
tylerAug.getValue().setLowerCourtText(XmlHelper.convertText(maybeCodeText.get()));
} else {
Expand Down

0 comments on commit f3f121e

Please sign in to comment.