From a6d05bcf69229c3400cdd2163cd6c9bb454be9c7 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 16 Sep 2025 18:37:35 +0300 Subject: [PATCH] feat(subscriptions): refactor subscription handling and update related queries - Renamed `hasUserTrialSubscription` to `usedTrialSubscription` for clarity in the SubscriptionsService. - Updated subscription-related queries and fragments to use `active` instead of `isActive` for consistency. - Enhanced the ProPage component to utilize the new subscription checks and improve trial usage logic. - Removed unused subscription history query to streamline the codebase. - Adjusted the SubscriptionInfoBar to reflect the new subscription state handling. --- .../bot/src/bot/conversations/subscription.ts | 4 +- apps/web/app/(main)/pro/page.tsx | 38 +-- .../components/profile/subscription-bar.tsx | 9 +- apps/web/hooks/api/subscriptions.ts | 11 - packages/graphql/api/base.ts | 2 + packages/graphql/api/orders.ts | 2 +- packages/graphql/api/subscriptions.ts | 224 ++++++++++-------- .../graphql/operations/subscriptions.graphql | 17 +- .../graphql/types/operations.generated.ts | 165 +++++-------- packages/utils/src/datetime-format.ts | 7 +- 10 files changed, 213 insertions(+), 266 deletions(-) diff --git a/apps/bot/src/bot/conversations/subscription.ts b/apps/bot/src/bot/conversations/subscription.ts index 97c5a00..58fd19c 100644 --- a/apps/bot/src/bot/conversations/subscription.ts +++ b/apps/bot/src/bot/conversations/subscription.ts @@ -18,11 +18,11 @@ export async function subscription(conversation: Conversation, const subscriptionsService = new SubscriptionsService({ telegramId }); - const hasUserTrial = await subscriptionsService.hasUserTrialSubscription(); + const hasUserTrial = await subscriptionsService.usedTrialSubscription(); const { subscriptionPrices } = await subscriptionsService.getSubscriptionPrices({ filters: { - isActive: { + active: { eq: true, }, period: { diff --git a/apps/web/app/(main)/pro/page.tsx b/apps/web/app/(main)/pro/page.tsx index ea65b30..3c63d52 100644 --- a/apps/web/app/(main)/pro/page.tsx +++ b/apps/web/app/(main)/pro/page.tsx @@ -4,25 +4,16 @@ import { PageHeader } from '@/components/navigation'; import { TryFreeButton } from '@/components/subscription'; import { env } from '@/config/env'; import { Button } from '@repo/ui/components/ui/button'; -import { ArrowRight, Crown, Infinity as InfinityIcon, Star, Users } from 'lucide-react'; +import { ArrowRight, Crown, Infinity as InfinityIcon } from 'lucide-react'; import Link from 'next/link'; export default async function ProPage() { const { telegramId } = await getSessionUser(); - const subscriptionData = await getSubscription({ telegramId }); + const { hasActiveSubscription, usedTrialSubscription } = await getSubscription({ + telegramId, + }); - // Простая логика для проверки статуса подписки - const subscription = subscriptionData?.subscription; - const isActive = - subscription?.isActive && - subscription?.expiresAt && - new Date() < new Date(subscription.expiresAt); - - // Проверка возможности использования пробного периода - const hasUsedTrial = subscription?.subscriptionHistories?.some( - (item) => item && item.period === 'trial' && item.state === 'success', - ); - const canUseTrial = !isActive && !hasUsedTrial; + const canUseTrial = !usedTrialSubscription; return (
@@ -47,10 +38,12 @@ export default async function ProPage() {

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

- {!isActive && ( + {!hasActiveSubscription && (
{canUseTrial && } @@ -86,23 +79,14 @@ export default async function ProPage() {

-
-
- -
-

- Ваш профиль доступен всем пользователям в поиске -

-
- -
+ {/*

Профиль и аватар выделяются цветом

-
+
*/}
diff --git a/apps/web/components/profile/subscription-bar.tsx b/apps/web/components/profile/subscription-bar.tsx index 9ca99d0..28c86a3 100644 --- a/apps/web/components/profile/subscription-bar.tsx +++ b/apps/web/components/profile/subscription-bar.tsx @@ -5,7 +5,6 @@ import { useCustomerQuery } from '@/hooks/api/customers'; import { useSubscriptionQuery } from '@/hooks/api/subscriptions'; import { Enum_Customer_Role } from '@repo/graphql/types'; import { cn } from '@repo/ui/lib/utils'; -import { getRemainingDays } from '@repo/utils/datetime-format'; import { ChevronRight } from 'lucide-react'; import Link from 'next/link'; @@ -14,10 +13,10 @@ export function SubscriptionInfoBar() { const { data: { customer } = {} } = useCustomerQuery(); - const isActive = data?.subscription?.isActive; + const isActive = data?.hasActiveSubscription; const remainingOrdersCount = data?.remainingOrdersCount; + const remainingDays = data?.remainingDays; const maxOrdersPerMonth = data?.maxOrdersPerMonth; - const expiresAt = data?.subscription?.expiresAt; if (customer?.role === Enum_Customer_Role.Client) return null; @@ -31,8 +30,8 @@ export function SubscriptionInfoBar() { description = `Доступно ${remainingOrdersCount} из ${maxOrdersPerMonth} записей в этом месяце`; } - if (isActive && expiresAt) { - description = `Осталось ${getRemainingDays(expiresAt)} дней`; + if (isActive) { + description = `Осталось ${remainingDays} дней`; } return ( diff --git a/apps/web/hooks/api/subscriptions.ts b/apps/web/hooks/api/subscriptions.ts index 3b49dc1..ae424d7 100644 --- a/apps/web/hooks/api/subscriptions.ts +++ b/apps/web/hooks/api/subscriptions.ts @@ -6,7 +6,6 @@ import { createSubscriptionHistory, createTrialSubscription, getSubscription, - getSubscriptionHistory, getSubscriptionPrices, getSubscriptionSettings, updateSubscription, @@ -43,16 +42,6 @@ export const useSubscriptionPricesQuery = ( }); }; -export const useSubscriptionHistoryQuery = ( - variables: Parameters[0], -) => { - return useQuery({ - enabled: Boolean(variables.subscriptionId), - queryFn: () => getSubscriptionHistory(variables), - queryKey: ['subscriptionHistory', variables.subscriptionId], - }); -}; - export const useSubscriptionMutation = () => { const { data: session } = useSession(); const telegramId = session?.user?.telegramId; diff --git a/packages/graphql/api/base.ts b/packages/graphql/api/base.ts index ec6d75e..c35cb83 100644 --- a/packages/graphql/api/base.ts +++ b/packages/graphql/api/base.ts @@ -53,6 +53,8 @@ export class BaseService { const customer = result.data.customers.at(0); + if (!customer) throw new Error(ERRORS.NOT_FOUND_CUSTOMER); + if (customer && isCustomerBanned(customer)) { throw new Error(SHARED_ERRORS.NO_PERMISSION); } diff --git a/packages/graphql/api/orders.ts b/packages/graphql/api/orders.ts index ef5fd7b..a3b70b9 100644 --- a/packages/graphql/api/orders.ts +++ b/packages/graphql/api/orders.ts @@ -74,7 +74,7 @@ export class OrdersService extends BaseService { const isMasterCreating = slot.master.documentId === customer?.documentId; // Если у мастера слота нет активной подписки и не осталось доступных заказов - if (!subscription?.isActive && remainingOrdersCount <= 0) { + if (!subscription?.active && remainingOrdersCount <= 0) { throw new Error( isMasterCreating ? ERRORS.ORDER_LIMIT_EXCEEDED_MASTER : ERRORS.ORDER_LIMIT_EXCEEDED_CLIENT, ); diff --git a/packages/graphql/api/subscriptions.ts b/packages/graphql/api/subscriptions.ts index 5a9230a..4ddf787 100644 --- a/packages/graphql/api/subscriptions.ts +++ b/packages/graphql/api/subscriptions.ts @@ -4,6 +4,11 @@ import { BaseService } from './base'; import { OrdersService } from './orders'; import { type VariablesOf } from '@graphql-typed-document-node/core'; import dayjs from 'dayjs'; +import minMax from 'dayjs/plugin/minMax'; + +if (!dayjs.prototype.minMax) { + dayjs.extend(minMax); +} export const ERRORS = { FAILED_TO_CREATE_TRIAL_SUBSCRIPTION: 'Не удалось создать пробную подписку', @@ -16,7 +21,6 @@ export const ERRORS = { export class SubscriptionsService extends BaseService { async createOrUpdateSubscription(payload: { period: GQL.Enum_Subscriptionprice_Period }) { - // ищем цену по выбранному периоду const { subscriptionPrices } = await this.getSubscriptionPrices({ filters: { period: { eq: payload.period } }, }); @@ -24,75 +28,50 @@ export class SubscriptionsService extends BaseService { const subscriptionPrice = subscriptionPrices[0]; if (!subscriptionPrice) throw new Error('Subscription price not found'); - // получаем текущую подписку const { subscription: existingSubscription } = await this.getSubscription({ telegramId: this._user.telegramId, }); - let expiresAt: string; + const newExpiresAt = dayjs + .max(dayjs(existingSubscription?.expiresAt), dayjs()) + .add(subscriptionPrice.days, 'day'); - if (existingSubscription?.expiresAt) { - // --- продлеваем подписку --- - expiresAt = dayjs(existingSubscription.expiresAt) - .add(subscriptionPrice.days, 'day') - .toISOString(); + const { customer } = await this.checkIsBanned(); - const result = await this.updateSubscription({ - data: { expiresAt }, - documentId: existingSubscription.documentId, - }); + const result = await this.createSubscription({ + data: { + active: true, + customer: customer.documentId, + expiresAt: newExpiresAt.toISOString(), + }, + }); - // создаём запись в истории - await this.createSubscriptionHistory({ + // Добавляем в последнюю подписку ссылку на новую только что созданную + if (result?.createSubscription && existingSubscription) + await this.updateSubscription({ data: { - amount: subscriptionPrice.amount, - currency: 'RUB', - description: subscriptionPrice.description ?? 'Продление подписки', - endDate: expiresAt, - period: subscriptionPrice.period, - source: GQL.Enum_Subscriptionhistory_Source.Renewal, - startDate: existingSubscription.expiresAt, - state: GQL.Enum_Subscriptionhistory_State.Success, - subscription: result?.updateSubscription?.documentId, - }, - }); - } else { - // --- создаём новую подписку --- - const { customer } = await this.checkIsBanned(); - if (!customer?.documentId) throw new Error('Customer not found'); - - const expiresAtNew = dayjs().add(subscriptionPrice.days, 'day').toISOString(); - - const result = await this.createSubscription({ - data: { - autoRenew: true, - customer: customer.documentId, - expiresAt: expiresAtNew, - isActive: true, + active: true, + nextSubscription: result.createSubscription.documentId, }, + documentId: existingSubscription?.documentId, }); - expiresAt = result?.createSubscription?.expiresAt ?? expiresAtNew; - - // создаём запись в истории - await this.createSubscriptionHistory({ - data: { - amount: subscriptionPrice.amount, - currency: 'RUB', - description: subscriptionPrice.description ?? 'Новая подписка', - endDate: expiresAt, - period: subscriptionPrice.period, - source: GQL.Enum_Subscriptionhistory_Source.Payment, - startDate: dayjs().toISOString(), - state: GQL.Enum_Subscriptionhistory_State.Success, - subscription: result?.createSubscription?.documentId, - }, - }); - } + await this.createSubscriptionHistory({ + data: { + amount: subscriptionPrice.amount, + currency: 'RUB', + description: existingSubscription ? 'Продление подписки' : 'Новая подписка', + period: subscriptionPrice.period, + source: GQL.Enum_Subscriptionhistory_Source.Payment, + state: GQL.Enum_Subscriptionhistory_State.Success, + subscription: result?.createSubscription?.documentId, + subscription_price: subscriptionPrice.documentId, + }, + }); return { - expiresAt, - formattedDate: dayjs(expiresAt).toDate().toLocaleDateString('ru-RU', { + expiresAt: newExpiresAt.toDate(), + formattedDate: newExpiresAt.toDate().toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: 'numeric', @@ -139,13 +118,13 @@ export class SubscriptionsService extends BaseService { const { customer } = await this.checkIsBanned(); // Проверяем, не использовал ли пользователь уже пробный период - const hasUserTrial = await this.hasUserTrialSubscription(); + const hasUserTrial = await this.usedTrialSubscription(); if (hasUserTrial) throw new Error(ERRORS.TRIAL_PERIOD_ALREADY_USED); // Получаем цены подписки для определения длительности пробного периода const { subscriptionPrices } = await this.getSubscriptionPrices({ filters: { - isActive: { + active: { eq: true, }, }, @@ -157,7 +136,7 @@ export class SubscriptionsService extends BaseService { (price) => price?.period === GQL.Enum_Subscriptionprice_Period.Trial, ); if (!trialPrice) throw new Error(ERRORS.TRIAL_PERIOD_NOT_FOUND); - if (!trialPrice.isActive) throw new Error(ERRORS.TRIAL_PERIOD_NOT_ACTIVE); + if (!trialPrice.active) throw new Error(ERRORS.TRIAL_PERIOD_NOT_ACTIVE); const trialPeriodDays = trialPrice?.days; const now = dayjs(); @@ -166,10 +145,9 @@ export class SubscriptionsService extends BaseService { // Создаем пробную подписку const subscriptionData = await this.createSubscription({ data: { - autoRenew: false, + active: true, customer: customer?.documentId, expiresAt: expiresAt.toISOString(), - isActive: true, }, }); @@ -185,10 +163,8 @@ export class SubscriptionsService extends BaseService { amount: 0, currency: 'RUB', description: `Пробный период на ${trialPeriodDays} дней`, - endDate: expiresAt.toISOString(), - period: GQL.Enum_Subscriptionhistory_Period.Trial, + period: trialPrice.period, source: GQL.Enum_Subscriptionhistory_Source.Trial, - startDate: now.toISOString(), state: GQL.Enum_Subscriptionhistory_State.Success, subscription: subscription.documentId, }, @@ -197,32 +173,41 @@ export class SubscriptionsService extends BaseService { return subscriptionData; } - async getSubscription(variables: VariablesOf) { + async getSubscription({ + telegramId, + }: Pick, 'telegramId'>) { await this.checkIsBanned(); - const { query } = await getClientWithToken(); - - const result = await query({ - query: GQL.GetSubscriptionDocument, - variables, + const data = await this.getSubscriptions({ + filters: { + active: { + eq: true, + }, + customer: { + telegramId: { eq: telegramId }, + }, + }, }); - const subscription = result.data.subscriptions.at(0); - - const hasActiveSubscription = Boolean( - subscription?.isActive && - subscription?.expiresAt && - new Date() < new Date(subscription.expiresAt), - ); + const subscription = data.subscriptions.find((x) => !x?.nextSubscription?.documentId); + const remainingDays = subscription ? this.getRemainingDays(subscription) : 0; + const hasActiveSubscription = subscription?.active && remainingDays > 0; const { maxOrdersPerMonth, remainingOrdersCount } = await this.getRemainingOrdersCount(); - return { hasActiveSubscription, maxOrdersPerMonth, remainingOrdersCount, subscription }; + const usedTrialSubscription = await this.usedTrialSubscription(); + + return { + hasActiveSubscription, + maxOrdersPerMonth, + remainingDays, + remainingOrdersCount, + subscription, + usedTrialSubscription, + }; } async getSubscriptionHistory(variables: VariablesOf) { - await this.checkIsBanned(); - const { query } = await getClientWithToken(); const result = await query({ @@ -248,6 +233,19 @@ export class SubscriptionsService extends BaseService { return result.data; } + async getSubscriptions(variables?: VariablesOf) { + await this.checkIsBanned(); + + const { query } = await getClientWithToken(); + + const result = await query({ + query: GQL.GetSubscriptionsDocument, + variables, + }); + + return result.data; + } + async getSubscriptionSettings() { await this.checkIsBanned(); @@ -260,27 +258,6 @@ export class SubscriptionsService extends BaseService { return result.data; } - async hasUserTrialSubscription() { - const { customer } = await this.checkIsBanned(); - - const { subscription: existingSubscription } = await this.getSubscription({ - telegramId: customer?.telegramId, - }); - - if (!existingSubscription) return false; - - const { subscriptionHistories } = await this.getSubscriptionHistory({ - filters: { - period: { eq: GQL.Enum_Subscriptionhistory_Period.Trial }, - subscription: { documentId: { eq: existingSubscription.documentId } }, - }, - }); - - return subscriptionHistories?.some( - (history) => history?.state === GQL.Enum_Subscriptionhistory_State.Success, - ); - } - async updateSubscription(variables: VariablesOf) { await this.checkIsBanned(); @@ -315,6 +292,49 @@ export class SubscriptionsService extends BaseService { return mutationResult.data; } + async usedTrialSubscription() { + const { customer } = await this._getUser(); + + const { subscriptionHistories } = await this.getSubscriptionHistory({ + filters: { + or: [ + { + source: { + eq: GQL.Enum_Subscriptionhistory_Source.Trial, + }, + }, + { + period: { + eq: GQL.Enum_Subscriptionprice_Period.Trial, + }, + }, + ], + + subscription: { + customer: { + documentId: { + eq: customer?.documentId, + }, + }, + }, + }, + }); + + return subscriptionHistories?.some( + (history) => history?.state === GQL.Enum_Subscriptionhistory_State.Success, + ); + } + + private getRemainingDays(subscription: GQL.SubscriptionFieldsFragment) { + if (!subscription) return 0; + + const remainingDays = dayjs(subscription?.expiresAt).diff(dayjs(), 'day', true); + + if (remainingDays <= 0) return 0; + + return Math.ceil(remainingDays); + } + private async getRemainingOrdersCount() { const ordersService = new OrdersService(this._user); diff --git a/packages/graphql/operations/subscriptions.graphql b/packages/graphql/operations/subscriptions.graphql index aa2bb8a..ab3dc64 100644 --- a/packages/graphql/operations/subscriptions.graphql +++ b/packages/graphql/operations/subscriptions.graphql @@ -1,21 +1,24 @@ fragment SubscriptionFields on Subscription { documentId - isActive + active expiresAt - autoRenew + nextSubscription { + documentId + } } fragment SubscriptionHistoryFields on SubscriptionHistory { documentId period - startDate - endDate amount currency state paymentId source description + subscription { + ...SubscriptionFields + } } fragment SubscriptionSettingFields on SubscriptionSetting { @@ -30,7 +33,7 @@ fragment SubscriptionPriceFields on SubscriptionPrice { days amount currency - isActive + active description } @@ -48,8 +51,8 @@ fragment SubscriptionRewardFields on SubscriptionReward { } } -query GetSubscription($telegramId: Long) { - subscriptions(filters: { customer: { telegramId: { eq: $telegramId } } }) { +query GetSubscriptions($filters: SubscriptionFiltersInput) { + subscriptions(filters: $filters) { ...SubscriptionFields } } diff --git a/packages/graphql/types/operations.generated.ts b/packages/graphql/types/operations.generated.ts index 548be12..6f5a2cc 100644 --- a/packages/graphql/types/operations.generated.ts +++ b/packages/graphql/types/operations.generated.ts @@ -19,36 +19,6 @@ export type Scalars = { Time: { input: string; output: string; } }; -export type BlockFiltersInput = { - and?: InputMaybe>>; - client?: InputMaybe; - createdAt?: InputMaybe; - datetime_end?: InputMaybe; - datetime_start?: InputMaybe; - documentId?: InputMaybe; - master?: InputMaybe; - not?: InputMaybe; - or?: InputMaybe>>; - orders?: InputMaybe; - publishedAt?: InputMaybe; - sessions_completed?: InputMaybe; - sessions_total?: InputMaybe; - state?: InputMaybe; - updatedAt?: InputMaybe; -}; - -export type BlockInput = { - client?: InputMaybe; - datetime_end?: InputMaybe; - datetime_start?: InputMaybe; - master?: InputMaybe; - orders?: InputMaybe>>; - publishedAt?: InputMaybe; - sessions_completed?: InputMaybe; - sessions_total?: InputMaybe; - state?: InputMaybe; -}; - export type BooleanFilterInput = { and?: InputMaybe>>; between?: InputMaybe>>; @@ -78,8 +48,8 @@ export type CustomerFiltersInput = { active?: InputMaybe; and?: InputMaybe>>; bannedUntil?: InputMaybe; - blocks?: InputMaybe; createdAt?: InputMaybe; + customer_setting?: InputMaybe; documentId?: InputMaybe; invited?: InputMaybe; invitedBy?: InputMaybe; @@ -93,8 +63,8 @@ export type CustomerFiltersInput = { role?: InputMaybe; services?: InputMaybe; slots?: InputMaybe; - subscription?: InputMaybe; subscription_rewards?: InputMaybe; + subscriptions?: InputMaybe; telegramId?: InputMaybe; updatedAt?: InputMaybe; }; @@ -102,7 +72,7 @@ export type CustomerFiltersInput = { export type CustomerInput = { active?: InputMaybe; bannedUntil?: InputMaybe; - blocks?: InputMaybe>>; + customer_setting?: InputMaybe; invited?: InputMaybe>>; invitedBy?: InputMaybe>>; name?: InputMaybe; @@ -113,11 +83,29 @@ export type CustomerInput = { role?: InputMaybe; services?: InputMaybe>>; slots?: InputMaybe>>; - subscription?: InputMaybe; subscription_rewards?: InputMaybe>>; + subscriptions?: InputMaybe>>; telegramId?: InputMaybe; }; +export type CustomerSettingFiltersInput = { + and?: InputMaybe>>; + autoRenewSubscription?: InputMaybe; + createdAt?: InputMaybe; + customer?: InputMaybe; + documentId?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>>; + publishedAt?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type CustomerSettingInput = { + autoRenewSubscription?: InputMaybe; + customer?: InputMaybe; + publishedAt?: InputMaybe; +}; + export type DateTimeFilterInput = { and?: InputMaybe>>; between?: InputMaybe>>; @@ -143,12 +131,6 @@ export type DateTimeFilterInput = { startsWith?: InputMaybe; }; -export enum Enum_Block_State { - Created = 'created', - Deleted = 'deleted', - Paid = 'paid' -} - export enum Enum_Customer_Role { Client = 'client', Master = 'master' @@ -169,17 +151,10 @@ export enum Enum_Slot_State { Reserved = 'reserved' } -export enum Enum_Subscriptionhistory_Period { - HalfYear = 'half_year', - Month = 'month', - Trial = 'trial', - Week = 'week', - Year = 'year' -} - export enum Enum_Subscriptionhistory_Source { Admin = 'admin', Payment = 'payment', + Renewal = 'renewal', Reward = 'reward', Trial = 'trial' } @@ -343,7 +318,6 @@ export type LongFilterInput = { export type OrderFiltersInput = { and?: InputMaybe>>; - block?: InputMaybe; client?: InputMaybe; createdAt?: InputMaybe; datetime_end?: InputMaybe; @@ -360,7 +334,6 @@ export type OrderFiltersInput = { }; export type OrderInput = { - block?: InputMaybe; client?: InputMaybe; datetime_end?: InputMaybe; datetime_start?: InputMaybe; @@ -453,22 +426,6 @@ export type ServiceInput = { publishedAt?: InputMaybe; }; -export type SettingFiltersInput = { - and?: InputMaybe>>; - createdAt?: InputMaybe; - documentId?: InputMaybe; - not?: InputMaybe; - or?: InputMaybe>>; - publishedAt?: InputMaybe; - recording_by_blocks?: InputMaybe; - updatedAt?: InputMaybe; -}; - -export type SettingInput = { - publishedAt?: InputMaybe; - recording_by_blocks?: InputMaybe; -}; - export type SlotFiltersInput = { and?: InputMaybe>>; createdAt?: InputMaybe; @@ -519,17 +476,18 @@ export type StringFilterInput = { }; export type SubscriptionFiltersInput = { + active?: InputMaybe; and?: InputMaybe>>; - autoRenew?: InputMaybe; createdAt?: InputMaybe; customer?: InputMaybe; documentId?: InputMaybe; expiresAt?: InputMaybe; - isActive?: InputMaybe; + nextSubscription?: InputMaybe; not?: InputMaybe; or?: InputMaybe>>; publishedAt?: InputMaybe; - subscriptionHistories?: InputMaybe; + subscription_history?: InputMaybe; + subscription_rewards?: InputMaybe; updatedAt?: InputMaybe; }; @@ -540,17 +498,15 @@ export type SubscriptionHistoryFiltersInput = { currency?: InputMaybe; description?: InputMaybe; documentId?: InputMaybe; - endDate?: InputMaybe; not?: InputMaybe; or?: InputMaybe>>; paymentId?: InputMaybe; period?: InputMaybe; publishedAt?: InputMaybe; source?: InputMaybe; - startDate?: InputMaybe; state?: InputMaybe; subscription?: InputMaybe; - subscription_rewards?: InputMaybe; + subscription_price?: InputMaybe; updatedAt?: InputMaybe; }; @@ -558,27 +514,27 @@ export type SubscriptionHistoryInput = { amount?: InputMaybe; currency?: InputMaybe; description?: InputMaybe; - endDate?: InputMaybe; paymentId?: InputMaybe; - period?: InputMaybe; + period?: InputMaybe; publishedAt?: InputMaybe; source?: InputMaybe; - startDate?: InputMaybe; state?: InputMaybe; subscription?: InputMaybe; - subscription_rewards?: InputMaybe>>; + subscription_price?: InputMaybe; }; export type SubscriptionInput = { - autoRenew?: InputMaybe; + active?: InputMaybe; customer?: InputMaybe; expiresAt?: InputMaybe; - isActive?: InputMaybe; + nextSubscription?: InputMaybe; publishedAt?: InputMaybe; - subscriptionHistories?: InputMaybe>>; + subscription_history?: InputMaybe; + subscription_rewards?: InputMaybe>>; }; export type SubscriptionPriceFiltersInput = { + active?: InputMaybe; amount?: InputMaybe; and?: InputMaybe>>; createdAt?: InputMaybe; @@ -586,7 +542,6 @@ export type SubscriptionPriceFiltersInput = { days?: InputMaybe; description?: InputMaybe; documentId?: InputMaybe; - isActive?: InputMaybe; not?: InputMaybe; or?: InputMaybe>>; period?: InputMaybe; @@ -595,11 +550,11 @@ export type SubscriptionPriceFiltersInput = { }; export type SubscriptionPriceInput = { + active?: InputMaybe; amount?: InputMaybe; currency?: InputMaybe; days?: InputMaybe; description?: InputMaybe; - isActive?: InputMaybe; period?: InputMaybe; publishedAt?: InputMaybe; }; @@ -617,7 +572,7 @@ export type SubscriptionRewardFiltersInput = { or?: InputMaybe>>; owner?: InputMaybe; publishedAt?: InputMaybe; - subscription_history?: InputMaybe; + subscription?: InputMaybe; updatedAt?: InputMaybe; }; @@ -629,7 +584,7 @@ export type SubscriptionRewardInput = { invited?: InputMaybe; owner?: InputMaybe; publishedAt?: InputMaybe; - subscription_history?: InputMaybe; + subscription?: InputMaybe; }; export type SubscriptionSettingInput = { @@ -942,22 +897,22 @@ export type DeleteSlotMutationVariables = Exact<{ export type DeleteSlotMutation = { __typename?: 'Mutation', deleteSlot?: { __typename?: 'DeleteMutationResponse', documentId: string } | null | undefined }; -export type SubscriptionFieldsFragment = { __typename?: 'Subscription', documentId: string, isActive: boolean, expiresAt: string, autoRenew: boolean }; +export type SubscriptionFieldsFragment = { __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined }; -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 SubscriptionHistoryFieldsFragment = { __typename?: 'SubscriptionHistory', documentId: string, period?: string | null | undefined, amount: number, currency?: string | null | undefined, state: Enum_Subscriptionhistory_State, paymentId?: string | null | undefined, source: Enum_Subscriptionhistory_Source, description?: string | null | undefined, subscription?: { __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined } | null | undefined }; export type SubscriptionSettingFieldsFragment = { __typename?: 'SubscriptionSetting', documentId: string, maxOrdersPerMonth: number, referralRewardDays: number }; -export type SubscriptionPriceFieldsFragment = { __typename?: 'SubscriptionPrice', documentId: string, period: Enum_Subscriptionprice_Period, days: number, amount: 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, amount: number, currency?: string | null | undefined, active?: boolean | null | undefined, description?: string | null | undefined }; export type SubscriptionRewardFieldsFragment = { __typename?: 'SubscriptionReward', documentId: string, days: number, expiresAt: string, activated?: boolean | null | undefined, description?: string | null | undefined, owner?: { __typename?: 'Customer', active?: boolean | null | undefined, bannedUntil?: string | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name: string } | null | undefined> } | null | undefined, invited?: { __typename?: 'Customer', active?: boolean | null | undefined, bannedUntil?: string | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name: string } | null | undefined> } | null | undefined }; -export type GetSubscriptionQueryVariables = Exact<{ - telegramId?: InputMaybe; +export type GetSubscriptionsQueryVariables = Exact<{ + filters?: InputMaybe; }>; -export type GetSubscriptionQuery = { __typename?: 'Query', subscriptions: Array<{ __typename?: 'Subscription', documentId: string, isActive: boolean, expiresAt: string, autoRenew: boolean } | null | undefined> }; +export type GetSubscriptionsQuery = { __typename?: 'Query', subscriptions: Array<{ __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined } | null | undefined> }; export type GetSubscriptionSettingsQueryVariables = Exact<{ [key: string]: never; }>; @@ -969,21 +924,21 @@ export type GetSubscriptionPricesQueryVariables = Exact<{ }>; -export type GetSubscriptionPricesQuery = { __typename?: 'Query', subscriptionPrices: Array<{ __typename?: 'SubscriptionPrice', documentId: string, period: Enum_Subscriptionprice_Period, days: number, amount: 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, amount: number, currency?: string | null | undefined, active?: boolean | null | undefined, description?: string | null | undefined } | null | undefined> }; export type GetSubscriptionHistoryQueryVariables = Exact<{ filters?: InputMaybe; }>; -export type GetSubscriptionHistoryQuery = { __typename?: 'Query', subscriptionHistories: Array<{ __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 } | null | undefined> }; +export type GetSubscriptionHistoryQuery = { __typename?: 'Query', subscriptionHistories: Array<{ __typename?: 'SubscriptionHistory', documentId: string, period?: string | null | undefined, amount: number, currency?: string | null | undefined, state: Enum_Subscriptionhistory_State, paymentId?: string | null | undefined, source: Enum_Subscriptionhistory_Source, description?: string | null | undefined, subscription?: { __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined } | null | undefined } | null | undefined> }; export type CreateSubscriptionMutationVariables = Exact<{ data: SubscriptionInput; }>; -export type CreateSubscriptionMutation = { __typename?: 'Mutation', createSubscription?: { __typename?: 'Subscription', documentId: string, isActive: boolean, expiresAt: string, autoRenew: boolean } | null | undefined }; +export type CreateSubscriptionMutation = { __typename?: 'Mutation', createSubscription?: { __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined } | null | undefined }; export type UpdateSubscriptionMutationVariables = Exact<{ documentId: Scalars['ID']['input']; @@ -991,14 +946,14 @@ export type UpdateSubscriptionMutationVariables = Exact<{ }>; -export type UpdateSubscriptionMutation = { __typename?: 'Mutation', updateSubscription?: { __typename?: 'Subscription', documentId: string, isActive: boolean, expiresAt: string, autoRenew: boolean } | null | undefined }; +export type UpdateSubscriptionMutation = { __typename?: 'Mutation', updateSubscription?: { __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined } | null | undefined }; export type CreateSubscriptionHistoryMutationVariables = Exact<{ data: SubscriptionHistoryInput; }>; -export type CreateSubscriptionHistoryMutation = { __typename?: 'Mutation', createSubscriptionHistory?: { __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 } | null | undefined }; +export type CreateSubscriptionHistoryMutation = { __typename?: 'Mutation', createSubscriptionHistory?: { __typename?: 'SubscriptionHistory', documentId: string, period?: string | null | undefined, amount: number, currency?: string | null | undefined, state: Enum_Subscriptionhistory_State, paymentId?: string | null | undefined, source: Enum_Subscriptionhistory_Source, description?: string | null | undefined, subscription?: { __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined } | null | undefined } | null | undefined }; export type UpdateSubscriptionHistoryMutationVariables = Exact<{ documentId: Scalars['ID']['input']; @@ -1006,16 +961,16 @@ export type UpdateSubscriptionHistoryMutationVariables = Exact<{ }>; -export type UpdateSubscriptionHistoryMutation = { __typename?: 'Mutation', updateSubscriptionHistory?: { __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 } | null | undefined }; +export type UpdateSubscriptionHistoryMutation = { __typename?: 'Mutation', updateSubscriptionHistory?: { __typename?: 'SubscriptionHistory', documentId: string, period?: string | null | undefined, amount: number, currency?: string | null | undefined, state: Enum_Subscriptionhistory_State, paymentId?: string | null | undefined, source: Enum_Subscriptionhistory_Source, description?: string | null | undefined, subscription?: { __typename?: 'Subscription', documentId: string, active: boolean, expiresAt: string, nextSubscription?: { __typename?: 'Subscription', documentId: string } | null | undefined } | null | undefined } | null | undefined }; export const CustomerFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const ServiceFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"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":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const SlotFieldsFragmentDoc = {"kind":"Document","definitions":[{"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"}}]}}]}},{"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":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; 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":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"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 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"}}]}}]} 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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} 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":"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":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}},{"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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} 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"}}]}}]} 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":"amount"}},{"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 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":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]} as unknown as DocumentNode; export const SubscriptionRewardFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SubscriptionRewardFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionReward"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"days"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"activated"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"owner"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"invited"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"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":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} 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; @@ -1039,11 +994,11 @@ export const GetSlotsOrdersDocument = {"kind":"Document","definitions":[{"kind": export const GetSlotDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSlot"},"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":"slot"},"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":"orders"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"StringValue","value":"datetime_start:asc","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"OrderFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"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":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"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"}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode; 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":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"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":"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"}}]}}]} as unknown as DocumentNode; +export const GetSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}},{"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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} 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"}}]}}]} 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":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPriceFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionPrices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"StringValue","value":"amount: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":"amount"}},{"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":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistoryFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionHistories"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"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":"data"}},"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":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}},{"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"}}]}}]} 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":"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"}}]}}]} as unknown as DocumentNode; -export const CreateSubscriptionHistoryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSubscriptionHistory"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistoryInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSubscriptionHistory"},"arguments":[{"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":"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 UpdateSubscriptionHistoryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSubscriptionHistory"},"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":"SubscriptionHistoryInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateSubscriptionHistory"},"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":"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; \ No newline at end of file +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":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPriceFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionPrices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"sort"},"value":{"kind":"StringValue","value":"amount: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":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"active"}},{"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":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistoryFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionHistories"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionHistoryFields"}}]}}]}},{"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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}},{"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":"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":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}}]} 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":"data"}},"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":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}},{"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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} 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":"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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode; +export const CreateSubscriptionHistoryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSubscriptionHistory"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionHistoryInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSubscriptionHistory"},"arguments":[{"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":"SubscriptionHistoryFields"}}]}}]}},{"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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}},{"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":"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":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}}]} as unknown as DocumentNode; +export const UpdateSubscriptionHistoryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSubscriptionHistory"},"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":"SubscriptionHistoryInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateSubscriptionHistory"},"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":"SubscriptionHistoryFields"}}]}}]}},{"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":"active"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"nextSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}},{"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":"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":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SubscriptionFields"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/utils/src/datetime-format.ts b/packages/utils/src/datetime-format.ts index a75b2fa..b2c97a7 100644 --- a/packages/utils/src/datetime-format.ts +++ b/packages/utils/src/datetime-format.ts @@ -1,6 +1,5 @@ /* eslint-disable import/no-unassigned-import */ -import { type OpUnitType } from 'dayjs'; -import dayjs, { type ConfigType } from 'dayjs'; +import dayjs, { type ConfigType, type OpUnitType } from 'dayjs'; import timezone from 'dayjs/plugin/timezone'; import utc from 'dayjs/plugin/utc'; import 'dayjs/locale/ru'; @@ -85,10 +84,6 @@ export function getMinutes(time: string) { return Number.parseInt(hours, 10) * 60 + Number.parseInt(minutes, 10); } -export function getRemainingDays(date: DateTime) { - return dayjs(date).diff(dayjs(), 'day'); -} - export function getTimeZoneLabel(tz: string = DEFAULT_TZ): string { if (tz === DEFAULT_TZ) return 'МСК'; const offset = dayjs().tz(tz).format('Z');