Fix/bugs features pt 2 (#58)

* refactor(profile): comment out change role feature

* refactor(orders): update OrderServices and ServiceSelect components to utilize ServiceCard, and enhance service fields with duration in GraphQL types

* refactor(schedule): implement forbidden order states to disable editing slots with active orders

* fix(deploy): update SSH configuration to use dynamic port from secrets for improved flexibility

* refactor(api/orders): simplify order creation logic by removing unnecessary validations and improving error handling

* refactor(contact-row): replace role display logic with useIsMaster hook for improved clarity

* refactor(profile/orders-list): update header text from "Общие записи" to "Недавние записи" for better clarity
gql: GetOrders add sort slot.date:desc

* refactor(profile/orders-list): enhance OrderCard component by adding avatarSource prop based on user role

* feat(order-form): implement date selection with event highlighting and monthly view for available time slots

* refactor(i18n/config): update timeZone from 'Europe/Amsterdam' to 'Europe/Moscow'

* refactor(order-form/datetime-select): enhance date selection logic to include slot availability check

* refactor(datetime-format): integrate dayjs timezone support with default Moscow timezone for date and time formatting

* fix(contact-row): replace useIsMaster hook with isCustomerMaster utility for role display logic

* refactor(service-card): replace formatTime with getMinutes for duration display

* refactor(order-datetime): update date and time handling to use datetime_start and datetime_end for improved consistency

* refactor(profile): streamline profile and slot pages by integrating session user retrieval and updating booking logic with BookButton component

* fix(navigation): append query parameter to bottom-nav links and enhance back navigation logic in success page
This commit is contained in:
Vlad Chikalkin 2025-07-18 17:11:43 +03:00 committed by GitHub
parent 1075e47904
commit ccfc65ca9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
35 changed files with 488 additions and 414 deletions

View File

@ -56,11 +56,11 @@ jobs:
mkdir -p ~/.ssh
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
ssh-keyscan -p ${{ secrets.VPS_PORT }} -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
- name: Ensure zapishis directory exists on VPS
run: |
ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "mkdir -p /home/${{ secrets.VPS_USER }}/zapishis"
ssh -i ~/.ssh/id_rsa -p ${{ secrets.VPS_PORT }} -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "mkdir -p /home/${{ secrets.VPS_USER }}/zapishis"
- name: Create real .env file for production
run: |
@ -78,7 +78,7 @@ jobs:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
port: 22
port: ${{ secrets.VPS_PORT }}
source: '.env'
target: '/home/${{ secrets.VPS_USER }}/zapishis/'
@ -88,13 +88,13 @@ jobs:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
port: 22
port: ${{ secrets.VPS_PORT }}
source: 'docker-compose.yml'
target: '/home/${{ secrets.VPS_USER }}/zapishis/'
- name: Login and deploy on VPS
run: |
ssh ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "
ssh -i ~/.ssh/id_rsa -p ${{ secrets.VPS_PORT }} -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "
cd /home/${{ secrets.VPS_USER }}/zapishis && \
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} && \
docker compose pull && \

View File

@ -1,35 +1,55 @@
import { getCustomer } from '@/actions/api/customers';
import { getSessionUser } from '@/actions/session';
import { Container } from '@/components/layout';
import { PageHeader } from '@/components/navigation';
import {
BookContactButton,
ContactDataCard,
PersonCard,
ProfileOrdersList,
} from '@/components/profile';
import { ContactDataCard, PersonCard, ProfileOrdersList } from '@/components/profile';
import { BookButton } from '@/components/shared/book-button';
import { isCustomerMaster } from '@repo/utils/customer';
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
// Тип параметров страницы
type Props = { params: Promise<{ telegramId: string }> };
export default async function ProfilePage(props: Readonly<Props>) {
const parameters = await props.params;
const telegramId = Number.parseInt(parameters.telegramId, 10);
const { telegramId } = await props.params;
const contactTelegramId = Number(telegramId);
const queryClient = new QueryClient();
await queryClient.prefetchQuery({
queryFn: () => getCustomer({ telegramId }),
queryKey: ['customer', telegramId],
// Получаем профиль контакта
const { customer: profile } = await queryClient.fetchQuery({
queryFn: () => getCustomer({ telegramId: contactTelegramId }),
queryKey: ['customer', contactTelegramId],
});
// Получаем текущего пользователя
const sessionUser = await getSessionUser();
const { customer: currentUser } = await queryClient.fetchQuery({
queryFn: () => getCustomer({ telegramId: sessionUser.telegramId }),
queryKey: ['customer', sessionUser.telegramId],
});
// Проверка наличия данных
if (!profile || !currentUser) return null;
// Определяем роли и id
const isMaster = isCustomerMaster(currentUser);
const masterId = isMaster ? currentUser.documentId : profile.documentId;
const clientId = isMaster ? profile.documentId : currentUser.documentId;
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<PageHeader title="Профиль контакта" />
<Container className="px-0">
<PersonCard telegramId={telegramId} />
<ContactDataCard telegramId={telegramId} />
<ProfileOrdersList telegramId={telegramId} />
<BookContactButton telegramId={telegramId} />
<PersonCard telegramId={contactTelegramId} />
<ContactDataCard telegramId={contactTelegramId} />
<ProfileOrdersList telegramId={contactTelegramId} />
{masterId && clientId && (
<BookButton
clientId={clientId}
label={isMaster ? 'Записать' : 'Записаться'}
masterId={masterId}
/>
)}
</Container>
</HydrationBoundary>
);

View File

@ -1,8 +1,11 @@
import { getCustomer } from '@/actions/api/customers';
import { getSlot } from '@/actions/api/slots';
import { getSessionUser } from '@/actions/session';
import { Container } from '@/components/layout';
import { PageHeader } from '@/components/navigation';
import { SlotButtons, SlotDateTime, SlotOrdersList } from '@/components/schedule';
import { type SlotPageParameters } from '@/components/schedule/types';
import { BookButton } from '@/components/shared/book-button';
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
type Props = { params: Promise<SlotPageParameters> };
@ -18,12 +21,22 @@ export default async function SlotPage(props: Readonly<Props>) {
queryKey: ['slot', documentId],
});
// Получаем текущего пользователя
const sessionUser = await getSessionUser();
const { customer: currentUser } = await queryClient.fetchQuery({
queryFn: () => getCustomer({ telegramId: sessionUser.telegramId }),
queryKey: ['customer', sessionUser.telegramId],
});
const masterId = currentUser?.documentId;
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<PageHeader title="Слот" />
<Container>
<SlotDateTime {...parameters} />
<SlotOrdersList {...parameters} />
{masterId && <BookButton label="Создать запись" masterId={masterId} />}
<div className="pb-24" />
<SlotButtons {...parameters} />
</Container>

View File

@ -27,7 +27,7 @@ export function NavButton({ disabled, href, icon, label }: NavButtonProps) {
<span className="mt-1 text-xs">{label}</span>
</div>
) : (
<Link href={href}>
<Link href={href + '?from=bottom-nav'}>
<span>{icon}</span>
<span className="mt-1 text-xs">{label}</span>
</Link>

View File

@ -13,12 +13,12 @@ export function OrderDateTime({ documentId }: Readonly<OrderComponentProps>) {
return (
<div className="flex flex-col">
<span className="text-sm tracking-wide text-muted-foreground">
{formatDate(order.slot?.date).user()}
{order.slot?.datetime_start ? formatDate(order.slot.datetime_start).user() : ''}
</span>
<ReadonlyTimeRange
className="text-3xl"
timeEnd={order.time_end}
timeStart={order.time_start}
datetimeEnd={order?.datetime_end}
datetimeStart={order?.datetime_start}
/>
</div>
);

View File

@ -4,22 +4,54 @@ import { useAvailableTimeSlotsQuery } from '@/hooks/api/slots';
import { useOrderStore } from '@/stores/order';
import { Button } from '@repo/ui/components/ui/button';
import { Calendar } from '@repo/ui/components/ui/calendar';
import { formatDate } from '@repo/utils/datetime-format';
import { formatTime } from '@repo/utils/datetime-format';
import dayjs from 'dayjs';
import { useState } from 'react';
export function DateSelect() {
const selectedDate = useOrderStore((store) => store.date);
const setDate = useOrderStore((store) => store.setDate);
const setTime = useOrderStore((store) => store.setTime);
const setSlot = useOrderStore((store) => store.setSlotId);
const masterId = useOrderStore((store) => store.masterId);
const serviceId = useOrderStore((store) => store.serviceId);
const [selectedMonthDate, setSelectedMonthDate] = useState(new Date());
const { data: { slots } = {} } = useAvailableTimeSlotsQuery(
{
filters: {
datetime_start: {
gte: dayjs(selectedMonthDate).startOf('month').startOf('day').toISOString(),
lte: dayjs(selectedMonthDate).endOf('month').endOf('day').toISOString(),
},
master: {
documentId: {
eq: masterId,
},
},
},
},
{
service: {
documentId: {
eq: serviceId,
},
},
},
);
return (
<Calendar
className="bg-background"
disabled={(date) => {
return dayjs().isAfter(dayjs(date), 'day');
return (
dayjs().isAfter(dayjs(date), 'day') ||
!slots?.some((slot) => dayjs(slot?.datetime_start).isSame(date, 'day'))
);
}}
mode="single"
onMonthChange={(date) => setSelectedMonthDate(date)}
onSelect={(date) => {
if (date) setDate(date);
setTime(null);
@ -47,8 +79,9 @@ export function TimeSelect() {
const { data: { times } = {}, isLoading } = useAvailableTimeSlotsQuery(
{
filters: {
date: {
eq: formatDate(date).db(),
datetime_start: {
gte: dayjs(date).startOf('day').toISOString(),
lte: dayjs(date).endOf('day').toISOString(),
},
master: {
documentId: {
@ -68,6 +101,7 @@ export function TimeSelect() {
if (isLoading || !times) return null;
const getHour = (isoString: string) => dayjs(isoString).hour();
const morning = times.filter(({ time }) => getHour(time) < 12);
const afternoon = times?.filter(({ time }) => {
const hour = getHour(time);
@ -84,13 +118,6 @@ export function TimeSelect() {
);
}
function getHour(time: string) {
const hour = time.split(':')[0];
if (hour) return Number.parseInt(hour, 10);
return -1;
}
function TimeSlotsButtons({
times,
title,
@ -114,7 +141,7 @@ function TimeSlotsButtons({
}}
variant="outline"
>
{time}
{formatTime(time).user()}
</Button>
))}
</div>

View File

@ -3,8 +3,8 @@
import { useOrderStore } from '@/stores/order';
import { Button } from '@repo/ui/components/ui/button';
import { Card, CardContent } from '@repo/ui/components/ui/card';
import { AlertCircle, CheckCircle2, Home, RefreshCw } from 'lucide-react';
import Link from 'next/link';
import { AlertCircle, CheckCircle2, RefreshCw } from 'lucide-react';
import { useRouter, useSearchParams } from 'next/navigation';
export function ErrorPage() {
const setStep = useOrderStore((store) => store.setStep);
@ -35,6 +35,19 @@ export function ErrorPage() {
}
export function SuccessPage() {
const router = useRouter();
const from = useSearchParams().get('from');
const handleBack = () => {
if (from === 'bottom-nav') {
router.push('/');
} else if (window.history.length > 1) {
router.back();
} else {
router.push('/');
}
};
return (
<div className="flex min-h-screen items-center justify-center bg-background p-4">
<Card className="w-full max-w-sm border-none bg-card text-card-foreground shadow-none">
@ -46,11 +59,8 @@ export function SuccessPage() {
<h1 className="text-2xl font-bold">Готово!</h1>
<p className="text-muted-foreground">Запись успешно создана</p>
</div>
<Button asChild className="w-full">
<Link href="/">
<Home className="mr-2 size-4" />
На главный экран
</Link>
<Button className="w-full" onClick={handleBack}>
ОК
</Button>
</CardContent>
</Card>

View File

@ -1,11 +1,11 @@
'use client';
import { DataNotFound } from '@/components/shared/alert';
import { ServiceCard } from '@/components/shared/service-card';
import { useServicesQuery } from '@/hooks/api/services';
import { useOrderStore } from '@/stores/order';
import { type ServiceFieldsFragment } from '@repo/graphql/types';
import { cn } from '@repo/ui/lib/utils';
import { formatTime } from '@repo/utils/datetime-format';
export function ServiceSelect() {
const { data: { services } = {} } = useServicesQuery({});
@ -14,12 +14,14 @@ export function ServiceSelect() {
return (
<div className="space-y-2 px-6">
{services.map((service) => service && <ServiceCard key={service.documentId} {...service} />)}
{services.map(
(service) => service && <ServiceCardRadio key={service.documentId} {...service} />,
)}
</div>
);
}
function ServiceCard({ documentId, duration, name }: Readonly<ServiceFieldsFragment>) {
function ServiceCardRadio({ documentId, ...props }: Readonly<ServiceFieldsFragment>) {
const serviceId = useOrderStore((store) => store.serviceId);
const setServiceId = useOrderStore((store) => store.setServiceId);
@ -32,7 +34,7 @@ function ServiceCard({ documentId, duration, name }: Readonly<ServiceFieldsFragm
return (
<label
className={cn(
'flex items-center justify-between border-2 rounded-2xl bg-background p-4 cursor-pointer dark:bg-primary/5',
'flex items-center justify-between rounded-2xl border-2 cursor-pointer',
selected ? 'border-primary' : 'border-transparent',
)}
>
@ -44,24 +46,7 @@ function ServiceCard({ documentId, duration, name }: Readonly<ServiceFieldsFragm
type="radio"
value={documentId}
/>
<div className="flex w-full items-center justify-between gap-2">
<span className="text-base font-semibold text-foreground">{name}</span>
<span
className={cn(
'inline-flex items-center gap-1 px-4 p-2 rounded-full bg-secondary dark:bg-background text-primary text-xs font-medium',
)}
>
<svg
className="size-4 opacity-70"
fill="currentColor"
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M8 1.5a6.5 6.5 0 1 0 0 13a6.5 6.5 0 0 0 0-13ZM2.5 8a5.5 5.5 0 1 1 11 0a5.5 5.5 0 0 1-11 0Zm6-2.75a.5.5 0 0 0-1 0v3c0 .28.22.5.5.5h2a.5.5 0 0 0 0-1H8.5V5.25Z" />
</svg>
{formatTime(duration).user()}
</span>
</div>
<ServiceCard {...props} />
</label>
);
}

View File

@ -4,7 +4,6 @@ import { useOrderCreate } from '@/hooks/api/orders';
import { useOrderStore } from '@/stores/order';
import { Button } from '@repo/ui/components/ui/button';
import { LoadingSpinner } from '@repo/ui/components/ui/spinner';
import { formatTime } from '@repo/utils/datetime-format';
import { useEffect } from 'react';
export function SubmitButton() {
@ -19,9 +18,9 @@ export function SubmitButton() {
createOrder({
input: {
client: clientId,
datetime_start: time,
services: [serviceId],
slot: slotId,
time_start: formatTime(time).db(),
},
});
};

View File

@ -1,9 +1,8 @@
'use client';
import { ServiceCard } from '../shared/service-card';
import { type OrderComponentProps } from './types';
import { useOrderQuery } from '@/hooks/api/orders';
import { type ServiceFieldsFragment } from '@repo/graphql/types';
type ServiceCardProps = Pick<ServiceFieldsFragment, 'name'>;
export function OrderServices({ documentId }: Readonly<OrderComponentProps>) {
const { data: { order } = {} } = useOrderQuery({ documentId });
@ -19,11 +18,3 @@ export function OrderServices({ documentId }: Readonly<OrderComponentProps>) {
</div>
);
}
function ServiceCard({ name }: Readonly<ServiceCardProps>) {
return (
<div className="flex items-center justify-between rounded-2xl border-2 bg-background p-4 px-6">
{name}
</div>
);
}

View File

@ -5,7 +5,8 @@ import { useOrdersQuery } from '@/hooks/api/orders';
import { useDateTimeStore } from '@/stores/datetime';
import { HorizontalCalendar } from '@repo/ui/components/ui/horizontal-calendar';
import dayjs from 'dayjs';
import { useState } from 'react';
import { sift } from 'radashi';
import { useMemo, useState } from 'react';
export function DateSelect() {
const { data: { customer } = {} } = useCustomerQuery();
@ -14,7 +15,7 @@ export function DateSelect() {
const [currentMonthDate, setCurrentMonthDate] = useState(new Date());
const { data: { orders } = {} } = useOrdersQuery({
const { data: { orders } = { orders: [] } } = useOrdersQuery({
filters: {
client: {
documentId: {
@ -22,9 +23,9 @@ export function DateSelect() {
},
},
slot: {
date: {
gte: dayjs(currentMonthDate).startOf('month').format('YYYY-MM-DD'),
lte: dayjs(currentMonthDate).endOf('month').format('YYYY-MM-DD'),
datetime_start: {
gte: dayjs(currentMonthDate).startOf('month').toISOString(),
lte: dayjs(currentMonthDate).endOf('month').toISOString(),
},
master: {
documentId: {
@ -35,12 +36,22 @@ export function DateSelect() {
},
});
const daysWithOrders = useMemo(() => {
return sift(
orders.map((order) => {
const dateString = order?.slot?.datetime_start;
return dateString ? new Date(dateString) : undefined;
}),
);
}, [orders]);
const setSelectedDate = useDateTimeStore((store) => store.setDate);
const selectedDate = useDateTimeStore((store) => store.date);
return (
<HorizontalCalendar
daysWithOrders={orders?.map((order) => new Date(order?.slot?.date))}
daysWithOrders={daysWithOrders}
onDateChange={setSelectedDate}
onMonthChange={(date) => setCurrentMonthDate(date)}
selectedDate={selectedDate}

View File

@ -4,7 +4,7 @@ import { OrderCard } from '@/components/shared/order-card';
import { useCustomerQuery, useIsMaster } from '@/hooks/api/customers';
import { useOrdersQuery } from '@/hooks/api/orders';
import { useDateTimeStore } from '@/stores/datetime';
import { formatDate } from '@repo/utils/datetime-format';
import { getDateUTCRange } from '@repo/utils/datetime-format';
export function ClientsOrdersList() {
const { data: { customer } = {} } = useCustomerQuery();
@ -12,13 +12,15 @@ export function ClientsOrdersList() {
const isMaster = useIsMaster();
const selectedDate = useDateTimeStore((store) => store.date);
const { endOfDay, startOfDay } = getDateUTCRange(selectedDate).day();
const { data: { orders } = {}, isLoading } = useOrdersQuery(
{
filters: {
slot: {
date: {
eq: formatDate(selectedDate).db(),
datetime_start: {
gte: startOfDay,
lt: endOfDay,
},
master: {
documentId: {
@ -45,6 +47,7 @@ export function OrdersList() {
const { data: { customer } = {} } = useCustomerQuery();
const selectedDate = useDateTimeStore((store) => store.date);
const { endOfDay, startOfDay } = getDateUTCRange(selectedDate).day();
const { data: { orders } = {}, isLoading } = useOrdersQuery(
{
@ -55,8 +58,9 @@ export function OrdersList() {
},
},
slot: {
date: {
eq: formatDate(selectedDate).db(),
datetime_start: {
gte: startOfDay,
lt: endOfDay,
},
},
},

View File

@ -1,11 +1,9 @@
'use client';
import { type ProfileProps } from '../types';
import { CheckboxWithText } from './checkbox-field';
import { DataField } from './text-field';
import { CardSectionHeader } from '@/components/ui';
import { useCustomerMutation, useCustomerQuery } from '@/hooks/api/customers';
import { Enum_Customer_Role as Role } from '@repo/graphql/types';
import { Button } from '@repo/ui/components/ui/button';
import { Card } from '@repo/ui/components/ui/card';
import Link from 'next/link';
@ -49,7 +47,7 @@ export function ProfileDataCard() {
value={customer?.name ?? ''}
/>
<DataField disabled id="phone" label="Телефон" readOnly value={customer?.phone ?? ''} />
<CheckboxWithText
{/* <CheckboxWithText
checked={customer.role !== 'client'}
description="Разрешить другим пользователям записываться к вам"
onChange={(checked) =>
@ -58,7 +56,7 @@ export function ProfileDataCard() {
})
}
text="Быть мастером"
/>
/> */}
</div>
</Card>
);

View File

@ -4,62 +4,6 @@ import { OrderCard } from '../shared/order-card';
import { type ProfileProps } from './types';
import { useCustomerQuery, useIsMaster } from '@/hooks/api/customers';
import { useOrdersQuery } from '@/hooks/api/orders';
import { usePushWithData } from '@/hooks/url';
import { CalendarPlus } from 'lucide-react';
export function BookContactButton({ telegramId }: Readonly<ProfileProps>) {
const { data: { customer } = {}, isLoading: isCustomerLoading } = useCustomerQuery();
const isMaster = useIsMaster();
const { data: { customer: profile } = {}, isLoading: isProfileLoading } = useCustomerQuery({
telegramId,
});
const push = usePushWithData();
const handleBook = () => {
if (!profile || !customer) return;
if (isMaster) {
push('/orders/add', {
client: {
documentId: profile.documentId,
},
slot: {
master: {
documentId: customer.documentId,
},
},
});
} else {
push('/orders/add', {
client: {
documentId: customer.documentId,
},
slot: {
master: {
documentId: profile.documentId,
},
},
});
}
};
if (isCustomerLoading || isProfileLoading || !profile || !customer) return null;
return (
<div className="flex flex-col items-center justify-center">
<button
className="flex items-center justify-center gap-2 self-center rounded-xl bg-primary/5 px-6 py-2 font-semibold text-primary shadow-sm transition-colors hover:bg-primary/10"
onClick={handleBook}
type="button"
>
<CalendarPlus className="size-5 text-primary" />
<span>{isMaster ? 'Записать' : 'Записаться'}</span>
</button>
</div>
);
}
export function ProfileOrdersList({ telegramId }: Readonly<ProfileProps>) {
const { data: { customer } = {} } = useCustomerQuery();
@ -94,8 +38,18 @@ export function ProfileOrdersList({ telegramId }: Readonly<ProfileProps>) {
return (
<div className="flex flex-col space-y-2 px-4">
<h1 className="font-bold">Общие записи</h1>
{orders?.map((order) => order && <OrderCard key={order.documentId} showDate {...order} />)}
<h1 className="font-bold">Недавние записи</h1>
{orders?.map(
(order) =>
order && (
<OrderCard
avatarSource={isMaster ? 'master' : 'client'}
key={order.documentId}
showDate
{...order}
/>
),
)}
</div>
);
}

View File

@ -4,6 +4,7 @@ import { useCustomerQuery } from '@/hooks/api/customers';
import { useSlotsQuery } from '@/hooks/api/slots';
import { useDateTimeStore } from '@/stores/datetime';
import { Calendar } from '@repo/ui/components/ui/calendar';
import { getDateUTCRange } from '@repo/utils/datetime-format';
import dayjs from 'dayjs';
import { useState } from 'react';
@ -15,11 +16,13 @@ export function ScheduleCalendar() {
const [currentMonthDate, setCurrentMonthDate] = useState(new Date());
const { endOfMonth, startOfMonth } = getDateUTCRange(currentMonthDate).month();
const { data: { slots } = {} } = useSlotsQuery({
filters: {
date: {
gte: dayjs(currentMonthDate).startOf('month').format('YYYY-MM-DD'),
lte: dayjs(currentMonthDate).endOf('month').format('YYYY-MM-DD'),
datetime_start: {
gte: startOfMonth,
lte: endOfMonth,
},
master: {
documentId: {
@ -38,7 +41,7 @@ export function ScheduleCalendar() {
mode="single"
modifiers={{
hasEvent: (date) => {
return slots?.some((slot) => dayjs(slot?.date).isSame(date, 'day')) || false;
return slots?.some((slot) => dayjs(slot?.datetime_start).isSame(date, 'day')) || false;
},
}}
modifiersClassNames={{

View File

@ -8,7 +8,7 @@ import { ScheduleStoreProvider, useScheduleStore } from '@/stores/schedule';
import { withContext } from '@/utils/context';
import { Enum_Slot_State } from '@repo/graphql/types';
import { Button } from '@repo/ui/components/ui/button';
import { formatDate, formatTime } from '@repo/utils/datetime-format';
import { combineDateAndTimeToUTC } from '@repo/utils/datetime-format';
import { PlusSquare } from 'lucide-react';
import { type FormEvent } from 'react';
@ -23,15 +23,15 @@ export const DaySlotAddForm = withContext(ScheduleStoreProvider)(function () {
const handleSubmit = (event: FormEvent) => {
event.preventDefault();
if (startTime && endTime) {
const datetimeStart = combineDateAndTimeToUTC(selectedDate, startTime);
const datetimeEnd = combineDateAndTimeToUTC(selectedDate, endTime);
addSlot({
input: {
date: formatDate(selectedDate).db(),
datetime_end: datetimeEnd,
datetime_start: datetimeStart,
state: Enum_Slot_State.Open,
time_end: formatTime(endTime).db(),
time_start: formatTime(startTime).db(),
},
});
resetTime();
}
};

View File

@ -6,22 +6,21 @@ import { useCustomerQuery } from '@/hooks/api/customers';
import { useMasterSlotsQuery } from '@/hooks/api/slots';
import { useDateTimeStore } from '@/stores/datetime';
import { LoadingSpinner } from '@repo/ui/components/ui/spinner';
import { formatDate } from '@repo/utils/datetime-format';
import { getDateUTCRange } from '@repo/utils/datetime-format';
export function DaySlotsList() {
const { data: { customer } = {} } = useCustomerQuery();
const selectedDate = useDateTimeStore((store) => store.date);
const { endOfDay, startOfDay } = getDateUTCRange(selectedDate).day();
const { data: { slots } = {}, isLoading } = useMasterSlotsQuery({
filters: {
date: { eq: formatDate(selectedDate).db() },
datetime_start: { gte: startOfDay, lt: endOfDay },
master: { documentId: { eq: customer?.documentId } },
},
});
if (isLoading) return <LoadingSpinner />;
return (
<div className="flex flex-col space-y-2 px-4">
<h1 className="font-bold">Слоты</h1>

View File

@ -23,7 +23,10 @@ export function SlotCard(props: Readonly<Props>) {
<Link href={`${pathname}/slots/${props.documentId}`} rel="noopener noreferrer">
<div className="flex items-center justify-between rounded-2xl bg-background p-4 px-6 dark:bg-primary/5">
<div className="flex flex-col">
<ReadonlyTimeRange timeEnd={props.time_end} timeStart={props.time_start} />
<ReadonlyTimeRange
datetimeEnd={props.datetime_end}
datetimeStart={props.datetime_start}
/>
<span
className={cn(
'text-xs font-normal',

View File

@ -11,7 +11,7 @@ export function SlotDate({ documentId }: Readonly<SlotComponentProps>) {
return (
<span className="text-sm tracking-wide text-muted-foreground">
{formatDate(slot?.date).user()}
{formatDate(slot?.datetime_start).user()}
</span>
);
}

View File

@ -1,3 +1,4 @@
/* eslint-disable canonical/id-match */
/* eslint-disable react/jsx-no-bind */
'use client';
@ -5,14 +6,15 @@ import { type SlotComponentProps } from '../types';
import { EditableTimeRangeForm, ReadonlyTimeRange } from '@/components/shared/time-range';
import { useSlotMutation, useSlotQuery } from '@/hooks/api/slots';
import { useScheduleStore } from '@/stores/schedule';
import { Enum_Order_State } from '@repo/graphql/types';
import { Button } from '@repo/ui/components/ui/button';
import { formatTime } from '@repo/utils/datetime-format';
import { combineDateAndTimeToUTC, formatTime } from '@repo/utils/datetime-format';
import dayjs from 'dayjs';
import { PencilLine } from 'lucide-react';
import { useEffect } from 'react';
export function SlotTime(props: Readonly<SlotComponentProps>) {
const editMode = useScheduleStore((state) => state.editMode);
return editMode ? <SlotTimeEditForm {...props} /> : <SlotTimeReadonly {...props} />;
}
@ -20,21 +22,25 @@ function SlotTimeEditForm({ documentId }: Readonly<SlotComponentProps>) {
const { editMode, endTime, resetTime, setEditMode, setEndTime, setStartTime, startTime } =
useScheduleStore((state) => state);
const { isPending: isMutationPending, mutate: updateSlot } = useSlotMutation({ documentId });
const { data: { slot } = {}, isPending: isQueryPending } = useSlotQuery({ documentId });
const isPending = isMutationPending || isQueryPending;
useEffect(() => {
if (editMode) {
if (slot?.time_start) setStartTime(slot.time_start);
if (slot?.time_end) setEndTime(slot.time_end);
if (editMode && slot?.datetime_start && slot?.datetime_end) {
setStartTime(formatTime(slot.datetime_start).user());
setEndTime(formatTime(slot.datetime_end).user());
}
}, [editMode, setEndTime, setStartTime, slot]);
function handleSubmit() {
if (!slot?.datetime_start) return;
const date = slot.datetime_start; // ISO-строка, год-месяц-день и время
const dateOnly = dayjs(date).format('YYYY-MM-DD'); // Получаем только дату
const newDatetimeStart = combineDateAndTimeToUTC(dateOnly, startTime);
const newDatetimeEnd = combineDateAndTimeToUTC(dateOnly, endTime);
updateSlot({
data: { time_end: formatTime(endTime).db(), time_start: formatTime(startTime).db() },
data: { datetime_end: newDatetimeEnd, datetime_start: newDatetimeStart },
});
resetTime();
setEditMode(false);
@ -42,28 +48,37 @@ function SlotTimeEditForm({ documentId }: Readonly<SlotComponentProps>) {
return (
<EditableTimeRangeForm disabled={isPending} onSubmit={handleSubmit}>
<Button className="rounded-full text-xs" disabled={isPending} onClick={() => handleSubmit()}>
<Button className="rounded-full text-xs" disabled={isPending} onClick={handleSubmit}>
Сохранить
</Button>
</EditableTimeRangeForm>
);
}
const FORBIDDEN_ORDER_STATES: Enum_Order_State[] = [
Enum_Order_State.Scheduled,
Enum_Order_State.Approved,
Enum_Order_State.Completed,
Enum_Order_State.Cancelling,
];
function SlotTimeReadonly({ documentId }: Readonly<SlotComponentProps>) {
const setEditMode = useScheduleStore((state) => state.setEditMode);
const { data: { slot } = {} } = useSlotQuery({ documentId });
if (!slot) return null;
const hasOrders = Boolean(slot?.orders.length);
const disabledEdit = slot?.orders.some(
(order) => order?.state && FORBIDDEN_ORDER_STATES.includes(order?.state),
);
return (
<div className="flex items-center gap-2">
<ReadonlyTimeRange className="text-3xl" timeEnd={slot.time_end} timeStart={slot.time_start} />
<ReadonlyTimeRange
className="text-3xl"
datetimeEnd={slot.datetime_end ?? ''}
datetimeStart={slot.datetime_start ?? ''}
/>
<Button
className="rounded-full text-xs"
disabled={hasOrders}
disabled={disabledEdit}
onClick={() => setEditMode(true)}
size="icon"
variant="outline"

View File

@ -0,0 +1,46 @@
'use client';
import { usePushWithData } from '@/hooks/url';
import { CalendarPlus } from 'lucide-react';
type BookButtonProps = {
clientId?: string;
disabled?: boolean;
label: string;
masterId: string;
onBooked?: () => void;
};
export function BookButton({
clientId,
disabled,
label,
masterId,
onBooked,
}: Readonly<BookButtonProps>) {
const push = usePushWithData();
const handleBook = () => {
push('/orders/add', {
...(clientId && { client: { documentId: clientId } }),
slot: { master: { documentId: masterId } },
});
onBooked?.();
};
if (!masterId && !clientId) return null;
return (
<div className="flex flex-col items-center justify-center">
<button
className="flex items-center justify-center gap-2 self-center rounded-xl bg-primary/5 px-6 py-2 font-semibold text-primary shadow-sm transition-colors hover:bg-primary/10"
disabled={disabled}
onClick={handleBook}
type="button"
>
<CalendarPlus className="size-5 text-primary" />
<span>{label}</span>
</button>
</div>
);
}

View File

@ -1,7 +1,8 @@
import * as GQL from '@repo/graphql/types';
import type * as GQL from '@repo/graphql/types';
import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar';
import { Badge } from '@repo/ui/components/ui/badge';
import { cn } from '@repo/ui/lib/utils';
import { isCustomerMaster } from '@repo/utils/customer';
import Link from 'next/link';
import { memo } from 'react';
@ -31,7 +32,7 @@ export const ContactRow = memo(function ({ className, ...contact }: ContactRowPr
<div>
<p className="font-medium">{contact.name}</p>
<p className="text-sm text-muted-foreground">
{contact.role === GQL.Enum_Customer_Role.Client ? 'Клиент' : 'Мастер'}
{isCustomerMaster(contact) ? 'Мастер' : 'Клиент'}
</p>
</div>
</div>

View File

@ -21,8 +21,6 @@ export function OrderCard({
...order
}: Readonly<OrderComponentProps>) {
const services = order?.services.map((service) => service?.name).join(', ');
const date = order?.slot?.date;
const customer = avatarSource === 'master' ? order?.slot?.master : order?.client;
return (
@ -37,9 +35,14 @@ export function OrderCard({
<div className="flex items-center gap-4">
{customer && <CustomerAvatar customer={customer} />}
<div className="flex flex-col">
<ReadonlyTimeRange timeEnd={order?.time_end} timeStart={order?.time_start} />
<ReadonlyTimeRange
datetimeEnd={order?.datetime_end}
datetimeStart={order?.datetime_start}
/>
<span className="truncate text-xs text-muted-foreground">
{showDate ? `${formatDate(date).user('DD.MM.YYYY')}` : ''}
{showDate && order?.slot?.datetime_start
? `${formatDate(order?.slot?.datetime_start).user('DD.MM.YYYY')}`
: ''}
{services}
</span>
</div>

View File

@ -0,0 +1,32 @@
'use client';
import { type ServiceFieldsFragment } from '@repo/graphql/types';
import { cn } from '@repo/ui/lib/utils';
import { getMinutes } from '@repo/utils/datetime-format';
type ServiceCardProps = Pick<ServiceFieldsFragment, 'duration' | 'name'>;
export function ServiceCard({ duration, name }: Readonly<ServiceCardProps>) {
return (
<div className="w-full rounded-2xl border-2 bg-background p-4 dark:bg-primary/5">
<div className="flex w-full items-center justify-between gap-2">
<span className="text-base font-semibold text-foreground">{name}</span>
<span
className={cn(
'inline-flex items-center gap-1 px-4 p-2 rounded-full bg-secondary dark:bg-background text-primary text-xs font-medium',
)}
>
<svg
className="size-4 opacity-70"
fill="currentColor"
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M8 1.5a6.5 6.5 0 1 0 0 13a6.5 6.5 0 0 0 0-13ZM2.5 8a5.5 5.5 0 1 1 11 0a5.5 5.5 0 0 1-11 0Zm6-2.75a.5.5 0 0 0-1 0v3c0 .28.22.5.5.5h2a.5.5 0 0 0 0-1H8.5V5.25Z" />
</svg>
{getMinutes(duration) + ' мин'}
</span>
</div>
</div>
);
}

View File

@ -3,16 +3,24 @@ import { formatTime } from '@repo/utils/datetime-format';
type TimeRangeProps = {
readonly className?: string;
readonly timeEnd: null | string | undefined;
readonly timeStart: null | string | undefined;
readonly datetimeEnd: null | string | undefined;
readonly datetimeStart: null | string | undefined;
};
export function ReadonlyTimeRange({ className, timeEnd, timeStart }: Readonly<TimeRangeProps>) {
export function ReadonlyTimeRange({
className,
datetimeEnd,
datetimeStart,
}: Readonly<TimeRangeProps>) {
return (
<div className={cn('flex flex-row items-center gap-2 text-lg font-bold', className)}>
<span className="tracking-wider">{timeStart ? formatTime(timeStart).user() : 'xx:xx'}</span>
<span className="tracking-wider">
{datetimeStart ? formatTime(datetimeStart).user() : 'xx:xx'}
</span>
{' - '}
<span className="tracking-wider">{timeEnd ? formatTime(timeEnd).user() : 'xx:xx'}</span>
<span className="tracking-wider">
{datetimeEnd ? formatTime(datetimeEnd).user() : 'xx:xx'}
</span>
</div>
);
}

View File

@ -1,5 +1,4 @@
'use client';
import { useCustomerQuery } from './customers';
import {
createSlot,
@ -10,21 +9,20 @@ import {
updateSlot,
} from '@/actions/api/slots';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import dayjs from 'dayjs';
type UseMasterSlotsVariables = {
filters: Required<
Pick<NonNullable<Parameters<typeof getSlots>[0]['filters']>, 'date' | 'master'>
Pick<NonNullable<Parameters<typeof getSlots>[0]['filters']>, 'datetime_start' | 'master'>
>;
};
export const useMasterSlotsQuery = (variables: UseMasterSlotsVariables) => {
const masterId = variables.filters?.master?.documentId?.eq;
const date = variables.filters?.date?.eq;
const datetimeStart = variables.filters?.datetime_start;
return useQuery({
queryFn: () => getSlots(variables),
queryKey: ['slots', masterId, dayjs(date).format('YYYY-MM-DD')],
queryKey: ['slots', masterId, datetimeStart],
});
};

View File

@ -1,8 +1,8 @@
export const defaultLocale = 'ru';
export const timeZone = 'Europe/Amsterdam';
export const timeZone = 'Europe/Moscow';
export const locales = [defaultLocale, 'en'] as const;
export const locales = [defaultLocale, 'ru'] as const;
export const localesMap = [
{ key: 'en', title: 'English' },

View File

@ -1,3 +1,4 @@
/* eslint-disable complexity */
import * as GQL from '../types';
import { notifyByTelegramId } from '../utils/notify';
import { BaseService } from './base';
@ -6,7 +7,7 @@ import { OrdersService } from './orders';
import { ServicesService } from './services';
import { SlotsService } from './slots';
import { type VariablesOf } from '@graphql-typed-document-node/core';
import { formatDate, formatTime, sumTime } from '@repo/utils/datetime-format';
import { formatDate, formatTime, getMinutes, sumTime } from '@repo/utils/datetime-format';
const STATE_MAP = {
approved: 'Одобрено',
@ -19,9 +20,7 @@ const STATE_MAP = {
};
export class NotifyService extends BaseService {
async orderCreated(
variables: {
input: Omit<VariablesOf<typeof GQL.CreateOrderDocument>['input'], 'time_end'>;
},
variables: VariablesOf<typeof GQL.CreateOrderDocument>,
createdByMaster: boolean,
) {
const customersService = new CustomersService(this.customer);
@ -30,9 +29,10 @@ export class NotifyService extends BaseService {
const slotId = String(variables.input.slot ?? '');
const serviceId = String(variables.input.services?.[0] ?? '');
const timeStart = String(variables.input.time_start ?? '');
const clientId = String(variables.input.client ?? '');
if (!serviceId || !clientId || !slotId) return;
let emoji = '🆕';
let confirmText = '';
if (createdByMaster) {
@ -47,10 +47,12 @@ export class NotifyService extends BaseService {
});
const { customer: client } = await customersService.getCustomer({ documentId: clientId });
const slotDate = formatDate(slot?.date).user();
const timeStartString = formatTime(timeStart).user();
if (!slot?.datetime_start || !variables.input.datetime_start || !service?.duration) return;
const slotDate = formatDate(slot?.datetime_start).user();
const timeStartString = formatTime(variables.input.datetime_start).user();
const timeEndString = formatTime(
service?.duration ? sumTime(timeStart, service.duration) : timeStart,
sumTime(variables.input.datetime_start, getMinutes(service?.duration)),
).user();
// Мастеру
@ -73,14 +75,16 @@ export class NotifyService extends BaseService {
if (!order) return;
const slot = order.slot;
if (!slot) return;
const service = order.services[0];
const master = slot?.master;
const client = order.client;
const orderStateString = STATE_MAP[order.state || 'unknown'];
const slotDate = formatDate(slot?.date).user();
const timeStartString = formatTime(order.time_start ?? '').user();
const timeEndString = formatTime(order.time_end ?? '').user();
const slotDate = formatDate(slot?.datetime_start).user();
const timeStartString = formatTime(order.datetime_start ?? '').user();
const timeEndString = formatTime(order.datetime_end ?? '').user();
let emoji = '✏️';
if (order.state === GQL.Enum_Order_State.Cancelled) {

View File

@ -1,22 +1,17 @@
/* eslint-disable sonarjs/cognitive-complexity */
/* eslint-disable canonical/id-match */
import { getClientWithToken } from '../apollo/client';
import * as GQL from '../types';
import { Enum_Slot_State } from '../types';
import { BaseService } from './base';
import { CustomersService } from './customers';
import { NotifyService } from './notify';
import { ServicesService } from './services';
import { SlotsService } from './slots';
import { type VariablesOf } from '@graphql-typed-document-node/core';
import { isCustomerMaster } from '@repo/utils/customer';
import { formatTime, sumTime } from '@repo/utils/datetime-format';
import { getMinutes } from '@repo/utils/datetime-format';
import dayjs from 'dayjs';
const ERRORS = {
INVALID_CLIENT: 'Invalid client',
INVALID_MASTER: 'Invalid master',
INVALID_SERVICE_DURATION: 'Invalid service duration',
MISSING_CLIENT: 'Missing client id',
MISSING_CLIENT: 'Missing client',
MISSING_ORDER: 'Order not found',
MISSING_SERVICE_ID: 'Missing service id',
MISSING_SERVICES: 'Missing services',
@ -24,69 +19,31 @@ const ERRORS = {
MISSING_START_TIME: 'Missing time start',
MISSING_USER: 'User not found',
NO_PERMISSION: 'No permission',
SLOT_CLOSED: 'Slot is closed',
};
export class OrdersService extends BaseService {
async createOrder(variables: {
input: Omit<VariablesOf<typeof GQL.CreateOrderDocument>['input'], 'time_end'>;
}) {
async createOrder(variables: VariablesOf<typeof GQL.CreateOrderDocument>) {
// Проверки на существование обязательных полей для предотвращения ошибок типов
if (!variables.input.slot) throw new Error(ERRORS.MISSING_SLOT);
if (!variables.input.client) throw new Error(ERRORS.MISSING_CLIENT);
if (!variables.input.services?.length) throw new Error(ERRORS.MISSING_SERVICES);
if (!variables.input.services[0]) throw new Error(ERRORS.MISSING_SERVICE_ID);
if (!variables.input.time_start) throw new Error(ERRORS.MISSING_START_TIME);
if (!variables.input.datetime_start) throw new Error(ERRORS.MISSING_START_TIME);
if (!variables.input.client) throw new Error(ERRORS.MISSING_CLIENT);
const customersService = new CustomersService(this.customer);
const slotsService = new SlotsService(this.customer);
const servicesService = new ServicesService(this.customer);
const { customer } = await customersService.getCustomer(this.customer);
if (!customer) throw new Error(ERRORS.MISSING_USER);
const { slot } = await slotsService.getSlot({ documentId: variables.input.slot });
if (slot?.state === Enum_Slot_State.Closed) {
throw new Error(ERRORS.SLOT_CLOSED);
}
const isMaster = isCustomerMaster(customer);
if (!isMaster) {
if (customer.documentId !== variables.input.client) {
throw new Error(ERRORS.INVALID_CLIENT);
}
const { customers } = await customersService.getMasters(this.customer);
const masters = customers.at(0)?.masters;
const masterId = slot?.master?.documentId;
if (!masters?.some((master) => master?.documentId === masterId)) {
throw new Error(ERRORS.INVALID_MASTER);
}
}
if (isMaster) {
const { customers: myMasters } = await customersService.getMasters(this.customer);
const clientId = variables.input.client;
const isTryingToRecordMaster = myMasters.some((master) => master?.documentId === clientId);
if (isTryingToRecordMaster) throw new Error(ERRORS.INVALID_CLIENT);
}
if (isMaster && slot?.master?.documentId !== customer.documentId) {
throw new Error(ERRORS.INVALID_MASTER);
}
const { service } = await servicesService.getService({
documentId: variables.input.services[0],
});
if (!service?.duration) throw new Error(ERRORS.INVALID_SERVICE_DURATION);
const endTime = sumTime(variables.input.time_start, service?.duration);
const datetimeEnd = dayjs(variables.input.datetime_start)
.add(getMinutes(service.duration), 'minute')
.toISOString();
const { mutate } = await getClientWithToken();
@ -96,8 +53,10 @@ export class OrdersService extends BaseService {
...variables,
input: {
...variables.input,
state: isMaster ? GQL.Enum_Order_State.Approved : GQL.Enum_Order_State.Created,
time_end: formatTime(endTime).db(),
datetime_end: datetimeEnd,
state: isCustomerMaster(customer)
? GQL.Enum_Order_State.Approved
: GQL.Enum_Order_State.Created,
},
},
});
@ -107,7 +66,7 @@ export class OrdersService extends BaseService {
// Уведомление об создании заказа
const notifyService = new NotifyService(this.customer);
notifyService.orderCreated(variables, isMaster);
notifyService.orderCreated(variables, isCustomerMaster(customer));
return mutationResult.data;
}

View File

@ -50,6 +50,9 @@ export class SlotsService extends BaseService {
variables: VariablesOf<typeof GQL.GetSlotsDocument>,
context: { service: GQL.ServiceFiltersInput },
) {
if (!variables.filters?.datetime_start) throw new Error('Missing date');
if (!context?.service?.documentId?.eq) throw new Error('Missing service id');
const { query } = await getClientWithToken();
const getSlotsResult = await query({
@ -66,8 +69,6 @@ export class SlotsService extends BaseService {
const servicesService = new ServicesService(this.customer);
if (!context?.service?.documentId?.eq) throw new Error('Missing service id');
const { service } = await servicesService.getService({
documentId: context.service.documentId.eq,
});
@ -76,38 +77,36 @@ export class SlotsService extends BaseService {
const serviceDuration = getMinutes(service.duration);
const openedSlots = getSlotsResult.data.slots;
const slots = getSlotsResult.data.slots;
const times: Array<{ slotId: string; time: string }> = [];
for (const slot of openedSlots) {
if (!slot?.time_start || !slot?.time_end) continue;
for (const slot of slots) {
if (!slot?.datetime_start || !slot?.datetime_end) continue;
let startTime = dayjs(`${slot.date} ${slot.time_start}`);
const endTime = dayjs(`${slot.date} ${slot.time_end}`).subtract(serviceDuration, 'minutes');
let datetimeStart = dayjs(slot.datetime_start);
const datetimeEnd = dayjs(slot.datetime_end).subtract(serviceDuration, 'minutes');
while (startTime.valueOf() <= endTime.valueOf()) {
const slotStartTime = startTime;
const potentialEndTime = startTime.add(serviceDuration, 'minutes');
while (datetimeStart.valueOf() <= datetimeEnd.valueOf()) {
const slotStartTime = datetimeStart;
const potentialDatetimeEnd = datetimeStart.add(serviceDuration, 'minutes');
const hasConflict = slot.orders.some(
(order) =>
order?.state &&
![GQL.Enum_Order_State.Cancelled, GQL.Enum_Order_State.Completed].includes(
order.state,
) &&
slotStartTime.isBefore(dayjs(`${slot.date} ${order.time_end}`)) &&
potentialEndTime.isAfter(dayjs(`${slot.date} ${order.time_start}`)),
![GQL.Enum_Order_State.Cancelled].includes(order.state) &&
slotStartTime.isBefore(dayjs(order.datetime_end)) &&
potentialDatetimeEnd.isAfter(dayjs(order.datetime_start)),
);
if (!hasConflict) {
times.push({ slotId: slot.documentId, time: startTime.format('HH:mm') });
times.push({ slotId: slot.documentId, time: datetimeStart.toISOString() });
}
startTime = startTime.add(15, 'minutes');
datetimeStart = datetimeStart.add(15, 'minutes');
}
}
return { times };
return { slots, times };
}
async getSlot(variables: VariablesOf<typeof GQL.GetSlotDocument>) {

View File

@ -8,6 +8,8 @@ module.exports = {
maybeValue: 'T | null | undefined',
onlyOperationTypes: true,
scalars: {
Date: 'string',
DateTime: 'string',
Long: 'number',
Time: 'string',
},

View File

@ -1,30 +1,26 @@
fragment OrderFields on Order {
documentId
time_start
time_end
datetime_start
datetime_end
state
order_number
services {
documentId
name
...ServiceFields
}
client {
...CustomerFields
}
slot {
date
master {
...CustomerFields
}
}
services {
documentId
name
...SlotFields
}
}
query GetOrders($filters: OrderFiltersInput, $pagination: PaginationArg) {
orders(filters: $filters, sort: "time_start:asc", pagination: $pagination) {
orders(
filters: $filters
sort: ["slot.datetime_start:desc", "datetime_start:asc"]
pagination: $pagination
) {
...OrderFields
}
}

View File

@ -1,9 +1,11 @@
fragment SlotFields on Slot {
documentId
date
time_start
time_end
datetime_start
datetime_end
state
master {
...CustomerFields
}
}
mutation CreateSlot($input: SlotInput!) {
@ -13,32 +15,27 @@ mutation CreateSlot($input: SlotInput!) {
}
query GetSlots($filters: SlotFiltersInput) {
slots(filters: $filters, sort: "time_start:asc") {
slots(filters: $filters, sort: "datetime_start:asc") {
...SlotFields
}
}
query GetSlotsOrders($filters: SlotFiltersInput) {
slots(filters: $filters, sort: "time_start:asc") {
slots(filters: $filters, sort: "datetime_start:asc") {
...SlotFields
orders(sort: "time_start:asc") {
documentId
state
time_start
time_end
orders(sort: "datetime_start:asc") {
...OrderFields
}
}
}
query GetSlot($documentId: ID!) {
slot(documentId: $documentId) {
orders(sort: "time_start:asc") {
documentId
time_start
time_end
orders(sort: "datetime_start:asc") {
...OrderFields
}
master {
documentId
...CustomerFields
}
...SlotFields
}

View File

@ -13,8 +13,7 @@ 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; }
DateTime: { input: string; output: string; }
JSON: { input: any; output: any; }
Long: { input: number; output: number; }
Time: { input: string; output: string; }
@ -113,31 +112,6 @@ 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']>>>;
@ -337,6 +311,8 @@ export type OrderFiltersInput = {
block?: InputMaybe<BlockFiltersInput>;
client?: InputMaybe<CustomerFiltersInput>;
createdAt?: InputMaybe<DateTimeFilterInput>;
datetime_end?: InputMaybe<DateTimeFilterInput>;
datetime_start?: InputMaybe<DateTimeFilterInput>;
documentId?: InputMaybe<IdFilterInput>;
not?: InputMaybe<OrderFiltersInput>;
or?: InputMaybe<Array<InputMaybe<OrderFiltersInput>>>;
@ -347,14 +323,14 @@ export type OrderFiltersInput = {
services?: InputMaybe<ServiceFiltersInput>;
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']>;
datetime_end?: InputMaybe<Scalars['DateTime']['input']>;
datetime_start?: InputMaybe<Scalars['DateTime']['input']>;
order_number?: InputMaybe<Scalars['Int']['input']>;
price?: InputMaybe<Scalars['Int']['input']>;
publishedAt?: InputMaybe<Scalars['DateTime']['input']>;
@ -362,8 +338,6 @@ export type OrderInput = {
services?: InputMaybe<Array<InputMaybe<Scalars['ID']['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 = {
@ -461,7 +435,8 @@ export type SettingInput = {
export type SlotFiltersInput = {
and?: InputMaybe<Array<InputMaybe<SlotFiltersInput>>>;
createdAt?: InputMaybe<DateTimeFilterInput>;
date?: InputMaybe<DateFilterInput>;
datetime_end?: InputMaybe<DateTimeFilterInput>;
datetime_start?: InputMaybe<DateTimeFilterInput>;
documentId?: InputMaybe<IdFilterInput>;
master?: InputMaybe<CustomerFiltersInput>;
not?: InputMaybe<SlotFiltersInput>;
@ -469,19 +444,16 @@ 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 = {
date?: InputMaybe<Scalars['Date']['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']>;
state?: InputMaybe<Enum_Slot_State>;
time_end?: InputMaybe<Scalars['Time']['input']>;
time_start?: InputMaybe<Scalars['Time']['input']>;
};
export type StringFilterInput = {
@ -695,7 +667,7 @@ export type UpdateCustomerMutationVariables = Exact<{
export type UpdateCustomerMutation = { __typename?: 'Mutation', updateCustomer?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined };
export type OrderFieldsFragment = { __typename?: 'Order', documentId: string, time_start?: string | null | undefined, time_end?: string | 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', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', date?: any | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined };
export type OrderFieldsFragment = { __typename?: 'Order', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined>, client?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined };
export type GetOrdersQueryVariables = Exact<{
filters?: InputMaybe<OrderFiltersInput>;
@ -703,21 +675,21 @@ export type GetOrdersQueryVariables = Exact<{
}>;
export type GetOrdersQuery = { __typename?: 'Query', orders: Array<{ __typename?: 'Order', documentId: string, time_start?: string | null | undefined, time_end?: string | 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', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', date?: any | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined> };
export type GetOrdersQuery = { __typename?: 'Query', orders: Array<{ __typename?: 'Order', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined>, client?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined> };
export type GetOrderQueryVariables = Exact<{
documentId: Scalars['ID']['input'];
}>;
export type GetOrderQuery = { __typename?: 'Query', order?: { __typename?: 'Order', documentId: string, time_start?: string | null | undefined, time_end?: string | 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', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', date?: any | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined };
export type GetOrderQuery = { __typename?: 'Query', order?: { __typename?: 'Order', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined>, client?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined };
export type CreateOrderMutationVariables = Exact<{
input: OrderInput;
}>;
export type CreateOrderMutation = { __typename?: 'Mutation', createOrder?: { __typename?: 'Order', documentId: string, time_start?: string | null | undefined, time_end?: string | 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', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', date?: any | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined };
export type CreateOrderMutation = { __typename?: 'Mutation', createOrder?: { __typename?: 'Order', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined>, client?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined };
export type UpdateOrderMutationVariables = Exact<{
documentId: Scalars['ID']['input'];
@ -725,7 +697,7 @@ export type UpdateOrderMutationVariables = Exact<{
}>;
export type UpdateOrderMutation = { __typename?: 'Mutation', updateOrder?: { __typename?: 'Order', documentId: string, time_start?: string | null | undefined, time_end?: string | 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', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', date?: any | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined };
export type UpdateOrderMutation = { __typename?: 'Mutation', updateOrder?: { __typename?: 'Order', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined>, client?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined };
export type ServiceFieldsFragment = { __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string };
@ -743,35 +715,35 @@ export type GetServiceQueryVariables = Exact<{
export type GetServiceQuery = { __typename?: 'Query', service?: { __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined };
export type SlotFieldsFragment = { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: string, time_end: string, state?: Enum_Slot_State | null | undefined };
export type SlotFieldsFragment = { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined };
export type CreateSlotMutationVariables = Exact<{
input: SlotInput;
}>;
export type CreateSlotMutation = { __typename?: 'Mutation', createSlot?: { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: string, time_end: string, state?: Enum_Slot_State | null | undefined } | null | undefined };
export type CreateSlotMutation = { __typename?: 'Mutation', createSlot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined };
export type GetSlotsQueryVariables = Exact<{
filters?: InputMaybe<SlotFiltersInput>;
}>;
export type GetSlotsQuery = { __typename?: 'Query', slots: Array<{ __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: string, time_end: string, state?: Enum_Slot_State | null | undefined } | null | undefined> };
export type GetSlotsQuery = { __typename?: 'Query', slots: Array<{ __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined> };
export type GetSlotsOrdersQueryVariables = Exact<{
filters?: InputMaybe<SlotFiltersInput>;
}>;
export type GetSlotsOrdersQuery = { __typename?: 'Query', slots: Array<{ __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: string, time_end: string, state?: Enum_Slot_State | null | undefined, orders: Array<{ __typename?: 'Order', documentId: string, state?: Enum_Order_State | null | undefined, time_start?: string | null | undefined, time_end?: string | null | undefined } | null | undefined> } | null | undefined> };
export type GetSlotsOrdersQuery = { __typename?: 'Query', slots: Array<{ __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, orders: Array<{ __typename?: 'Order', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined>, client?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined>, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined> };
export type GetSlotQueryVariables = Exact<{
documentId: Scalars['ID']['input'];
}>;
export type GetSlotQuery = { __typename?: 'Query', slot?: { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: string, time_end: string, state?: Enum_Slot_State | null | undefined, orders: Array<{ __typename?: 'Order', documentId: string, time_start?: string | null | undefined, time_end?: string | null | undefined } | null | undefined>, master?: { __typename?: 'Customer', documentId: string } | null | undefined } | null | undefined };
export type GetSlotQuery = { __typename?: 'Query', slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, orders: Array<{ __typename?: 'Order', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Order_State | null | undefined, order_number?: number | null | undefined, services: Array<{ __typename?: 'Service', documentId: string, name?: string | null | undefined, duration: string } | null | undefined>, client?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined, slot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined } | null | undefined>, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined };
export type UpdateSlotMutationVariables = Exact<{
documentId: Scalars['ID']['input'];
@ -779,7 +751,7 @@ export type UpdateSlotMutationVariables = Exact<{
}>;
export type UpdateSlotMutation = { __typename?: 'Mutation', updateSlot?: { __typename?: 'Slot', documentId: string, date?: any | null | undefined, time_start: string, time_end: string, state?: Enum_Slot_State | null | undefined } | null | undefined };
export type UpdateSlotMutation = { __typename?: 'Mutation', updateSlot?: { __typename?: 'Slot', documentId: string, datetime_start: string, datetime_end: string, state?: Enum_Slot_State | null | undefined, master?: { __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: number | null | undefined } | null | undefined } | null | undefined };
export type DeleteSlotMutationVariables = Exact<{
documentId: Scalars['ID']['input'];
@ -788,10 +760,10 @@ 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 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":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"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":"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<OrderFieldsFragment, unknown>;
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":"duration"}}]}}]} as unknown as DocumentNode<ServiceFieldsFragment, 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 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":"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":"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<SlotFieldsFragment, unknown>;
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":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ServiceFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Service"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"duration"}}]}},{"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<OrderFieldsFragment, 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>;
@ -799,15 +771,15 @@ export const GetCustomerDocument = {"kind":"Document","definitions":[{"kind":"Op
export const GetMastersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMasters"},"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"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}],"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":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"documentId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}}}]}}]}]}}]}}],"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<GetMastersQuery, GetMastersQueryVariables>;
export const GetClientsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetClients"},"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"}}}]}}]}]}}]}}],"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<GetClientsQuery, GetClientsQueryVariables>;
export const UpdateCustomerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCustomer"},"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<UpdateCustomerMutation, UpdateCustomerMutationVariables>;
export const GetOrdersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOrders"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderFiltersInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationArg"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"orders"},"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}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"OrderFields"}}]}}]}},{"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"}}]}},{"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":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<GetOrdersQuery, GetOrdersQueryVariables>;
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":"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"}}]}},{"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":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<GetOrderQuery, GetOrderQueryVariables>;
export const CreateOrderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateOrder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createOrder"},"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":"OrderFields"}}]}}]}},{"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"}}]}},{"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":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<CreateOrderMutation, CreateOrderMutationVariables>;
export const UpdateOrderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateOrder"},"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":"OrderInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateOrder"},"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":"OrderFields"}}]}}]}},{"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"}}]}},{"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":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"slot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<UpdateOrderMutation, UpdateOrderMutationVariables>;
export const GetOrdersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOrders"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderFiltersInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationArg"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"orders"},"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":"ListValue","values":[{"kind":"StringValue","value":"slot.datetime_start:desc","block":false},{"kind":"StringValue","value":"datetime_start:asc","block":false}]}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"OrderFields"}}]}}]}},{"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":"duration"}}]}},{"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"}}]}},{"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<GetOrdersQuery, GetOrdersQueryVariables>;
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":"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":"duration"}}]}},{"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"}}]}},{"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<GetOrderQuery, GetOrderQueryVariables>;
export const CreateOrderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateOrder"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createOrder"},"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":"OrderFields"}}]}}]}},{"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":"duration"}}]}},{"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"}}]}},{"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<CreateOrderMutation, CreateOrderMutationVariables>;
export const UpdateOrderDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateOrder"},"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":"OrderInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateOrder"},"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":"OrderFields"}}]}}]}},{"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":"duration"}}]}},{"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"}}]}},{"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<UpdateOrderMutation, UpdateOrderMutationVariables>;
export const GetServicesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetServices"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"ServiceFiltersInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"services"},"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":"ServiceFields"}}]}}]}},{"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":"duration"}}]}}]} as unknown as DocumentNode<GetServicesQuery, GetServicesQueryVariables>;
export const GetServiceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetService"},"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":"service"},"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":"ServiceFields"}}]}}]}},{"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":"duration"}}]}}]} as unknown as DocumentNode<GetServiceQuery, GetServiceQueryVariables>;
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":"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<GetSlotsQuery, GetSlotsQueryVariables>;
export const GetSlotsOrdersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSlotsOrders"},"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":"FragmentSpread","name":{"kind":"Name","value":"SlotFields"}},{"kind":"Field","name":{"kind":"Name","value":"orders"},"arguments":[{"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"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"time_start"}},{"kind":"Field","name":{"kind":"Name","value":"time_end"}}]}}]}}]}},{"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<GetSlotsOrdersQuery, GetSlotsOrdersQueryVariables>;
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":"time_start:asc","block":false}}],"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":"master"},"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 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":"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"}}]}},{"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<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":"datetime_start:asc","block":false}}],"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":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SlotFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Slot"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_start"}},{"kind":"Field","name":{"kind":"Name","value":"datetime_end"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"master"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]} as unknown as DocumentNode<GetSlotsQuery, GetSlotsQueryVariables>;
export const GetSlotsOrdersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSlotsOrders"},"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":"datetime_start:asc","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SlotFields"}},{"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":"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"}}]}},{"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":"duration"}}]}},{"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<GetSlotsOrdersQuery, GetSlotsOrdersQueryVariables>;
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":"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":"duration"}}]}},{"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"}}]}},{"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<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":"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"}}]}},{"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<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>;

View File

@ -1,62 +1,87 @@
/* eslint-disable import/no-unassigned-import */
import { isBrowser } from './environment';
import dayjs, { type ConfigType } from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import 'dayjs/locale/ru';
import dayjs from 'dayjs';
import { noop } from 'radashi';
export function combineDateTime(date: Date, time: string) {
const [hours = '00', minutes = '00'] = time.split(':');
type DateTime = Exclude<ConfigType, null | undefined>;
return new Date(
date.getFullYear(),
date.getMonth(),
date.getDate(),
Number.parseInt(hours, 10),
Number.parseInt(minutes, 10),
);
if (!dayjs.prototype.tz) {
dayjs.extend(utc);
dayjs.extend(timezone);
}
export function formatDate(date: Date | string) {
if (!date) return { db: noop, user: noop };
dayjs.locale('ru');
const DEFAULT_TZ = 'Europe/Moscow';
/**
* Склеивает дату (Date/string) и время (string, HH:mm) в datetime в нужной таймзоне, возвращает ISO строку в UTC
*/
export function combineDateAndTimeToUTC(
date: DateTime,
time: string,
tz: string = DEFAULT_TZ,
): string {
if (!date || !time) return '';
const dateString = dayjs(date).format('YYYY-MM-DD');
return dayjs.tz(`${dateString}T${time}`, tz).utc().toISOString();
}
export function formatDate(datetime: DateTime) {
return {
db: () => dayjs(date).format('YYYY-MM-DD'),
user: (template?: string, fallbackLang: string = 'ru') => {
const lang = isBrowser() ? document.documentElement.lang || fallbackLang : fallbackLang;
dayjs.locale(lang);
return dayjs(date).format(template || 'D MMMM YYYY');
db: () => dayjs(datetime).utc().toISOString(),
user: (template?: string, tz: string = DEFAULT_TZ) => {
return dayjs
.utc(datetime)
.tz(tz)
.format(template || 'D MMMM YYYY');
},
};
}
export function formatTime(time: string) {
const [hours = '00', minutes = '00'] = time.split(':');
export function formatTime(datetime: ConfigType) {
return {
db: () => `${hours}:${minutes}:00`,
user: () => `${hours}:${minutes}`,
db: () => dayjs(datetime).utc().toISOString(),
user: (tz: string = DEFAULT_TZ) => {
return dayjs.utc(datetime).tz(tz).format('HH:mm');
},
};
}
export function getDateUTCRange(date?: DateTime, tz: string = DEFAULT_TZ) {
return {
day: () => {
const startOfDay = dayjs(date).tz(tz).startOf('day').utc().toISOString();
const endOfDay = dayjs(date).tz(tz).endOf('day').utc().toISOString();
return { endOfDay, startOfDay };
},
month: () => {
const startOfMonth = dayjs(date).tz(tz).startOf('month').utc().toISOString();
const endOfMonth = dayjs(date).tz(tz).endOf('month').utc().toISOString();
return { endOfMonth, startOfMonth };
},
};
}
export function getMinutes(time: string) {
const [hours = '00', minutes = '00'] = time.split(':');
return Number.parseInt(hours, 10) * 60 + Number.parseInt(minutes, 10);
}
export function sumTime(time1: string, time2: string) {
const [hours1 = '00', minutes1 = '00'] = time1.split(':');
const [hours2 = '00', minutes2 = '00'] = time2.split(':');
export function getTimeZoneLabel(tz: string = DEFAULT_TZ): string {
if (tz === DEFAULT_TZ) return 'МСК';
const offset = dayjs().tz(tz).format('Z');
let totalMinutes = Number.parseInt(minutes1, 10) + Number.parseInt(minutes2, 10);
let totalHours = Number.parseInt(hours1, 10) + Number.parseInt(hours2, 10);
totalHours += Math.floor(totalMinutes / 60);
totalMinutes %= 60;
const paddedHours = totalHours.toString().padStart(2, '0');
const paddedMinutes = totalMinutes.toString().padStart(2, '0');
return `${paddedHours}:${paddedMinutes}`;
return `GMT${offset}`;
}
export function sumTime(datetime: DateTime, durationMinutes: number) {
if (!datetime) return '';
return dayjs(datetime).add(durationMinutes, 'minute').toISOString();
}