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 3 years ago
committed by GitHub
parent
commit
751256f158
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CHANGELOG.md
  2. 10
      apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
  3. 2
      prisma/migrations/20220430083454_added_real_estate_to_asset_class/migration.sql
  4. 2
      prisma/migrations/20220430083631_added_precious_metal_to_asset_sub_class/migration.sql
  5. 2
      prisma/schema.prisma

5
CHANGELOG.md

@ -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

10
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts

@ -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;

2
prisma/migrations/20220430083454_added_real_estate_to_asset_class/migration.sql

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "AssetClass" ADD VALUE 'REAL_ESTATE';

2
prisma/migrations/20220430083631_added_precious_metal_to_asset_sub_class/migration.sql

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "AssetSubClass" ADD VALUE 'PRECIOUS_METAL';

2
prisma/schema.prisma

@ -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
} }

Loading…
Cancel
Save