303 lines
4.6 KiB
TypeScript
303 lines
4.6 KiB
TypeScript
import { gql } from 'graphql-tag'
|
|
|
|
export const GET_ME = gql`
|
|
query GetMe {
|
|
me {
|
|
id
|
|
phone
|
|
avatar
|
|
managerName
|
|
createdAt
|
|
organization {
|
|
id
|
|
inn
|
|
kpp
|
|
name
|
|
fullName
|
|
address
|
|
addressFull
|
|
ogrn
|
|
ogrnDate
|
|
type
|
|
status
|
|
actualityDate
|
|
registrationDate
|
|
liquidationDate
|
|
managementName
|
|
managementPost
|
|
opfCode
|
|
opfFull
|
|
opfShort
|
|
okato
|
|
oktmo
|
|
okpo
|
|
okved
|
|
employeeCount
|
|
revenue
|
|
taxSystem
|
|
phones
|
|
emails
|
|
apiKeys {
|
|
id
|
|
marketplace
|
|
isActive
|
|
validationData
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GET_MY_SERVICES = gql`
|
|
query GetMyServices {
|
|
myServices {
|
|
id
|
|
name
|
|
description
|
|
price
|
|
imageUrl
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GET_MY_SUPPLIES = gql`
|
|
query GetMySupplies {
|
|
mySupplies {
|
|
id
|
|
name
|
|
description
|
|
price
|
|
quantity
|
|
imageUrl
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
}
|
|
`
|
|
|
|
// Запросы для контрагентов
|
|
export const SEARCH_ORGANIZATIONS = gql`
|
|
query SearchOrganizations($type: OrganizationType, $search: String) {
|
|
searchOrganizations(type: $type, search: $search) {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
type
|
|
address
|
|
phones
|
|
emails
|
|
createdAt
|
|
isCounterparty
|
|
isCurrentUser
|
|
hasOutgoingRequest
|
|
hasIncomingRequest
|
|
users {
|
|
id
|
|
avatar
|
|
managerName
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GET_MY_COUNTERPARTIES = gql`
|
|
query GetMyCounterparties {
|
|
myCounterparties {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
managementName
|
|
type
|
|
address
|
|
phones
|
|
emails
|
|
createdAt
|
|
users {
|
|
id
|
|
avatar
|
|
managerName
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GET_INCOMING_REQUESTS = gql`
|
|
query GetIncomingRequests {
|
|
incomingRequests {
|
|
id
|
|
status
|
|
message
|
|
createdAt
|
|
sender {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
type
|
|
address
|
|
phones
|
|
emails
|
|
createdAt
|
|
users {
|
|
id
|
|
avatar
|
|
}
|
|
}
|
|
receiver {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
type
|
|
users {
|
|
id
|
|
avatar
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GET_OUTGOING_REQUESTS = gql`
|
|
query GetOutgoingRequests {
|
|
outgoingRequests {
|
|
id
|
|
status
|
|
message
|
|
createdAt
|
|
sender {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
type
|
|
users {
|
|
id
|
|
avatar
|
|
}
|
|
}
|
|
receiver {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
type
|
|
address
|
|
phones
|
|
emails
|
|
createdAt
|
|
users {
|
|
id
|
|
avatar
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GET_ORGANIZATION = gql`
|
|
query GetOrganization($id: ID!) {
|
|
organization(id: $id) {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
address
|
|
type
|
|
apiKeys {
|
|
id
|
|
marketplace
|
|
isActive
|
|
validationData
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
}
|
|
`
|
|
|
|
// Запросы для сообщений
|
|
export const GET_MESSAGES = gql`
|
|
query GetMessages($counterpartyId: ID!, $limit: Int, $offset: Int) {
|
|
messages(counterpartyId: $counterpartyId, limit: $limit, offset: $offset) {
|
|
id
|
|
content
|
|
type
|
|
voiceUrl
|
|
voiceDuration
|
|
fileUrl
|
|
fileName
|
|
fileSize
|
|
fileType
|
|
senderId
|
|
senderOrganization {
|
|
id
|
|
name
|
|
fullName
|
|
type
|
|
users {
|
|
id
|
|
avatar
|
|
managerName
|
|
}
|
|
}
|
|
receiverOrganization {
|
|
id
|
|
name
|
|
fullName
|
|
type
|
|
users {
|
|
id
|
|
avatar
|
|
managerName
|
|
}
|
|
}
|
|
isRead
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GET_CONVERSATIONS = gql`
|
|
query GetConversations {
|
|
conversations {
|
|
id
|
|
counterparty {
|
|
id
|
|
inn
|
|
name
|
|
fullName
|
|
type
|
|
address
|
|
users {
|
|
id
|
|
avatar
|
|
managerName
|
|
}
|
|
}
|
|
lastMessage {
|
|
id
|
|
content
|
|
type
|
|
voiceUrl
|
|
voiceDuration
|
|
fileUrl
|
|
fileName
|
|
fileSize
|
|
fileType
|
|
senderId
|
|
isRead
|
|
createdAt
|
|
}
|
|
unreadCount
|
|
updatedAt
|
|
}
|
|
}
|
|
`
|