get customer contacts
This commit is contained in:
parent
0a7d9c75c0
commit
550c5474a3
@ -1,71 +1,21 @@
|
||||
'use server';
|
||||
|
||||
export type Contact = {
|
||||
avatarUrl: string;
|
||||
id: string;
|
||||
name: string;
|
||||
status: 'client' | 'master';
|
||||
};
|
||||
|
||||
// Имитация базы данных
|
||||
const contacts: Contact[] = [
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '1',
|
||||
name: 'Иван Иванов',
|
||||
status: 'client',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '2',
|
||||
name: 'Петр Петров',
|
||||
status: 'master',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '3',
|
||||
name: 'Анна Сидорова',
|
||||
status: 'client',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '4',
|
||||
name: 'Мария Кузнецова',
|
||||
status: 'master',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '5',
|
||||
name: 'Алексей Петров',
|
||||
status: 'client',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '6',
|
||||
name: 'Иван Иванов',
|
||||
status: 'master',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '7',
|
||||
name: 'Петр Петров',
|
||||
status: 'client',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '8',
|
||||
name: 'Анна Сидорова',
|
||||
status: 'master',
|
||||
},
|
||||
{
|
||||
avatarUrl: '/placeholder.svg?height=40&width=40',
|
||||
id: '9',
|
||||
name: 'Мария Кузнецова',
|
||||
status: 'client',
|
||||
},
|
||||
] as const;
|
||||
import { authOptions } from '@/config/auth';
|
||||
import { getCustomerClients, getCustomerMasters } from '@repo/graphql/api';
|
||||
import { getServerSession } from 'next-auth/next';
|
||||
|
||||
export async function getContacts() {
|
||||
// В реальном приложении здесь был бы запрос к базе данных
|
||||
return contacts;
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
if (session) {
|
||||
const { user } = session;
|
||||
const getCustomerMastersResponse = await getCustomerMasters({ telegramId: user?.telegramId });
|
||||
const getCustomerClientsResponse = await getCustomerClients({ telegramId: user?.telegramId });
|
||||
|
||||
return {
|
||||
clients: getCustomerClientsResponse?.clients,
|
||||
masters: getCustomerMastersResponse?.masters,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,27 +1,26 @@
|
||||
/* eslint-disable promise/prefer-await-to-then */
|
||||
'use client';
|
||||
import { type Contact, getContacts } from '@/actions/contacts';
|
||||
import { ContactsFilterContext } from '@/context/contacts-filter';
|
||||
import { useCustomerContacts } from '@/hooks/contacts';
|
||||
import * as GQL from '@repo/graphql/types';
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar';
|
||||
import Link from 'next/link';
|
||||
import { memo, use, useEffect, useMemo, useState } from 'react';
|
||||
import { memo } from 'react';
|
||||
|
||||
type ContactRowProps = {
|
||||
readonly contact: Contact;
|
||||
readonly contact: GQL.CustomerFieldsFragment;
|
||||
};
|
||||
|
||||
const ContactRow = memo(function ({ contact }: ContactRowProps) {
|
||||
return (
|
||||
<Link href={`/profile/${contact.id}`} key={contact.id}>
|
||||
<Link href={`/profile/${contact.telegramId}`} key={contact.telegramId}>
|
||||
<div className="flex items-center space-x-4 rounded-lg py-2 transition-colors hover:bg-accent">
|
||||
<Avatar>
|
||||
<AvatarImage alt={contact.name} src={contact.avatarUrl} />
|
||||
<AvatarImage alt={contact.name} src={contact.photoUrl || ''} />
|
||||
<AvatarFallback>{contact.name.charAt(0)}</AvatarFallback>
|
||||
</Avatar>
|
||||
<div>
|
||||
<p className="font-medium">{contact.name}</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{contact.status === 'client' ? 'Клиент' : 'Мастер'}
|
||||
{contact.role === GQL.Enum_Customer_Role.Client ? 'Клиент' : 'Мастер'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -30,24 +29,12 @@ const ContactRow = memo(function ({ contact }: ContactRowProps) {
|
||||
});
|
||||
|
||||
export function ContactsList() {
|
||||
const [contacts, setContacts] = useState<Contact[]>([]);
|
||||
const { filter } = use(ContactsFilterContext);
|
||||
|
||||
useEffect(() => {
|
||||
getContacts().then(setContacts);
|
||||
}, []);
|
||||
|
||||
const filteredContacts = useMemo(() => {
|
||||
if (filter === 'all') return contacts;
|
||||
if (filter === 'clients') return contacts.filter((contact) => contact.status === 'client');
|
||||
if (filter === 'masters') return contacts.filter((contact) => contact.status === 'master');
|
||||
return contacts;
|
||||
}, [contacts, filter]);
|
||||
const { contacts } = useCustomerContacts();
|
||||
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
{filteredContacts.map((contact) => (
|
||||
<ContactRow contact={contact} key={contact.id} />
|
||||
{contacts.map((contact) => (
|
||||
<ContactRow contact={contact} key={contact.documentId} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
||||
1
apps/web/hooks/contacts/index.ts
Normal file
1
apps/web/hooks/contacts/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './use-customer-contacts';
|
||||
43
apps/web/hooks/contacts/use-customer-contacts.ts
Normal file
43
apps/web/hooks/contacts/use-customer-contacts.ts
Normal file
@ -0,0 +1,43 @@
|
||||
/* eslint-disable promise/prefer-await-to-then */
|
||||
'use client';
|
||||
import { getContacts } from '@/actions/contacts';
|
||||
import { ContactsFilterContext } from '@/context/contacts-filter';
|
||||
import type * as GQL from '@repo/graphql/types';
|
||||
import { sift } from 'radash';
|
||||
import { use, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
type Clients = NonNullable<GQL.GetCustomerClientsQuery['customers'][0]>['clients'];
|
||||
type Masters = NonNullable<GQL.GetCustomerMastersQuery['customers'][0]>['masters'];
|
||||
|
||||
export function useCustomerContacts() {
|
||||
const [contacts, setContacts] = useState<{ clients: Clients; masters: Masters }>({
|
||||
clients: [],
|
||||
masters: [],
|
||||
});
|
||||
|
||||
const { filter } = use(ContactsFilterContext);
|
||||
|
||||
useEffect(() => {
|
||||
getContacts().then((response) => {
|
||||
setContacts({
|
||||
clients: response?.clients || [],
|
||||
masters: response?.masters || [],
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
|
||||
const filteredContacts = useMemo(() => {
|
||||
const { clients, masters } = contacts;
|
||||
|
||||
switch (filter) {
|
||||
case 'clients':
|
||||
return sift(clients);
|
||||
case 'masters':
|
||||
return sift(masters);
|
||||
default:
|
||||
return [...sift(clients), ...sift(masters)];
|
||||
}
|
||||
}, [contacts, filter]);
|
||||
|
||||
return { contacts: filteredContacts };
|
||||
}
|
||||
@ -22,6 +22,7 @@
|
||||
"next-auth": "^4.24.11",
|
||||
"next-intl": "^3.26.0",
|
||||
"next-themes": "^0.4.4",
|
||||
"radash": "^12.1.0",
|
||||
"react": "catalog:",
|
||||
"react-dom": "catalog:",
|
||||
"use-debounce": "^10.0.4",
|
||||
|
||||
@ -38,9 +38,29 @@ export async function getCustomer(input: GQL.GetCustomerQueryVariables) {
|
||||
variables: input,
|
||||
});
|
||||
|
||||
const customer = response?.data?.customers?.at(0);
|
||||
return response?.data?.customers?.at(0);
|
||||
}
|
||||
|
||||
return customer;
|
||||
export async function getCustomerMasters(input: GQL.GetCustomerMastersQueryVariables) {
|
||||
const { query } = await getClientWithToken();
|
||||
|
||||
const response = await query({
|
||||
query: GQL.GetCustomerMastersDocument,
|
||||
variables: input,
|
||||
});
|
||||
|
||||
return response?.data?.customers?.at(0);
|
||||
}
|
||||
|
||||
export async function getCustomerClients(input: GQL.GetCustomerClientsQueryVariables) {
|
||||
const { query } = await getClientWithToken();
|
||||
|
||||
const response = await query({
|
||||
query: GQL.GetCustomerClientsDocument,
|
||||
variables: input,
|
||||
});
|
||||
|
||||
return response?.data?.customers?.at(0);
|
||||
}
|
||||
|
||||
type AddCustomerMasterInput = Pick<GQL.CreateCustomerMutationVariables, 'phone' | 'telegramId'> & {
|
||||
|
||||
@ -21,7 +21,12 @@ query GetCustomer($phone: String, $telegramId: Long) {
|
||||
}
|
||||
|
||||
query GetCustomerMasters($phone: String, $telegramId: Long) {
|
||||
customers(filters: { or: [{ phone: { eq: $phone } }, { telegramId: { eq: $telegramId } }] }) {
|
||||
customers(
|
||||
filters: {
|
||||
or: [{ phone: { eq: $phone } }, { telegramId: { eq: $telegramId } }]
|
||||
and: [{ active: { eq: true } }]
|
||||
}
|
||||
) {
|
||||
documentId
|
||||
masters {
|
||||
...CustomerFields
|
||||
@ -29,6 +34,20 @@ query GetCustomerMasters($phone: String, $telegramId: Long) {
|
||||
}
|
||||
}
|
||||
|
||||
query GetCustomerClients($phone: String, $telegramId: Long) {
|
||||
customers(
|
||||
filters: {
|
||||
or: [{ phone: { eq: $phone } }, { telegramId: { eq: $telegramId } }]
|
||||
and: [{ active: { eq: true } }]
|
||||
}
|
||||
) {
|
||||
documentId
|
||||
clients {
|
||||
...CustomerFields
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mutation UpdateCustomerProfile($documentId: ID!, $data: CustomerInput!) {
|
||||
updateCustomer(documentId: $documentId, data: $data) {
|
||||
...CustomerFields
|
||||
|
||||
@ -594,6 +594,14 @@ export type GetCustomerMastersQueryVariables = Exact<{
|
||||
|
||||
export type GetCustomerMastersQuery = { __typename?: 'Query', customers: Array<{ __typename?: 'Customer', documentId: string, masters: Array<{ __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: any | null | undefined } | null | undefined> } | null | undefined> };
|
||||
|
||||
export type GetCustomerClientsQueryVariables = Exact<{
|
||||
phone?: InputMaybe<Scalars['String']['input']>;
|
||||
telegramId?: InputMaybe<Scalars['Long']['input']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetCustomerClientsQuery = { __typename?: 'Query', customers: Array<{ __typename?: 'Customer', documentId: string, clients: Array<{ __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: any | null | undefined } | null | undefined> } | null | undefined> };
|
||||
|
||||
export type UpdateCustomerProfileMutationVariables = Exact<{
|
||||
documentId: Scalars['ID']['input'];
|
||||
data: CustomerInput;
|
||||
@ -607,5 +615,6 @@ export const RegisterDocument = {"kind":"Document","definitions":[{"kind":"Opera
|
||||
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 GetCustomerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomer"},"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":"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<GetCustomerQuery, GetCustomerQueryVariables>;
|
||||
export const GetCustomerMastersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerMasters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"masters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode<GetCustomerMastersQuery, GetCustomerMastersQueryVariables>;
|
||||
export const GetCustomerMastersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerMasters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"and"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"masters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode<GetCustomerMastersQuery, GetCustomerMastersQueryVariables>;
|
||||
export const GetCustomerClientsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerClients"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"and"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"clients"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode<GetCustomerClientsQuery, GetCustomerClientsQueryVariables>;
|
||||
export const UpdateCustomerProfileDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCustomerProfile"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CustomerInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCustomer"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"documentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode<UpdateCustomerProfileMutation, UpdateCustomerProfileMutationVariables>;
|
||||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@ -162,6 +162,9 @@ importers:
|
||||
next-themes:
|
||||
specifier: ^0.4.4
|
||||
version: 0.4.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||
radash:
|
||||
specifier: ^12.1.0
|
||||
version: 12.1.0
|
||||
react:
|
||||
specifier: 'catalog:'
|
||||
version: 19.0.0
|
||||
@ -5203,6 +5206,10 @@ packages:
|
||||
queue-microtask@1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
|
||||
radash@12.1.0:
|
||||
resolution: {integrity: sha512-b0Zcf09AhqKS83btmUeYBS8tFK7XL2e3RvLmZcm0sTdF1/UUlHSsjXdCcWNxe7yfmAlPve5ym0DmKGtTzP6kVQ==}
|
||||
engines: {node: '>=14.18.0'}
|
||||
|
||||
rambda@7.5.0:
|
||||
resolution: {integrity: sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA==}
|
||||
|
||||
@ -11887,6 +11894,8 @@ snapshots:
|
||||
|
||||
queue-microtask@1.2.3: {}
|
||||
|
||||
radash@12.1.0: {}
|
||||
|
||||
rambda@7.5.0: {}
|
||||
|
||||
ramda@0.30.1: {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user