Compare commits

...

4 Commits

Author SHA1 Message Date
e14f08a8fb Release 1.42.0 (#313) 2021-08-22 22:37:44 +02:00
72c065a59d Feature/introduce asset sub class (#312)
* Introduce asset sub class

* Update changelog
2021-08-22 22:19:10 +02:00
98dac4052a Feature/add subscription type to the admin user table (#311)
* Add the subscription type to the user table in the admin control panel

* Update changelog
2021-08-22 22:11:05 +02:00
2083d28d02 Feature/minor improvements in the page components (#310)
* Move permissions to constructor

* Sort imports
2021-08-22 10:25:34 +02:00
23 changed files with 306 additions and 93 deletions

View File

@ -5,6 +5,17 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 1.42.0 - 22.08.2021
### Added
- Added the subscription type to the users table of the admin control panel
- Introduced the sub classification of assets
### Todo
- Apply data migration (`yarn database:push`)
## 1.41.0 - 21.08.2021
### Added

View File

@ -1,3 +1,4 @@
import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module';
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module';
import { DataGatheringModule } from '@ghostfolio/api/services/data-gathering.module';
import { DataProviderModule } from '@ghostfolio/api/services/data-provider/data-provider.module';
@ -14,9 +15,11 @@ import { AdminService } from './admin.service';
DataGatheringModule,
DataProviderModule,
ExchangeRateDataModule,
PrismaModule
PrismaModule,
SubscriptionModule
],
controllers: [AdminController],
providers: [AdminService]
providers: [AdminService],
exports: [AdminService]
})
export class AdminModule {}

View File

@ -1,3 +1,5 @@
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service';
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
@ -9,9 +11,11 @@ import { differenceInDays } from 'date-fns';
@Injectable()
export class AdminService {
public constructor(
private readonly configurationService: ConfigurationService,
private readonly dataGatheringService: DataGatheringService,
private readonly exchangeRateDataService: ExchangeRateDataService,
private readonly prismaService: PrismaService
private readonly prismaService: PrismaService,
private readonly subscriptionService: SubscriptionService
) {}
public async get(): Promise<AdminData> {
@ -107,7 +111,8 @@ export class AdminService {
}
},
createdAt: true,
id: true
id: true,
Subscription: true
},
take: 30,
where: {
@ -118,16 +123,23 @@ export class AdminService {
});
return usersWithAnalytics.map(
({ _count, alias, Analytics, createdAt, id }) => {
({ _count, alias, Analytics, createdAt, id, Subscription }) => {
const daysSinceRegistration =
differenceInDays(new Date(), createdAt) + 1;
const engagement = Analytics.activityCount / daysSinceRegistration;
const subscription = this.configurationService.get(
'ENABLE_FEATURE_SUBSCRIPTION'
)
? this.subscriptionService.getSubscription(Subscription)
: undefined;
return {
alias,
createdAt,
engagement,
id,
subscription,
accountCount: _count.Account || 0,
lastActivity: Analytics.updatedAt,
transactionCount: _count.Order || 0

View File

@ -1,5 +1,6 @@
import { AuthDeviceService } from '@ghostfolio/api/app/auth-device/auth-device.service';
import { WebAuthService } from '@ghostfolio/api/app/auth/web-auth.service';
import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module';
import { UserService } from '@ghostfolio/api/app/user/user.service';
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
@ -17,7 +18,8 @@ import { JwtStrategy } from './jwt.strategy';
JwtModule.register({
secret: process.env.JWT_SECRET_KEY,
signOptions: { expiresIn: '180 days' }
})
}),
SubscriptionModule
],
providers: [
AuthDeviceService,

View File

@ -218,6 +218,7 @@ export class PortfolioService {
allocationCurrent: value.div(totalValue).toNumber(),
allocationInvestment: item.investment.div(totalInvestment).toNumber(),
assetClass: symbolProfile.assetClass,
assetSubClass: symbolProfile.assetSubClass,
countries: symbolProfile.countries,
currency: item.currency,
exchange: dataProviderResponse.exchange,

View File

@ -8,6 +8,7 @@ import { SubscriptionService } from './subscription.service';
@Module({
imports: [],
controllers: [SubscriptionController],
providers: [ConfigurationService, PrismaService, SubscriptionService]
providers: [ConfigurationService, PrismaService, SubscriptionService],
exports: [SubscriptionService]
})
export class SubscriptionModule {}

View File

@ -1,7 +1,9 @@
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { SubscriptionType } from '@ghostfolio/common/types/subscription.type';
import { Injectable } from '@nestjs/common';
import { addDays } from 'date-fns';
import { Subscription } from '@prisma/client';
import { addDays, isBefore } from 'date-fns';
import Stripe from 'stripe';
@Injectable()
@ -86,4 +88,23 @@ export class SubscriptionService {
console.error(error);
}
}
public getSubscription(aSubscriptions: Subscription[]) {
if (aSubscriptions.length > 0) {
const latestSubscription = aSubscriptions.reduce((a, b) => {
return new Date(a.expiresAt) > new Date(b.expiresAt) ? a : b;
});
return {
expiresAt: latestSubscription.expiresAt,
type: isBefore(new Date(), latestSubscription.expiresAt)
? SubscriptionType.Premium
: SubscriptionType.Basic
};
} else {
return {
type: SubscriptionType.Basic
};
}
}
}

View File

@ -1,3 +1,4 @@
import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module';
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { Module } from '@nestjs/common';
@ -11,7 +12,8 @@ import { UserService } from './user.service';
JwtModule.register({
secret: process.env.JWT_SECRET_KEY,
signOptions: { expiresIn: '30 days' }
})
}),
SubscriptionModule
],
controllers: [UserController],
providers: [ConfigurationService, PrismaService, UserService],

View File

@ -1,3 +1,4 @@
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service';
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { locale } from '@ghostfolio/common/config';
@ -6,7 +7,6 @@ import { getPermissions, permissions } from '@ghostfolio/common/permissions';
import { SubscriptionType } from '@ghostfolio/common/types/subscription.type';
import { Injectable } from '@nestjs/common';
import { Currency, Prisma, Provider, User, ViewMode } from '@prisma/client';
import { isBefore } from 'date-fns';
import { UserSettingsParams } from './interfaces/user-settings-params.interface';
import { UserSettings } from './interfaces/user-settings.interface';
@ -19,7 +19,8 @@ export class UserService {
public constructor(
private readonly configurationService: ConfigurationService,
private readonly prismaService: PrismaService
private readonly prismaService: PrismaService,
private readonly subscriptionService: SubscriptionService
) {}
public async getUser({
@ -98,24 +99,9 @@ export class UserService {
}
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) {
if (userFromDatabase?.Subscription?.length > 0) {
const latestSubscription = userFromDatabase.Subscription.reduce(
(a, b) => {
return new Date(a.expiresAt) > new Date(b.expiresAt) ? a : b;
}
);
user.subscription = {
expiresAt: latestSubscription.expiresAt,
type: isBefore(new Date(), latestSubscription.expiresAt)
? SubscriptionType.Premium
: SubscriptionType.Basic
};
} else {
user.subscription = {
type: SubscriptionType.Basic
};
}
user.subscription = this.subscriptionService.getSubscription(
userFromDatabase?.Subscription
);
if (user.subscription.type === SubscriptionType.Basic) {
user.permissions = user.permissions.filter((permission) => {

View File

@ -38,7 +38,7 @@ export class DataGatheringService {
if (isDataGatheringNeeded) {
console.log('7d data gathering has been started.');
console.time('7d-data-gathering');
console.time('data-gathering-7d');
await this.prismaService.property.create({
data: {
@ -71,7 +71,7 @@ export class DataGatheringService {
});
console.log('7d data gathering has been completed.');
console.timeEnd('7d-data-gathering');
console.timeEnd('data-gathering-7d');
}
}
@ -82,7 +82,7 @@ export class DataGatheringService {
if (!isDataGatheringLocked) {
console.log('Max data gathering has been started.');
console.time('max-data-gathering');
console.time('data-gathering-max');
await this.prismaService.property.create({
data: {
@ -115,13 +115,13 @@ export class DataGatheringService {
});
console.log('Max data gathering has been completed.');
console.timeEnd('max-data-gathering');
console.timeEnd('data-gathering-max');
}
}
public async gatherProfileData(aSymbols?: string[]) {
console.log('Profile data gathering has been started.');
console.time('profile-data-gathering');
console.time('data-gathering-profile');
let symbols = aSymbols;
@ -136,12 +136,13 @@ export class DataGatheringService {
for (const [
symbol,
{ assetClass, currency, dataSource, name }
{ assetClass, assetSubClass, currency, dataSource, name }
] of Object.entries(currentData)) {
try {
await this.prismaService.symbolProfile.upsert({
create: {
assetClass,
assetSubClass,
currency,
dataSource,
name,
@ -149,6 +150,7 @@ export class DataGatheringService {
},
update: {
assetClass,
assetSubClass,
currency,
name
},
@ -165,7 +167,7 @@ export class DataGatheringService {
}
console.log('Profile data gathering has been completed.');
console.timeEnd('profile-data-gathering');
console.timeEnd('data-gathering-profile');
}
public async gatherSymbols(aSymbolsWithStartDate: IDataGatheringItem[]) {

View File

@ -8,7 +8,12 @@ import {
} from '@ghostfolio/common/helper';
import { Granularity } from '@ghostfolio/common/types';
import { Injectable } from '@nestjs/common';
import { AssetClass, Currency, DataSource } from '@prisma/client';
import {
AssetClass,
AssetSubClass,
Currency,
DataSource
} from '@prisma/client';
import * as bent from 'bent';
import Big from 'big.js';
import { format } from 'date-fns';
@ -22,6 +27,7 @@ import {
} from '../../interfaces/interfaces';
import {
IYahooFinanceHistoricalResponse,
IYahooFinancePrice,
IYahooFinanceQuoteResponse
} from './interfaces/interfaces';
@ -60,8 +66,11 @@ export class YahooFinanceService implements DataProviderInterface {
// Convert symbols back
const symbol = convertFromYahooSymbol(yahooSymbol);
const { assetClass, assetSubClass } = this.parseAssetClass(value.price);
response[symbol] = {
assetClass: this.parseAssetClass(value.price?.quoteType),
assetClass,
assetSubClass,
currency: parseCurrency(value.price?.currency),
dataSource: DataSource.YAHOO,
exchange: this.parseExchange(value.price?.exchangeName),
@ -229,20 +238,29 @@ export class YahooFinanceService implements DataProviderInterface {
return aSymbol;
}
private parseAssetClass(aString: string): AssetClass {
private parseAssetClass(aPrice: IYahooFinancePrice): {
assetClass: AssetClass;
assetSubClass: AssetSubClass;
} {
let assetClass: AssetClass;
let assetSubClass: AssetSubClass;
switch (aString?.toLowerCase()) {
switch (aPrice?.quoteType?.toLowerCase()) {
case 'cryptocurrency':
assetClass = AssetClass.CASH;
assetSubClass = AssetSubClass.CRYPTOCURRENCY;
break;
case 'equity':
assetClass = AssetClass.EQUITY;
assetSubClass = AssetSubClass.STOCK;
break;
case 'etf':
assetClass = AssetClass.EQUITY;
assetSubClass = AssetSubClass.ETF;
break;
}
return assetClass;
return { assetClass, assetSubClass };
}
private parseExchange(aString: string): string {

View File

@ -1,6 +1,7 @@
import {
Account,
AssetClass,
AssetSubClass,
Currency,
DataSource,
SymbolProfile
@ -35,6 +36,7 @@ export interface IDataProviderHistoricalResponse {
export interface IDataProviderResponse {
assetClass?: AssetClass;
assetSubClass?: AssetSubClass;
currency: Currency;
dataSource: DataSource;
exchange?: string;

View File

@ -1,9 +1,15 @@
import { Country } from '@ghostfolio/common/interfaces/country.interface';
import { Sector } from '@ghostfolio/common/interfaces/sector.interface';
import { AssetClass, Currency, DataSource } from '@prisma/client';
import {
AssetClass,
AssetSubClass,
Currency,
DataSource
} from '@prisma/client';
export interface EnhancedSymbolProfile {
assetClass: AssetClass;
assetSubClass: AssetSubClass;
createdAt: Date;
currency: Currency | null;
dataSource: DataSource;

View File

@ -16,6 +16,7 @@ import { LinearScale } from 'chart.js';
import { ArcElement } from 'chart.js';
import { DoughnutController } from 'chart.js';
import { Chart } from 'chart.js';
import * as Color from 'color';
@Component({
selector: 'gf-portfolio-proportion-chart',
@ -28,7 +29,7 @@ export class PortfolioProportionChartComponent
{
@Input() baseCurrency: Currency;
@Input() isInPercent: boolean;
@Input() key: string;
@Input() keys: string[];
@Input() locale: string;
@Input() maxItems?: number;
@Input() positions: {
@ -65,24 +66,54 @@ export class PortfolioProportionChartComponent
private initialize() {
this.isLoading = true;
const chartData: {
[symbol: string]: { color?: string; value: number };
[symbol: string]: {
color?: string;
subCategory: { [symbol: string]: { value: number } };
value: number;
};
} = {};
Object.keys(this.positions).forEach((symbol) => {
if (this.positions[symbol][this.key]) {
if (chartData[this.positions[symbol][this.key]]) {
chartData[this.positions[symbol][this.key]].value +=
if (this.positions[symbol][this.keys[0]]) {
if (chartData[this.positions[symbol][this.keys[0]]]) {
chartData[this.positions[symbol][this.keys[0]]].value +=
this.positions[symbol].value;
if (
chartData[this.positions[symbol][this.keys[0]]].subCategory[
this.positions[symbol][this.keys[1]]
]
) {
chartData[this.positions[symbol][this.keys[0]]].subCategory[
this.positions[symbol][this.keys[1]]
].value += this.positions[symbol].value;
} else {
chartData[this.positions[symbol][this.keys[0]]].subCategory[
this.positions[symbol][this.keys[1]] ?? UNKNOWN_KEY
] = { value: this.positions[symbol].value };
}
} else {
chartData[this.positions[symbol][this.key]] = {
chartData[this.positions[symbol][this.keys[0]]] = {
subCategory: {},
value: this.positions[symbol].value
};
if (this.positions[symbol][this.keys[1]]) {
chartData[this.positions[symbol][this.keys[0]]].subCategory = {
[this.positions[symbol][this.keys[1]]]: {
value: this.positions[symbol].value
}
};
}
}
} else {
if (chartData[UNKNOWN_KEY]) {
chartData[UNKNOWN_KEY].value += this.positions[symbol].value;
} else {
chartData[UNKNOWN_KEY] = {
subCategory: this.keys[1]
? { [this.keys[1]]: { value: 0 } }
: undefined,
value: this.positions[symbol].value
};
}
@ -107,13 +138,17 @@ export class PortfolioProportionChartComponent
});
if (!unknownItem) {
const index = chartDataSorted.push([UNKNOWN_KEY, { value: 0 }]);
const index = chartDataSorted.push([
UNKNOWN_KEY,
{ subCategory: {}, value: 0 }
]);
unknownItem = chartDataSorted[index];
}
rest.forEach((restItem) => {
if (unknownItem?.[1]) {
unknownItem[1] = {
subCategory: {},
value: unknownItem[1].value + restItem[1].value
};
}
@ -141,21 +176,53 @@ export class PortfolioProportionChartComponent
}
});
const backgroundColorSubCategory: string[] = [];
const dataSubCategory: number[] = [];
const labelSubCategory: string[] = [];
chartDataSorted.forEach(([, item]) => {
let lightnessRatio = 0.2;
Object.keys(item.subCategory).forEach((subCategory) => {
backgroundColorSubCategory.push(
Color(item.color).lighten(lightnessRatio).hex()
);
dataSubCategory.push(item.subCategory[subCategory].value);
labelSubCategory.push(subCategory);
lightnessRatio += 0.1;
});
});
const datasets = [
{
backgroundColor: chartDataSorted.map(([, item]) => {
return item.color;
}),
borderWidth: 0,
data: chartDataSorted.map(([, item]) => {
return item.value;
})
}
];
let labels = chartDataSorted.map(([label]) => {
return label;
});
if (this.keys[1]) {
datasets.unshift({
backgroundColor: backgroundColorSubCategory,
borderWidth: 0,
data: dataSubCategory
});
labels = labelSubCategory.concat(labels);
}
const data = {
datasets: [
{
backgroundColor: chartDataSorted.map(([, item]) => {
return item.color;
}),
borderWidth: 0,
data: chartDataSorted.map(([, item]) => {
return item.value;
})
}
],
labels: chartDataSorted.map(([label]) => {
return label;
})
datasets,
labels
};
if (this.chartCanvas) {
@ -166,13 +233,16 @@ export class PortfolioProportionChartComponent
this.chart = new Chart(this.chartCanvas.nativeElement, {
data,
options: {
cutout: '70%',
plugins: {
legend: { display: false },
tooltip: {
callbacks: {
label: (context) => {
const label =
context.label === UNKNOWN_KEY ? 'Other' : context.label;
const labelIndex =
(data.datasets[context.datasetIndex - 1]?.data?.length ??
0) + context.dataIndex;
const label = context.chart.data.labels[labelIndex];
if (this.isInPercent) {
const value = 100 * <number>context.raw;

View File

@ -35,12 +35,7 @@ export class AboutPageComponent implements OnDestroy, OnInit {
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private userService: UserService
) {}
/**
* Initializes the controller
*/
public ngOnInit() {
) {
const { globalPermissions, statistics } = this.dataService.fetchInfo();
this.hasPermissionForBlog = hasPermission(
@ -59,7 +54,12 @@ export class AboutPageComponent implements OnDestroy, OnInit {
);
this.statistics = statistics;
}
/**
* Initializes the controller
*/
public ngOnInit() {
this.userService.stateChanged
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((state) => {

View File

@ -116,7 +116,20 @@
<tr *ngFor="let userItem of users; let i = index" class="mat-row">
<td class="mat-cell px-1 py-2 text-right">{{ i + 1 }}</td>
<td class="mat-cell px-1 py-2">
{{ userItem.alias || userItem.id }}
<div class="d-flex align-items-center">
<span class="d-none d-sm-inline-block"
>{{ userItem.alias || userItem.id }}</span
>
<span class="d-inline-block d-sm-none"
>{{ userItem.alias || (userItem.id | slice:0:5) +
'...' }}</span
>
<ion-icon
*ngIf="userItem?.subscription?.type === 'Premium'"
class="ml-1 text-muted"
name="diamond-outline"
></ion-icon>
</div>
</td>
<td class="mat-cell px-1 py-2 text-right">
{{ formatDistanceToNow(userItem.createdAt) }}

View File

@ -3,7 +3,7 @@ import { ToggleOption } from '@ghostfolio/client/components/toggle/interfaces/to
import { DataService } from '@ghostfolio/client/services/data.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { ghostfolioCashSymbol, UNKNOWN_KEY } from '@ghostfolio/common/config';
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
import {
PortfolioDetails,
PortfolioPosition,
@ -129,6 +129,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
)) {
this.positions[symbol] = {
assetClass: position.assetClass,
assetSubClass: position.assetSubClass,
currency: position.currency,
exchange: position.exchange,
value:

View File

@ -18,9 +18,9 @@
</mat-card-header>
<mat-card-content>
<gf-portfolio-proportion-chart
key="name"
[baseCurrency]="user?.settings?.baseCurrency"
[isInPercent]="hasImpersonationId"
[keys]="['name']"
[locale]="user?.settings?.locale"
[positions]="accounts"
></gf-portfolio-proportion-chart>
@ -40,9 +40,9 @@
</mat-card-header>
<mat-card-content>
<gf-portfolio-proportion-chart
key="assetClass"
[baseCurrency]="user?.settings?.baseCurrency"
[isInPercent]="true"
[keys]="['assetClass', 'assetSubClass']"
[locale]="user?.settings?.locale"
[positions]="positions"
></gf-portfolio-proportion-chart>
@ -62,9 +62,9 @@
</mat-card-header>
<mat-card-content>
<gf-portfolio-proportion-chart
key="currency"
[baseCurrency]="user?.settings?.baseCurrency"
[isInPercent]="true"
[keys]="['currency']"
[locale]="user?.settings?.locale"
[positions]="positions"
></gf-portfolio-proportion-chart>
@ -84,9 +84,9 @@
</mat-card-header>
<mat-card-content>
<gf-portfolio-proportion-chart
key="name"
[baseCurrency]="user?.settings?.baseCurrency"
[isInPercent]="false"
[keys]="['name']"
[locale]="user?.settings?.locale"
[maxItems]="10"
[positions]="sectors"
@ -107,9 +107,9 @@
</mat-card-header>
<mat-card-content>
<gf-portfolio-proportion-chart
key="name"
[baseCurrency]="user?.settings?.baseCurrency"
[isInPercent]="false"
[keys]="['name']"
[locale]="user?.settings?.locale"
[positions]="continents"
></gf-portfolio-proportion-chart>
@ -129,7 +129,7 @@
</mat-card-header>
<mat-card-content>
<gf-portfolio-proportion-chart
key="name"
[keys]="['name']"
[baseCurrency]="user?.settings?.baseCurrency"
[isInPercent]="false"
[locale]="user?.settings?.locale"

View File

@ -1,5 +1,5 @@
import { MarketState } from '@ghostfolio/api/services/interfaces/interfaces';
import { AssetClass, Currency } from '@prisma/client';
import { AssetClass, AssetSubClass, Currency } from '@prisma/client';
import { Country } from './country.interface';
import { Sector } from './sector.interface';
@ -8,6 +8,7 @@ export interface PortfolioPosition {
allocationCurrent: number;
allocationInvestment: number;
assetClass?: AssetClass;
assetSubClass?: AssetSubClass;
countries: Country[];
currency: Currency;
exchange?: string;

View File

@ -1,6 +1,6 @@
{
"name": "ghostfolio",
"version": "1.41.0",
"version": "1.42.0",
"homepage": "https://ghostfol.io",
"license": "AGPL-3.0",
"scripts": {
@ -82,6 +82,7 @@
"cheerio": "1.0.0-rc.6",
"class-transformer": "0.3.2",
"class-validator": "0.13.1",
"color": "4.0.1",
"countries-list": "2.6.1",
"countup.js": "2.0.7",
"cryptocurrencies": "7.0.0",
@ -126,6 +127,7 @@
"@nrwl/workspace": "12.5.4",
"@types/big.js": "6.1.1",
"@types/cache-manager": "3.4.0",
"@types/color": "3.0.2",
"@types/jest": "26.0.20",
"@types/lodash": "4.14.168",
"@types/node": "14.14.33",

View File

@ -0,0 +1,5 @@
-- CreateEnum
CREATE TYPE "AssetSubClass" AS ENUM ('CRYPTOCURRENCY', 'ETF', 'STOCK');
-- AlterTable
ALTER TABLE "SymbolProfile" ADD COLUMN "assetSubClass" "AssetSubClass";

View File

@ -117,17 +117,18 @@ model Settings {
}
model SymbolProfile {
assetClass AssetClass?
countries Json?
createdAt DateTime @default(now())
currency Currency?
dataSource DataSource
id String @id @default(uuid())
name String?
Order Order[]
updatedAt DateTime @updatedAt
sectors Json?
symbol String
assetClass AssetClass?
assetSubClass AssetSubClass?
countries Json?
createdAt DateTime @default(now())
currency Currency?
dataSource DataSource
id String @id @default(uuid())
name String?
Order Order[]
updatedAt DateTime @updatedAt
sectors Json?
symbol String
@@unique([dataSource, symbol])
}
@ -174,6 +175,12 @@ enum AssetClass {
EQUITY
}
enum AssetSubClass {
CRYPTOCURRENCY
ETF
STOCK
}
enum Currency {
CHF
EUR

View File

@ -2567,6 +2567,25 @@
resolved "https://registry.yarnpkg.com/@types/cache-manager/-/cache-manager-3.4.0.tgz#414136ea3807a8cd071b8f20370c5df5dbffd382"
integrity sha512-XVbn2HS+O+Mk2SKRCjr01/8oD5p2Tv1fxxdBqJ0+Cl+UBNiz0WVY5rusHpMGx+qF6Vc2pnRwPVwSKbGaDApCpw==
"@types/color-convert@*":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/color-convert/-/color-convert-2.0.0.tgz#8f5ee6b9e863dcbee5703f5a517ffb13d3ea4e22"
integrity sha512-m7GG7IKKGuJUXvkZ1qqG3ChccdIM/qBBo913z+Xft0nKCX4hAU/IxKwZBU4cpRZ7GS5kV4vOblUkILtSShCPXQ==
dependencies:
"@types/color-name" "*"
"@types/color-name@*":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
"@types/color@3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@types/color/-/color-3.0.2.tgz#3779043e782f562aa9157b5fc6bd07e14fd8e7f3"
integrity sha512-INiJl6sfNn8iyC5paxVzqiVUEj2boIlFki02uRTAkKwAj++7aAF+ZfEv/XrIeBa0XI/fTZuDHW8rEEcEVnON+Q==
dependencies:
"@types/color-convert" "*"
"@types/connect@*":
version "3.4.34"
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.34.tgz#170a40223a6d666006d93ca128af2beb1d9b1901"
@ -4804,11 +4823,27 @@ color-name@1.1.3:
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
color-name@~1.1.4:
color-name@^1.0.0, color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
color-string@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.6.0.tgz#c3915f61fe267672cb7e1e064c9d692219f6c312"
integrity sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==
dependencies:
color-name "^1.0.0"
simple-swizzle "^0.2.2"
color@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/color/-/color-4.0.1.tgz#21df44cd10245a91b1ccf5ba031609b0e10e7d67"
integrity sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA==
dependencies:
color-convert "^2.0.1"
color-string "^1.6.0"
colord@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/colord/-/colord-2.0.1.tgz#1e7fb1f9fa1cf74f42c58cb9c20320bab8435aa0"
@ -7780,6 +7815,11 @@ is-arrayish@^0.2.1:
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
is-arrayish@^0.3.1:
version "0.3.2"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03"
integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==
is-bigint@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a"
@ -12349,6 +12389,13 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3:
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==
simple-swizzle@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=
dependencies:
is-arrayish "^0.3.1"
sisteransi@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"