fix date time types & names

This commit is contained in:
vchikalkin 2025-02-11 12:26:49 +03:00
parent d73b663e42
commit 176a9b1946
8 changed files with 118 additions and 52 deletions

View File

@ -2,6 +2,7 @@
// eslint-disable-next-line sonarjs/no-internal-api-use
import type * as ApolloTypes from '../../../packages/graphql/node_modules/@apollo/client/core';
import { getProfile } from './profile';
import { formatDate, formatTime } from '@/utils/date';
import * as api from '@repo/graphql/api';
import type * as GQL from '@repo/graphql/types';
@ -13,7 +14,13 @@ type FixTypescriptCringe = ApolloTypes.FetchResult;
export async function addSlot(input: AddSlotInput) {
const customer = await getProfile();
return api.createSlot({ ...input, master: customer?.documentId });
return api.createSlot({
...input,
date: formatDate(input.date),
master: customer?.documentId,
time_end: formatTime(input.time_end),
time_start: formatTime(input.time_start),
});
}
export async function getSlots(input: GQL.GetSlotsQueryVariables) {

View File

@ -5,7 +5,6 @@ import { AddTimePair } from './time-pair';
import { ScheduleSlotsContext } from '@/context/schedule-slots';
import { useSlotAdd } from '@/hooks/slots';
import { withContext } from '@/utils/context';
import { combineDateTime } from '@/utils/date';
import { Enum_Slot_State } from '@repo/graphql/types';
import { Button } from '@repo/ui/components/ui/button';
import { PlusSquare } from 'lucide-react';
@ -22,9 +21,10 @@ export const AddSlotForm = withContext(ContextProvider)(function () {
event.preventDefault();
if (startTime && endTime) {
addSlot({
dateend: combineDateTime(selectedDate, endTime).toISOString(),
datestart: combineDateTime(selectedDate, startTime).toISOString(),
date: selectedDate,
state: Enum_Slot_State.Open,
time_end: endTime,
time_start: startTime,
});
setStartTime('');

View File

@ -2,7 +2,7 @@
import { Context, type ContextType } from '../context';
import { type Slot } from '../types';
import { useSlotAdd } from '@/hooks/slots';
import { getTimeString } from '@/utils/date';
import { parseTime } from '@/utils/date';
import { Input } from '@repo/ui/components/ui/input';
import { use } from 'react';
@ -25,12 +25,12 @@ export function AddTimePair() {
);
}
export function ReadonlyTimeRange({ dateend, datestart }: Readonly<Slot>) {
export function ReadonlyTimeRange({ time_end, time_start }: Readonly<Slot>) {
return (
<div className="flex flex-row items-center gap-2 text-lg font-bold">
<span>{getTimeString(datestart)}</span>
<span>{parseTime(time_start)}</span>
{' - '}
<span>{getTimeString(dateend)}</span>
<span>{parseTime(time_end)}</span>
</div>
);
}

View File

@ -1,5 +1,4 @@
'use client';
import { combineDateTime } from '@/utils/date';
import { createContext, useMemo, useState } from 'react';
type ContextType = {
@ -10,7 +9,7 @@ type ContextType = {
export const ScheduleSlotsContext = createContext<ContextType>({} as ContextType);
export function ScheduleSlotsProvider({ children }: { readonly children: React.ReactNode }) {
const [selectedDate, setSelectedDate] = useState(combineDateTime(new Date(), '00:00'));
const [selectedDate, setSelectedDate] = useState(new Date());
const value = useMemo(() => ({ selectedDate, setSelectedDate }), [selectedDate]);

View File

@ -1,7 +1,7 @@
'use client';
import { addSlot, deleteSlot, getSlot, getSlots, updateSlot } from '@/actions/slots';
import { ScheduleSlotsContext } from '@/context/schedule-slots';
import { combineDateTime } from '@/utils/date';
import { formatDate } from '@/utils/date';
// eslint-disable-next-line sonarjs/no-internal-api-use
import type * as ApolloTypes from '@repo/graphql/node_modules/@apollo/client/core';
import { useMutation, useQuery } from '@tanstack/react-query';
@ -12,16 +12,13 @@ type FixTypescriptCringe = ApolloTypes.FetchResult;
export const useSlots = () => {
const { selectedDate } = use(ScheduleSlotsContext);
const dayStart = combineDateTime(selectedDate, '00:00');
const dayEnd = combineDateTime(selectedDate, '23:59');
return useQuery({
queryFn: () =>
getSlots({
filters: {
datestart: {
gte: dayStart,
lte: dayEnd,
date: {
eq: formatDate(selectedDate),
},
},
}),

View File

@ -12,8 +12,16 @@ export function combineDateTime(date: Date, time: string) {
);
}
export function getTimeString(date: Date) {
if (!date) return '-';
return dayjs(date).format('HH:mm');
export function formatDate(date: Date) {
return dayjs(date).format('YYYY-MM-DD');
}
export function formatTime(time: string) {
return `${time}:00`;
}
export function parseTime(time: string) {
const [hours = '00', minutes = '00'] = time.split(':');
return `${hours}:${minutes}`;
}

View File

@ -1,7 +1,8 @@
fragment SlotFields on Slot {
documentId
datestart
dateend
date
time_start
time_end
state
}
@ -12,7 +13,7 @@ mutation CreateSlot($input: SlotInput!) {
}
query GetSlots($filters: SlotFiltersInput) {
slots(filters: $filters, sort: "datestart:asc") {
slots(filters: $filters, sort: "time_start:asc") {
documentId
}
}

View File

@ -13,38 +13,40 @@ export type Scalars = {
Boolean: { input: boolean; output: boolean; }
Int: { input: number; output: number; }
Float: { input: number; output: number; }
Date: { input: any; output: any; }
DateTime: { input: any; output: any; }
JSON: { input: any; output: any; }
Long: { input: any; output: any; }
Time: { input: any; output: any; }
};
export type BlockFiltersInput = {
and?: InputMaybe<Array<InputMaybe<BlockFiltersInput>>>;
client?: InputMaybe<CustomerFiltersInput>;
createdAt?: InputMaybe<DateTimeFilterInput>;
dateend?: InputMaybe<DateTimeFilterInput>;
datestart?: InputMaybe<DateTimeFilterInput>;
datetime_end?: InputMaybe<DateTimeFilterInput>;
datetime_start?: InputMaybe<DateTimeFilterInput>;
documentId?: InputMaybe<IdFilterInput>;
master?: InputMaybe<CustomerFiltersInput>;
not?: InputMaybe<BlockFiltersInput>;
or?: InputMaybe<Array<InputMaybe<BlockFiltersInput>>>;
orders?: InputMaybe<OrderFiltersInput>;
publishedAt?: InputMaybe<DateTimeFilterInput>;
sessionsCompleted?: InputMaybe<IntFilterInput>;
sessionsTotal?: InputMaybe<IntFilterInput>;
sessions_completed?: InputMaybe<IntFilterInput>;
sessions_total?: InputMaybe<IntFilterInput>;
state?: InputMaybe<StringFilterInput>;
updatedAt?: InputMaybe<DateTimeFilterInput>;
};
export type BlockInput = {
client?: InputMaybe<Scalars['ID']['input']>;
dateend?: InputMaybe<Scalars['DateTime']['input']>;
datestart?: InputMaybe<Scalars['DateTime']['input']>;
datetime_end?: InputMaybe<Scalars['DateTime']['input']>;
datetime_start?: InputMaybe<Scalars['DateTime']['input']>;
master?: InputMaybe<Scalars['ID']['input']>;
orders?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
publishedAt?: InputMaybe<Scalars['DateTime']['input']>;
sessionsCompleted?: InputMaybe<Scalars['Int']['input']>;
sessionsTotal?: InputMaybe<Scalars['Int']['input']>;
sessions_completed?: InputMaybe<Scalars['Int']['input']>;
sessions_total?: InputMaybe<Scalars['Int']['input']>;
state?: InputMaybe<Enum_Block_State>;
};
@ -109,6 +111,31 @@ export type CustomerInput = {
telegramId?: InputMaybe<Scalars['Long']['input']>;
};
export type DateFilterInput = {
and?: InputMaybe<Array<InputMaybe<Scalars['Date']['input']>>>;
between?: InputMaybe<Array<InputMaybe<Scalars['Date']['input']>>>;
contains?: InputMaybe<Scalars['Date']['input']>;
containsi?: InputMaybe<Scalars['Date']['input']>;
endsWith?: InputMaybe<Scalars['Date']['input']>;
eq?: InputMaybe<Scalars['Date']['input']>;
eqi?: InputMaybe<Scalars['Date']['input']>;
gt?: InputMaybe<Scalars['Date']['input']>;
gte?: InputMaybe<Scalars['Date']['input']>;
in?: InputMaybe<Array<InputMaybe<Scalars['Date']['input']>>>;
lt?: InputMaybe<Scalars['Date']['input']>;
lte?: InputMaybe<Scalars['Date']['input']>;
ne?: InputMaybe<Scalars['Date']['input']>;
nei?: InputMaybe<Scalars['Date']['input']>;
not?: InputMaybe<DateFilterInput>;
notContains?: InputMaybe<Scalars['Date']['input']>;
notContainsi?: InputMaybe<Scalars['Date']['input']>;
notIn?: InputMaybe<Array<InputMaybe<Scalars['Date']['input']>>>;
notNull?: InputMaybe<Scalars['Boolean']['input']>;
null?: InputMaybe<Scalars['Boolean']['input']>;
or?: InputMaybe<Array<InputMaybe<Scalars['Date']['input']>>>;
startsWith?: InputMaybe<Scalars['Date']['input']>;
};
export type DateTimeFilterInput = {
and?: InputMaybe<Array<InputMaybe<Scalars['DateTime']['input']>>>;
between?: InputMaybe<Array<InputMaybe<Scalars['DateTime']['input']>>>;
@ -307,31 +334,31 @@ export type OrderFiltersInput = {
block?: InputMaybe<BlockFiltersInput>;
client?: InputMaybe<CustomerFiltersInput>;
createdAt?: InputMaybe<DateTimeFilterInput>;
dateend?: InputMaybe<DateTimeFilterInput>;
datestart?: InputMaybe<DateTimeFilterInput>;
documentId?: InputMaybe<IdFilterInput>;
not?: InputMaybe<OrderFiltersInput>;
or?: InputMaybe<Array<InputMaybe<OrderFiltersInput>>>;
orderNumber?: InputMaybe<IntFilterInput>;
order_number?: InputMaybe<IntFilterInput>;
price?: InputMaybe<IntFilterInput>;
publishedAt?: InputMaybe<DateTimeFilterInput>;
service?: InputMaybe<StringFilterInput>;
slot?: InputMaybe<SlotFiltersInput>;
state?: InputMaybe<StringFilterInput>;
time_end?: InputMaybe<TimeFilterInput>;
time_start?: InputMaybe<TimeFilterInput>;
updatedAt?: InputMaybe<DateTimeFilterInput>;
};
export type OrderInput = {
block?: InputMaybe<Scalars['ID']['input']>;
client?: InputMaybe<Scalars['ID']['input']>;
dateend?: InputMaybe<Scalars['DateTime']['input']>;
datestart?: InputMaybe<Scalars['DateTime']['input']>;
orderNumber?: InputMaybe<Scalars['Int']['input']>;
order_number?: InputMaybe<Scalars['Int']['input']>;
price?: InputMaybe<Scalars['Int']['input']>;
publishedAt?: InputMaybe<Scalars['DateTime']['input']>;
service?: InputMaybe<Scalars['String']['input']>;
slot?: InputMaybe<Scalars['ID']['input']>;
state?: InputMaybe<Enum_Order_State>;
time_end?: InputMaybe<Scalars['Time']['input']>;
time_start?: InputMaybe<Scalars['Time']['input']>;
};
export type PaginationArg = {
@ -395,20 +422,19 @@ export type SettingFiltersInput = {
not?: InputMaybe<SettingFiltersInput>;
or?: InputMaybe<Array<InputMaybe<SettingFiltersInput>>>;
publishedAt?: InputMaybe<DateTimeFilterInput>;
recordingByBlocks?: InputMaybe<BooleanFilterInput>;
recording_by_blocks?: InputMaybe<BooleanFilterInput>;
updatedAt?: InputMaybe<DateTimeFilterInput>;
};
export type SettingInput = {
publishedAt?: InputMaybe<Scalars['DateTime']['input']>;
recordingByBlocks?: InputMaybe<Scalars['Boolean']['input']>;
recording_by_blocks?: InputMaybe<Scalars['Boolean']['input']>;
};
export type SlotFiltersInput = {
and?: InputMaybe<Array<InputMaybe<SlotFiltersInput>>>;
createdAt?: InputMaybe<DateTimeFilterInput>;
dateend?: InputMaybe<DateTimeFilterInput>;
datestart?: InputMaybe<DateTimeFilterInput>;
date?: InputMaybe<DateFilterInput>;
documentId?: InputMaybe<IdFilterInput>;
master?: InputMaybe<CustomerFiltersInput>;
not?: InputMaybe<SlotFiltersInput>;
@ -416,16 +442,19 @@ export type SlotFiltersInput = {
orders?: InputMaybe<OrderFiltersInput>;
publishedAt?: InputMaybe<DateTimeFilterInput>;
state?: InputMaybe<StringFilterInput>;
time_end?: InputMaybe<TimeFilterInput>;
time_start?: InputMaybe<TimeFilterInput>;
updatedAt?: InputMaybe<DateTimeFilterInput>;
};
export type SlotInput = {
dateend?: InputMaybe<Scalars['DateTime']['input']>;
datestart?: InputMaybe<Scalars['DateTime']['input']>;
date?: InputMaybe<Scalars['Date']['input']>;
master?: InputMaybe<Scalars['ID']['input']>;
orders?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
publishedAt?: InputMaybe<Scalars['DateTime']['input']>;
state?: InputMaybe<Enum_Slot_State>;
time_end?: InputMaybe<Scalars['Time']['input']>;
time_start?: InputMaybe<Scalars['Time']['input']>;
};
export type StringFilterInput = {
@ -453,6 +482,31 @@ export type StringFilterInput = {
startsWith?: InputMaybe<Scalars['String']['input']>;
};
export type TimeFilterInput = {
and?: InputMaybe<Array<InputMaybe<Scalars['Time']['input']>>>;
between?: InputMaybe<Array<InputMaybe<Scalars['Time']['input']>>>;
contains?: InputMaybe<Scalars['Time']['input']>;
containsi?: InputMaybe<Scalars['Time']['input']>;
endsWith?: InputMaybe<Scalars['Time']['input']>;
eq?: InputMaybe<Scalars['Time']['input']>;
eqi?: InputMaybe<Scalars['Time']['input']>;
gt?: InputMaybe<Scalars['Time']['input']>;
gte?: InputMaybe<Scalars['Time']['input']>;
in?: InputMaybe<Array<InputMaybe<Scalars['Time']['input']>>>;
lt?: InputMaybe<Scalars['Time']['input']>;
lte?: InputMaybe<Scalars['Time']['input']>;
ne?: InputMaybe<Scalars['Time']['input']>;
nei?: InputMaybe<Scalars['Time']['input']>;
not?: InputMaybe<TimeFilterInput>;
notContains?: InputMaybe<Scalars['Time']['input']>;
notContainsi?: InputMaybe<Scalars['Time']['input']>;
notIn?: InputMaybe<Array<InputMaybe<Scalars['Time']['input']>>>;
notNull?: InputMaybe<Scalars['Boolean']['input']>;
null?: InputMaybe<Scalars['Boolean']['input']>;
or?: InputMaybe<Array<InputMaybe<Scalars['Time']['input']>>>;
startsWith?: InputMaybe<Scalars['Time']['input']>;
};
export type UploadFileFiltersInput = {
alternativeText?: InputMaybe<StringFilterInput>;
and?: InputMaybe<Array<InputMaybe<UploadFileFiltersInput>>>;
@ -612,14 +666,14 @@ 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 SlotFieldsFragment = { __typename?: 'Slot', documentId: string, datestart: any, dateend: any, state?: Enum_Slot_State | 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<{
input: SlotInput;
}>;
export type CreateSlotMutation = { __typename?: 'Mutation', createSlot?: { __typename?: 'Slot', documentId: string, datestart: any, dateend: any, state?: Enum_Slot_State | null | undefined } | null | undefined };
export type CreateSlotMutation = { __typename?: 'Mutation', createSlot?: { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: any, time_end: any, state?: Enum_Slot_State | null | undefined } | null | undefined };
export type GetSlotsQueryVariables = Exact<{
filters?: InputMaybe<SlotFiltersInput>;
@ -633,7 +687,7 @@ export type GetSlotQueryVariables = Exact<{
}>;
export type GetSlotQuery = { __typename?: 'Query', slot?: { __typename?: 'Slot', documentId: string, datestart: any, dateend: any, state?: Enum_Slot_State | null | undefined, orders: Array<{ __typename?: 'Order', documentId: string } | null | undefined> } | null | undefined };
export type GetSlotQuery = { __typename?: 'Query', slot?: { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: any, time_end: any, state?: Enum_Slot_State | null | undefined, orders: Array<{ __typename?: 'Order', documentId: string } | null | undefined> } | null | undefined };
export type UpdateSlotMutationVariables = Exact<{
documentId: Scalars['ID']['input'];
@ -641,7 +695,7 @@ export type UpdateSlotMutationVariables = Exact<{
}>;
export type UpdateSlotMutation = { __typename?: 'Mutation', updateSlot?: { __typename?: 'Slot', documentId: string, datestart: any, dateend: any, state?: Enum_Slot_State | null | undefined } | null | undefined };
export type UpdateSlotMutation = { __typename?: 'Mutation', updateSlot?: { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: any, time_end: any, state?: Enum_Slot_State | null | undefined } | null | undefined };
export type DeleteSlotMutationVariables = Exact<{
documentId: Scalars['ID']['input'];
@ -651,7 +705,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<CustomerFieldsFragment, unknown>;
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":"datestart"}},{"kind":"Field","name":{"kind":"Name","value":"dateend"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode<SlotFieldsFragment, unknown>;
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<SlotFieldsFragment, unknown>;
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<RegisterMutation, RegisterMutationVariables>;
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<LoginMutation, LoginMutationVariables>;
export const CreateCustomerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCustomer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCustomer"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"role"},"value":{"kind":"EnumValue","value":"client"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode<CreateCustomerMutation, CreateCustomerMutationVariables>;
@ -659,8 +713,8 @@ 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<GetCustomerMastersQuery, GetCustomerMastersQueryVariables>;
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<GetCustomerClientsQuery, GetCustomerClientsQueryVariables>;
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<UpdateCustomerProfileMutation, UpdateCustomerProfileMutationVariables>;
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":"datestart"}},{"kind":"Field","name":{"kind":"Name","value":"dateend"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode<CreateSlotMutation, CreateSlotMutationVariables>;
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":"datestart:asc","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode<GetSlotsQuery, GetSlotsQueryVariables>;
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"},"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":"datestart"}},{"kind":"Field","name":{"kind":"Name","value":"dateend"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode<GetSlotQuery, GetSlotQueryVariables>;
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":"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":"datestart"}},{"kind":"Field","name":{"kind":"Name","value":"dateend"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode<UpdateSlotMutation, UpdateSlotMutationVariables>;
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<CreateSlotMutation, CreateSlotMutationVariables>;
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<GetSlotsQuery, GetSlotsQueryVariables>;
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"},"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<GetSlotQuery, GetSlotQueryVariables>;
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":"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<UpdateSlotMutation, UpdateSlotMutationVariables>;
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<DeleteSlotMutation, DeleteSlotMutationVariables>;