From 2f3390a5b1960a839403b1d872dd895f17907c9d Mon Sep 17 00:00:00 2001 From: Vitalii Ananev Date: Sun, 17 Jan 2021 21:41:47 +0300 Subject: [PATCH 1/3] impl ForeignExchangeRate and PortfolioPropertyType.TOTAL_ASSETS_USD for Foreign Brokers --- .../broker/pojo/ForeignExchangeRate.java | 43 +++++++++++++++++++ .../broker/pojo/PortfolioPropertyType.java | 11 ++--- 2 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 src/main/java/org/spacious_team/broker/pojo/ForeignExchangeRate.java diff --git a/src/main/java/org/spacious_team/broker/pojo/ForeignExchangeRate.java b/src/main/java/org/spacious_team/broker/pojo/ForeignExchangeRate.java new file mode 100644 index 0000000..2d4939f --- /dev/null +++ b/src/main/java/org/spacious_team/broker/pojo/ForeignExchangeRate.java @@ -0,0 +1,43 @@ +/* + * Broker Report Parser API + * Copyright (C) 2021 Vitalii Ananev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.spacious_team.broker.pojo; + +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDate; + +@Getter +@ToString +@Builder(toBuilder = true) +@EqualsAndHashCode +public class ForeignExchangeRate { + @NotNull + private final LocalDate date; + + @NotNull + private final String currencyPair; + + @NotNull + private final BigDecimal rate; +} diff --git a/src/main/java/org/spacious_team/broker/pojo/PortfolioPropertyType.java b/src/main/java/org/spacious_team/broker/pojo/PortfolioPropertyType.java index 8c3932e..6412b2d 100644 --- a/src/main/java/org/spacious_team/broker/pojo/PortfolioPropertyType.java +++ b/src/main/java/org/spacious_team/broker/pojo/PortfolioPropertyType.java @@ -1,6 +1,6 @@ /* * Broker Report Parser API - * Copyright (C) 2020 Vitalii Ananev + * Copyright (C) 2021 Vitalii Ananev * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -19,10 +19,7 @@ package org.spacious_team.broker.pojo; public enum PortfolioPropertyType { - TOTAL_ASSETS, // in RUB - CASH, - USDRUB_EXCHANGE_RATE, - EURRUB_EXCHANGE_RATE, - GBPRUB_EXCHANGE_RATE, - CHFRUB_EXCHANGE_RATE + TOTAL_ASSETS_RUB, + TOTAL_ASSETS_USD, // use one of TOTAL_ASSETS_RUB or TOTAL_ASSETS_USD + CASH } From deeceb44ac13d34f587d7b8bbab89a14e15d2b59 Mon Sep 17 00:00:00 2001 From: Vitalii Ananev Date: Sun, 17 Jan 2021 21:57:49 +0300 Subject: [PATCH 2/3] add ReportTables.getForeignExchangeRateTable() --- .../spacious_team/broker/report_parser/api/ReportTables.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/spacious_team/broker/report_parser/api/ReportTables.java b/src/main/java/org/spacious_team/broker/report_parser/api/ReportTables.java index a4483b4..5c2869f 100644 --- a/src/main/java/org/spacious_team/broker/report_parser/api/ReportTables.java +++ b/src/main/java/org/spacious_team/broker/report_parser/api/ReportTables.java @@ -1,6 +1,6 @@ /* * Broker Report Parser API - * Copyright (C) 2020 Vitalii Ananev + * Copyright (C) 2021 Vitalii Ananev * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -19,6 +19,7 @@ package org.spacious_team.broker.report_parser.api; import org.spacious_team.broker.pojo.EventCashFlow; +import org.spacious_team.broker.pojo.ForeignExchangeRate; import org.spacious_team.broker.pojo.PortfolioProperty; import org.spacious_team.broker.pojo.Security; import org.spacious_team.broker.pojo.SecurityEventCashFlow; @@ -48,4 +49,6 @@ public interface ReportTables { ReportTable getDerivativeCashFlowTable(); ReportTable getSecurityQuoteTable(); + + ReportTable getForeignExchangeRateTable(); } From f7a543e1d00bf7a4ed5e9397c20f0d38943ca9d4 Mon Sep 17 00:00:00 2001 From: Vitalii Ananev Date: Sun, 24 Jan 2021 14:58:07 +0300 Subject: [PATCH 3/3] version 2021.1.1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 96c28ac..49339fe 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.spacious-team broker-report-parser-api - 2021.1 + 2021.1.1 jar Broker Report Parser API @@ -107,5 +107,5 @@ - + \ No newline at end of file