Implemented comprehensive data security infrastructure for SFERA platform:
## Security Classes Created:
- `SupplyDataFilter`: Role-based data filtering for supply orders
- `ParticipantIsolation`: Data isolation between competing organizations
- `RecipeAccessControl`: Protection of production recipes and trade secrets
- `CommercialDataAudit`: Audit logging and suspicious activity detection
- `SecurityLogger`: Centralized security event logging system
## Infrastructure Components:
- Feature flags system for gradual security rollout
- Database migrations for audit logging (AuditLog, SecurityAlert models)
- Secure resolver wrapper for automatic GraphQL security
- TypeScript interfaces and type safety throughout
## Security Features:
- Role-based access control (SELLER, WHOLESALE, FULFILLMENT, LOGIST)
- Commercial data protection between competitors
- Production recipe confidentiality
- Audit trail for all data access
- Real-time security monitoring and alerts
- Rate limiting and suspicious activity detection
## Implementation Notes:
- All console logging replaced with centralized security logger
- Comprehensive TypeScript typing with no explicit 'any' types
- Modular architecture following SFERA coding standards
- Feature flag controlled rollout for safe deployment
This completes Phase 1 of the security implementation plan.
Next phases will integrate these classes into existing GraphQL resolvers.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Обернул console.log в проверки development режима и заменил на console.warn
- Исправил типизацию в sidebar.tsx (убрал any types)
- Добавил точки с запятой в market-counterparties.tsx
- Исправил длинную строку в marketplace-api-step.tsx
- Исправил длинную строку в resolvers/index.ts
- Исправил unused parameter в referrals.ts
- Создал .eslintignore для исключения старых файлов
- Все изменения протестированы, сайт работает корректно
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Добавлена полная реферальная система с GraphQL резолверами и UI компонентами
- Улучшена система регистрации с поддержкой ВКонтакте и реферальных ссылок
- Обновлена схема Prisma для поддержки реферальной системы
- Добавлены новые файлы документации правил системы
- Улучшена система партнерства и контрагентов
- Обновлены компоненты авторизации для поддержки новых функций
- Удален устаревший server.log
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Добавлен компонент AppShell в RootLayout для улучшения структуры
- Обновлен компонент Sidebar для предотвращения дублирования при рендеринге
- Оптимизированы импорты в компонентах AdvertisingTab и SalesTab
- Реализована логика кэширования статистики селлера в GraphQL резолверах
- Убран текст "(с рецептурой)" из названий товаров в корзине
- Добавлен раздел 9.2.6 в rules-complete.md с единым стандартом корзины
- Определены обязательные размеры, структура и функциональность
- Запрещено отображение технических суффиксов в UI корзины
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add pricePerUnit field to Supply model for seller pricing
- Fix updateSupplyPrice mutation to update pricePerUnit only
- Separate purchase price (price) from selling price (pricePerUnit)
- Fix GraphQL mutations to include organization field (CREATE/UPDATE_LOGISTICS)
- Update GraphQL types to make Supply.price required again
- Add comprehensive pricing rules to rules-complete.md sections 11.7.5 and 18.8
- Fix supplies-tab.tsx to show debug info and handle user loading
Architecture changes:
• Supply.price = purchase price from supplier (immutable)
• Supply.pricePerUnit = selling price to sellers (mutable by fulfillment)
• Warehouse shows purchase price only (readonly)
• Services shows/edits selling price only
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Обновлена схема Prisma с новыми полями и связями
- Актуализированы правила системы в rules-complete.md
- Оптимизированы GraphQL типы, запросы и мутации
- Улучшены компоненты интерфейса и валидация данных
- Исправлены критические ESLint ошибки: удалены неиспользуемые импорты и переменные
- Добавлены тестовые файлы для проверки функционала
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Добавлена автогенерация артикулов СФ (SF-T для товаров, SF-C для расходников)
- Добавлены поля для комплектов: количество и цена за комплект
- Добавлены поля учета движения товаров: заказано, в пути, остаток, продано
- Создан компонент статистики склада с общими показателями и разбивкой по типам
- Реализовано переключение между карточным и табличным режимом отображения (5 карточек в ряду)
- Обновлены GraphQL схемы для поддержки новых полей
- Улучшен пользовательский интерфейс: убран заголовок, оптимизирована компоновка
- Синхронизированы поля между карточками и таблицей для единообразного отображения
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added new GraphQL query `GET_FULFILLMENT_WAREHOUSE_STATS` to fetch warehouse statistics with daily changes
- Created comprehensive GraphQL resolver `fulfillmentWarehouseStats` that calculates:
* Current quantities for products, goods, defects, pvzReturns, fulfillmentSupplies, sellerSupplies
* Daily changes (absolute numbers) based on deliveries in the last 24 hours
* Percentage changes for all categories
- Updated fulfillment warehouse dashboard to use real GraphQL data instead of static calculations
- Added polling every 60 seconds to keep statistics up-to-date
- Enhanced StatCard component to display accurate percentage and absolute changes
- Statistics now show real supply deliveries and changes relative to the previous day
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added logistics partner selection as mandatory requirement for fulfillment supply orders
- Implemented complete status workflow: PENDING → SUPPLIER_APPROVED → LOGISTICS_CONFIRMED → SHIPPED → DELIVERED
- Created dedicated interfaces for all three parties:
* Fulfillment: Create orders with mandatory logistics selection and receive shipments
* Suppliers: View, approve/reject orders, and ship approved orders via /supplies tab
* Logistics: Confirm/reject transport requests via new /logistics-orders dashboard
- Updated Prisma schema with logisticsPartnerId (non-nullable) and new SupplyOrderStatus enum
- Added comprehensive GraphQL mutations for each party's workflow actions
- Fixed GraphQL resolver to include logistics partners in supplyOrders query
- Enhanced UI components with proper status badges and action buttons
- Added backward compatibility for legacy status handling
- Updated sidebar navigation routing for LOGIST organization type
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- ✨ Added compact employee forms (add/edit) with all fields visible
- 🎯 Implemented expandable employee rows with timesheet integration
- 📊 Added real KPI calculation based on work hours, sick days, and overtime
- 📅 Added bulk date selection and editing in calendar
- 🗓️ Implemented day-specific editing modal with hours and overtime tracking
- 💾 Extended database schema with overtimeHours field
- 🎨 Improved UI layout: tabs left, search right, real current date display
- 🧹 Fixed spacing issues and removed unnecessary gaps
- 🔧 Enhanced GraphQL mutations for employee schedule management