Fix Purchase Order modal and reorganize documentation

Frontend Changes:
- Fix runtime error: Remove undefined handleModify reference from ActionQueueCard in DashboardPage
- Migrate PurchaseOrderDetailsModal to use correct PurchaseOrderItem type from purchase_orders service
- Fix item display: Parse unit_price as string (Decimal) instead of number
- Use correct field names: item_notes instead of notes
- Remove deprecated PurchaseOrder types from suppliers.ts to prevent type conflicts
- Update CreatePurchaseOrderModal to use unified types
- Clean up API exports: Remove old PO hooks re-exported from suppliers
- Add comprehensive translations for PO modal (en, es, eu)

Documentation Reorganization:
- Move WhatsApp implementation docs to docs/03-features/notifications/whatsapp/
- Move forecast validation docs to docs/03-features/forecasting/
- Move specification docs to docs/03-features/specifications/
- Move deployment docs (Colima, K8s, VPS sizing) to docs/05-deployment/
- Archive completed implementation summaries to docs/archive/implementation-summaries/
- Delete obsolete FRONTEND_CHANGES_NEEDED.md
- Standardize filenames to lowercase with hyphens

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Urtzi Alfaro
2025-11-18 11:59:23 +01:00
parent 5c45164c8e
commit 3c3d3ce042
32 changed files with 654 additions and 874 deletions

View File

@@ -37,7 +37,6 @@ import { OrchestrationSummaryCard } from '../../components/dashboard/Orchestrati
import { ProductionTimelineCard } from '../../components/dashboard/ProductionTimelineCard';
import { InsightsGrid } from '../../components/dashboard/InsightsGrid';
import { PurchaseOrderDetailsModal } from '../../components/dashboard/PurchaseOrderDetailsModal';
import { ModifyPurchaseOrderModal } from '../../components/domain/procurement/ModifyPurchaseOrderModal';
import { UnifiedAddWizard } from '../../components/domain/unified-wizard';
import type { ItemType } from '../../components/domain/unified-wizard';
import { useDemoTour, shouldStartTour, clearTourStartPending } from '../../features/demo-onboarding';
@@ -57,10 +56,7 @@ export function NewDashboardPage() {
// PO Details Modal state
const [selectedPOId, setSelectedPOId] = useState<string | null>(null);
const [isPOModalOpen, setIsPOModalOpen] = useState(false);
// PO Modify Modal state
const [modifyPOId, setModifyPOId] = useState<string | null>(null);
const [isModifyPOModalOpen, setIsModifyPOModalOpen] = useState(false);
const [poModalMode, setPOModalMode] = useState<'view' | 'edit'>('view');
// Data fetching
const {
@@ -128,12 +124,6 @@ export function NewDashboardPage() {
setIsPOModalOpen(true);
};
const handleModify = (actionId: string) => {
// Open modal to modify PO
setModifyPOId(actionId);
setIsModifyPOModalOpen(true);
};
const handleStartBatch = async (batchId: string) => {
try {
await startBatch.mutateAsync({ tenantId, batchId });
@@ -283,7 +273,6 @@ export function NewDashboardPage() {
onApprove={handleApprove}
onReject={handleReject}
onViewDetails={handleViewDetails}
onModify={handleModify}
tenantId={tenantId}
/>
</div>
@@ -366,35 +355,20 @@ export function NewDashboardPage() {
onComplete={handleAddWizardComplete}
/>
{/* Purchase Order Details Modal */}
{/* Purchase Order Details Modal - Unified View/Edit */}
{selectedPOId && (
<PurchaseOrderDetailsModal
poId={selectedPOId}
tenantId={tenantId}
isOpen={isPOModalOpen}
initialMode={poModalMode}
onClose={() => {
setIsPOModalOpen(false);
setSelectedPOId(null);
}}
onApprove={handleApprove}
onModify={handleModify}
/>
)}
{/* Modify Purchase Order Modal */}
{modifyPOId && (
<ModifyPurchaseOrderModal
poId={modifyPOId}
isOpen={isModifyPOModalOpen}
onClose={() => {
setIsModifyPOModalOpen(false);
setModifyPOId(null);
}}
onSuccess={() => {
setIsModifyPOModalOpen(false);
setModifyPOId(null);
setPOModalMode('view');
handleRefreshAll();
}}
onApprove={handleApprove}
/>
)}
</div>