|
|
|
@ -35,6 +35,41 @@ export class SymbolProfileService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async getActiveSymbolProfilesByUserSubscription({
|
|
|
|
|
withUserSubscription = false
|
|
|
|
|
}: {
|
|
|
|
|
withUserSubscription?: boolean;
|
|
|
|
|
}) {
|
|
|
|
|
return this.prismaService.symbolProfile.findMany({
|
|
|
|
|
include: {
|
|
|
|
|
Order: {
|
|
|
|
|
include: {
|
|
|
|
|
User: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
orderBy: [{ symbol: 'asc' }],
|
|
|
|
|
where: {
|
|
|
|
|
isActive: true,
|
|
|
|
|
Order: withUserSubscription
|
|
|
|
|
? {
|
|
|
|
|
some: {
|
|
|
|
|
User: {
|
|
|
|
|
Subscription: { some: { expiresAt: { gt: new Date() } } }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
: {
|
|
|
|
|
every: {
|
|
|
|
|
User: {
|
|
|
|
|
Subscription: { none: { expiresAt: { gt: new Date() } } }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async getSymbolProfiles(
|
|
|
|
|
aAssetProfileIdentifiers: AssetProfileIdentifier[]
|
|
|
|
|
): Promise<EnhancedSymbolProfile[]> {
|
|
|
|
@ -91,40 +126,6 @@ export class SymbolProfileService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async getSymbolProfilesByUserSubscription({
|
|
|
|
|
withUserSubscription = false
|
|
|
|
|
}: {
|
|
|
|
|
withUserSubscription?: boolean;
|
|
|
|
|
}) {
|
|
|
|
|
return this.prismaService.symbolProfile.findMany({
|
|
|
|
|
include: {
|
|
|
|
|
Order: {
|
|
|
|
|
include: {
|
|
|
|
|
User: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
orderBy: [{ symbol: 'asc' }],
|
|
|
|
|
where: {
|
|
|
|
|
Order: withUserSubscription
|
|
|
|
|
? {
|
|
|
|
|
some: {
|
|
|
|
|
User: {
|
|
|
|
|
Subscription: { some: { expiresAt: { gt: new Date() } } }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
: {
|
|
|
|
|
every: {
|
|
|
|
|
User: {
|
|
|
|
|
Subscription: { none: { expiresAt: { gt: new Date() } } }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public updateSymbolProfile({
|
|
|
|
|
assetClass,
|
|
|
|
|
assetSubClass,
|
|
|
|
@ -133,6 +134,7 @@ export class SymbolProfileService {
|
|
|
|
|
currency,
|
|
|
|
|
dataSource,
|
|
|
|
|
holdings,
|
|
|
|
|
isActive,
|
|
|
|
|
name,
|
|
|
|
|
scraperConfiguration,
|
|
|
|
|
sectors,
|
|
|
|
@ -149,6 +151,7 @@ export class SymbolProfileService {
|
|
|
|
|
countries,
|
|
|
|
|
currency,
|
|
|
|
|
holdings,
|
|
|
|
|
isActive,
|
|
|
|
|
name,
|
|
|
|
|
scraperConfiguration,
|
|
|
|
|
sectors,
|
|
|
|
|