Skip to content

Commit 01714b1

Browse files
Aboruhenpawana_backbaseRoman Kniazevychapawan
authored
Generating Intraday Prices for the Assets (#577) (#578)
* define a flow to ingest news with images; content creation; implement multipart data resttempalte image ingestion for django server support feature * fix logging, formatting, fix tests * Generating Intraday Prices for the Assets --------- Co-authored-by: pawana_backbase <pawana@backbase.com> Co-authored-by: Roman Kniazevych <Aboruhen@gmail.com> Co-authored-by: Roman Kniazevych <romank@backbase.com> Co-authored-by: Pawan Ajagond <a.pawan.s.a@gmail.com>
1 parent 0b4baca commit 01714b1

30 files changed

Lines changed: 1352 additions & 162 deletions

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [9.5.0]
5+
### Added
6+
- investment service intraday generation and ingestion function
7+
- ingest images for investment service (asset logo, asset category image, news content image)
8+
### Changed
9+
- fix investment asset universe from create to upsert implementation
10+
11+
### Fixed
12+
- Added resttemplate client for investment service to fix request multipart/form-data to django server.
13+
- Django & WebFlux don't work OOTB
14+
15+
## [9.4.x]
16+
### Changed
17+
418
## [9.3.0](https://github.com/Backbase/stream-services/compare/9.2.0...9.3.0)
519
### Changed
620
- fix for NoSuchElementException (No value present) thrown while update data groups

stream-dbs-clients/src/main/java/com/backbase/stream/clients/config/InvestmentClientConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.backbase.investment.api.service.v1.AssetUniverseApi;
66
import com.backbase.investment.api.service.v1.AsyncBulkGroupsApi;
77
import com.backbase.investment.api.service.v1.ClientApi;
8+
import com.backbase.investment.api.service.v1.ContentApi;
89
import com.backbase.investment.api.service.v1.FinancialAdviceApi;
910
import com.backbase.investment.api.service.v1.InvestmentApi;
1011
import com.backbase.investment.api.service.v1.InvestmentProductsApi;
@@ -100,6 +101,12 @@ public InvestmentApi investmentApi(ApiClient investmentApiClient) {
100101
return new InvestmentApi(investmentApiClient);
101102
}
102103

104+
@Bean
105+
@ConditionalOnMissingBean
106+
public ContentApi contentApi(ApiClient investmentApiClient) {
107+
return new ContentApi(investmentApiClient);
108+
}
109+
103110
@Bean
104111
@ConditionalOnMissingBean
105112
public PaymentsApi paymentsApi(ApiClient investmentApiClient) {

stream-investment/investment-core/pom.xml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919

2020
<dependencyManagement>
2121
<dependencies>
22+
<dependency>
23+
<groupId>com.backbase</groupId>
24+
<artifactId>backbase-bom</artifactId>
25+
<version>${backbase-bom.version}</version>
26+
<type>pom</type>
27+
<scope>import</scope>
28+
</dependency>
2229
<dependency>
2330
<groupId>com.backbase.buildingblocks</groupId>
2431
<artifactId>backbase-building-blocks-release</artifactId>
@@ -29,6 +36,11 @@
2936
</dependencyManagement>
3037

3138
<dependencies>
39+
<dependency>
40+
<groupId>com.backbase.buildingblocks</groupId>
41+
<artifactId>api</artifactId>
42+
</dependency>
43+
3244
<!-- DBS clients (includes generated Investment ClientApi) -->
3345
<dependency>
3446
<groupId>com.backbase.stream</groupId>
@@ -83,6 +95,64 @@
8395
</compilerArgs>
8496
</configuration>
8597
</plugin>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-dependency-plugin</artifactId>
101+
<version>3.6.0</version>
102+
<executions>
103+
<execution>
104+
<id>unpack</id>
105+
<goals>
106+
<goal>unpack</goal>
107+
</goals>
108+
<phase>generate-resources</phase>
109+
<configuration>
110+
<artifactItems>
111+
<artifactItem>
112+
<groupId>com.backbase.investment</groupId>
113+
<artifactId>investment-service-api</artifactId>
114+
<classifier>api</classifier>
115+
<type>zip</type>
116+
<outputDirectory>${project.build.directory}/yaml</outputDirectory>
117+
<overWrite>true</overWrite>
118+
</artifactItem>
119+
</artifactItems>
120+
<includes>**/*.yaml, **/*.json</includes>
121+
</configuration>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
<plugin>
126+
<groupId>com.backbase.oss</groupId>
127+
<artifactId>boat-maven-plugin</artifactId>
128+
<version>0.17.66</version>
129+
<executions>
130+
<execution>
131+
<id>generate-investment-service-api-code</id>
132+
<goals>
133+
<goal>generate-rest-template-embedded</goal>
134+
</goals>
135+
<phase>generate-resources</phase>
136+
<configuration>
137+
<inputSpec>${project.build.directory}/yaml/investment-service-api/investment-service-api-v1*.yaml</inputSpec>
138+
<apiPackage>com.backbase.investment.api.service.sync.v1</apiPackage>
139+
<modelPackage>com.backbase.investment.api.service.sync.v1.model</modelPackage>
140+
<enumNameMappings>
141+
<enumNameMapping>Etc/GMT-12=ETC_GMT_1222</enumNameMapping>
142+
</enumNameMappings>
143+
<configOptions>
144+
<openApiNullable>false</openApiNullable>
145+
<useBeanValidation>false</useBeanValidation>
146+
</configOptions>
147+
</configuration>
148+
</execution>
149+
</executions>
150+
</plugin>
151+
152+
<plugin>
153+
<groupId>org.codehaus.mojo</groupId>
154+
<artifactId>build-helper-maven-plugin</artifactId>
155+
</plugin>
86156
</plugins>
87157
</build>
88158
</project>

stream-investment/investment-core/src/main/java/com/backbase/stream/configuration/InvestmentIngestionConfigurationProperties.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
@ConfigurationProperties(prefix = "backbase.bootstrap.ingestions.investment")
1212
public class InvestmentIngestionConfigurationProperties {
1313

14-
private boolean assetUniversEnabled = true;
14+
private boolean contentEnabled = true;
15+
private boolean assetUniverseEnabled = true;
1516
private boolean wealthEnabled = true;
1617
private int portfolioActivationPastMonths = 1;
1718

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package com.backbase.stream.configuration;
2+
3+
import com.backbase.investment.api.service.sync.v1.AssetUniverseApi;
4+
import com.backbase.investment.api.service.sync.v1.ContentApi;
5+
import com.backbase.stream.investment.service.resttemplate.InvestmentRestAssetUniverseService;
6+
import com.backbase.stream.investment.service.resttemplate.InvestmentRestNewsContentService;
7+
import com.fasterxml.jackson.annotation.JsonInclude.Include;
8+
import com.fasterxml.jackson.databind.ObjectMapper;
9+
import com.fasterxml.jackson.databind.SerializationFeature;
10+
import jakarta.validation.constraints.Pattern;
11+
import lombok.Setter;
12+
import org.springframework.beans.factory.annotation.Qualifier;
13+
import org.springframework.beans.factory.annotation.Value;
14+
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
15+
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
16+
import org.springframework.boot.context.properties.ConfigurationProperties;
17+
import org.springframework.context.annotation.Bean;
18+
import org.springframework.context.annotation.Configuration;
19+
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
20+
import org.springframework.web.client.RestTemplate;
21+
22+
@Setter
23+
@Configuration
24+
@ConditionalOnBean(InvestmentServiceConfiguration.class)
25+
@ConfigurationProperties(prefix = "backbase.investment.communication.integration")
26+
public class InvestmentRestServiceApiConfiguration {
27+
28+
private String serviceId = "investment";
29+
private String serviceUrl = "";
30+
31+
@Value("${backbase.communication.http.default-scheme:http}")
32+
@Pattern(regexp = "https?")
33+
private String scheme;
34+
35+
/**
36+
* Configuration for Investment service REST client (ClientApi).
37+
*/
38+
@Bean
39+
@ConditionalOnMissingBean
40+
public com.backbase.investment.api.service.sync.ApiClient restInvestmentApiClient(
41+
@Qualifier("interServiceRestTemplate") RestTemplate restTemplate,
42+
@Qualifier("restInvestmentObjectMapper") ObjectMapper restInvestmentObjectMapper) {
43+
44+
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
45+
converter.setObjectMapper(restInvestmentObjectMapper);
46+
47+
restTemplate.getMessageConverters().removeIf(m -> m instanceof MappingJackson2HttpMessageConverter);
48+
restTemplate.getMessageConverters().add(converter);
49+
50+
com.backbase.investment.api.service.sync.ApiClient apiClient = new com.backbase.investment.api.service.sync.ApiClient(
51+
restTemplate);
52+
apiClient.setBasePath(scheme + "://" + serviceId + serviceUrl);
53+
return apiClient;
54+
}
55+
56+
@Bean
57+
@Qualifier("restInvestmentObjectMapper")
58+
public ObjectMapper restInvestmentObjectMapper(ObjectMapper objectMapper) {
59+
ObjectMapper mapper = objectMapper.copy();
60+
mapper.setSerializationInclusion(Include.NON_EMPTY);
61+
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
62+
return mapper;
63+
}
64+
65+
@Bean
66+
@ConditionalOnMissingBean
67+
public com.backbase.investment.api.service.sync.v1.ContentApi restContentApi(
68+
com.backbase.investment.api.service.sync.ApiClient restInvestmentApiClient) {
69+
return new com.backbase.investment.api.service.sync.v1.ContentApi(restInvestmentApiClient);
70+
}
71+
72+
@Bean
73+
@ConditionalOnMissingBean
74+
public com.backbase.investment.api.service.sync.v1.AssetUniverseApi restAssetUniverseApi(
75+
com.backbase.investment.api.service.sync.ApiClient restInvestmentApiClient) {
76+
return new com.backbase.investment.api.service.sync.v1.AssetUniverseApi(restInvestmentApiClient);
77+
}
78+
79+
@Bean
80+
public InvestmentRestNewsContentService investmentNewsContentService(ContentApi restContentApi,
81+
com.backbase.investment.api.service.sync.ApiClient restInvestmentApiClient) {
82+
return new InvestmentRestNewsContentService(restContentApi, restInvestmentApiClient);
83+
}
84+
85+
86+
@Bean
87+
public InvestmentRestAssetUniverseService investmentRestAssetUniverseService(AssetUniverseApi assetUniverseApi,
88+
com.backbase.investment.api.service.sync.ApiClient restInvestmentApiClient) {
89+
return new InvestmentRestAssetUniverseService(assetUniverseApi, restInvestmentApiClient);
90+
}
91+
92+
}

stream-investment/investment-core/src/main/java/com/backbase/stream/configuration/InvestmentServiceConfiguration.java

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,28 @@
33
import com.backbase.investment.api.service.ApiClient;
44
import com.backbase.investment.api.service.v1.AllocationsApi;
55
import com.backbase.investment.api.service.v1.AssetUniverseApi;
6+
import com.backbase.investment.api.service.v1.AsyncBulkGroupsApi;
67
import com.backbase.investment.api.service.v1.ClientApi;
78
import com.backbase.investment.api.service.v1.FinancialAdviceApi;
89
import com.backbase.investment.api.service.v1.InvestmentApi;
910
import com.backbase.investment.api.service.v1.InvestmentProductsApi;
1011
import com.backbase.investment.api.service.v1.PaymentsApi;
1112
import com.backbase.investment.api.service.v1.PortfolioApi;
1213
import com.backbase.stream.clients.autoconfigure.DbsApiClientsAutoConfiguration;
13-
import com.backbase.stream.investment.saga.InvestmentAssetUniversSaga;
14+
import com.backbase.stream.investment.saga.InvestmentAssetUniverseSaga;
15+
import com.backbase.stream.investment.saga.InvestmentContentSaga;
1416
import com.backbase.stream.investment.saga.InvestmentSaga;
1517
import com.backbase.stream.investment.service.AsyncTaskService;
1618
import com.backbase.stream.investment.service.CustomIntegrationApiService;
1719
import com.backbase.stream.investment.service.InvestmentAssetPriceService;
1820
import com.backbase.stream.investment.service.InvestmentAssetUniverseService;
1921
import com.backbase.stream.investment.service.InvestmentClientService;
22+
import com.backbase.stream.investment.service.InvestmentIntradayAssetPriceService;
2023
import com.backbase.stream.investment.service.InvestmentModelPortfolioService;
2124
import com.backbase.stream.investment.service.InvestmentPortfolioAllocationService;
2225
import com.backbase.stream.investment.service.InvestmentPortfolioService;
26+
import com.backbase.stream.investment.service.resttemplate.InvestmentRestAssetUniverseService;
27+
import com.backbase.stream.investment.service.resttemplate.InvestmentRestNewsContentService;
2328
import lombok.RequiredArgsConstructor;
2429
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
2530
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -58,8 +63,15 @@ public InvestmentPortfolioService investmentPortfolioService(PortfolioApi portfo
5863

5964
@Bean
6065
public InvestmentAssetUniverseService investmentAssetUniverseService(AssetUniverseApi assetUniverseApi,
66+
InvestmentRestAssetUniverseService investmentRestAssetUniverseService,
6167
CustomIntegrationApiService customIntegrationApiService) {
62-
return new InvestmentAssetUniverseService(assetUniverseApi, customIntegrationApiService);
68+
return new InvestmentAssetUniverseService(assetUniverseApi, investmentRestAssetUniverseService,
69+
customIntegrationApiService);
70+
}
71+
72+
@Bean
73+
public AsyncTaskService asyncTaskService(AsyncBulkGroupsApi asyncBulkGroupsApi) {
74+
return new AsyncTaskService(asyncBulkGroupsApi);
6375
}
6476

6577
@Bean
@@ -73,6 +85,11 @@ public InvestmentAssetPriceService investmentAssetPriceService(AssetUniverseApi
7385
return new InvestmentAssetPriceService(assetUniverseApi);
7486
}
7587

88+
@Bean
89+
public InvestmentIntradayAssetPriceService investmentIntradayAssetPriceService(AssetUniverseApi assetUniverseApi) {
90+
return new InvestmentIntradayAssetPriceService(assetUniverseApi);
91+
}
92+
7693
@Bean
7794
public InvestmentPortfolioAllocationService investmentPortfolioAllocationService(AllocationsApi allocationsApi,
7895
AssetUniverseApi assetUniverseApi, InvestmentApi investmentApi,
@@ -93,12 +110,20 @@ public InvestmentSaga investmentSaga(InvestmentClientService investmentClientSer
93110
}
94111

95112
@Bean
96-
public InvestmentAssetUniversSaga investmentStaticDataSaga(
113+
public InvestmentAssetUniverseSaga investmentStaticDataSaga(
97114
InvestmentAssetUniverseService investmentAssetUniverseService,
98115
InvestmentAssetPriceService investmentAssetPriceService,
116+
InvestmentIntradayAssetPriceService investmentIntradayAssetPriceService,
99117
InvestmentIngestionConfigurationProperties coreConfigurationProperties) {
100-
return new InvestmentAssetUniversSaga(investmentAssetUniverseService, investmentAssetPriceService,
101-
coreConfigurationProperties);
118+
return new InvestmentAssetUniverseSaga(investmentAssetUniverseService, investmentAssetPriceService,
119+
investmentIntradayAssetPriceService, coreConfigurationProperties);
120+
}
121+
122+
@Bean
123+
public InvestmentContentSaga investmentContentSaga(
124+
InvestmentRestNewsContentService investmentRestNewsContentService,
125+
InvestmentIngestionConfigurationProperties coreConfigurationProperties) {
126+
return new InvestmentContentSaga(investmentRestNewsContentService, coreConfigurationProperties);
102127
}
103128

104129
}

0 commit comments

Comments
 (0)