From 6e04c4b273ebebb352b14aba06ea7487e6390fd0 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 12 Feb 2025 11:54:50 +0300 Subject: [PATCH] add orders list --- apps/web/actions/orders.ts | 4 + .../schedule/slot/[documentId]/page.tsx | 2 + .../schedule/components/slot-card.tsx | 6 +- .../schedule/components/time-pair.tsx | 13 ++-- .../web/components/schedule/datetime-card.tsx | 4 +- apps/web/components/schedule/orders-list.tsx | 75 +++++++++++++++++++ apps/web/components/schedule/slot-buttons.tsx | 4 +- apps/web/components/schedule/types/index.tsx | 8 +- apps/web/hooks/orders/index.ts | 18 +++++ packages/graphql/api/index.ts | 1 + packages/graphql/api/order.ts | 12 +++ packages/graphql/operations/order.graphql | 21 ++++++ .../graphql/types/operations.generated.ts | 35 ++++++++- 13 files changed, 185 insertions(+), 18 deletions(-) create mode 100644 apps/web/actions/orders.ts create mode 100644 apps/web/components/schedule/orders-list.tsx create mode 100644 apps/web/hooks/orders/index.ts create mode 100644 packages/graphql/api/order.ts create mode 100644 packages/graphql/operations/order.graphql diff --git a/apps/web/actions/orders.ts b/apps/web/actions/orders.ts new file mode 100644 index 0000000..f1891b0 --- /dev/null +++ b/apps/web/actions/orders.ts @@ -0,0 +1,4 @@ +'use server'; +import * as api from '@repo/graphql/api'; + +export const getOrder = api.getOrder; diff --git a/apps/web/app/(main)/profile/schedule/slot/[documentId]/page.tsx b/apps/web/app/(main)/profile/schedule/slot/[documentId]/page.tsx index f84c073..5fa6c33 100644 --- a/apps/web/app/(main)/profile/schedule/slot/[documentId]/page.tsx +++ b/apps/web/app/(main)/profile/schedule/slot/[documentId]/page.tsx @@ -2,6 +2,7 @@ import { getSlot } from '@/actions/slots'; import { Container } from '@/components/layout'; import { PageHeader } from '@/components/navigation'; import { DateTimeCard, SlotButtons } from '@/components/schedule'; +import { OrdersList } from '@/components/schedule/orders-list'; import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; type Props = { params: Promise<{ documentId: string }> }; @@ -24,6 +25,7 @@ export default async function ProfilePage(props: Readonly) { + ); } diff --git a/apps/web/components/schedule/components/slot-card.tsx b/apps/web/components/schedule/components/slot-card.tsx index 69afc9d..4ecff5c 100644 --- a/apps/web/components/schedule/components/slot-card.tsx +++ b/apps/web/components/schedule/components/slot-card.tsx @@ -1,7 +1,7 @@ /* eslint-disable canonical/id-match */ 'use client'; import { ContextProvider } from '../context'; -import { type SlotProps } from '../types'; +import { type SlotComponentProps } from '../types'; import { ReadonlyTimeRange } from './time-pair'; import { useSlotQuery } from '@/hooks/slots'; import { withContext } from '@/utils/context'; @@ -22,7 +22,9 @@ function getBadgeText(state: Enum_Slot_State) { return MAP_BADGE_TEXT[state]; } -export const SlotCard = withContext(ContextProvider)(function (props: Readonly) { +export const SlotCard = withContext(ContextProvider)(function ( + props: Readonly, +) { const { documentId } = props; const { data } = useSlotQuery({ documentId }); diff --git a/apps/web/components/schedule/components/time-pair.tsx b/apps/web/components/schedule/components/time-pair.tsx index 954f6b1..234a1bd 100644 --- a/apps/web/components/schedule/components/time-pair.tsx +++ b/apps/web/components/schedule/components/time-pair.tsx @@ -1,6 +1,5 @@ 'use client'; import { Context, type ContextType } from '../context'; -import { type Slot } from '../types'; import { useSlotAdd } from '@/hooks/slots'; import { formatTime } from '@/utils/date'; import { Input } from '@repo/ui/components/ui/input'; @@ -11,6 +10,12 @@ type TimePairProps = Pick & { readonly className?: string }) { +export function ReadonlyTimeRange({ className, time_end, time_start }: Readonly) { return (
{formatTime(time_start).user()} diff --git a/apps/web/components/schedule/datetime-card.tsx b/apps/web/components/schedule/datetime-card.tsx index 2b6a2f6..5c43ffd 100644 --- a/apps/web/components/schedule/datetime-card.tsx +++ b/apps/web/components/schedule/datetime-card.tsx @@ -1,9 +1,9 @@ 'use client'; -import { type SlotProps } from './types'; +import { type SlotComponentProps } from './types'; import { useSlotQuery } from '@/hooks/slots'; import { formatDate, formatTime } from '@/utils/date'; -export function DateTimeCard({ documentId }: Readonly) { +export function DateTimeCard({ documentId }: Readonly) { const { data } = useSlotQuery({ documentId }); if (!data?.slot) return null; diff --git a/apps/web/components/schedule/orders-list.tsx b/apps/web/components/schedule/orders-list.tsx new file mode 100644 index 0000000..ed0f044 --- /dev/null +++ b/apps/web/components/schedule/orders-list.tsx @@ -0,0 +1,75 @@ +/* eslint-disable canonical/id-match */ +'use client'; +import { ReadonlyTimeRange } from './components/time-pair'; +import { type OrderComponentProps, type SlotComponentProps } from './types'; +import { useOrderQuery } from '@/hooks/orders'; +import { useSlotQuery } from '@/hooks/slots'; +import { Enum_Order_State } from '@repo/graphql/types'; +import { Badge } from '@repo/ui/components/ui/badge'; +import { cn } from '@repo/ui/lib/utils'; +import Link from 'next/link'; + +const MAP_BADGE_TEXT: Record = { + approved: 'Подтверждено', + cancelled: 'Отменено', + completed: 'Завершено', + created: 'Создано', + scheduled: 'Запланировано', +}; + +export function OrdersList({ + className, + documentId, +}: Readonly & { readonly className?: string }) { + const { data } = useSlotQuery({ documentId }); + + return ( +
+

Записи

+ {data?.slot?.orders.map((order) => { + return order && ; + })} +
+ ); +} + +function getBadgeText(state: Enum_Order_State) { + if (!state) return ''; + + return MAP_BADGE_TEXT[state]; +} + +function Order({ documentId }: Readonly) { + const { data } = useOrderQuery({ documentId }); + + if (!data?.data.order) return null; + + const isCompleted = data?.data.order?.state === Enum_Order_State.Completed; + const isCancelled = data?.data.order?.state === Enum_Order_State.Cancelled; + + return ( + +
+
+ + {data?.data.order?.client?.name} +
+ {data?.data.order?.state && ( + + {getBadgeText(data?.data.order?.state)} + + )} +
+ + ); +} diff --git a/apps/web/components/schedule/slot-buttons.tsx b/apps/web/components/schedule/slot-buttons.tsx index 8a6f08b..241fb17 100644 --- a/apps/web/components/schedule/slot-buttons.tsx +++ b/apps/web/components/schedule/slot-buttons.tsx @@ -1,13 +1,13 @@ /* eslint-disable react/jsx-no-bind */ /* eslint-disable canonical/id-match */ 'use client'; -import { type SlotProps } from './types'; +import { type SlotComponentProps } from './types'; import { useSlotDelete, useSlotMutation, useSlotQuery } from '@/hooks/slots'; import { Enum_Slot_State } from '@repo/graphql/types'; import { Button } from '@repo/ui/components/ui/button'; import { useRouter } from 'next/navigation'; -export function SlotButtons({ documentId }: Readonly) { +export function SlotButtons({ documentId }: Readonly) { const { data } = useSlotQuery({ documentId }); const isOpened = data?.slot?.state === Enum_Slot_State.Open; diff --git a/apps/web/components/schedule/types/index.tsx b/apps/web/components/schedule/types/index.tsx index 3c19d55..b66c635 100644 --- a/apps/web/components/schedule/types/index.tsx +++ b/apps/web/components/schedule/types/index.tsx @@ -1,5 +1,5 @@ -'use client'; -import { type GetSlotQuery, type SlotFieldsFragment } from '@repo/graphql/types'; +import type * as GQL from '@repo/graphql/types'; -export type Slot = NonNullable; -export type SlotProps = Pick; +export type OrderComponentProps = Pick; +export type Slot = NonNullable; +export type SlotComponentProps = Pick; diff --git a/apps/web/hooks/orders/index.ts b/apps/web/hooks/orders/index.ts new file mode 100644 index 0000000..15bdfe8 --- /dev/null +++ b/apps/web/hooks/orders/index.ts @@ -0,0 +1,18 @@ +'use client'; +import { getOrder } from '@/actions/orders'; +// eslint-disable-next-line sonarjs/no-internal-api-use +import type * as ApolloTypes from '@repo/graphql/node_modules/@apollo/client/core'; +import { useQuery } from '@tanstack/react-query'; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +type FixTypescriptCringe = ApolloTypes.FetchResult; + +type Props = { + documentId: string; +}; + +export const useOrderQuery = ({ documentId }: Props) => + useQuery({ + queryFn: () => getOrder({ documentId }), + queryKey: ['orders', 'get', documentId], + }); diff --git a/packages/graphql/api/index.ts b/packages/graphql/api/index.ts index 82e7be9..746f8f1 100644 --- a/packages/graphql/api/index.ts +++ b/packages/graphql/api/index.ts @@ -1,3 +1,4 @@ export * from './auth'; export * from './customer'; export * from './slot'; +export * from './order'; diff --git a/packages/graphql/api/order.ts b/packages/graphql/api/order.ts new file mode 100644 index 0000000..2ad81d7 --- /dev/null +++ b/packages/graphql/api/order.ts @@ -0,0 +1,12 @@ +'use server'; +import { getClientWithToken } from '../apollo/client'; +import * as GQL from '../types'; + +export async function getOrder(input: GQL.GetOrderQueryVariables) { + const { query } = await getClientWithToken(); + + return query({ + query: GQL.GetOrderDocument, + variables: input, + }); +} diff --git a/packages/graphql/operations/order.graphql b/packages/graphql/operations/order.graphql new file mode 100644 index 0000000..4555c77 --- /dev/null +++ b/packages/graphql/operations/order.graphql @@ -0,0 +1,21 @@ +fragment OrderFields on Order { + documentId + time_start + time_end + state + order_number + services { + documentId + name + } + client { + name + documentId + } +} + +query GetOrder($documentId: ID!) { + order(documentId: $documentId) { + ...OrderFields + } +} diff --git a/packages/graphql/types/operations.generated.ts b/packages/graphql/types/operations.generated.ts index c3cf19a..76ab372 100644 --- a/packages/graphql/types/operations.generated.ts +++ b/packages/graphql/types/operations.generated.ts @@ -340,7 +340,8 @@ export type OrderFiltersInput = { order_number?: InputMaybe; price?: InputMaybe; publishedAt?: InputMaybe; - service?: InputMaybe; + service_description?: InputMaybe; + services?: InputMaybe; slot?: InputMaybe; state?: InputMaybe; time_end?: InputMaybe; @@ -354,7 +355,8 @@ export type OrderInput = { order_number?: InputMaybe; price?: InputMaybe; publishedAt?: InputMaybe; - service?: InputMaybe; + service_description?: InputMaybe; + services?: InputMaybe>>; slot?: InputMaybe; state?: InputMaybe; time_end?: InputMaybe; @@ -415,6 +417,24 @@ export type ReviewWorkflowsWorkflowStageInput = { workflow?: InputMaybe; }; +export type ServiceFiltersInput = { + and?: InputMaybe>>; + createdAt?: InputMaybe; + documentId?: InputMaybe; + name?: InputMaybe; + not?: InputMaybe; + or?: InputMaybe>>; + orders?: InputMaybe; + publishedAt?: InputMaybe; + updatedAt?: InputMaybe; +}; + +export type ServiceInput = { + name?: InputMaybe; + orders?: InputMaybe>>; + publishedAt?: InputMaybe; +}; + export type SettingFiltersInput = { and?: InputMaybe>>; createdAt?: InputMaybe; @@ -666,6 +686,15 @@ export type UpdateCustomerProfileMutationVariables = Exact<{ export type UpdateCustomerProfileMutation = { __typename?: 'Mutation', updateCustomer?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: any | null | undefined } | null | undefined }; +export type OrderFieldsFragment = { __typename?: 'Order', documentId: string, time_start?: any | null | undefined, time_end?: any | null | undefined, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined } | null | undefined>, client?: { __typename?: 'Customer', name: string, documentId: string } | null | undefined }; + +export type GetOrderQueryVariables = Exact<{ + documentId: Scalars['ID']['input']; +}>; + + +export type GetOrderQuery = { __typename?: 'Query', order?: { __typename?: 'Order', documentId: string, time_start?: any | null | undefined, time_end?: any | null | undefined, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined } | null | undefined>, client?: { __typename?: 'Customer', name: string, documentId: string } | null | undefined } | null | undefined }; + export type SlotFieldsFragment = { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: any, time_end: any, state?: Enum_Slot_State | null | undefined }; export type CreateSlotMutationVariables = Exact<{ @@ -705,6 +734,7 @@ export type DeleteSlotMutationVariables = Exact<{ export type DeleteSlotMutation = { __typename?: 'Mutation', deleteSlot?: { __typename?: 'DeleteMutationResponse', documentId: string } | 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":"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"}}]}}]} 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":"time_start"}},{"kind":"Field","name":{"kind":"Name","value":"time_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":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"client"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} 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":"date"}},{"kind":"Field","name":{"kind":"Name","value":"time_start"}},{"kind":"Field","name":{"kind":"Name","value":"time_end"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} 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; @@ -713,6 +743,7 @@ export const GetCustomerDocument = {"kind":"Document","definitions":[{"kind":"Op export const GetCustomerMastersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerMasters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"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"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"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"}}}]}}]}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"and"},"value":{"kind":"ListValue","values":[{"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":"masters"},"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":"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"}}]}}]} as unknown as DocumentNode; export const GetCustomerClientsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerClients"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"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"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"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"}}}]}}]}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"and"},"value":{"kind":"ListValue","values":[{"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":"clients"},"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":"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"}}]}}]} as unknown as DocumentNode; export const UpdateCustomerProfileDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCustomerProfile"},"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":"CustomerInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCustomer"},"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":"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":"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"}}]}}]} as unknown as DocumentNode; +export const GetOrderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOrder"},"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":"order"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"documentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"OrderFields"}}]}}]}},{"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":"time_start"}},{"kind":"Field","name":{"kind":"Name","value":"time_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":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"client"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode; export const CreateSlotDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSlot"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SlotInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSlot"},"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":"SlotFields"}}]}}]}},{"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":"date"}},{"kind":"Field","name":{"kind":"Name","value":"time_start"}},{"kind":"Field","name":{"kind":"Name","value":"time_end"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode; export const GetSlotsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSlots"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SlotFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slots"},"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":"time_start:asc","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode; 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":"state"}},{"kind":"Field","name":{"kind":"Name","value":"orders"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SlotFields"}}]}}]}},{"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":"date"}},{"kind":"Field","name":{"kind":"Name","value":"time_start"}},{"kind":"Field","name":{"kind":"Name","value":"time_end"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode;