Compare commits

...

17 Commits

Author SHA1 Message Date
vchikalkin
c3cac74228 fix(navigation): append query parameter to bottom-nav links and enhance back navigation logic in success page 2025-07-18 16:33:24 +03:00
vchikalkin
6e91315647 refactor(profile): streamline profile and slot pages by integrating session user retrieval and updating booking logic with BookButton component 2025-07-18 16:17:12 +03:00
vchikalkin
b5626a0a58 refactor(order-datetime): update date and time handling to use datetime_start and datetime_end for improved consistency 2025-07-18 14:18:21 +03:00
vchikalkin
4c24ba2c97 refactor(service-card): replace formatTime with getMinutes for duration display 2025-07-16 17:19:15 +03:00
vchikalkin
4e5fd308c7 fix(contact-row): replace useIsMaster hook with isCustomerMaster utility for role display logic 2025-07-16 17:05:32 +03:00
vchikalkin
6a1565825d refactor(datetime-format): integrate dayjs timezone support with default Moscow timezone for date and time formatting 2025-07-16 16:23:41 +03:00
vchikalkin
e8771ed999 refactor(order-form/datetime-select): enhance date selection logic to include slot availability check 2025-07-16 13:58:02 +03:00
vchikalkin
e925f2925a refactor(i18n/config): update timeZone from 'Europe/Amsterdam' to 'Europe/Moscow' 2025-07-16 13:34:56 +03:00
vchikalkin
307997d67f feat(order-form): implement date selection with event highlighting and monthly view for available time slots 2025-07-16 13:27:41 +03:00
vchikalkin
5e517def3d refactor(profile/orders-list): enhance OrderCard component by adding avatarSource prop based on user role 2025-07-16 12:57:39 +03:00
vchikalkin
adce2b2efb refactor(profile/orders-list): update header text from "Общие записи" to "Недавние записи" for better clarity
gql: GetOrders add sort slot.date:desc
2025-07-11 18:02:38 +03:00
vchikalkin
f3446840e6 refactor(contact-row): replace role display logic with useIsMaster hook for improved clarity 2025-07-11 14:50:22 +03:00
vchikalkin
a64d974832 refactor(api/orders): simplify order creation logic by removing unnecessary validations and improving error handling 2025-07-11 13:38:59 +03:00
vchikalkin
9b464c6fac fix(deploy): update SSH configuration to use dynamic port from secrets for improved flexibility 2025-07-10 16:29:54 +03:00
vchikalkin
214414cb06 refactor(schedule): implement forbidden order states to disable editing slots with active orders 2025-07-10 16:18:46 +03:00
vchikalkin
6355fc3c68 refactor(orders): update OrderServices and ServiceSelect components to utilize ServiceCard, and enhance service fields with duration in GraphQL types 2025-07-10 15:24:42 +03:00
vchikalkin
64a7421d7c refactor(profile): comment out change role feature 2025-07-10 14:39:34 +03:00
35 changed files with 488 additions and 414 deletions

View File

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

View File

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

View File

@ -1,8 +1,11 @@
import { getCustomer } from '@/actions/api/customers';
import { getSlot } from '@/actions/api/slots'; import { getSlot } from '@/actions/api/slots';
import { getSessionUser } from '@/actions/session';
import { Container } from '@/components/layout'; import { Container } from '@/components/layout';
import { PageHeader } from '@/components/navigation'; import { PageHeader } from '@/components/navigation';
import { SlotButtons, SlotDateTime, SlotOrdersList } from '@/components/schedule'; import { SlotButtons, SlotDateTime, SlotOrdersList } from '@/components/schedule';
import { type SlotPageParameters } from '@/components/schedule/types'; import { type SlotPageParameters } from '@/components/schedule/types';
import { BookButton } from '@/components/shared/book-button';
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
type Props = { params: Promise<SlotPageParameters> }; type Props = { params: Promise<SlotPageParameters> };
@ -18,12 +21,22 @@ export default async function SlotPage(props: Readonly<Props>) {
queryKey: ['slot', documentId], 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 ( return (
<HydrationBoundary state={dehydrate(queryClient)}> <HydrationBoundary state={dehydrate(queryClient)}>
<PageHeader title="Слот" /> <PageHeader title="Слот" />
<Container> <Container>
<SlotDateTime {...parameters} /> <SlotDateTime {...parameters} />
<SlotOrdersList {...parameters} /> <SlotOrdersList {...parameters} />
{masterId && <BookButton label="Создать запись" masterId={masterId} />}
<div className="pb-24" /> <div className="pb-24" />
<SlotButtons {...parameters} /> <SlotButtons {...parameters} />
</Container> </Container>

View File

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

View File

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

View File

@ -4,22 +4,54 @@ import { useAvailableTimeSlotsQuery } from '@/hooks/api/slots';
import { useOrderStore } from '@/stores/order'; import { useOrderStore } from '@/stores/order';
import { Button } from '@repo/ui/components/ui/button'; import { Button } from '@repo/ui/components/ui/button';
import { Calendar } from '@repo/ui/components/ui/calendar'; 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 dayjs from 'dayjs';
import { useState } from 'react';
export function DateSelect() { export function DateSelect() {
const selectedDate = useOrderStore((store) => store.date); const selectedDate = useOrderStore((store) => store.date);
const setDate = useOrderStore((store) => store.setDate); const setDate = useOrderStore((store) => store.setDate);
const setTime = useOrderStore((store) => store.setTime); const setTime = useOrderStore((store) => store.setTime);
const setSlot = useOrderStore((store) => store.setSlotId); 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 ( return (
<Calendar <Calendar
className="bg-background" className="bg-background"
disabled={(date) => { 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" mode="single"
onMonthChange={(date) => setSelectedMonthDate(date)}
onSelect={(date) => { onSelect={(date) => {
if (date) setDate(date); if (date) setDate(date);
setTime(null); setTime(null);
@ -47,8 +79,9 @@ export function TimeSelect() {
const { data: { times } = {}, isLoading } = useAvailableTimeSlotsQuery( const { data: { times } = {}, isLoading } = useAvailableTimeSlotsQuery(
{ {
filters: { filters: {
date: { datetime_start: {
eq: formatDate(date).db(), gte: dayjs(date).startOf('day').toISOString(),
lte: dayjs(date).endOf('day').toISOString(),
}, },
master: { master: {
documentId: { documentId: {
@ -68,6 +101,7 @@ export function TimeSelect() {
if (isLoading || !times) return null; if (isLoading || !times) return null;
const getHour = (isoString: string) => dayjs(isoString).hour();
const morning = times.filter(({ time }) => getHour(time) < 12); const morning = times.filter(({ time }) => getHour(time) < 12);
const afternoon = times?.filter(({ time }) => { const afternoon = times?.filter(({ time }) => {
const hour = getHour(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({ function TimeSlotsButtons({
times, times,
title, title,
@ -114,7 +141,7 @@ function TimeSlotsButtons({
}} }}
variant="outline" variant="outline"
> >
{time} {formatTime(time).user()}
</Button> </Button>
))} ))}
</div> </div>

View File

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

View File

@ -1,11 +1,11 @@
'use client'; 'use client';
import { DataNotFound } from '@/components/shared/alert'; import { DataNotFound } from '@/components/shared/alert';
import { ServiceCard } from '@/components/shared/service-card';
import { useServicesQuery } from '@/hooks/api/services'; import { useServicesQuery } from '@/hooks/api/services';
import { useOrderStore } from '@/stores/order'; import { useOrderStore } from '@/stores/order';
import { type ServiceFieldsFragment } from '@repo/graphql/types'; import { type ServiceFieldsFragment } from '@repo/graphql/types';
import { cn } from '@repo/ui/lib/utils'; import { cn } from '@repo/ui/lib/utils';
import { formatTime } from '@repo/utils/datetime-format';
export function ServiceSelect() { export function ServiceSelect() {
const { data: { services } = {} } = useServicesQuery({}); const { data: { services } = {} } = useServicesQuery({});
@ -14,12 +14,14 @@ export function ServiceSelect() {
return ( return (
<div className="space-y-2 px-6"> <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> </div>
); );
} }
function ServiceCard({ documentId, duration, name }: Readonly<ServiceFieldsFragment>) { function ServiceCardRadio({ documentId, ...props }: Readonly<ServiceFieldsFragment>) {
const serviceId = useOrderStore((store) => store.serviceId); const serviceId = useOrderStore((store) => store.serviceId);
const setServiceId = useOrderStore((store) => store.setServiceId); const setServiceId = useOrderStore((store) => store.setServiceId);
@ -32,7 +34,7 @@ function ServiceCard({ documentId, duration, name }: Readonly<ServiceFieldsFragm
return ( return (
<label <label
className={cn( 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', selected ? 'border-primary' : 'border-transparent',
)} )}
> >
@ -44,24 +46,7 @@ function ServiceCard({ documentId, duration, name }: Readonly<ServiceFieldsFragm
type="radio" type="radio"
value={documentId} value={documentId}
/> />
<div className="flex w-full items-center justify-between gap-2"> <ServiceCard {...props} />
<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>
</label> </label>
); );
} }

View File

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

View File

@ -1,9 +1,8 @@
'use client'; 'use client';
import { ServiceCard } from '../shared/service-card';
import { type OrderComponentProps } from './types'; import { type OrderComponentProps } from './types';
import { useOrderQuery } from '@/hooks/api/orders'; import { useOrderQuery } from '@/hooks/api/orders';
import { type ServiceFieldsFragment } from '@repo/graphql/types';
type ServiceCardProps = Pick<ServiceFieldsFragment, 'name'>;
export function OrderServices({ documentId }: Readonly<OrderComponentProps>) { export function OrderServices({ documentId }: Readonly<OrderComponentProps>) {
const { data: { order } = {} } = useOrderQuery({ documentId }); const { data: { order } = {} } = useOrderQuery({ documentId });
@ -19,11 +18,3 @@ export function OrderServices({ documentId }: Readonly<OrderComponentProps>) {
</div> </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 { useDateTimeStore } from '@/stores/datetime';
import { HorizontalCalendar } from '@repo/ui/components/ui/horizontal-calendar'; import { HorizontalCalendar } from '@repo/ui/components/ui/horizontal-calendar';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { useState } from 'react'; import { sift } from 'radashi';
import { useMemo, useState } from 'react';
export function DateSelect() { export function DateSelect() {
const { data: { customer } = {} } = useCustomerQuery(); const { data: { customer } = {} } = useCustomerQuery();
@ -14,7 +15,7 @@ export function DateSelect() {
const [currentMonthDate, setCurrentMonthDate] = useState(new Date()); const [currentMonthDate, setCurrentMonthDate] = useState(new Date());
const { data: { orders } = {} } = useOrdersQuery({ const { data: { orders } = { orders: [] } } = useOrdersQuery({
filters: { filters: {
client: { client: {
documentId: { documentId: {
@ -22,9 +23,9 @@ export function DateSelect() {
}, },
}, },
slot: { slot: {
date: { datetime_start: {
gte: dayjs(currentMonthDate).startOf('month').format('YYYY-MM-DD'), gte: dayjs(currentMonthDate).startOf('month').toISOString(),
lte: dayjs(currentMonthDate).endOf('month').format('YYYY-MM-DD'), lte: dayjs(currentMonthDate).endOf('month').toISOString(),
}, },
master: { master: {
documentId: { 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 setSelectedDate = useDateTimeStore((store) => store.setDate);
const selectedDate = useDateTimeStore((store) => store.date); const selectedDate = useDateTimeStore((store) => store.date);
return ( return (
<HorizontalCalendar <HorizontalCalendar
daysWithOrders={orders?.map((order) => new Date(order?.slot?.date))} daysWithOrders={daysWithOrders}
onDateChange={setSelectedDate} onDateChange={setSelectedDate}
onMonthChange={(date) => setCurrentMonthDate(date)} onMonthChange={(date) => setCurrentMonthDate(date)}
selectedDate={selectedDate} selectedDate={selectedDate}

View File

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

View File

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

View File

@ -4,62 +4,6 @@ import { OrderCard } from '../shared/order-card';
import { type ProfileProps } from './types'; import { type ProfileProps } from './types';
import { useCustomerQuery, useIsMaster } from '@/hooks/api/customers'; import { useCustomerQuery, useIsMaster } from '@/hooks/api/customers';
import { useOrdersQuery } from '@/hooks/api/orders'; 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>) { export function ProfileOrdersList({ telegramId }: Readonly<ProfileProps>) {
const { data: { customer } = {} } = useCustomerQuery(); const { data: { customer } = {} } = useCustomerQuery();
@ -94,8 +38,18 @@ export function ProfileOrdersList({ telegramId }: Readonly<ProfileProps>) {
return ( return (
<div className="flex flex-col space-y-2 px-4"> <div className="flex flex-col space-y-2 px-4">
<h1 className="font-bold">Общие записи</h1> <h1 className="font-bold">Недавние записи</h1>
{orders?.map((order) => order && <OrderCard key={order.documentId} showDate {...order} />)} {orders?.map(
(order) =>
order && (
<OrderCard
avatarSource={isMaster ? 'master' : 'client'}
key={order.documentId}
showDate
{...order}
/>
),
)}
</div> </div>
); );
} }

View File

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

View File

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

View File

@ -6,22 +6,21 @@ import { useCustomerQuery } from '@/hooks/api/customers';
import { useMasterSlotsQuery } from '@/hooks/api/slots'; import { useMasterSlotsQuery } from '@/hooks/api/slots';
import { useDateTimeStore } from '@/stores/datetime'; import { useDateTimeStore } from '@/stores/datetime';
import { LoadingSpinner } from '@repo/ui/components/ui/spinner'; 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() { export function DaySlotsList() {
const { data: { customer } = {} } = useCustomerQuery(); const { data: { customer } = {} } = useCustomerQuery();
const selectedDate = useDateTimeStore((store) => store.date); const selectedDate = useDateTimeStore((store) => store.date);
const { endOfDay, startOfDay } = getDateUTCRange(selectedDate).day();
const { data: { slots } = {}, isLoading } = useMasterSlotsQuery({ const { data: { slots } = {}, isLoading } = useMasterSlotsQuery({
filters: { filters: {
date: { eq: formatDate(selectedDate).db() }, datetime_start: { gte: startOfDay, lt: endOfDay },
master: { documentId: { eq: customer?.documentId } }, master: { documentId: { eq: customer?.documentId } },
}, },
}); });
if (isLoading) return <LoadingSpinner />; if (isLoading) return <LoadingSpinner />;
return ( return (
<div className="flex flex-col space-y-2 px-4"> <div className="flex flex-col space-y-2 px-4">
<h1 className="font-bold">Слоты</h1> <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"> <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 items-center justify-between rounded-2xl bg-background p-4 px-6 dark:bg-primary/5">
<div className="flex flex-col"> <div className="flex flex-col">
<ReadonlyTimeRange timeEnd={props.time_end} timeStart={props.time_start} /> <ReadonlyTimeRange
datetimeEnd={props.datetime_end}
datetimeStart={props.datetime_start}
/>
<span <span
className={cn( className={cn(
'text-xs font-normal', 'text-xs font-normal',

View File

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

View File

@ -1,3 +1,4 @@
/* eslint-disable canonical/id-match */
/* eslint-disable react/jsx-no-bind */ /* eslint-disable react/jsx-no-bind */
'use client'; 'use client';
@ -5,14 +6,15 @@ import { type SlotComponentProps } from '../types';
import { EditableTimeRangeForm, ReadonlyTimeRange } from '@/components/shared/time-range'; import { EditableTimeRangeForm, ReadonlyTimeRange } from '@/components/shared/time-range';
import { useSlotMutation, useSlotQuery } from '@/hooks/api/slots'; import { useSlotMutation, useSlotQuery } from '@/hooks/api/slots';
import { useScheduleStore } from '@/stores/schedule'; import { useScheduleStore } from '@/stores/schedule';
import { Enum_Order_State } from '@repo/graphql/types';
import { Button } from '@repo/ui/components/ui/button'; 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 { PencilLine } from 'lucide-react';
import { useEffect } from 'react'; import { useEffect } from 'react';
export function SlotTime(props: Readonly<SlotComponentProps>) { export function SlotTime(props: Readonly<SlotComponentProps>) {
const editMode = useScheduleStore((state) => state.editMode); const editMode = useScheduleStore((state) => state.editMode);
return editMode ? <SlotTimeEditForm {...props} /> : <SlotTimeReadonly {...props} />; return editMode ? <SlotTimeEditForm {...props} /> : <SlotTimeReadonly {...props} />;
} }
@ -20,21 +22,25 @@ function SlotTimeEditForm({ documentId }: Readonly<SlotComponentProps>) {
const { editMode, endTime, resetTime, setEditMode, setEndTime, setStartTime, startTime } = const { editMode, endTime, resetTime, setEditMode, setEndTime, setStartTime, startTime } =
useScheduleStore((state) => state); useScheduleStore((state) => state);
const { isPending: isMutationPending, mutate: updateSlot } = useSlotMutation({ documentId }); const { isPending: isMutationPending, mutate: updateSlot } = useSlotMutation({ documentId });
const { data: { slot } = {}, isPending: isQueryPending } = useSlotQuery({ documentId }); const { data: { slot } = {}, isPending: isQueryPending } = useSlotQuery({ documentId });
const isPending = isMutationPending || isQueryPending; const isPending = isMutationPending || isQueryPending;
useEffect(() => { useEffect(() => {
if (editMode) { if (editMode && slot?.datetime_start && slot?.datetime_end) {
if (slot?.time_start) setStartTime(slot.time_start); setStartTime(formatTime(slot.datetime_start).user());
if (slot?.time_end) setEndTime(slot.time_end); setEndTime(formatTime(slot.datetime_end).user());
} }
}, [editMode, setEndTime, setStartTime, slot]); }, [editMode, setEndTime, setStartTime, slot]);
function handleSubmit() { 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({ updateSlot({
data: { time_end: formatTime(endTime).db(), time_start: formatTime(startTime).db() }, data: { datetime_end: newDatetimeEnd, datetime_start: newDatetimeStart },
}); });
resetTime(); resetTime();
setEditMode(false); setEditMode(false);
@ -42,28 +48,37 @@ function SlotTimeEditForm({ documentId }: Readonly<SlotComponentProps>) {
return ( return (
<EditableTimeRangeForm disabled={isPending} onSubmit={handleSubmit}> <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> </Button>
</EditableTimeRangeForm> </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>) { function SlotTimeReadonly({ documentId }: Readonly<SlotComponentProps>) {
const setEditMode = useScheduleStore((state) => state.setEditMode); const setEditMode = useScheduleStore((state) => state.setEditMode);
const { data: { slot } = {} } = useSlotQuery({ documentId }); const { data: { slot } = {} } = useSlotQuery({ documentId });
if (!slot) return null; if (!slot) return null;
const disabledEdit = slot?.orders.some(
const hasOrders = Boolean(slot?.orders.length); (order) => order?.state && FORBIDDEN_ORDER_STATES.includes(order?.state),
);
return ( return (
<div className="flex items-center gap-2"> <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 <Button
className="rounded-full text-xs" className="rounded-full text-xs"
disabled={hasOrders} disabled={disabledEdit}
onClick={() => setEditMode(true)} onClick={() => setEditMode(true)}
size="icon" size="icon"
variant="outline" 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 { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar';
import { Badge } from '@repo/ui/components/ui/badge'; import { Badge } from '@repo/ui/components/ui/badge';
import { cn } from '@repo/ui/lib/utils'; import { cn } from '@repo/ui/lib/utils';
import { isCustomerMaster } from '@repo/utils/customer';
import Link from 'next/link'; import Link from 'next/link';
import { memo } from 'react'; import { memo } from 'react';
@ -31,7 +32,7 @@ export const ContactRow = memo(function ({ className, ...contact }: ContactRowPr
<div> <div>
<p className="font-medium">{contact.name}</p> <p className="font-medium">{contact.name}</p>
<p className="text-sm text-muted-foreground"> <p className="text-sm text-muted-foreground">
{contact.role === GQL.Enum_Customer_Role.Client ? 'Клиент' : 'Мастер'} {isCustomerMaster(contact) ? 'Мастер' : 'Клиент'}
</p> </p>
</div> </div>
</div> </div>

View File

@ -21,8 +21,6 @@ export function OrderCard({
...order ...order
}: Readonly<OrderComponentProps>) { }: Readonly<OrderComponentProps>) {
const services = order?.services.map((service) => service?.name).join(', '); const services = order?.services.map((service) => service?.name).join(', ');
const date = order?.slot?.date;
const customer = avatarSource === 'master' ? order?.slot?.master : order?.client; const customer = avatarSource === 'master' ? order?.slot?.master : order?.client;
return ( return (
@ -37,9 +35,14 @@ export function OrderCard({
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">
{customer && <CustomerAvatar customer={customer} />} {customer && <CustomerAvatar customer={customer} />}
<div className="flex flex-col"> <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"> <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} {services}
</span> </span>
</div> </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 = { type TimeRangeProps = {
readonly className?: string; readonly className?: string;
readonly timeEnd: null | string | undefined; readonly datetimeEnd: null | string | undefined;
readonly timeStart: 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 ( return (
<div className={cn('flex flex-row items-center gap-2 text-lg font-bold', className)}> <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> </div>
); );
} }

View File

@ -1,5 +1,4 @@
'use client'; 'use client';
import { useCustomerQuery } from './customers'; import { useCustomerQuery } from './customers';
import { import {
createSlot, createSlot,
@ -10,21 +9,20 @@ import {
updateSlot, updateSlot,
} from '@/actions/api/slots'; } from '@/actions/api/slots';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import dayjs from 'dayjs';
type UseMasterSlotsVariables = { type UseMasterSlotsVariables = {
filters: Required< 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) => { export const useMasterSlotsQuery = (variables: UseMasterSlotsVariables) => {
const masterId = variables.filters?.master?.documentId?.eq; const masterId = variables.filters?.master?.documentId?.eq;
const date = variables.filters?.date?.eq; const datetimeStart = variables.filters?.datetime_start;
return useQuery({ return useQuery({
queryFn: () => getSlots(variables), 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 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 = [ export const localesMap = [
{ key: 'en', title: 'English' }, { key: 'en', title: 'English' },

View File

@ -1,3 +1,4 @@
/* eslint-disable complexity */
import * as GQL from '../types'; import * as GQL from '../types';
import { notifyByTelegramId } from '../utils/notify'; import { notifyByTelegramId } from '../utils/notify';
import { BaseService } from './base'; import { BaseService } from './base';
@ -6,7 +7,7 @@ import { OrdersService } from './orders';
import { ServicesService } from './services'; import { ServicesService } from './services';
import { SlotsService } from './slots'; import { SlotsService } from './slots';
import { type VariablesOf } from '@graphql-typed-document-node/core'; 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 = { const STATE_MAP = {
approved: 'Одобрено', approved: 'Одобрено',
@ -19,9 +20,7 @@ const STATE_MAP = {
}; };
export class NotifyService extends BaseService { export class NotifyService extends BaseService {
async orderCreated( async orderCreated(
variables: { variables: VariablesOf<typeof GQL.CreateOrderDocument>,
input: Omit<VariablesOf<typeof GQL.CreateOrderDocument>['input'], 'time_end'>;
},
createdByMaster: boolean, createdByMaster: boolean,
) { ) {
const customersService = new CustomersService(this.customer); const customersService = new CustomersService(this.customer);
@ -30,9 +29,10 @@ export class NotifyService extends BaseService {
const slotId = String(variables.input.slot ?? ''); const slotId = String(variables.input.slot ?? '');
const serviceId = String(variables.input.services?.[0] ?? ''); const serviceId = String(variables.input.services?.[0] ?? '');
const timeStart = String(variables.input.time_start ?? '');
const clientId = String(variables.input.client ?? ''); const clientId = String(variables.input.client ?? '');
if (!serviceId || !clientId || !slotId) return;
let emoji = '🆕'; let emoji = '🆕';
let confirmText = ''; let confirmText = '';
if (createdByMaster) { if (createdByMaster) {
@ -47,10 +47,12 @@ export class NotifyService extends BaseService {
}); });
const { customer: client } = await customersService.getCustomer({ documentId: clientId }); const { customer: client } = await customersService.getCustomer({ documentId: clientId });
const slotDate = formatDate(slot?.date).user(); if (!slot?.datetime_start || !variables.input.datetime_start || !service?.duration) return;
const timeStartString = formatTime(timeStart).user();
const slotDate = formatDate(slot?.datetime_start).user();
const timeStartString = formatTime(variables.input.datetime_start).user();
const timeEndString = formatTime( const timeEndString = formatTime(
service?.duration ? sumTime(timeStart, service.duration) : timeStart, sumTime(variables.input.datetime_start, getMinutes(service?.duration)),
).user(); ).user();
// Мастеру // Мастеру
@ -73,14 +75,16 @@ export class NotifyService extends BaseService {
if (!order) return; if (!order) return;
const slot = order.slot; const slot = order.slot;
if (!slot) return;
const service = order.services[0]; const service = order.services[0];
const master = slot?.master; const master = slot?.master;
const client = order.client; const client = order.client;
const orderStateString = STATE_MAP[order.state || 'unknown']; const orderStateString = STATE_MAP[order.state || 'unknown'];
const slotDate = formatDate(slot?.date).user(); const slotDate = formatDate(slot?.datetime_start).user();
const timeStartString = formatTime(order.time_start ?? '').user(); const timeStartString = formatTime(order.datetime_start ?? '').user();
const timeEndString = formatTime(order.time_end ?? '').user(); const timeEndString = formatTime(order.datetime_end ?? '').user();
let emoji = '✏️'; let emoji = '✏️';
if (order.state === GQL.Enum_Order_State.Cancelled) { 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 { getClientWithToken } from '../apollo/client';
import * as GQL from '../types'; import * as GQL from '../types';
import { Enum_Slot_State } from '../types';
import { BaseService } from './base'; import { BaseService } from './base';
import { CustomersService } from './customers'; import { CustomersService } from './customers';
import { NotifyService } from './notify'; import { NotifyService } from './notify';
import { ServicesService } from './services'; import { ServicesService } from './services';
import { SlotsService } from './slots';
import { type VariablesOf } from '@graphql-typed-document-node/core'; import { type VariablesOf } from '@graphql-typed-document-node/core';
import { isCustomerMaster } from '@repo/utils/customer'; 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 = { const ERRORS = {
INVALID_CLIENT: 'Invalid client',
INVALID_MASTER: 'Invalid master',
INVALID_SERVICE_DURATION: 'Invalid service duration', INVALID_SERVICE_DURATION: 'Invalid service duration',
MISSING_CLIENT: 'Missing client id', MISSING_CLIENT: 'Missing client',
MISSING_ORDER: 'Order not found', MISSING_ORDER: 'Order not found',
MISSING_SERVICE_ID: 'Missing service id', MISSING_SERVICE_ID: 'Missing service id',
MISSING_SERVICES: 'Missing services', MISSING_SERVICES: 'Missing services',
@ -24,69 +19,31 @@ const ERRORS = {
MISSING_START_TIME: 'Missing time start', MISSING_START_TIME: 'Missing time start',
MISSING_USER: 'User not found', MISSING_USER: 'User not found',
NO_PERMISSION: 'No permission', NO_PERMISSION: 'No permission',
SLOT_CLOSED: 'Slot is closed',
}; };
export class OrdersService extends BaseService { export class OrdersService extends BaseService {
async createOrder(variables: { async createOrder(variables: VariablesOf<typeof GQL.CreateOrderDocument>) {
input: Omit<VariablesOf<typeof GQL.CreateOrderDocument>['input'], 'time_end'>; // Проверки на существование обязательных полей для предотвращения ошибок типов
}) {
if (!variables.input.slot) throw new Error(ERRORS.MISSING_SLOT); 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?.length) throw new Error(ERRORS.MISSING_SERVICES);
if (!variables.input.services[0]) throw new Error(ERRORS.MISSING_SERVICE_ID); 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 customersService = new CustomersService(this.customer);
const slotsService = new SlotsService(this.customer);
const servicesService = new ServicesService(this.customer); const servicesService = new ServicesService(this.customer);
const { customer } = await customersService.getCustomer(this.customer); const { customer } = await customersService.getCustomer(this.customer);
if (!customer) throw new Error(ERRORS.MISSING_USER); 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({ const { service } = await servicesService.getService({
documentId: variables.input.services[0], documentId: variables.input.services[0],
}); });
if (!service?.duration) throw new Error(ERRORS.INVALID_SERVICE_DURATION); 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(); const { mutate } = await getClientWithToken();
@ -96,8 +53,10 @@ export class OrdersService extends BaseService {
...variables, ...variables,
input: { input: {
...variables.input, ...variables.input,
state: isMaster ? GQL.Enum_Order_State.Approved : GQL.Enum_Order_State.Created, datetime_end: datetimeEnd,
time_end: formatTime(endTime).db(), 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); const notifyService = new NotifyService(this.customer);
notifyService.orderCreated(variables, isMaster); notifyService.orderCreated(variables, isCustomerMaster(customer));
return mutationResult.data; return mutationResult.data;
} }

View File

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

View File

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

View File

@ -1,30 +1,26 @@
fragment OrderFields on Order { fragment OrderFields on Order {
documentId documentId
time_start datetime_start
time_end datetime_end
state state
order_number order_number
services { services {
documentId ...ServiceFields
name
} }
client { client {
...CustomerFields ...CustomerFields
} }
slot { slot {
date ...SlotFields
master {
...CustomerFields
}
}
services {
documentId
name
} }
} }
query GetOrders($filters: OrderFiltersInput, $pagination: PaginationArg) { 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 ...OrderFields
} }
} }

View File

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

View File

@ -13,8 +13,7 @@ export type Scalars = {
Boolean: { input: boolean; output: boolean; } Boolean: { input: boolean; output: boolean; }
Int: { input: number; output: number; } Int: { input: number; output: number; }
Float: { input: number; output: number; } Float: { input: number; output: number; }
Date: { input: any; output: any; } DateTime: { input: string; output: string; }
DateTime: { input: any; output: any; }
JSON: { input: any; output: any; } JSON: { input: any; output: any; }
Long: { input: number; output: number; } Long: { input: number; output: number; }
Time: { input: string; output: string; } Time: { input: string; output: string; }
@ -113,31 +112,6 @@ export type CustomerInput = {
telegramId?: InputMaybe<Scalars['Long']['input']>; 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 = { export type DateTimeFilterInput = {
and?: InputMaybe<Array<InputMaybe<Scalars['DateTime']['input']>>>; and?: InputMaybe<Array<InputMaybe<Scalars['DateTime']['input']>>>;
between?: InputMaybe<Array<InputMaybe<Scalars['DateTime']['input']>>>; between?: InputMaybe<Array<InputMaybe<Scalars['DateTime']['input']>>>;
@ -337,6 +311,8 @@ export type OrderFiltersInput = {
block?: InputMaybe<BlockFiltersInput>; block?: InputMaybe<BlockFiltersInput>;
client?: InputMaybe<CustomerFiltersInput>; client?: InputMaybe<CustomerFiltersInput>;
createdAt?: InputMaybe<DateTimeFilterInput>; createdAt?: InputMaybe<DateTimeFilterInput>;
datetime_end?: InputMaybe<DateTimeFilterInput>;
datetime_start?: InputMaybe<DateTimeFilterInput>;
documentId?: InputMaybe<IdFilterInput>; documentId?: InputMaybe<IdFilterInput>;
not?: InputMaybe<OrderFiltersInput>; not?: InputMaybe<OrderFiltersInput>;
or?: InputMaybe<Array<InputMaybe<OrderFiltersInput>>>; or?: InputMaybe<Array<InputMaybe<OrderFiltersInput>>>;
@ -347,14 +323,14 @@ export type OrderFiltersInput = {
services?: InputMaybe<ServiceFiltersInput>; services?: InputMaybe<ServiceFiltersInput>;
slot?: InputMaybe<SlotFiltersInput>; slot?: InputMaybe<SlotFiltersInput>;
state?: InputMaybe<StringFilterInput>; state?: InputMaybe<StringFilterInput>;
time_end?: InputMaybe<TimeFilterInput>;
time_start?: InputMaybe<TimeFilterInput>;
updatedAt?: InputMaybe<DateTimeFilterInput>; updatedAt?: InputMaybe<DateTimeFilterInput>;
}; };
export type OrderInput = { export type OrderInput = {
block?: InputMaybe<Scalars['ID']['input']>; block?: InputMaybe<Scalars['ID']['input']>;
client?: 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']>; order_number?: InputMaybe<Scalars['Int']['input']>;
price?: InputMaybe<Scalars['Int']['input']>; price?: InputMaybe<Scalars['Int']['input']>;
publishedAt?: InputMaybe<Scalars['DateTime']['input']>; publishedAt?: InputMaybe<Scalars['DateTime']['input']>;
@ -362,8 +338,6 @@ export type OrderInput = {
services?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>; services?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
slot?: InputMaybe<Scalars['ID']['input']>; slot?: InputMaybe<Scalars['ID']['input']>;
state?: InputMaybe<Enum_Order_State>; state?: InputMaybe<Enum_Order_State>;
time_end?: InputMaybe<Scalars['Time']['input']>;
time_start?: InputMaybe<Scalars['Time']['input']>;
}; };
export type PaginationArg = { export type PaginationArg = {
@ -461,7 +435,8 @@ export type SettingInput = {
export type SlotFiltersInput = { export type SlotFiltersInput = {
and?: InputMaybe<Array<InputMaybe<SlotFiltersInput>>>; and?: InputMaybe<Array<InputMaybe<SlotFiltersInput>>>;
createdAt?: InputMaybe<DateTimeFilterInput>; createdAt?: InputMaybe<DateTimeFilterInput>;
date?: InputMaybe<DateFilterInput>; datetime_end?: InputMaybe<DateTimeFilterInput>;
datetime_start?: InputMaybe<DateTimeFilterInput>;
documentId?: InputMaybe<IdFilterInput>; documentId?: InputMaybe<IdFilterInput>;
master?: InputMaybe<CustomerFiltersInput>; master?: InputMaybe<CustomerFiltersInput>;
not?: InputMaybe<SlotFiltersInput>; not?: InputMaybe<SlotFiltersInput>;
@ -469,19 +444,16 @@ export type SlotFiltersInput = {
orders?: InputMaybe<OrderFiltersInput>; orders?: InputMaybe<OrderFiltersInput>;
publishedAt?: InputMaybe<DateTimeFilterInput>; publishedAt?: InputMaybe<DateTimeFilterInput>;
state?: InputMaybe<StringFilterInput>; state?: InputMaybe<StringFilterInput>;
time_end?: InputMaybe<TimeFilterInput>;
time_start?: InputMaybe<TimeFilterInput>;
updatedAt?: InputMaybe<DateTimeFilterInput>; updatedAt?: InputMaybe<DateTimeFilterInput>;
}; };
export type SlotInput = { 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']>; master?: InputMaybe<Scalars['ID']['input']>;
orders?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>; orders?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
publishedAt?: InputMaybe<Scalars['DateTime']['input']>; publishedAt?: InputMaybe<Scalars['DateTime']['input']>;
state?: InputMaybe<Enum_Slot_State>; state?: InputMaybe<Enum_Slot_State>;
time_end?: InputMaybe<Scalars['Time']['input']>;
time_start?: InputMaybe<Scalars['Time']['input']>;
}; };
export type StringFilterInput = { 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 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<{ export type GetOrdersQueryVariables = Exact<{
filters?: InputMaybe<OrderFiltersInput>; 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<{ export type GetOrderQueryVariables = Exact<{
documentId: Scalars['ID']['input']; 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<{ export type CreateOrderMutationVariables = Exact<{
input: OrderInput; 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<{ export type UpdateOrderMutationVariables = Exact<{
documentId: Scalars['ID']['input']; 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 }; 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 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<{ export type CreateSlotMutationVariables = Exact<{
input: SlotInput; 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<{ export type GetSlotsQueryVariables = Exact<{
filters?: InputMaybe<SlotFiltersInput>; 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<{ export type GetSlotsOrdersQueryVariables = Exact<{
filters?: InputMaybe<SlotFiltersInput>; 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<{ export type GetSlotQueryVariables = Exact<{
documentId: Scalars['ID']['input']; 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<{ export type UpdateSlotMutationVariables = Exact<{
documentId: Scalars['ID']['input']; 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<{ export type DeleteSlotMutationVariables = Exact<{
documentId: Scalars['ID']['input']; 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 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 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 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 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>; 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 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 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 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 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":"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 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":"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 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":"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 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 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 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 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":"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 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":"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 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":"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 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":"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 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>; 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 */ /* 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/locale/ru';
import dayjs from 'dayjs';
import { noop } from 'radashi';
export function combineDateTime(date: Date, time: string) { type DateTime = Exclude<ConfigType, null | undefined>;
const [hours = '00', minutes = '00'] = time.split(':');
return new Date( if (!dayjs.prototype.tz) {
date.getFullYear(), dayjs.extend(utc);
date.getMonth(), dayjs.extend(timezone);
date.getDate(),
Number.parseInt(hours, 10),
Number.parseInt(minutes, 10),
);
} }
export function formatDate(date: Date | string) { dayjs.locale('ru');
if (!date) return { db: noop, user: noop };
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 { return {
db: () => dayjs(date).format('YYYY-MM-DD'), db: () => dayjs(datetime).utc().toISOString(),
user: (template?: string, fallbackLang: string = 'ru') => { user: (template?: string, tz: string = DEFAULT_TZ) => {
const lang = isBrowser() ? document.documentElement.lang || fallbackLang : fallbackLang; return dayjs
.utc(datetime)
dayjs.locale(lang); .tz(tz)
.format(template || 'D MMMM YYYY');
return dayjs(date).format(template || 'D MMMM YYYY');
}, },
}; };
} }
export function formatTime(time: string) { export function formatTime(datetime: ConfigType) {
const [hours = '00', minutes = '00'] = time.split(':');
return { return {
db: () => `${hours}:${minutes}:00`, db: () => dayjs(datetime).utc().toISOString(),
user: () => `${hours}:${minutes}`, 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) { export function getMinutes(time: string) {
const [hours = '00', minutes = '00'] = time.split(':'); const [hours = '00', minutes = '00'] = time.split(':');
return Number.parseInt(hours, 10) * 60 + Number.parseInt(minutes, 10); return Number.parseInt(hours, 10) * 60 + Number.parseInt(minutes, 10);
} }
export function sumTime(time1: string, time2: string) { export function getTimeZoneLabel(tz: string = DEFAULT_TZ): string {
const [hours1 = '00', minutes1 = '00'] = time1.split(':'); if (tz === DEFAULT_TZ) return 'МСК';
const [hours2 = '00', minutes2 = '00'] = time2.split(':'); const offset = dayjs().tz(tz).format('Z');
let totalMinutes = Number.parseInt(minutes1, 10) + Number.parseInt(minutes2, 10); return `GMT${offset}`;
let totalHours = Number.parseInt(hours1, 10) + Number.parseInt(hours2, 10); }
totalHours += Math.floor(totalMinutes / 60); export function sumTime(datetime: DateTime, durationMinutes: number) {
totalMinutes %= 60; if (!datetime) return '';
const paddedHours = totalHours.toString().padStart(2, '0'); return dayjs(datetime).add(durationMinutes, 'minute').toISOString();
const paddedMinutes = totalMinutes.toString().padStart(2, '0');
return `${paddedHours}:${paddedMinutes}`;
} }