From 81e223c69b971f3f3e1006ba79a1523ed7e1fcfe Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 2 Sep 2025 19:32:11 +0300 Subject: [PATCH] feat(subscriptions): add trial subscription functionality - Implemented `createTrialSubscription` action in the API for initiating trial subscriptions. - Enhanced the Pro page to include a `TryFreeButton` for users to activate their trial. - Updated GraphQL operations and types to support trial subscription features. - Improved subscription messaging and user experience across relevant components. --- apps/web/actions/api/server/subscriptions.ts | 7 +- apps/web/actions/api/subscriptions.ts | 1 + apps/web/app/(main)/pro/page.tsx | 86 ++++++++++--------- .../components/profile/subscription-bar.tsx | 8 +- .../subscription/try-free-button.tsx | 21 +++-- apps/web/hooks/api/subscriptions.ts | 20 +++++ packages/graphql/api/subscriptions.ts | 53 ++++++++++++ .../graphql/operations/subscriptions.graphql | 4 +- .../graphql/types/operations.generated.ts | 21 +++-- 9 files changed, 151 insertions(+), 70 deletions(-) diff --git a/apps/web/actions/api/server/subscriptions.ts b/apps/web/actions/api/server/subscriptions.ts index 1c32aa9..8c8c077 100644 --- a/apps/web/actions/api/server/subscriptions.ts +++ b/apps/web/actions/api/server/subscriptions.ts @@ -1,5 +1,4 @@ 'use server'; - import { useService } from '../lib/service'; import { wrapServerAction } from '@/utils/actions'; import { SubscriptionsService } from '@repo/graphql/api/subscriptions'; @@ -22,6 +21,12 @@ export async function createSubscriptionHistory( return wrapServerAction(() => service.createSubscriptionHistory(...variables)); } +export async function createTrialSubscription() { + const service = await getService(); + + return wrapServerAction(() => service.createTrialSubscription()); +} + export async function getSubscription( ...variables: Parameters ) { diff --git a/apps/web/actions/api/subscriptions.ts b/apps/web/actions/api/subscriptions.ts index c30a2cd..25ad537 100644 --- a/apps/web/actions/api/subscriptions.ts +++ b/apps/web/actions/api/subscriptions.ts @@ -9,3 +9,4 @@ export const createSubscription = wrapClientAction(subscriptions.createSubscript export const updateSubscription = wrapClientAction(subscriptions.updateSubscription); export const createSubscriptionHistory = wrapClientAction(subscriptions.createSubscriptionHistory); export const updateSubscriptionHistory = wrapClientAction(subscriptions.updateSubscriptionHistory); +export const createTrialSubscription = wrapClientAction(subscriptions.createTrialSubscription); diff --git a/apps/web/app/(main)/pro/page.tsx b/apps/web/app/(main)/pro/page.tsx index f99c3a4..e7fd4f6 100644 --- a/apps/web/app/(main)/pro/page.tsx +++ b/apps/web/app/(main)/pro/page.tsx @@ -1,5 +1,6 @@ import { getSubscription } from '@/actions/api/subscriptions'; import { getSessionUser } from '@/actions/session'; +import { PageHeader } from '@/components/navigation'; import { TryFreeButton } from '@/components/subscription'; import { env } from '@/config/env'; import { Button } from '@repo/ui/components/ui/button'; @@ -24,53 +25,54 @@ export default async function ProPage() { const canUseTrial = !isActive && !hasUsedTrial; return ( -
- {/* Hero Section */} -
-
-
-
-
-
- + <> + +
+ {/* Hero Section */} +
+
+
+
+
+
+ +
-
-

- Подписка{' '} - - Pro - -

+

+ Подписка{' '} + + Pro + +

-

- {isActive ? 'Ваша подписка Pro активна!' : 'Разблокируйте больше возможностей'} -

+

+ {isActive ? 'Ваша подписка Pro активна!' : 'Разблокируйте больше возможностей'} +

- {!isActive && ( -
- {canUseTrial && } + {!isActive && ( +
+ {canUseTrial && } - -
- )} + +
+ )} - {!isActive && (

Преимущества @@ -104,9 +106,9 @@ export default async function ProPage() {

- )} +
-
+ ); } diff --git a/apps/web/components/profile/subscription-bar.tsx b/apps/web/components/profile/subscription-bar.tsx index 5172c43..9b9cfe3 100644 --- a/apps/web/components/profile/subscription-bar.tsx +++ b/apps/web/components/profile/subscription-bar.tsx @@ -19,14 +19,14 @@ export function SubscriptionInfoBar() { let description = 'Попробуйте бесплатно'; - if (isActive && expiresAt) { - description = `Осталось ${getRemainingDays(expiresAt)} дней`; - } - if (!isLoading && remainingOrdersCount && maxOrdersPerMonth) { description = `Доступно ${remainingOrdersCount} из ${maxOrdersPerMonth} записей в этом месяце`; } + if (isActive && expiresAt) { + description = `Осталось ${getRemainingDays(expiresAt)} дней`; + } + return (
diff --git a/apps/web/components/subscription/try-free-button.tsx b/apps/web/components/subscription/try-free-button.tsx index 011c627..5438aa4 100644 --- a/apps/web/components/subscription/try-free-button.tsx +++ b/apps/web/components/subscription/try-free-button.tsx @@ -1,25 +1,28 @@ 'use client'; - +import { useCreateTrialSubscriptionMutation } from '@/hooks/api/subscriptions'; import { Button } from '@repo/ui/components/ui/button'; import { Sparkles } from 'lucide-react'; +import { useRouter } from 'next/navigation'; +import { type ComponentProps } from 'react'; -type TryFreeButtonProps = { - readonly className?: string; - readonly size?: 'default' | 'lg'; -}; +export function TryFreeButton({ className = '', size = 'lg' }: ComponentProps) { + const router = useRouter(); + const { isPending, mutateAsync: createTrialSubscription } = useCreateTrialSubscriptionMutation(); -export function TryFreeButton({ className = '', size = 'lg' }: TryFreeButtonProps) { - // eslint-disable-next-line unicorn/consistent-function-scoping - const handleTryFree = () => {}; + const handleTryFree = async () => { + await createTrialSubscription(); + router.refresh(); + }; return ( ); } diff --git a/apps/web/hooks/api/subscriptions.ts b/apps/web/hooks/api/subscriptions.ts index a17bd50..1bfd54d 100644 --- a/apps/web/hooks/api/subscriptions.ts +++ b/apps/web/hooks/api/subscriptions.ts @@ -4,6 +4,7 @@ import { createSubscription, createSubscriptionHistory, + createTrialSubscription, getSubscription, getSubscriptionHistory, getSubscriptionPrices, @@ -126,3 +127,22 @@ export const useSubscriptionHistoryCreate = () => { onSuccess: handleOnSuccess, }); }; + +export const useCreateTrialSubscriptionMutation = () => { + const { data: session } = useSession(); + const telegramId = session?.user?.telegramId; + const queryClient = useQueryClient(); + + const handleOnSuccess = () => { + if (!telegramId) return; + + queryClient.invalidateQueries({ + queryKey: ['subscription', telegramId], + }); + }; + + return useMutation({ + mutationFn: createTrialSubscription, + onSuccess: handleOnSuccess, + }); +}; diff --git a/packages/graphql/api/subscriptions.ts b/packages/graphql/api/subscriptions.ts index 1031a22..ded79d6 100644 --- a/packages/graphql/api/subscriptions.ts +++ b/packages/graphql/api/subscriptions.ts @@ -40,6 +40,59 @@ export class SubscriptionsService extends BaseService { return mutationResult.data; } + async createTrialSubscription() { + // Получаем пользователя и проверяем бан + const { customer } = await this.checkIsBanned(); + + // Получаем цены подписки для определения длительности пробного периода + const { subscriptionPrices } = await this.getSubscriptionPrices({ isActive: true }); + if (!subscriptionPrices) throw new Error('Subscription prices not found'); + + // Ищем пробный период + const trialPrice = subscriptionPrices.find( + (price) => price?.period === GQL.Enum_Subscriptionprice_Period.Trial, + ); + if (!trialPrice) throw new Error('Trial period not found'); + if (!trialPrice.isActive) throw new Error('Trial period is not active'); + + const trialPeriodDays = trialPrice?.days; + const now = dayjs(); + const expiresAt = now.add(trialPeriodDays, 'day'); + + // Создаем пробную подписку + const subscriptionData = await this.createSubscription({ + input: { + autoRenew: false, + customer: customer.documentId, + expiresAt: expiresAt.toISOString(), + isActive: true, + }, + }); + + if (!subscriptionData?.createSubscription) { + throw new Error('Failed to create trial subscription'); + } + + const subscription = subscriptionData.createSubscription; + + // Создаем запись в истории подписки + await this.createSubscriptionHistory({ + input: { + amount: 0, + currency: 'RUB', + description: `Пробный период на ${trialPeriodDays} дней`, + endDate: expiresAt.toISOString(), + period: GQL.Enum_Subscriptionhistory_Period.Trial, + source: GQL.Enum_Subscriptionhistory_Source.Promo, + startDate: now.toISOString(), + state: GQL.Enum_Subscriptionhistory_State.Success, + subscription: subscription.documentId, + }, + }); + + return subscriptionData; + } + async getSubscription(variables: VariablesOf) { await this.checkIsBanned(); diff --git a/packages/graphql/operations/subscriptions.graphql b/packages/graphql/operations/subscriptions.graphql index 97ab23a..2a90722 100644 --- a/packages/graphql/operations/subscriptions.graphql +++ b/packages/graphql/operations/subscriptions.graphql @@ -29,14 +29,12 @@ fragment SubscriptionSettingFields on SubscriptionSetting { maxOrdersPerMonth referralRewardDays referralBonusDays - description - trialPeriodDays - trialEnabled } fragment SubscriptionPriceFields on SubscriptionPrice { documentId period + days price currency isActive diff --git a/packages/graphql/types/operations.generated.ts b/packages/graphql/types/operations.generated.ts index 2591981..c250912 100644 --- a/packages/graphql/types/operations.generated.ts +++ b/packages/graphql/types/operations.generated.ts @@ -578,6 +578,7 @@ export type SubscriptionPriceFiltersInput = { and?: InputMaybe>>; createdAt?: InputMaybe; currency?: InputMaybe; + days?: InputMaybe; description?: InputMaybe; documentId?: InputMaybe; isActive?: InputMaybe; @@ -591,6 +592,7 @@ export type SubscriptionPriceFiltersInput = { export type SubscriptionPriceInput = { currency?: InputMaybe; + days?: InputMaybe; description?: InputMaybe; isActive?: InputMaybe; period?: InputMaybe; @@ -599,13 +601,10 @@ export type SubscriptionPriceInput = { }; export type SubscriptionSettingInput = { - description?: InputMaybe; maxOrdersPerMonth?: InputMaybe; publishedAt?: InputMaybe; referralBonusDays?: InputMaybe; referralRewardDays?: InputMaybe; - trialEnabled?: InputMaybe; - trialPeriodDays?: InputMaybe; }; export type TimeFilterInput = { @@ -907,9 +906,9 @@ export type SubscriptionFieldsFragment = { __typename?: 'Subscription', document export type SubscriptionHistoryFieldsFragment = { __typename?: 'SubscriptionHistory', documentId: string, period: Enum_Subscriptionhistory_Period, startDate: string, endDate: string, amount: number, currency?: string | null | undefined, state: Enum_Subscriptionhistory_State, paymentId?: string | null | undefined, source: Enum_Subscriptionhistory_Source, description?: string | null | undefined }; -export type SubscriptionSettingFieldsFragment = { __typename?: 'SubscriptionSetting', documentId: string, maxOrdersPerMonth: number, referralRewardDays: number, referralBonusDays: number, description?: string | null | undefined, trialPeriodDays: number, trialEnabled: boolean }; +export type SubscriptionSettingFieldsFragment = { __typename?: 'SubscriptionSetting', documentId: string, maxOrdersPerMonth: number, referralRewardDays: number, referralBonusDays: number }; -export type SubscriptionPriceFieldsFragment = { __typename?: 'SubscriptionPrice', documentId: string, period: Enum_Subscriptionprice_Period, price: number, currency?: string | null | undefined, isActive?: boolean | null | undefined, description?: string | null | undefined }; +export type SubscriptionPriceFieldsFragment = { __typename?: 'SubscriptionPrice', documentId: string, period: Enum_Subscriptionprice_Period, days: number, price: number, currency?: string | null | undefined, isActive?: boolean | null | undefined, description?: string | null | undefined }; export type GetSubscriptionQueryVariables = Exact<{ telegramId?: InputMaybe; @@ -921,14 +920,14 @@ export type GetSubscriptionQuery = { __typename?: 'Query', subscriptions: Array< export type GetSubscriptionSettingsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetSubscriptionSettingsQuery = { __typename?: 'Query', subscriptionSetting?: { __typename?: 'SubscriptionSetting', documentId: string, maxOrdersPerMonth: number, referralRewardDays: number, referralBonusDays: number, description?: string | null | undefined, trialPeriodDays: number, trialEnabled: boolean } | null | undefined }; +export type GetSubscriptionSettingsQuery = { __typename?: 'Query', subscriptionSetting?: { __typename?: 'SubscriptionSetting', documentId: string, maxOrdersPerMonth: number, referralRewardDays: number, referralBonusDays: number } | null | undefined }; export type GetSubscriptionPricesQueryVariables = Exact<{ isActive?: InputMaybe; }>; -export type GetSubscriptionPricesQuery = { __typename?: 'Query', subscriptionPrices: Array<{ __typename?: 'SubscriptionPrice', documentId: string, period: Enum_Subscriptionprice_Period, price: number, currency?: string | null | undefined, isActive?: boolean | null | undefined, description?: string | null | undefined } | null | undefined> }; +export type GetSubscriptionPricesQuery = { __typename?: 'Query', subscriptionPrices: Array<{ __typename?: 'SubscriptionPrice', documentId: string, period: Enum_Subscriptionprice_Period, days: number, price: number, currency?: string | null | undefined, isActive?: boolean | null | undefined, description?: string | null | undefined } | null | undefined> }; export type GetSubscriptionHistoryQueryVariables = Exact<{ subscriptionId: Scalars['ID']['input']; @@ -973,8 +972,8 @@ export const SlotFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":" export const OrderFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OrderFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Order"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_start"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_end"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"order_number"}},{"kind":"Field","name":{"kind":"Name","value":"services"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ServiceFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"client"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SlotFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"bannedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ServiceFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Service"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"duration"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SlotFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Slot"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_start"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_end"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]} as unknown as DocumentNode; export const SubscriptionHistoryFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionHistoryFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistory"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"paymentId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; export const SubscriptionFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Subscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"autoRenew"}},{"kind":"Field","name":{"kind":"Name","value":"customer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscriptionHistories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionHistoryFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"bannedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionHistoryFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistory"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"paymentId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; -export const SubscriptionSettingFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionSettingFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionSetting"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"maxOrdersPerMonth"}},{"kind":"Field","name":{"kind":"Name","value":"referralRewardDays"}},{"kind":"Field","name":{"kind":"Name","value":"referralBonusDays"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"trialPeriodDays"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnabled"}}]}}]} as unknown as DocumentNode; -export const SubscriptionPriceFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionPriceFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPrice"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; +export const SubscriptionSettingFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionSettingFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionSetting"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"maxOrdersPerMonth"}},{"kind":"Field","name":{"kind":"Name","value":"referralRewardDays"}},{"kind":"Field","name":{"kind":"Name","value":"referralBonusDays"}}]}}]} as unknown as DocumentNode; +export const SubscriptionPriceFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionPriceFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPrice"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"days"}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; export const RegisterDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Register"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"identifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"register"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"username"},"value":{"kind":"Variable","name":{"kind":"Name","value":"identifier"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jwt"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"username"}}]}}]}}]}}]} as unknown as DocumentNode; export const LoginDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Login"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"identifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"login"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"identifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"identifier"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jwt"}}]}}]}}]} as unknown as DocumentNode; export const CreateCustomerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCustomer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCustomer"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"role"},"value":{"kind":"EnumValue","value":"client"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode; @@ -997,8 +996,8 @@ export const GetSlotDocument = {"kind":"Document","definitions":[{"kind":"Operat export const UpdateSlotDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSlot"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SlotInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateSlot"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"documentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SlotFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"bannedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SlotFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Slot"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_start"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_end"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]} as unknown as DocumentNode; export const DeleteSlotDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteSlot"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteSlot"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"documentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode; export const GetSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"customer"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"bannedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionHistoryFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistory"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"paymentId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Subscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"autoRenew"}},{"kind":"Field","name":{"kind":"Name","value":"customer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscriptionHistories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionHistoryFields"}}]}}]}}]} as unknown as DocumentNode; -export const GetSubscriptionSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getSubscriptionSettings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionSetting"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionSettingFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionSettingFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionSetting"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"maxOrdersPerMonth"}},{"kind":"Field","name":{"kind":"Name","value":"referralRewardDays"}},{"kind":"Field","name":{"kind":"Name","value":"referralBonusDays"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"trialPeriodDays"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnabled"}}]}}]} as unknown as DocumentNode; -export const GetSubscriptionPricesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionPrices"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"isActive"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionPrices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"isActive"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"isActive"}}}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"StringValue","value":"price:asc","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionPriceFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionPriceFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPrice"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; +export const GetSubscriptionSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getSubscriptionSettings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionSetting"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionSettingFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionSettingFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionSetting"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"maxOrdersPerMonth"}},{"kind":"Field","name":{"kind":"Name","value":"referralRewardDays"}},{"kind":"Field","name":{"kind":"Name","value":"referralBonusDays"}}]}}]} as unknown as DocumentNode; +export const GetSubscriptionPricesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionPrices"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"isActive"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionPrices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"isActive"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"isActive"}}}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"StringValue","value":"price:asc","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionPriceFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionPriceFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPrice"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"days"}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; export const GetSubscriptionHistoryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionHistory"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"subscriptionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionHistories"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"subscription"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"documentId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"subscriptionId"}}}]}}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"StringValue","value":"startDate:desc","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionHistoryFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionHistoryFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistory"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"paymentId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; export const CreateSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSubscription"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"bannedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionHistoryFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistory"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"paymentId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Subscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"autoRenew"}},{"kind":"Field","name":{"kind":"Name","value":"customer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscriptionHistories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionHistoryFields"}}]}}]}}]} as unknown as DocumentNode; export const UpdateSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateSubscription"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"documentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"bannedUntil"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionHistoryFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistory"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"period"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"paymentId"}},{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Subscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"autoRenew"}},{"kind":"Field","name":{"kind":"Name","value":"customer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscriptionHistories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionHistoryFields"}}]}}]}}]} as unknown as DocumentNode;