Обновлен README.md с новыми возможностями платформы Sfera V для управления бизнесом, добавлен раздел о складе Wildberries для селлеров. В компоненте Sidebar добавлена кнопка для перехода к складу ВБ, доступная только для пользователей с типом организации "SELLER". В классе WildberriesService реализованы новые методы для получения остатков товаров и интеграции с API Wildberries, включая обработку ошибок и кэширование данных.

This commit is contained in:
Bivekich
2025-07-23 18:02:20 +03:00
parent f478754bef
commit ff81d603a6
5 changed files with 1278 additions and 118 deletions

View File

@ -106,6 +106,10 @@ export function Sidebar() {
router.push("/warehouse");
};
const handleWBWarehouseClick = () => {
router.push("/wb-warehouse");
};
const handleEmployeesClick = () => {
router.push("/employees");
};
@ -151,6 +155,7 @@ export function Sidebar() {
const isMessengerActive = pathname.startsWith("/messenger");
const isServicesActive = pathname.startsWith("/services");
const isWarehouseActive = pathname.startsWith("/warehouse");
const isWBWarehouseActive = pathname.startsWith("/wb-warehouse");
const isFulfillmentWarehouseActive = pathname.startsWith(
"/fulfillment-warehouse"
);
@ -419,6 +424,25 @@ export function Sidebar() {
</Button>
)}
{/* Склад ВБ - для селлеров */}
{user?.organization?.type === "SELLER" && (
<Button
variant={isWBWarehouseActive ? "secondary" : "ghost"}
className={`w-full ${
isCollapsed ? "justify-center px-2 h-9" : "justify-start h-10"
} text-left transition-all duration-200 text-xs ${
isWBWarehouseActive
? "bg-white/20 text-white hover:bg-white/30"
: "text-white/80 hover:bg-white/10 hover:text-white"
} cursor-pointer`}
onClick={handleWBWarehouseClick}
title={isCollapsed ? "Склад ВБ" : ""}
>
<Warehouse className="h-4 w-4 flex-shrink-0" />
{!isCollapsed && <span className="ml-3">Склад ВБ</span>}
</Button>
)}
{/* Статистика - для селлеров */}
{user?.organization?.type === "SELLER" && (
<Button