Обновления системы после анализа и оптимизации архитектуры
- Обновлена схема Prisma с новыми полями и связями - Актуализированы правила системы в rules-complete.md - Оптимизированы GraphQL типы, запросы и мутации - Улучшены компоненты интерфейса и валидация данных - Исправлены критические ESLint ошибки: удалены неиспользуемые импорты и переменные - Добавлены тестовые файлы для проверки функционала 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -4,21 +4,16 @@ import { useQuery, useMutation } from '@apollo/client'
|
||||
import {
|
||||
ArrowLeft,
|
||||
Building2,
|
||||
MapPin,
|
||||
Phone,
|
||||
Mail,
|
||||
Star,
|
||||
Search,
|
||||
Package,
|
||||
Plus,
|
||||
Minus,
|
||||
ShoppingCart,
|
||||
Wrench,
|
||||
Box,
|
||||
} from 'lucide-react'
|
||||
import Image from 'next/image'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
import { Sidebar } from '@/components/dashboard/sidebar'
|
||||
@ -115,7 +110,7 @@ export function CreateFulfillmentConsumablesSupplyPage() {
|
||||
} = useQuery(GET_ORGANIZATION_PRODUCTS, {
|
||||
skip: !selectedSupplier,
|
||||
variables: {
|
||||
organizationId: selectedSupplier.id,
|
||||
organizationId: selectedSupplier?.id,
|
||||
search: productSearchQuery || null,
|
||||
category: null,
|
||||
type: 'CONSUMABLE', // Фильтруем только расходники согласно rules2.md
|
||||
@ -123,7 +118,7 @@ export function CreateFulfillmentConsumablesSupplyPage() {
|
||||
onCompleted: (data) => {
|
||||
console.warn('✅ GET_ORGANIZATION_PRODUCTS COMPLETED:', {
|
||||
totalProducts: data?.organizationProducts?.length || 0,
|
||||
organizationId: selectedSupplier.id,
|
||||
organizationId: selectedSupplier?.id,
|
||||
type: 'CONSUMABLE',
|
||||
products:
|
||||
data?.organizationProducts?.map((p) => ({
|
||||
@ -204,14 +199,6 @@ export function CreateFulfillmentConsumablesSupplyPage() {
|
||||
}).format(amount)
|
||||
}
|
||||
|
||||
const renderStars = (rating: number = 4.5) => {
|
||||
return Array.from({ length: 5 }, (_, i) => (
|
||||
<Star
|
||||
key={i}
|
||||
className={`h-3 w-3 ${i < Math.floor(rating) ? 'text-yellow-400 fill-current' : 'text-gray-400'}`}
|
||||
/>
|
||||
))
|
||||
}
|
||||
|
||||
const updateConsumableQuantity = (productId: string, quantity: number) => {
|
||||
const product = supplierProducts.find((p: FulfillmentConsumableProduct) => p.id === productId)
|
||||
|
@ -5,17 +5,13 @@ import { Building2, ShoppingCart, Package, Wrench, RotateCcw, Clock, FileText, C
|
||||
import React, { useState } from 'react'
|
||||
|
||||
import { Sidebar } from '@/components/dashboard/sidebar'
|
||||
import { Card } from '@/components/ui/card'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import { GET_PENDING_SUPPLIES_COUNT } from '@/graphql/queries'
|
||||
import { useSidebar } from '@/hooks/useSidebar'
|
||||
|
||||
// Импорты компонентов подразделов
|
||||
import { FulfillmentConsumablesOrdersTab } from './fulfillment-supplies/fulfillment-consumables-orders-tab'
|
||||
import { FulfillmentDetailedSuppliesTab } from './fulfillment-supplies/fulfillment-detailed-supplies-tab'
|
||||
import { FulfillmentSuppliesTab } from './fulfillment-supplies/fulfillment-supplies-tab'
|
||||
import { PvzReturnsTab } from './fulfillment-supplies/pvz-returns-tab'
|
||||
import { MarketplaceSuppliesTab } from './marketplace-supplies/marketplace-supplies-tab'
|
||||
|
||||
// Компонент для отображения бейджа с уведомлениями
|
||||
function NotificationBadge({ count }: { count: number }) {
|
||||
|
@ -5,10 +5,8 @@ import {
|
||||
Calendar,
|
||||
Package,
|
||||
Truck,
|
||||
User,
|
||||
CheckCircle,
|
||||
Clock,
|
||||
AlertCircle,
|
||||
XCircle,
|
||||
MapPin,
|
||||
Phone,
|
||||
@ -17,20 +15,18 @@ import {
|
||||
Building,
|
||||
Hash,
|
||||
Store,
|
||||
Bell,
|
||||
AlertTriangle,
|
||||
UserPlus,
|
||||
Settings,
|
||||
} from 'lucide-react'
|
||||
import React, { useState } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'
|
||||
import { Avatar, AvatarFallback } from '@/components/ui/avatar'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card } from '@/components/ui/card'
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
import { UPDATE_SUPPLY_ORDER_STATUS, ASSIGN_LOGISTICS_TO_SUPPLY, FULFILLMENT_RECEIVE_ORDER } from '@/graphql/mutations'
|
||||
import { ASSIGN_LOGISTICS_TO_SUPPLY, FULFILLMENT_RECEIVE_ORDER } from '@/graphql/mutations'
|
||||
import {
|
||||
GET_SUPPLY_ORDERS,
|
||||
GET_MY_SUPPLIES,
|
||||
|
@ -4,7 +4,6 @@ import { Calendar, Package, MapPin, Building2, TrendingUp, AlertTriangle, Dollar
|
||||
import React, { useState } from 'react'
|
||||
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card } from '@/components/ui/card'
|
||||
|
||||
// Типы данных для товаров ФФ
|
||||
|
Reference in New Issue
Block a user