Browse Source
			
			
			Feature/add support for real estate and precious metal (#878)
			
				* Add support for real estate and precious metal
* Update changelog
			
			
				pull/879/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
						
					
				
			
		
		
		
	
		
			
				 5 changed files with 
21 additions and 
0 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
- 
					
					
					 
					apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
				
- 
					
					
					 
					prisma/migrations/20220430083454_added_real_estate_to_asset_class/migration.sql
				
- 
					
					
					 
					prisma/migrations/20220430083631_added_precious_metal_to_asset_sub_class/migration.sql
				
- 
					
					
					 
					prisma/schema.prisma
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | 
			
		
	
		
		
			
				
					|  |  | ### Added |  |  | ### Added | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | - Added support for commodities (via futures) |  |  | - Added support for commodities (via futures) | 
			
		
	
		
		
			
				
					|  |  |  |  |  | - Added support for real estate | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ### Changed |  |  | ### Changed | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | @ -21,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | 
			
		
	
		
		
			
				
					|  |  | - Fixed the import validation for numbers equal 0 |  |  | - Fixed the import validation for numbers equal 0 | 
			
		
	
		
		
			
				
					|  |  | - Fixed the color of the spinner in the activities filter component (dark mode) |  |  | - Fixed the color of the spinner in the activities filter component (dark mode) | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | ### Todo | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | - Apply data migration (`yarn database:migrate`) | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ## 1.143.0 - 26.04.2022 |  |  | ## 1.143.0 - 26.04.2022 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | ### Changed |  |  | ### Changed | 
			
		
	
	
		
		
			
				
					|  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -365,6 +365,16 @@ export class YahooFinanceService implements DataProviderInterface { | 
			
		
	
		
		
			
				
					|  |  |       case 'future': |  |  |       case 'future': | 
			
		
	
		
		
			
				
					|  |  |         assetClass = AssetClass.COMMODITY; |  |  |         assetClass = AssetClass.COMMODITY; | 
			
		
	
		
		
			
				
					|  |  |         assetSubClass = AssetSubClass.COMMODITY; |  |  |         assetSubClass = AssetSubClass.COMMODITY; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         if ( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           aPrice?.shortName?.toLowerCase()?.startsWith('gold') || | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           aPrice?.shortName?.toLowerCase()?.startsWith('palladium') || | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           aPrice?.shortName?.toLowerCase()?.startsWith('platinum') || | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           aPrice?.shortName?.toLowerCase()?.startsWith('silver') | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         ) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           assetSubClass = AssetSubClass.PRECIOUS_METAL; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |         break; |  |  |         break; | 
			
		
	
		
		
			
				
					|  |  |       case 'mutualfund': |  |  |       case 'mutualfund': | 
			
		
	
		
		
			
				
					|  |  |         assetClass = AssetClass.EQUITY; |  |  |         assetClass = AssetClass.EQUITY; | 
			
		
	
	
		
		
			
				
					|  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -0,0 +1,2 @@ | 
			
		
	
		
		
			
				
					|  |  |  |  |  | -- AlterEnum | 
			
		
	
		
		
			
				
					|  |  |  |  |  | ALTER TYPE "AssetClass" ADD VALUE 'REAL_ESTATE'; | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -0,0 +1,2 @@ | 
			
		
	
		
		
			
				
					|  |  |  |  |  | -- AlterEnum | 
			
		
	
		
		
			
				
					|  |  |  |  |  | ALTER TYPE "AssetSubClass" ADD VALUE 'PRECIOUS_METAL'; | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -185,6 +185,7 @@ enum AssetClass { | 
			
		
	
		
		
			
				
					|  |  |   COMMODITY |  |  |   COMMODITY | 
			
		
	
		
		
			
				
					|  |  |   EQUITY |  |  |   EQUITY | 
			
		
	
		
		
			
				
					|  |  |   FIXED_INCOME |  |  |   FIXED_INCOME | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   REAL_ESTATE | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | enum AssetSubClass { |  |  | enum AssetSubClass { | 
			
		
	
	
		
		
			
				
					|  | @ -193,6 +194,7 @@ enum AssetSubClass { | 
			
		
	
		
		
			
				
					|  |  |   CRYPTOCURRENCY |  |  |   CRYPTOCURRENCY | 
			
		
	
		
		
			
				
					|  |  |   ETF |  |  |   ETF | 
			
		
	
		
		
			
				
					|  |  |   MUTUALFUND |  |  |   MUTUALFUND | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   PRECIOUS_METAL | 
			
		
	
		
		
			
				
					|  |  |   STOCK |  |  |   STOCK | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | 
 |