Feature/add support for multiple subscription offers (#1818)
* Setup for multiple subscription offers * Update changelog
This commit is contained in:
@@ -40,7 +40,6 @@ import { ScraperConfiguration } from './scraper-configuration.interface';
|
||||
import { TimelinePosition } from './timeline-position.interface';
|
||||
import { UniqueAsset } from './unique-asset.interface';
|
||||
import { UserSettings } from './user-settings.interface';
|
||||
import { UserWithSettings } from './user-with-settings';
|
||||
import { User } from './user.interface';
|
||||
|
||||
export {
|
||||
@@ -84,6 +83,5 @@ export {
|
||||
TimelinePosition,
|
||||
UniqueAsset,
|
||||
User,
|
||||
UserSettings,
|
||||
UserWithSettings
|
||||
UserSettings
|
||||
};
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { SubscriptionOffer } from '@ghostfolio/common/types';
|
||||
import { SymbolProfile, Tag } from '@prisma/client';
|
||||
|
||||
import { Statistics } from './statistics.interface';
|
||||
@@ -15,7 +16,7 @@ export interface InfoItem {
|
||||
platforms: { id: string; name: string }[];
|
||||
statistics: Statistics;
|
||||
stripePublicKey?: string;
|
||||
subscriptions: Subscription[];
|
||||
subscriptions: { [offer in SubscriptionOffer]: Subscription };
|
||||
systemMessage?: string;
|
||||
tags: Tag[];
|
||||
}
|
||||
|
@@ -1,7 +1,10 @@
|
||||
import { SubscriptionOffer } from '@ghostfolio/common/types';
|
||||
import { SubscriptionType } from '@ghostfolio/common/types/subscription-type.type';
|
||||
import { Account, Tag } from '@prisma/client';
|
||||
|
||||
import { UserSettings } from './user-settings.interface';
|
||||
|
||||
// TODO: Compare with UserWithSettings
|
||||
export interface User {
|
||||
access: {
|
||||
alias?: string;
|
||||
@@ -13,7 +16,8 @@ export interface User {
|
||||
settings: UserSettings;
|
||||
subscription: {
|
||||
expiresAt?: Date;
|
||||
type: 'Basic' | 'Premium';
|
||||
offer: SubscriptionOffer;
|
||||
type: SubscriptionType;
|
||||
};
|
||||
tags: Tag[];
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { UserWithSettings } from '@ghostfolio/common/types';
|
||||
import { Role } from '@prisma/client';
|
||||
|
||||
import { UserWithSettings } from './interfaces';
|
||||
|
||||
export const permissions = {
|
||||
accessAdminControl: 'accessAdminControl',
|
||||
createAccess: 'createAccess',
|
||||
|
@@ -9,7 +9,9 @@ import { MarketState } from './market-state.type';
|
||||
import { Market } from './market.type';
|
||||
import type { OrderWithAccount } from './order-with-account.type';
|
||||
import type { RequestWithUser } from './request-with-user.type';
|
||||
import { SubscriptionOffer } from './subscription-offer.type';
|
||||
import { ToggleOption } from './toggle-option.type';
|
||||
import { UserWithSettings } from './user-with-settings.type';
|
||||
import type { ViewMode } from './view-mode.type';
|
||||
|
||||
export type {
|
||||
@@ -24,6 +26,8 @@ export type {
|
||||
MarketState,
|
||||
OrderWithAccount,
|
||||
RequestWithUser,
|
||||
SubscriptionOffer,
|
||||
ToggleOption,
|
||||
UserWithSettings,
|
||||
ViewMode
|
||||
};
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import { UserWithSettings } from '@ghostfolio/common/interfaces';
|
||||
import { UserWithSettings } from '@ghostfolio/common/types';
|
||||
|
||||
export type RequestWithUser = Request & { user: UserWithSettings };
|
||||
|
1
libs/common/src/lib/types/subscription-offer.type.ts
Normal file
1
libs/common/src/lib/types/subscription-offer.type.ts
Normal file
@@ -0,0 +1 @@
|
||||
export type SubscriptionOffer = 'default' | 'renewal';
|
@@ -1,8 +1,9 @@
|
||||
import { SubscriptionType } from '@ghostfolio/common/types/subscription.type';
|
||||
import { UserSettings } from '@ghostfolio/common/interfaces/user-settings.interface';
|
||||
import { SubscriptionOffer } from '@ghostfolio/common/types';
|
||||
import { SubscriptionType } from '@ghostfolio/common/types/subscription-type.type';
|
||||
import { Account, Settings, User } from '@prisma/client';
|
||||
|
||||
import { UserSettings } from './user-settings.interface';
|
||||
|
||||
// TODO: Compare with User interface
|
||||
export type UserWithSettings = User & {
|
||||
Account: Account[];
|
||||
activityCount: number;
|
||||
@@ -10,6 +11,7 @@ export type UserWithSettings = User & {
|
||||
Settings: Settings & { settings: UserSettings };
|
||||
subscription?: {
|
||||
expiresAt?: Date;
|
||||
offer: SubscriptionOffer;
|
||||
type: SubscriptionType;
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user