Browse Source

database

pull/5794/head
ragavi-632007 2 weeks ago
parent
commit
7c1f30ef26
  1. 6
      CHANGELOG.md
  2. 4
      apps/api/src/app/endpoints/data-providers/ghostfolio/ghostfolio.service.ts
  3. 2
      apps/api/src/services/data-provider/data-provider.service.ts
  4. 4
      apps/api/src/services/data-provider/ghostfolio/ghostfolio.service.ts
  5. 8
      apps/client/src/app/components/admin-settings/admin-settings.component.html
  6. 4
      apps/client/src/app/components/admin-settings/admin-settings.component.ts
  7. 15
      prisma/migrations/20251019000000_remove_ghostfolio_data_source/migration.sql

6
CHANGELOG.md

@ -13,10 +13,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Renamed the `GHOSTFOLIO` data source to `MANUAL` in the GhostfolioService and related components
- Updated database schema to remove `GHOSTFOLIO` from DataSource enum
- Formatted the holdings table in the _Copy AI prompt to clipboard for analysis_ action on the analysis page (experimental) - Formatted the holdings table in the _Copy AI prompt to clipboard for analysis_ action on the analysis page (experimental)
- Formatted the holdings table in the _Copy portfolio data to clipboard for AI prompt_ action of the analysis page (experimental) - Formatted the holdings table in the _Copy portfolio data to clipboard for AI prompt_ action of the analysis page (experimental)
- Improved the language localization for German (`de`) - Improved the language localization for German (`de`)
### Migration
- Run the database migration to update the data source from `GHOSTFOLIO` to `MANUAL`
## 2.209.0 - 2025-10-18 ## 2.209.0 - 2025-10-18
### Added ### Added

4
apps/api/src/app/endpoints/data-providers/ghostfolio/ghostfolio.service.ts

@ -226,7 +226,7 @@ export class GhostfolioService {
for (const [symbol, dataProviderResponse] of Object.entries( for (const [symbol, dataProviderResponse] of Object.entries(
result result
)) { )) {
dataProviderResponse.dataSource = 'GHOSTFOLIO'; dataProviderResponse.dataSource = 'MANUAL';
if ( if (
[ [
@ -337,7 +337,7 @@ export class GhostfolioService {
}) })
.map((lookupItem) => { .map((lookupItem) => {
lookupItem.dataProviderInfo = this.getDataProviderInfo(); lookupItem.dataProviderInfo = this.getDataProviderInfo();
lookupItem.dataSource = 'GHOSTFOLIO'; lookupItem.dataSource = 'MANUAL';
return lookupItem; return lookupItem;
}); });

2
apps/api/src/services/data-provider/data-provider.service.ts

@ -181,7 +181,7 @@ export class DataProviderService implements OnModuleInit {
); );
if (ghostfolioApiKey) { if (ghostfolioApiKey) {
dataSources.push('GHOSTFOLIO'); dataSources.push('MANUAL');
} }
return dataSources.sort(); return dataSources.sort();

4
apps/api/src/services/data-provider/ghostfolio/ghostfolio.service.ts

@ -97,7 +97,7 @@ export class GhostfolioService implements DataProviderInterface {
public getDataProviderInfo(): DataProviderInfo { public getDataProviderInfo(): DataProviderInfo {
return { return {
dataSource: DataSource.GHOSTFOLIO, dataSource: DataSource.MANUAL,
isPremium: true, isPremium: true,
name: 'Ghostfolio', name: 'Ghostfolio',
url: 'https://ghostfol.io' url: 'https://ghostfol.io'
@ -221,7 +221,7 @@ export class GhostfolioService implements DataProviderInterface {
} }
public getName(): DataSource { public getName(): DataSource {
return DataSource.GHOSTFOLIO; return DataSource.MANUAL;
} }
public async getQuotes({ public async getQuotes({

8
apps/client/src/app/components/admin-settings/admin-settings.component.html

@ -49,7 +49,7 @@
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<gf-entity-logo class="mr-1" [url]="element.url" /> <gf-entity-logo class="mr-1" [url]="element.url" />
<div> <div>
@if (isGhostfolioDataProvider(element)) { @if (isManualDataProvider(element)) {
<a <a
class="align-items-center d-inline-flex" class="align-items-center d-inline-flex"
target="_blank" target="_blank"
@ -93,7 +93,7 @@
</th> </th>
<td *matCellDef="let element" class="px-1" mat-cell> <td *matCellDef="let element" class="px-1" mat-cell>
@if ( @if (
!isGhostfolioDataProvider(element) || !isManualDataProvider(element) ||
isGhostfolioApiKeyValid === true isGhostfolioApiKeyValid === true
) { ) {
<gf-data-provider-status [dataSource]="element.dataSource" /> <gf-data-provider-status [dataSource]="element.dataSource" />
@ -118,7 +118,7 @@
<th *matHeaderCellDef class="px-1" mat-header-cell></th> <th *matHeaderCellDef class="px-1" mat-header-cell></th>
<td *matCellDef="let element" class="px-1" mat-cell> <td *matCellDef="let element" class="px-1" mat-cell>
@if ( @if (
isGhostfolioDataProvider(element) && isManualDataProvider(element) &&
isGhostfolioApiKeyValid === true isGhostfolioApiKeyValid === true
) { ) {
<mat-progress-bar <mat-progress-bar
@ -144,7 +144,7 @@
<th *matHeaderCellDef class="px-1" mat-header-cell></th> <th *matHeaderCellDef class="px-1" mat-header-cell></th>
<td *matCellDef="let element" class="px-1 text-right" mat-cell> <td *matCellDef="let element" class="px-1 text-right" mat-cell>
@if (isGhostfolioDataProvider(element)) { @if (isManualDataProvider(element)) {
@if (isGhostfolioApiKeyValid === true) { @if (isGhostfolioApiKeyValid === true) {
<button <button
class="mx-1 no-min-width px-2" class="mx-1 no-min-width px-2"

4
apps/client/src/app/components/admin-settings/admin-settings.component.ts

@ -111,8 +111,8 @@ export class GfAdminSettingsComponent implements OnDestroy, OnInit {
this.initialize(); this.initialize();
} }
public isGhostfolioDataProvider(provider: DataProviderInfo): boolean { public isManualDataProvider(provider: DataProviderInfo): boolean {
return provider.dataSource === 'GHOSTFOLIO'; return provider.dataSource === 'MANUAL';
} }
public onRemoveGhostfolioApiKey() { public onRemoveGhostfolioApiKey() {

15
prisma/migrations/20251019000000_remove_ghostfolio_data_source/migration.sql

@ -0,0 +1,15 @@
-- Update existing records to use MANUAL instead of GHOSTFOLIO
UPDATE "MarketData" SET "dataSource" = 'MANUAL' WHERE "dataSource" = 'GHOSTFOLIO';
UPDATE "SymbolProfile" SET "dataSource" = 'MANUAL' WHERE "dataSource" = 'GHOSTFOLIO';
-- Create new enum without GHOSTFOLIO
CREATE TYPE "DataSource_new" AS ENUM ('ALPHA_VANTAGE', 'COINGECKO', 'EOD_HISTORICAL_DATA', 'FINANCIAL_MODELING_PREP', 'GOOGLE_SHEETS', 'MANUAL', 'RAPID_API', 'YAHOO');
-- Update columns to use new enum
ALTER TABLE "MarketData" ALTER COLUMN "dataSource" TYPE "DataSource_new" USING ("dataSource"::text::"DataSource_new");
ALTER TABLE "SymbolProfile" ALTER COLUMN "dataSource" TYPE "DataSource_new" USING ("dataSource"::text::"DataSource_new");
-- Drop old enum
ALTER TYPE "DataSource" RENAME TO "DataSource_old";
ALTER TYPE "DataSource_new" RENAME TO "DataSource";
DROP TYPE "DataSource_old";
Loading…
Cancel
Save