Browse Source
			
			
			Bugfix/filter out positions without quantity (#317)
			
				* Filter out positions without any quantity
* Update changelog
			
			
				pull/318/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
						
					
				
			
		
		
		
	
		
			
				 2 changed files with 
11 additions and 
0 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
- 
					
					
					 
					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 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | ### Fixed | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | - Filtered out positions without any quantity in the positions table | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ## 1.43.0 - 24.08.2021 |  |  | ## 1.43.0 - 24.08.2021 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ### Added |  |  | ### Added | 
			
		
	
	
		
		
			
				
					|  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -211,6 +211,11 @@ export class PortfolioService { | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     for (const item of currentPositions.positions) { |  |  |     for (const item of currentPositions.positions) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       if (item.quantity.lte(0)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         // Ignore positions without any quantity
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         continue; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |       const value = item.quantity.mul(item.marketPrice); |  |  |       const value = item.quantity.mul(item.marketPrice); | 
			
		
	
		
		
			
				
					|  |  |       const symbolProfile = symbolProfileMap[item.symbol]; |  |  |       const symbolProfile = symbolProfileMap[item.symbol]; | 
			
		
	
		
		
			
				
					|  |  |       const dataProviderResponse = dataProviderResponses[item.symbol]; |  |  |       const dataProviderResponse = dataProviderResponses[item.symbol]; | 
			
		
	
	
		
		
			
				
					|  | 
 |