формирование PaymentInstruction, для возврата депозитов: обнуляю баланс AM*B регистра при наличии DM*X для отправителя
This commit is contained in:
parent
bcbc335089
commit
f11b4d1b22
1 changed files with 11 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -131,11 +132,18 @@ public class FormingPaymentInstructionReturnMkrAction extends AbstractSessionAct
|
|||
if (dmx.isPresent()) {
|
||||
log.debug("LM*T#id={}, DM*X#id={} found, no action needed for group {}, skipping liability",
|
||||
lm_t.getId(), dmx.get().getId(), lm_t.getGroupId());
|
||||
dmx.get().setRegistryStatus(RegistryStatus.OK.getKey());
|
||||
receiverAmbO.ifPresent(r -> {
|
||||
Consumer<Registry> updateBalanceTo0 = r -> {
|
||||
log.debug("updating {}.id={} balance to 0...", r.getRegistryCode(), r.getId());
|
||||
r.setBalance(BigDecimal.ZERO);
|
||||
setUpdatedStoreInImdg(r, now);
|
||||
});
|
||||
};
|
||||
receiverAmbO.ifPresent(updateBalanceTo0);
|
||||
rgsMng.findRelatedAsset(
|
||||
lm_t.getTradingClearingRegistryId(),
|
||||
lm_t.getCompanyId(),
|
||||
cm_t.getSecuritySymbol(),
|
||||
AM_B).ifPresent(updateBalanceTo0);
|
||||
dmx.get().setRegistryStatus(RegistryStatus.OK.getKey());
|
||||
setUpdatedStoreInImdg(dmx.get(), now);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue