Skip to content

Commit

Permalink
disable ecommerce filter: passed logs to error level
Browse files Browse the repository at this point in the history
  • Loading branch information
aacitelli authored and aacitelli committed Sep 18, 2024
2 parents 2b2c0d4 + 577dcfa commit 8279f4c
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,18 @@ public static List<CartItem> getCartItems(BizEvent bizEvent) {
public static boolean isBizEventInvalid(BizEvent bizEvent, ExecutionContext context, Logger logger) {

if (bizEvent == null) {
logger.warn("[{}] event is null", context.getFunctionName());
logger.error("[{}] event is null", context.getFunctionName());
return true;
}

if (!BizEventStatusType.DONE.equals(bizEvent.getEventStatus()) && !BizEventStatusType.INGESTED.equals(bizEvent.getEventStatus())) {
logger.warn("[{}] event with id {} discarded because in status {}",
logger.error("[{}] event with id {} discarded because in status {}",
context.getFunctionName(), bizEvent.getId(), bizEvent.getEventStatus());
return true;
}

if (!hasValidFiscalCode(bizEvent)) {
logger.warn("[{}] event with id {} discarded because debtor's and payer's identifiers are missing or not valid",
logger.error("[{}] event with id {} discarded because debtor's and payer's identifiers are missing or not valid",
context.getFunctionName(), bizEvent.getId());
return true;
}
Expand All @@ -249,13 +249,13 @@ public static boolean isBizEventInvalid(BizEvent bizEvent, ExecutionContext cont
&& bizEvent.getTransactionDetails().getInfo() != null
&& ECOMMERCE.equals(bizEvent.getTransactionDetails().getInfo().getClientId())
) {
logger.warn("[{}] event with id {} discarded because from e-commerce {}",
logger.error("[{}] event with id {} discarded because from e-commerce {}",
context.getFunctionName(), bizEvent.getId(), bizEvent.getTransactionDetails().getInfo().getClientId());
return true;
}

if (!isCartMod1(bizEvent)) {
logger.warn("[{}] event with id {} contain either an invalid amount value," +
logger.error("[{}] event with id {} contain either an invalid amount value," +
" or it is a legacy cart element",
context.getFunctionName(), bizEvent.getId());
return true;
Expand All @@ -280,7 +280,7 @@ public static boolean isBizEventInvalid(BizEvent bizEvent, ExecutionContext cont
}

if (intTotalNotice > 1) {
logger.warn("[{}] event with id {} discarded because is part of a payment cart ({} total notice)",
logger.error("[{}] event with id {} discarded because is part of a payment cart ({} total notice)",
context.getFunctionName(), bizEvent.getId(),
intTotalNotice);
return true;
Expand Down

0 comments on commit 8279f4c

Please sign in to comment.