RequirementsAndObligationCreation stage execution matching logs

This commit is contained in:
ialbert 2023-05-30 14:03:45 +03:00
parent 374ff0ca34
commit 37b6b5d4e9

View file

@ -199,16 +199,17 @@ public class RequirementsAndObligationCreation implements ISessionStage {
//exchangeExecutionId=currentExecutionDeposit/Fond.exchangeExecutionId
//и [side=SELL (если currentExecutionDeposit/Fond.side=BUY) или side=BUY (если currentExecutionDeposit/Fond.side=SELL) по справочнику moneyFlowSide или справочнику side в зависимости от секции обрабатываемой сделки]
//и companyId=currentExecutionDeposit/Fond.counterPartyId
boolean valid = true;
String invalid = null;
if (!Objects.equals(exec1.getExchangeExecutionId(), exec2.getExchangeExecutionId())) {
valid = false;
invalid = String.format("exchangeExecutionId %d and %d not equal", exec1.getExchangeExecutionId(), exec2.getExchangeExecutionId());
} else if (Objects.equals(getSide(exec1), getSide(exec2))) {
valid = false;
invalid = String.format("side %s and %s equal, must be opposite", getSide(exec1), getSide(exec1));
} else if (!Objects.equals(exec1.getCounterPartyId(), exec2.getCounterPartyId())) {
valid = false;
invalid = String.format("Execution#id(%d)#counterPartyId(%d), Execution#id(%d)#counterPartyId(%d)",
exec1.getId(), exec1.getCounterPartyId(), exec2.getId(), exec2.getCounterPartyId());
}
if (!valid) {
log.error("FATAL skipping ExchangeExecutionId: {}", exec1.getId());
if (invalid != null) {
log.error("FATAL couldn't match Execution#id({}) with Execution#id({}) error: {}", exec1.getId(), exec2.getId(), invalid);
}
return new Pair<>(exec1, exec2);
}