Browse Source
			
			
			Bugfix/fix issue with import of activities with type FEE (#4187)
			
				* Fix import of activity with type FEE
* Update changelog
			
			
				pull/4197/head
			
			
		 
		
			
				
					
						 Ivan Kruglov
					
					10 months ago
						Ivan Kruglov
					
					10 months ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 2 changed files with 
3 additions and 
2 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
- 
					
					
					 
					apps/api/src/app/import/import.service.ts
				
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | ### Fixed | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | - Fixed an issue with the import of activities with type `FEE` (where unit price is `0`) | 
			
		
	
		
			
				
					|  |  |  | - Fixed an issue with the renaming of activities with type `FEE`, `INTEREST`, `ITEM` or `LIABILITY` | 
			
		
	
		
			
				
					|  |  |  | - Handled an exception in the scraper configuration introduced by the migration from `got` to `fetch` | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -30,7 +30,7 @@ import { Injectable } from '@nestjs/common'; | 
			
		
	
		
			
				
					|  |  |  | import { DataSource, Prisma, SymbolProfile } from '@prisma/client'; | 
			
		
	
		
			
				
					|  |  |  | import { Big } from 'big.js'; | 
			
		
	
		
			
				
					|  |  |  | import { endOfToday, format, isAfter, isSameSecond, parseISO } from 'date-fns'; | 
			
		
	
		
			
				
					|  |  |  | import { uniqBy } from 'lodash'; | 
			
		
	
		
			
				
					|  |  |  | import { isNumber, uniqBy } from 'lodash'; | 
			
		
	
		
			
				
					|  |  |  | import { v4 as uuidv4 } from 'uuid'; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | @Injectable() | 
			
		
	
	
		
			
				
					|  |  | @ -328,7 +328,7 @@ export class ImportService { | 
			
		
	
		
			
				
					|  |  |  |           date | 
			
		
	
		
			
				
					|  |  |  |         ); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         if (!unitPrice) { | 
			
		
	
		
			
				
					|  |  |  |         if (!isNumber(unitPrice)) { | 
			
		
	
		
			
				
					|  |  |  |           throw new Error( | 
			
		
	
		
			
				
					|  |  |  |             `activities.${index} historical exchange rate at ${format( | 
			
		
	
		
			
				
					|  |  |  |               date, | 
			
		
	
	
		
			
				
					|  |  | 
 |