feat: Add real-time warehouse statistics with daily changes for fulfillment centers

- 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>
This commit is contained in:
Bivekich
2025-07-31 14:46:00 +03:00
parent f8bb8508cb
commit 76a40e0eed
4 changed files with 266 additions and 85 deletions

View File

@ -1047,3 +1047,41 @@ export const GET_SELLER_STATS_CACHE = gql`
}
}
`;
// Запрос для получения статистики склада фулфилмента с изменениями за сутки
export const GET_FULFILLMENT_WAREHOUSE_STATS = gql`
query GetFulfillmentWarehouseStats {
fulfillmentWarehouseStats {
products {
current
change
percentChange
}
goods {
current
change
percentChange
}
defects {
current
change
percentChange
}
pvzReturns {
current
change
percentChange
}
fulfillmentSupplies {
current
change
percentChange
}
sellerSupplies {
current
change
percentChange
}
}
}
`;