fix: Resolve build errors and add database migrations

- Fix frontend import: Change from useAppContext to useTenant store
- Fix backend imports: Use app.core.database instead of shared.database
- Remove auth dependencies from dashboard endpoints
- Add database migrations for reasoning fields in procurement and production

Migrations:
- procurement: Add reasoning, consequence, reasoning_data to purchase_orders
- production: Add reasoning, reasoning_data to production_batches
This commit is contained in:
Claude
2025-11-07 17:19:46 +00:00
parent 2ced1ec670
commit 436622dc9a
4 changed files with 61 additions and 11 deletions

View File

@@ -18,7 +18,7 @@
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { RefreshCw, ExternalLink } from 'lucide-react';
import { useAppContext } from '../../contexts/AppContext';
import { useTenant } from '../../stores/tenant.store';
import {
useBakeryHealthStatus,
useOrchestrationSummary,
@@ -37,8 +37,8 @@ import { InsightsGrid } from '../../components/dashboard/InsightsGrid';
export function NewDashboardPage() {
const navigate = useNavigate();
const { selectedTenant } = useAppContext();
const tenantId = selectedTenant?.id || '';
const { currentTenant } = useTenant();
const tenantId = currentTenant?.id || '';
// Data fetching
const {