Skip to content

Commit

Permalink
Merge pull request #5 from spacious-team/develop
Browse files Browse the repository at this point in the history
Релиз 2020.13
  • Loading branch information
vananiev authored Dec 6, 2020
2 parents aeb4b11 + c16af81 commit 06bfc23
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target/
*.iml
*.ipr
!.idea/runConfigurations
!.idea/codeStyles
!.idea/copyright

### NetBeans ###
Expand Down
7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
например для Apache Maven проекта
```xml
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
Expand Down
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
</properties>

<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spacious_team/broker/pojo/Security.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@EqualsAndHashCode
public class Security {
@NotNull
private final String isin;
private final String id;

//@Nullable
private final String ticker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class SecurityEventCashFlow {
private final Instant timestamp;

@NotNull
private final String isin;
private final String security;

@NotNull
private final Integer count;
Expand All @@ -67,7 +67,7 @@ public static boolean checkEquality(SecurityEventCashFlow cash1, SecurityEventCa
return cash1.getPortfolio().equals(cash2.getPortfolio()) &&
cash1.getTimestamp().equals(cash2.getTimestamp()) &&
cash1.getEventType().equals(cash2.getEventType()) &&
cash1.getIsin().equals(cash2.getIsin());
cash1.getSecurity().equals(cash2.getSecurity());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SecurityQuote {
private final Integer id;

@NotNull
private final String isin;
private final String security;

@NotNull
private final Instant timestamp;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/spacious_team/broker/pojo/SecurityType.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public enum SecurityType {
private final String description;

public static SecurityType getSecurityType(Security security) {
return getSecurityType(security.getIsin());
return getSecurityType(security.getId());
}

public static SecurityType getSecurityType(String isin) {
if (isin.length() == 12 && !isin.contains("-")) {
public static SecurityType getSecurityType(String security) {
if (security.length() == 12 && !security.contains("-")) {
return STOCK_OR_BOND;
} else if (isin.length() == 6 || (isin.length() > 7 && isin.charAt(6) == '_')) { // USDRUB_TOM or USDRUB_TOD or USDRUB
} else if (security.length() == 6 || (security.length() > 7 && security.charAt(6) == '_')) { // USDRUB_TOM or USDRUB_TOD or USDRUB
return CURRENCY_PAIR;
} else {
return DERIVATIVE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Transaction {
private final String portfolio;

@NotNull
private final String isin;
private final String security;

@NotNull
private final Instant timestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

package org.spacious_team.broker.report_parser.api;

import lombok.*;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.spacious_team.table_wrapper.api.ReportPage;

import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

package org.spacious_team.broker.report_parser.api;

import org.spacious_team.table_wrapper.api.*;
import org.spacious_team.table_wrapper.api.ReportPage;
import org.spacious_team.table_wrapper.api.Table;
import org.spacious_team.table_wrapper.api.TableColumnDescription;
import org.spacious_team.table_wrapper.api.TableFactory;
import org.spacious_team.table_wrapper.api.TableRow;

import java.time.Instant;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Transaction getTransaction() {
return Transaction.builder()
.id(transactionId)
.portfolio(portfolio)
.isin(contract)
.security(contract)
.timestamp(timestamp)
.count(count)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ForeignExchangeTransaction {
private static final BigDecimal minValue = BigDecimal.valueOf(0.01);
private final String transactionId;
private final String portfolio;
private final String instrument; // валютная пара
private final String contract; // валютная пара
private final Instant timestamp; // дата исполнения
private final int count;
private final BigDecimal value; // оценочная стоиомсть в валюце цены
Expand All @@ -50,7 +50,7 @@ public Transaction getTransaction() {
return Transaction.builder()
.id(transactionId)
.portfolio(portfolio)
.isin(instrument)
.security(contract)
.timestamp(timestamp)
.count(count)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.*;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

package org.spacious_team.broker.report_parser.api;

import org.spacious_team.broker.pojo.*;
import org.spacious_team.broker.pojo.EventCashFlow;
import org.spacious_team.broker.pojo.PortfolioProperty;
import org.spacious_team.broker.pojo.Security;
import org.spacious_team.broker.pojo.SecurityEventCashFlow;
import org.spacious_team.broker.pojo.SecurityQuote;

public interface ReportTables {
BrokerReport getReport();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SecurityTransaction {
private static final BigDecimal minValue = BigDecimal.valueOf(0.01);
private final String transactionId;
private final String portfolio;
private final String isin;
private final String security;
private final Instant timestamp;
private final int count;
private final BigDecimal value; // оценочная стоиомсть в валюце цены
Expand All @@ -51,7 +51,7 @@ public Transaction getTransaction() {
return Transaction.builder()
.id(transactionId)
.portfolio(portfolio)
.isin(isin)
.security(security)
.timestamp(timestamp)
.count(count)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

import lombok.Getter;

import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class WrappingReportTable<RowType> implements ReportTable<RowType> {
@Getter
Expand Down

0 comments on commit 06bfc23

Please sign in to comment.