Добавлены новые зависимости, обновлены стили и улучшена структура проекта. Обновлен README с описанием функционала и технологий. Реализована анимация и адаптивный дизайн. Настроена авторизация с использованием Apollo Client.

This commit is contained in:
Bivekich
2025-07-16 18:00:41 +03:00
parent d260749bc9
commit 823ef9a28c
69 changed files with 15539 additions and 210 deletions

229
src/graphql/typedefs.ts Normal file
View File

@ -0,0 +1,229 @@
import { gql } from 'graphql-tag'
export const typeDefs = gql`
type Query {
me: User
organization(id: ID!): Organization
# Поиск организаций по типу для добавления в контрагенты
searchOrganizations(type: OrganizationType, search: String): [Organization!]!
# Мои контрагенты
myCounterparties: [Organization!]!
# Входящие заявки
incomingRequests: [CounterpartyRequest!]!
# Исходящие заявки
outgoingRequests: [CounterpartyRequest!]!
}
type Mutation {
# Авторизация через SMS
sendSmsCode(phone: String!): SmsResponse!
verifySmsCode(phone: String!, code: String!): AuthResponse!
# Валидация ИНН
verifyInn(inn: String!): InnValidationResponse!
# Обновление профиля пользователя
updateUserProfile(input: UpdateUserProfileInput!): UpdateUserProfileResponse!
# Обновление данных организации по ИНН
updateOrganizationByInn(inn: String!): UpdateOrganizationResponse!
# Регистрация организации
registerFulfillmentOrganization(input: FulfillmentRegistrationInput!): AuthResponse!
registerSellerOrganization(input: SellerRegistrationInput!): AuthResponse!
# Работа с API ключами
addMarketplaceApiKey(input: MarketplaceApiKeyInput!): ApiKeyResponse!
removeMarketplaceApiKey(marketplace: MarketplaceType!): Boolean!
# Выход из системы
logout: Boolean!
# Работа с контрагентами
sendCounterpartyRequest(organizationId: ID!, message: String): CounterpartyRequestResponse!
respondToCounterpartyRequest(requestId: ID!, accept: Boolean!): CounterpartyRequestResponse!
cancelCounterpartyRequest(requestId: ID!): Boolean!
removeCounterparty(organizationId: ID!): Boolean!
}
# Типы данных
type User {
id: ID!
phone: String!
avatar: String
organization: Organization
createdAt: String!
updatedAt: String!
}
type Organization {
id: ID!
inn: String!
kpp: String
name: String
fullName: String
address: String
addressFull: String
ogrn: String
ogrnDate: String
type: OrganizationType!
status: String
actualityDate: String
registrationDate: String
liquidationDate: String
managementName: String
managementPost: String
opfCode: String
opfFull: String
opfShort: String
okato: String
oktmo: String
okpo: String
okved: String
employeeCount: Int
revenue: String
taxSystem: String
phones: JSON
emails: JSON
users: [User!]!
apiKeys: [ApiKey!]!
isCounterparty: Boolean
createdAt: String!
updatedAt: String!
}
type ApiKey {
id: ID!
marketplace: MarketplaceType!
isActive: Boolean!
validationData: JSON
createdAt: String!
updatedAt: String!
}
# Входные типы для мутаций
input UpdateUserProfileInput {
# Аватар пользователя
avatar: String
# Контактные данные организации
orgPhone: String
managerName: String
telegram: String
whatsapp: String
email: String
# Банковские данные
bankName: String
bik: String
accountNumber: String
corrAccount: String
}
input FulfillmentRegistrationInput {
phone: String!
inn: String!
}
input SellerRegistrationInput {
phone: String!
wbApiKey: String
ozonApiKey: String
ozonClientId: String
}
input MarketplaceApiKeyInput {
marketplace: MarketplaceType!
apiKey: String!
clientId: String # Для Ozon
validateOnly: Boolean # Только валидация без сохранения
}
# Ответные типы
type SmsResponse {
success: Boolean!
message: String!
}
type AuthResponse {
success: Boolean!
message: String!
token: String
user: User
}
type InnValidationResponse {
success: Boolean!
message: String!
organization: ValidatedOrganization
}
type ValidatedOrganization {
name: String!
fullName: String!
address: String!
isActive: Boolean!
}
type ApiKeyResponse {
success: Boolean!
message: String!
apiKey: ApiKey
}
type UpdateUserProfileResponse {
success: Boolean!
message: String!
user: User
}
type UpdateOrganizationResponse {
success: Boolean!
message: String!
user: User
}
# Enums
enum OrganizationType {
FULFILLMENT
SELLER
LOGIST
WHOLESALE
}
enum MarketplaceType {
WILDBERRIES
OZON
}
enum CounterpartyRequestStatus {
PENDING
ACCEPTED
REJECTED
CANCELLED
}
# Типы для контрагентов
type CounterpartyRequest {
id: ID!
status: CounterpartyRequestStatus!
message: String
sender: Organization!
receiver: Organization!
createdAt: String!
updatedAt: String!
}
type CounterpartyRequestResponse {
success: Boolean!
message: String!
request: CounterpartyRequest
}
# JSON скаляр
scalar JSON
`