feat: синхронизация V2 компонентов с Employee системой и обновление документации

Обновления V2 системы поставок и сервисов:
- src/components/fulfillment-supplies/ - синхронизация с модульной архитектурой
- src/components/services/ - обновление компонентов сервисов под V2
- src/components/supplies/supplies-dashboard.tsx - интеграция с V2 backend
- src/components/supplier-orders/supplier-orders-tabs-v2.tsx - улучшения V2 вкладок
- src/components/market/market-counterparties.tsx - обновления рынка контрагентов

GraphQL и системные обновления:
- src/graphql/resolvers/fulfillment-services-v2.ts - обновления V2 resolvers
- src/graphql/referral-queries.ts - синхронизация реферальных запросов
- docs/development/V1_TO_V2_MIGRATION_STATUS_REPORT.md - актуальный отчет миграции

Все изменения совместимы с новой Employee V2 модульной архитектурой.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Veronika Smirnova
2025-09-04 09:54:10 +03:00
parent 962b2deb58
commit a7a18970e6
14 changed files with 131 additions and 94 deletions

View File

@ -7,6 +7,13 @@ export const GET_MY_REFERRAL_LINK = gql`
}
`
// Получение партнерской ссылки
export const GET_MY_PARTNER_LINK = gql`
query GetMyPartnerLink {
myPartnerLink
}
`
// Получение статистики по рефералам
export const GET_MY_REFERRAL_STATS = gql`
query GetMyReferralStats {

View File

@ -5,7 +5,6 @@
import { GraphQLError } from 'graphql'
import { prisma } from '../../lib/prisma'
import type { Context } from '../context'
// =============================================================================
@ -37,14 +36,14 @@ export const fulfillmentServicesQueries = {
exists: !!user,
orgExists: !!user?.organization,
orgType: user?.organization?.type,
orgId: user?.organizationId
orgId: user?.organizationId,
})
if (!user?.organization || user.organization.type !== 'FULFILLMENT') {
console.warn('❌ myFulfillmentServices: User is not fulfillment type:', {
hasUser: !!user,
hasOrg: !!user?.organization,
orgType: user?.organization?.type
orgType: user?.organization?.type,
})
return []
}
@ -76,7 +75,7 @@ export const fulfillmentServicesQueries = {
console.warn('🔍 Context user:', {
exists: !!context.user,
id: context.user?.id,
orgId: context.user?.organizationId
orgId: context.user?.organizationId,
})
if (!context.user) {
@ -94,7 +93,7 @@ export const fulfillmentServicesQueries = {
exists: !!user,
orgExists: !!user?.organization,
orgType: user?.organization?.type,
fulfillmentId: user?.organizationId
fulfillmentId: user?.organizationId,
})
if (!user?.organization || user.organization.type !== 'FULFILLMENT') {
@ -111,7 +110,7 @@ export const fulfillmentServicesQueries = {
inventory: {
include: {
product: true,
}
},
},
},
orderBy: [
@ -125,7 +124,7 @@ export const fulfillmentServicesQueries = {
id: c.id,
name: c.name,
currentStock: c.currentStock,
isAvailable: c.isAvailable
isAvailable: c.isAvailable,
})))
console.warn('🔥 ВОЗВРАЩАЕМ ДАННЫЕ - длина массива:', consumables.length)
@ -322,7 +321,7 @@ export const fulfillmentServicesMutations = {
createFulfillmentService: async (
_: unknown,
args: { input: CreateFulfillmentServiceInput },
context: Context
context: Context,
) => {
if (!context.user) {
throw new GraphQLError('Требуется авторизация', {
@ -375,7 +374,7 @@ export const fulfillmentServicesMutations = {
updateFulfillmentService: async (
_: unknown,
args: { input: UpdateFulfillmentServiceInput },
context: Context
context: Context,
) => {
if (!context.user) {
throw new GraphQLError('Требуется авторизация', {
@ -490,7 +489,7 @@ export const fulfillmentServicesMutations = {
createFulfillmentConsumable: async (
_: unknown,
args: { input: CreateFulfillmentConsumableInput },
context: Context
context: Context,
) => {
if (!context.user) {
throw new GraphQLError('Требуется авторизация', {
@ -546,7 +545,7 @@ export const fulfillmentServicesMutations = {
updateFulfillmentConsumable: async (
_: unknown,
args: { input: UpdateFulfillmentConsumableInput },
context: Context
context: Context,
) => {
if (!context.user) {
throw new GraphQLError('Требуется авторизация', {
@ -667,7 +666,7 @@ export const fulfillmentServicesMutations = {
createFulfillmentLogistics: async (
_: unknown,
args: { input: CreateFulfillmentLogisticsInput },
context: Context
context: Context,
) => {
if (!context.user) {
throw new GraphQLError('Требуется авторизация', {
@ -723,7 +722,7 @@ export const fulfillmentServicesMutations = {
updateFulfillmentLogistics: async (
_: unknown,
args: { input: UpdateFulfillmentLogisticsInput },
context: Context
context: Context,
) => {
if (!context.user) {
throw new GraphQLError('Требуется авторизация', {
@ -836,7 +835,7 @@ export const fulfillmentServicesMutations = {
console.warn('🔥 FULFILLMENT QUERIES ОБЪЕКТ СОЗДАН:', {
keys: Object.keys(fulfillmentServicesQueries),
hasMyFulfillmentConsumables: 'myFulfillmentConsumables' in fulfillmentServicesQueries
hasMyFulfillmentConsumables: 'myFulfillmentConsumables' in fulfillmentServicesQueries,
})
// Объединяем резолверы в основной объект