fix registry builders
This commit is contained in:
parent
d26ee55b55
commit
0f7a017a8d
1 changed files with 12 additions and 5 deletions
|
|
@ -86,16 +86,23 @@ public class RegistryDepoBuilder implements IRegistryBuilder {
|
|||
Account account = accountImdg.getSingleObjectByID(tcr.getMoneyAccountId());
|
||||
String capacityByAccount = defineCapacityByAccountType(account.getAccountType(), tcr.getMoneyAccountId());
|
||||
reg.setAccountId(tcr.getMoneyAccountId());
|
||||
if ((regDsgn.equals(RegistryDesignation.O) && side.isBuy()) || (regDsgn.equals(RegistryDesignation.T) && side.isSell())) {
|
||||
|
||||
boolean isOBuying = regDsgn.equals(RegistryDesignation.O) && side.isBuy();
|
||||
boolean isOSelling = regDsgn.equals(RegistryDesignation.O) && side.isSell();
|
||||
boolean isTSelling = regDsgn.equals(RegistryDesignation.T) && side.isSell();
|
||||
boolean isTBuying = regDsgn.equals(RegistryDesignation.T) && side.isBuy();
|
||||
|
||||
if ((isOBuying || isTSelling) && !secondLeg ||
|
||||
(isOSelling || isTBuying) && secondLeg) {
|
||||
reg.setRegistryInstrumentType(RegistryInstrumentType.M.getKey());
|
||||
reg.setBalanceDimension(BalanceDimension.MONY.getKey()); //fixme add second leg code branch
|
||||
reg.setBalanceDimension(BalanceDimension.MONY.getKey());
|
||||
Currency currency = currencyImdg.getSingleObjectByFieldValues(Map.of("currencyCode", exec.getSettlementCurrency()));
|
||||
reg.setSecurityId(currency.getId());
|
||||
reg.setSecuritySymbol(currency.getCurrencyCode());
|
||||
|
||||
} else if ((regDsgn.equals(RegistryDesignation.T) && side.isBuy()) || (regDsgn.equals(RegistryDesignation.O) && side.isSell())) {
|
||||
} else if ((isOSelling || isTBuying) && !secondLeg ||
|
||||
(isOBuying || isTSelling) && secondLeg) {
|
||||
reg.setRegistryInstrumentType(RegistryInstrumentType.S.getKey());
|
||||
reg.setBalanceDimension(BalanceDimension.PICS.getKey()); //fixme add second leg code branch
|
||||
reg.setBalanceDimension(BalanceDimension.PICS.getKey());
|
||||
reg.setSecurityId(exec.getSecurityId());
|
||||
reg.setSecuritySymbol(exec.getSecuritySymbol());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue