* Migrate to yahoo-finance2 * Add support for mutual funds * Add url to symbol profile * Clean up
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { LookupItem } from '@ghostfolio/api/app/symbol/interfaces/lookup-item.interface';
|
|
import { DataProviderInterface } from '@ghostfolio/api/services/data-provider/interfaces/data-provider.interface';
|
|
import {
|
|
IDataProviderHistoricalResponse,
|
|
IDataProviderResponse
|
|
} from '@ghostfolio/api/services/interfaces/interfaces';
|
|
import { Granularity } from '@ghostfolio/common/types';
|
|
import { Injectable } from '@nestjs/common';
|
|
import { DataSource, SymbolProfile } from '@prisma/client';
|
|
|
|
@Injectable()
|
|
export class ManualService implements DataProviderInterface {
|
|
public constructor() {}
|
|
|
|
public canHandle(symbol: string) {
|
|
return false;
|
|
}
|
|
|
|
public async getAssetProfile(
|
|
aSymbol: string
|
|
): Promise<Partial<SymbolProfile>> {
|
|
return {
|
|
dataSource: this.getName()
|
|
};
|
|
}
|
|
|
|
public async getHistorical(
|
|
aSymbol: string,
|
|
aGranularity: Granularity = 'day',
|
|
from: Date,
|
|
to: Date
|
|
): Promise<{
|
|
[symbol: string]: { [date: string]: IDataProviderHistoricalResponse };
|
|
}> {
|
|
return {};
|
|
}
|
|
|
|
public getName(): DataSource {
|
|
return DataSource.MANUAL;
|
|
}
|
|
|
|
public async getQuotes(
|
|
aSymbols: string[]
|
|
): Promise<{ [symbol: string]: IDataProviderResponse }> {
|
|
return {};
|
|
}
|
|
|
|
public async search(aQuery: string): Promise<{ items: LookupItem[] }> {
|
|
return { items: [] };
|
|
}
|
|
}
|