mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-31 04:37:56 +00:00 
			
		
		
		
	40 remove self billing feature flag (#4379)
* Define quantity at checkout * Remove billing submenu when not isBillingEnabled * Remove feature flag * Log warning when missing subscription active workspace add or remove member * Display subscribe cta for free usage of twenty * Authorize all settings when subscription canceled or unpaid * Display subscribe cta for workspace with canceled subscription * Replace OneToOne by OneToMany * Add a currentBillingSubscriptionField * Handle multiple subscriptions by workspace * Fix redirection * Fix test * Fix billingState
This commit is contained in:
		| @@ -65,6 +65,28 @@ export type Billing = { | ||||
|   isBillingEnabled: Scalars['Boolean']; | ||||
| }; | ||||
|  | ||||
| export type BillingSubscription = { | ||||
|   __typename?: 'BillingSubscription'; | ||||
|   id: Scalars['ID']; | ||||
|   status: Scalars['String']; | ||||
| }; | ||||
|  | ||||
| export type BillingSubscriptionFilter = { | ||||
|   and?: InputMaybe<Array<BillingSubscriptionFilter>>; | ||||
|   id?: InputMaybe<IdFilterComparison>; | ||||
|   or?: InputMaybe<Array<BillingSubscriptionFilter>>; | ||||
| }; | ||||
|  | ||||
| export type BillingSubscriptionSort = { | ||||
|   direction: SortDirection; | ||||
|   field: BillingSubscriptionSortFields; | ||||
|   nulls?: InputMaybe<SortNulls>; | ||||
| }; | ||||
|  | ||||
| export enum BillingSubscriptionSortFields { | ||||
|   Id = 'id' | ||||
| } | ||||
|  | ||||
| export type BooleanFieldComparison = { | ||||
|   is?: InputMaybe<Scalars['Boolean']>; | ||||
|   isNot?: InputMaybe<Scalars['Boolean']>; | ||||
| @@ -631,7 +653,9 @@ export type Workspace = { | ||||
|   __typename?: 'Workspace'; | ||||
|   activationStatus: Scalars['String']; | ||||
|   allowImpersonation: Scalars['Boolean']; | ||||
|   billingSubscriptions?: Maybe<Array<BillingSubscription>>; | ||||
|   createdAt: Scalars['DateTime']; | ||||
|   currentBillingSubscription?: Maybe<BillingSubscription>; | ||||
|   deletedAt?: Maybe<Scalars['DateTime']>; | ||||
|   displayName?: Maybe<Scalars['String']>; | ||||
|   domainName?: Maybe<Scalars['String']>; | ||||
| @@ -644,6 +668,12 @@ export type Workspace = { | ||||
| }; | ||||
|  | ||||
|  | ||||
| export type WorkspaceBillingSubscriptionsArgs = { | ||||
|   filter?: BillingSubscriptionFilter; | ||||
|   sorting?: Array<BillingSubscriptionSort>; | ||||
| }; | ||||
|  | ||||
|  | ||||
| export type WorkspaceFeatureFlagsArgs = { | ||||
|   filter?: FeatureFlagFilter; | ||||
|   sorting?: Array<FeatureFlagSort>; | ||||
| @@ -942,7 +972,7 @@ export type UploadProfilePictureMutation = { __typename?: 'Mutation', uploadProf | ||||
| export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>; | ||||
|  | ||||
|  | ||||
| export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale: string, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, defaultWorkspace: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, domainName?: string | null, inviteHash?: string | null, allowImpersonation: boolean, subscriptionStatus: string, activationStatus: string, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: string, key: string, value: boolean, workspaceId: string }> | null }, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, domainName?: string | null } | null }> } }; | ||||
| export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale: string, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, defaultWorkspace: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, domainName?: string | null, inviteHash?: string | null, allowImpersonation: boolean, subscriptionStatus: string, activationStatus: string, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: string, key: string, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', status: string } | null }, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, domainName?: string | null } | null }> } }; | ||||
|  | ||||
| export type ActivateWorkspaceMutationVariables = Exact<{ | ||||
|   input: ActivateWorkspaceInput; | ||||
| @@ -1917,6 +1947,9 @@ export const GetCurrentUserDocument = gql` | ||||
|         value | ||||
|         workspaceId | ||||
|       } | ||||
|       currentBillingSubscription { | ||||
|         status | ||||
|       } | ||||
|     } | ||||
|     workspaces { | ||||
|       workspace { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 martmull
					martmull