File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed
src/main/java/org/spacious_team/broker/report_parser/api Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 4040@ EqualsAndHashCode (cacheStrategy = LAZY )
4141public abstract class AbstractTransaction {
4242 protected static final BigDecimal minValue = BigDecimal .valueOf (0.01 );
43+ protected final Integer id ;
4344 protected final String tradeId ;
4445 protected final String portfolio ;
4546 protected final String security ;
@@ -52,6 +53,7 @@ public abstract class AbstractTransaction {
5253
5354 public Transaction getTransaction () {
5455 return Transaction .builder ()
56+ .id (id )
5557 .tradeId (tradeId )
5658 .portfolio (portfolio )
5759 .security (security )
@@ -70,6 +72,7 @@ public List<TransactionCashFlow> getTransactionCashFlows() {
7072 protected Optional <TransactionCashFlow > getValueCashFlow (CashFlowType type ) {
7173 if (value != null && value .abs ().compareTo (minValue ) >= 0 ) {
7274 return Optional .of (TransactionCashFlow .builder ()
75+ .transactionId (id )
7376 .eventType (type )
7477 .value (value )
7578 .currency (valueCurrency )
@@ -81,6 +84,7 @@ protected Optional<TransactionCashFlow> getValueCashFlow(CashFlowType type) {
8184 protected Optional <TransactionCashFlow > getCommissionCashFlow () {
8285 if (commission != null && commission .abs ().compareTo (minValue ) >= 0 ) {
8386 return Optional .of (TransactionCashFlow .builder ()
87+ .transactionId (id )
8488 .eventType (CashFlowType .COMMISSION )
8589 .value (commission )
8690 .currency (commissionCurrency )
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public List<TransactionCashFlow> getTransactionCashFlows() {
5151 protected Optional <TransactionCashFlow > getValueInPointsCashFlow () {
5252 if (valueInPoints != null ) {
5353 return Optional .of (TransactionCashFlow .builder ()
54+ .transactionId (id )
5455 .eventType (CashFlowType .DERIVATIVE_QUOTE )
5556 .value (valueInPoints )
5657 .currency (QUOTE_CURRENCY )
@@ -63,6 +64,7 @@ protected Optional<TransactionCashFlow> getValueInPointsCashFlow() {
6364 protected Optional <TransactionCashFlow > getValueCashFlow (CashFlowType type ) {
6465 if (value != null ) {
6566 return Optional .of (TransactionCashFlow .builder ()
67+ .transactionId (id )
6668 .eventType (type )
6769 .value (value )
6870 .currency (valueCurrency )
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ private Optional<TransactionCashFlow> getAccruedInterestCashFlow() {
5151 // for securities accrued interest = 0
5252 if (accruedInterest != null && accruedInterest .abs ().compareTo (minValue ) >= 0 ) {
5353 return Optional .of (TransactionCashFlow .builder ()
54+ .transactionId (id )
5455 .eventType (CashFlowType .ACCRUED_INTEREST )
5556 .value (accruedInterest )
5657 .currency (valueCurrency )
You can’t perform that action at this time.
0 commit comments