fix unit session

This commit is contained in:
etreschenkov 2025-07-09 15:48:36 +03:00
parent 88ea9e5a66
commit df7ad80c24
2 changed files with 9 additions and 1 deletions

View file

@ -445,9 +445,16 @@ public class RequirementAndObligationCreationAction extends AbstractSessionActio
invalid = String.format("exchangeExecutionId %d and %d not equal", exec1.getExchangeExecutionId(), exec2.getExchangeExecutionId());
} else if (Objects.equals(getSide(exec1), getSide(exec2))) {
invalid = String.format("side %s and %s equal, must be opposite", getSide(exec1), getSide(exec1));
} else if (!Objects.equals(exec1.getCompanyId(), exec2.getCounterPartyId()) || !Objects.equals(exec1.getCounterPartyId(), exec2.getCompanyId())) {
} else if (!isCk()
&& (!Objects.equals(exec1.getCompanyId(), exec2.getCounterPartyId())
|| !Objects.equals(exec1.getCounterPartyId(), exec2.getCompanyId()))) {
invalid = String.format("Execution#id(%d)#companyId(%d)#counterPartyId(%d), Execution#id(%d)#companyId(%d)#counterPartyId(%d)",
exec1.getId(), exec1.getCompanyId(), exec1.getCounterPartyId(), exec2.getId(), exec2.getCompanyId(), exec2.getCounterPartyId());
} else if (isCk()
&& !Objects.equals(exec1.getTradingDate(), exec2.getTradingDate())) {
invalid = String.format("[Execution#id(%d)#tradingDate=%s, Execution#id(%d)#tradingDate=%s] exchangeExecutionId=%d; tradingDate must be equal",
exec1.getId(), exec1.getTradingDate(),
exec2.getId(), exec2.getTradingDate(), exec2.getExchangeExecutionId());
}
if (invalid != null) {
log.error("FATAL couldn't match Execution#id({}) with Execution#id({}) error: {}", exec1.getId(), exec2.getId(), invalid);

View file

@ -58,6 +58,7 @@ public class RequirementAndObligationCreationCompoundAction extends RequirementA
safeMatch(executionCurrency, iec)
);
if (pair == null) continue;
log.info("Pair is not null with execType: {}", pair.getFirst().type());
if (pair.getFirst().type().equals(ExecutionType.ExecutionFond)) ief[0] += 2;
if (pair.getFirst().type().equals(ExecutionType.ExecutionDeposit)) ied[0] += 2;
if (pair.getFirst().type().equals(ExecutionType.ExecutionCurrency)) iec[0] += 2;