Browse Source
			
			
			Feature/access data source and symbol from symbol profile (#668)
			
				* Access dataSource and symbol from SymbolProfile
* Update changelog
			
			
				pull/669/head
			
			
		 
		
			
				
					
						 Thomas Kaul
					
					4 years ago
						Thomas Kaul
					
					4 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 4AEE18F83AFDEB23
						
					
				
			
		
		
		
	
		
			
				 4 changed files with 
41 additions and 
6 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
- 
					
					
					 
					apps/api/src/app/export/export.service.ts
				
- 
					
					
					 
					apps/api/src/app/portfolio/portfolio.service-new.ts
				
- 
					
					
					 
					apps/api/src/app/portfolio/portfolio.service.ts
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. | 
			
		
	
		
		
			
				
					|  |  | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |  |  | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | 
			
		
	
		
		
			
				
					|  |  | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |  |  | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | ## Unreleased | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | ### Changed | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | - Used `dataSource` and `symbol` from `SymbolProfile` instead of the `order` object (in `ExportService` and `PortfolioService`) | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ## 1.110.0 - 02.02.2022 |  |  | ## 1.110.0 - 02.02.2022 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ### Fixed |  |  | ### Fixed | 
			
		
	
	
		
		
			
				
					|  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -17,7 +17,7 @@ export class ExportService { | 
			
		
	
		
		
			
				
					|  |  |         date: true, |  |  |         date: true, | 
			
		
	
		
		
			
				
					|  |  |         fee: true, |  |  |         fee: true, | 
			
		
	
		
		
			
				
					|  |  |         quantity: true, |  |  |         quantity: true, | 
			
		
	
		
		
			
				
					
					|  |  |         symbol: true, |  |  |         SymbolProfile: true, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         type: true, |  |  |         type: true, | 
			
		
	
		
		
			
				
					|  |  |         unitPrice: true |  |  |         unitPrice: true | 
			
		
	
		
		
			
				
					|  |  |       }, |  |  |       }, | 
			
		
	
	
		
		
			
				
					|  | @ -26,7 +26,30 @@ export class ExportService { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     return { |  |  |     return { | 
			
		
	
		
		
			
				
					|  |  |       meta: { date: new Date().toISOString(), version: environment.version }, |  |  |       meta: { date: new Date().toISOString(), version: environment.version }, | 
			
		
	
		
		
			
				
					
					|  |  |       orders |  |  |       orders: orders.map( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |         ({ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           accountId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           currency, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           date, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           fee, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           quantity, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           SymbolProfile, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           type, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           unitPrice | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         }) => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           return { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             accountId, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             currency, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             date, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             fee, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             quantity, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             type, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             unitPrice, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             dataSource: SymbolProfile.dataSource, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             symbol: SymbolProfile.symbol | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           }; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       ) | 
			
		
	
		
		
			
				
					|  |  |     }; |  |  |     }; | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
	
		
		
			
				
					|  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -407,8 +407,11 @@ export class PortfolioServiceNew { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     const orders = ( |  |  |     const orders = ( | 
			
		
	
		
		
			
				
					|  |  |       await this.orderService.getOrders({ userCurrency, userId }) |  |  |       await this.orderService.getOrders({ userCurrency, userId }) | 
			
		
	
		
		
			
				
					
					|  |  |     ).filter((order) => { |  |  |     ).filter(({ SymbolProfile }) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       return order.dataSource === aDataSource && order.symbol === aSymbol; |  |  |       return ( | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |         SymbolProfile.dataSource === aDataSource && | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         SymbolProfile.symbol === aSymbol | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       ); | 
			
		
	
		
		
			
				
					|  |  |     }); |  |  |     }); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     if (orders.length <= 0) { |  |  |     if (orders.length <= 0) { | 
			
		
	
	
		
		
			
				
					|  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -395,8 +395,11 @@ export class PortfolioService { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     const orders = ( |  |  |     const orders = ( | 
			
		
	
		
		
			
				
					|  |  |       await this.orderService.getOrders({ userCurrency, userId }) |  |  |       await this.orderService.getOrders({ userCurrency, userId }) | 
			
		
	
		
		
			
				
					
					|  |  |     ).filter((order) => { |  |  |     ).filter(({ SymbolProfile }) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       return order.dataSource === aDataSource && order.symbol === aSymbol; |  |  |       return ( | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |         SymbolProfile.dataSource === aDataSource && | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         SymbolProfile.symbol === aSymbol | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       ); | 
			
		
	
		
		
			
				
					|  |  |     }); |  |  |     }); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     if (orders.length <= 0) { |  |  |     if (orders.length <= 0) { | 
			
		
	
	
		
		
			
				
					|  | 
 |