Fix null paymentMomentId

This commit is contained in:
Max Martens 2026-07-28 20:58:22 +02:00 committed by Mirjam Herald
parent 5e255b7bac
commit 8eed2a9dd6
2 changed files with 7 additions and 2 deletions

View File

@ -215,8 +215,13 @@ public class ABTProductsPUTGenerator {
}
case "paymentMoment" -> {
LOGGER.info("Rewriting paymentMoment to paymentMomentId...");
Long paymentMomentId = jsonField.getValue().get("paymentMomentId").asLong();
((ObjectNode)newJsonNode).put("paymentMomentId", paymentMomentId);
if (jsonField.getValue().get("paymentMomentId").isNull()) {
LOGGER.info("Rewriting null paymentMomentId...");
((ObjectNode)newJsonNode).putRawValue("paymentMomentId", null);
} else {
Long paymentMomentId = jsonField.getValue().get("paymentMomentId").asLong();
((ObjectNode)newJsonNode).put("paymentMomentId", paymentMomentId);
}
}
case "requiredCustomerLevel" -> {
LOGGER.info("Rewriting requiredCustomerLevel to requiredCustomerLevelId...");