Skip to content

Commit 1719822

Browse files
committed
update Transaction, TransactionCashFlow spacious-team/investbook#363
1 parent 8f954d0 commit 1719822

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

src/main/java/org/spacious_team/broker/pojo/Transaction.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
@EqualsAndHashCode(cacheStrategy = LAZY)
3838
@Schema(name = "Сделка")
3939
public class Transaction {
40+
//@Nullable // autoincrement
41+
@Schema(description = "Внутренний идентификатор сделки", example = "123", required = true)
42+
private final Integer pk;
43+
4044
@NotNull
4145
@Schema(description = "Номер сделки в системе учета брокера", example = "123SP", required = true)
4246
private final String id;

src/main/java/org/spacious_team/broker/pojo/TransactionCashFlow.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
@EqualsAndHashCode(cacheStrategy = LAZY)
4040
@Schema(name = "Движение ДС по сделке")
4141
public class TransactionCashFlow {
42-
@NotNull
43-
@JsonProperty("transaction-id")
44-
@Schema(description = "Номер сделки в системе учета брокера", example = "123SP", required = true)
45-
private final String transactionId;
42+
//@Nullable // autoincrement
43+
@Schema(description = "Внутренний идентификатор записи", example = "1", required = true)
44+
private final Integer pk;
4645

4746
@NotNull
48-
@Schema(description = "Номер счета в системе учета брокера", example = "10200I", required = true)
49-
private final String portfolio;
47+
@JsonProperty("transaction-pk")
48+
@Schema(description = "Внутренний идентификатор сделки", example = "123", required = true)
49+
private final Integer transactionPk;
5050

5151
@NotNull
5252
@JsonProperty("event-type")

src/main/java/org/spacious_team/broker/report_parser/api/AbstractTransaction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ public List<TransactionCashFlow> getTransactionCashFlows() {
7070
protected Optional<TransactionCashFlow> getValueCashFlow(CashFlowType type) {
7171
if (value != null && value.abs().compareTo(minValue) >= 0) {
7272
return Optional.of(TransactionCashFlow.builder()
73-
.transactionId(transactionId)
74-
.portfolio(portfolio)
7573
.eventType(type)
7674
.value(value)
7775
.currency(valueCurrency)
@@ -83,8 +81,6 @@ protected Optional<TransactionCashFlow> getValueCashFlow(CashFlowType type) {
8381
protected Optional<TransactionCashFlow> getCommissionCashFlow() {
8482
if (commission != null && commission.abs().compareTo(minValue) >= 0) {
8583
return Optional.of(TransactionCashFlow.builder()
86-
.transactionId(transactionId)
87-
.portfolio(portfolio)
8884
.eventType(CashFlowType.COMMISSION)
8985
.value(commission)
9086
.currency(commissionCurrency)

src/main/java/org/spacious_team/broker/report_parser/api/DerivativeTransaction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public List<TransactionCashFlow> getTransactionCashFlows() {
5151
protected Optional<TransactionCashFlow> getValueInPointsCashFlow() {
5252
if (valueInPoints != null) {
5353
return Optional.of(TransactionCashFlow.builder()
54-
.transactionId(transactionId)
55-
.portfolio(portfolio)
5654
.eventType(CashFlowType.DERIVATIVE_QUOTE)
5755
.value(valueInPoints)
5856
.currency(QUOTE_CURRENCY)
@@ -65,8 +63,6 @@ protected Optional<TransactionCashFlow> getValueInPointsCashFlow() {
6563
protected Optional<TransactionCashFlow> getValueCashFlow(CashFlowType type) {
6664
if (value != null) {
6765
return Optional.of(TransactionCashFlow.builder()
68-
.transactionId(transactionId)
69-
.portfolio(portfolio)
7066
.eventType(type)
7167
.value(value)
7268
.currency(valueCurrency)

src/main/java/org/spacious_team/broker/report_parser/api/SecurityTransaction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ 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(transactionId)
55-
.portfolio(portfolio)
5654
.eventType(CashFlowType.ACCRUED_INTEREST)
5755
.value(accruedInterest)
5856
.currency(valueCurrency)

0 commit comments

Comments
 (0)