Files
nnterp-react-admin/docs/PLAN-warehouse-module.md

3.5 KiB

Project Plan: Warehouse Management Module

This plan outlines the phase-by-phase development of a dedicated Warehouse Management module for the ERP system. Based on our Socratic Gate decisions, this module will implement a manual fulfillment queue for warehouse staff, will manipulate the existing WarehouseStock table within the ProductService module, and will include PDF generation for Pick Lists and Packing Slips.

Phase 1: Foundation & Scaffolding

Goal: Establish the module footprint and registration within the Workdo ecosystem.

  • 1.1 Package Setup: Create packages/workdo/Warehouse directory structure.
  • 1.2 Registration: Update root composer.json with PSR-4 namespace (Workdo\\Warehouse\\).
  • 1.3 Metadata: Create module.json and internal composer.json.
  • 1.4 Service Provider: Implement WarehouseServiceProvider to load routes, views, and migrations.

Phase 2: Inventory & Stock Core

Goal: Establish the truth-source for inventory changes (Ledger) while reusing the ProductService stock base.

  • 2.1 Database Schema: Create warehouse_stock_movements (Ledger for tracking in/out reasons) and warehouse_transfers tables.
  • 2.2 Stock Dashboard:
    • Real-time stock monitoring UI across multiple warehouses by reading Workdo\ProductService\Models\WarehouseStock.
    • Low-stock alerts and reports.
  • 2.3 Stock Adjustments: Interfaces for manual stock-in (receiving) and stock-out (shrinkage/damage).

Phase 3: Order Fulfillment Processing

Goal: Bridge the gap between Sales Orders/Invoices and physical stock using a manual dispatch queue.

  • 3.1 Fulfillment Queue: A dashboard displaying approved SalesInvoice and SalesOrder records pending dispatch.
  • 3.2 PDF Document Generation:
    • Generate printable "Pick Lists" (PDF) for warehouse floor staff.
    • Generate "Packing Slips" (PDF) for shipments.
  • 3.3 Manual Goods Issue (Dispatch): A specific UI action for warehouse staff to click "Fulfill/Dispatch". This action will formally deduct quantities from WarehouseStock and log it into warehouse_stock_movements.

Phase 4: Integrations & Sidebar

Goal: Connect the module cleanly to the rest of the ERP.

  • 4.1 Event Listeners: Listen for InvoiceCreated or OrderApproved events to automatically populate the Fulfillment Queue without immediately deducting stock.
  • 4.2 Sidebar Integration: Register menus (Dashboard, Fulfillment Queue, Stock Movements, Stock Transfers) under a new "Warehouse" section.

Phase 5: Final Polishing

Goal: UX refinement, security, and production readiness.

  • 5.1 Permissions: Granular roles (Warehouse Manager, Picker/Packer, Dispatcher).
  • 5.2 Verification: System-wide test of a full order-to-dispatch flow.

Agent Assignments

Component Responsibility Agent Role
Backend DB Schema, Service Providers, Fulfillment Logic, PDF Gen backend-specialist
Frontend React/Inertia Components, Dashboards, Printables UI frontend-specialist
Logistics Cross-module linking, Event Systems, Permissions orchestrator

Verification Checklist

  • Module accessible via composer dump-autoload
  • php artisan migrate completed for new warehouse tables
  • Inertia renders the Fulfillment and Stock Movement menus
  • "Dispatch" button successfully deducts stock from ProductService's WarehouseStock table
  • PDF generation for Pick Lists downloads successfully