Browse Source

Fix Tag Handling

pull/5027/head
Dan 10 months ago
parent
commit
e6c0102139
  1. 1
      apps/api/src/app/admin/admin.service.ts
  2. 33
      apps/api/src/app/portfolio/portfolio.service.ts

1
apps/api/src/app/admin/admin.service.ts

@ -419,6 +419,7 @@ export class AdminService {
sectors, sectors,
symbol, symbol,
symbolMapping, symbolMapping,
tags,
...(dataSource === 'MANUAL' ...(dataSource === 'MANUAL'
? { assetClass, assetSubClass, name, url } ? { assetClass, assetSubClass, name, url }
: { : {

33
apps/api/src/app/portfolio/portfolio.service.ts

@ -1390,8 +1390,37 @@ export class PortfolioService {
userId: string; userId: string;
}) { }) {
userId = await this.getUserId(impersonationId, userId); userId = await this.getUserId(impersonationId, userId);
let symbolProfile = await this.symbolProfileService.getSymbolProfiles([
await this.orderService.assignTags({ dataSource, symbol, tags, userId }); {
dataSource,
symbol
}
])[0];
await this.symbolProfileService.updateSymbolProfile({
assetClass: symbolProfile.assetClass,
assetSubClass: symbolProfile.assetSubClass,
countries: symbolProfile.countries,
currency: symbolProfile.currency,
dataSource,
holdings: symbolProfile.holdings,
name: symbolProfile.name,
sectors: symbolProfile.sectors,
symbol,
tags: {
connectOrCreate: tags.map(({ id,name }) => {
return {
create: {
id,
name
},
where: {
id
}
};
}
},
url: symbolProfile.url
});
} }
@LogPerformance @LogPerformance

Loading…
Cancel
Save