feat: завершить полную миграцию кабинета поставщика V1→V2
Полностью мигрирован кабинет поставщика /wholesale/orders на V2 архитектуру: - Создан supplier-orders-tabs-v2.tsx с 3 V2 источниками данных - Удалены устаревшие V1 компоненты (supplier-orders-tabs.tsx, supplier-orders-content.tsx, supplier-order-card.tsx) - Исправлены React Hooks Order ошибки и GraphQL поля - Реализована умная маршрутизация действий по типу поставки - Добавлены V2 мутации для редактирования параметров - Сохранен 100% оригинальный визуал и функционал - Создана документация миграции - Исправлены все ESLint ошибки для чистого кода 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -94,6 +94,26 @@ export const UPDATE_SELLER_GOODS_SUPPLY_STATUS = gql`
|
||||
}
|
||||
`
|
||||
|
||||
export const UPDATE_SUPPLY_VOLUME_V2 = gql`
|
||||
mutation UpdateSupplyVolumeV2($id: ID!, $volume: Float) {
|
||||
updateSellerGoodsSupplyVolume(id: $id, volume: $volume) {
|
||||
id
|
||||
estimatedVolume
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const UPDATE_SUPPLY_PACKAGES_V2 = gql`
|
||||
mutation UpdateSupplyPackagesV2($id: ID!, $packagesCount: Int) {
|
||||
updateSellerGoodsSupplyPackages(id: $id, packagesCount: $packagesCount) {
|
||||
id
|
||||
packagesCount
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const CANCEL_SELLER_GOODS_SUPPLY = gql`
|
||||
mutation CancelSellerGoodsSupply($id: ID!) {
|
||||
cancelSellerGoodsSupply(id: $id) {
|
||||
@ -152,6 +172,74 @@ export const GET_MY_SELLER_GOODS_SUPPLIES = gql`
|
||||
}
|
||||
`
|
||||
|
||||
export const GET_MY_SELLER_GOODS_SUPPLY_REQUESTS = gql`
|
||||
query GetMySellerGoodsSupplyRequests {
|
||||
mySellerGoodsSupplyRequests {
|
||||
id
|
||||
status
|
||||
sellerId
|
||||
seller {
|
||||
id
|
||||
name
|
||||
inn
|
||||
}
|
||||
fulfillmentCenterId
|
||||
fulfillmentCenter {
|
||||
id
|
||||
name
|
||||
inn
|
||||
}
|
||||
supplierId
|
||||
supplier {
|
||||
id
|
||||
name
|
||||
inn
|
||||
}
|
||||
logisticsPartnerId
|
||||
logisticsPartner {
|
||||
id
|
||||
name
|
||||
inn
|
||||
}
|
||||
requestedDeliveryDate
|
||||
estimatedDeliveryDate
|
||||
shippedAt
|
||||
deliveredAt
|
||||
supplierApprovedAt
|
||||
receivedById
|
||||
receivedBy {
|
||||
id
|
||||
managerName
|
||||
phone
|
||||
}
|
||||
notes
|
||||
supplierNotes
|
||||
receiptNotes
|
||||
totalCostWithDelivery
|
||||
packagesCount
|
||||
estimatedVolume
|
||||
trackingNumber
|
||||
|
||||
recipeItems {
|
||||
id
|
||||
productId
|
||||
quantity
|
||||
recipeType
|
||||
product {
|
||||
id
|
||||
name
|
||||
article
|
||||
price
|
||||
mainImage
|
||||
}
|
||||
}
|
||||
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const GET_SELLER_GOODS_INVENTORY = gql`
|
||||
query GetSellerGoodsInventory {
|
||||
mySellerGoodsInventory {
|
||||
|
@ -58,7 +58,7 @@ export const GET_MY_SELLER_CONSUMABLE_SUPPLIES = gql`
|
||||
trackingNumber
|
||||
|
||||
# Данные приемки
|
||||
deliveredAt
|
||||
receivedAt
|
||||
receivedById
|
||||
receivedBy {
|
||||
id
|
||||
@ -149,7 +149,7 @@ export const GET_SELLER_CONSUMABLE_SUPPLY = gql`
|
||||
trackingNumber
|
||||
|
||||
# Данные приемки
|
||||
deliveredAt
|
||||
receivedAt
|
||||
receivedById
|
||||
receivedBy {
|
||||
id
|
||||
@ -302,7 +302,7 @@ export const UPDATE_SELLER_SUPPLY_STATUS = gql`
|
||||
updatedAt
|
||||
supplierApprovedAt
|
||||
shippedAt
|
||||
deliveredAt
|
||||
receivedAt
|
||||
supplierNotes
|
||||
receiptNotes
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import { fulfillmentConsumableV2Queries as fulfillmentConsumableV2QueriesRestore
|
||||
import { fulfillmentInventoryV2Queries } from './resolvers/fulfillment-inventory-v2'
|
||||
import { sellerGoodsQueries, sellerGoodsMutations } from './resolvers/goods-supply-v2'
|
||||
import { logisticsConsumableV2Queries, logisticsConsumableV2Mutations } from './resolvers/logistics-consumables-v2'
|
||||
import { sellerConsumableQueries, sellerConsumableMutations } from './resolvers/seller-consumables'
|
||||
import { sellerInventoryV2Queries } from './resolvers/seller-inventory-v2'
|
||||
import { CommercialDataAudit } from './security/commercial-data-audit'
|
||||
import { createSecurityContext } from './security/index'
|
||||
@ -2909,6 +2910,9 @@ export const resolvers = {
|
||||
// V2 система поставок для логистики
|
||||
...logisticsConsumableV2Queries,
|
||||
|
||||
// V2 система поставок расходников селлера
|
||||
...sellerConsumableQueries,
|
||||
|
||||
// Новая система складских остатков V2 (заменяет старый myFulfillmentSupplies)
|
||||
...fulfillmentInventoryV2Queries,
|
||||
|
||||
@ -10303,6 +10307,9 @@ resolvers.Mutation = {
|
||||
// V2 mutations для логистики
|
||||
...logisticsConsumableV2Mutations,
|
||||
|
||||
// V2 mutations для поставок расходников селлера
|
||||
...sellerConsumableMutations,
|
||||
|
||||
// V2 mutations для товарных поставок селлера
|
||||
...sellerGoodsMutations,
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ export const sellerConsumableMutations = {
|
||||
const fulfillmentCenter = await prisma.organization.findUnique({
|
||||
where: { id: fulfillmentCenterId },
|
||||
include: {
|
||||
counterpartiesAsCounterparty: {
|
||||
counterpartyOf: {
|
||||
where: { organizationId: user.organizationId! },
|
||||
},
|
||||
},
|
||||
@ -251,7 +251,7 @@ export const sellerConsumableMutations = {
|
||||
throw new GraphQLError('Фулфилмент-центр не найден или имеет неверный тип')
|
||||
}
|
||||
|
||||
if (fulfillmentCenter.counterpartiesAsCounterparty.length === 0) {
|
||||
if (fulfillmentCenter.counterpartyOf.length === 0) {
|
||||
throw new GraphQLError('Нет партнерских отношений с данным фулфилмент-центром')
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ export const sellerConsumableMutations = {
|
||||
const supplier = await prisma.organization.findUnique({
|
||||
where: { id: supplierId },
|
||||
include: {
|
||||
counterpartiesAsCounterparty: {
|
||||
counterpartyOf: {
|
||||
where: { organizationId: user.organizationId! },
|
||||
},
|
||||
},
|
||||
@ -269,7 +269,7 @@ export const sellerConsumableMutations = {
|
||||
throw new GraphQLError('Поставщик не найден или имеет неверный тип')
|
||||
}
|
||||
|
||||
if (supplier.counterpartiesAsCounterparty.length === 0) {
|
||||
if (supplier.counterpartyOf.length === 0) {
|
||||
throw new GraphQLError('Нет партнерских отношений с данным поставщиком')
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user