2.3 KiB
2.3 KiB
WFDASH Migration Audit (2026-05-25)
Current State
- Legacy app: Django monolith in
/D:/NEWBUILD/WFDASH_django. - New app: Next.js + PocketBase in
/D:/NEWBUILD/wfnextjs. - Database direction: PocketBase collections already mirror core CRM entities.
- Operations direction: workflow automation moving to n8n.
Django Scope Found
- 40+ model classes across modules, including: quotes, orders, driver_list, delivery_notes, stock, repairs, husqvarna service, POS, AI orders, reporting/portal modules.
- Heavy background/process setup: Celery, Redis, email monitors, webhook integrations, debug middleware, multiple app copies/archives.
- Hosting complexity indicators:
- very broad
INSTALLED_APPS - multiple legacy snapshots (
*_old, date-stamped modules) - mixed concerns (UI, automation, integrations, monitoring) in one runtime.
- very broad
Next.js Scope Found
- Strong foundation for CRM core modules (customers, companies, suppliers, quotes, orders).
- PocketBase collection integration already implemented in UI helpers.
- Missing before agent rollout:
- dedicated server API layer
- MCP-compatible tool gateway
- migration governance docs and field naming standards.
PocketBase Findings (from attached schema)
Core collections present:
customers,companies,suppliers,quotes,quote_items,orders,order_items,purchase_orders.
order_items already includes advanced lifecycle fields and driver/delivery states.
Current mixed naming exists (driver_status) while new desired naming is drv_*.
Recommended Migration Strategy
- Freeze feature growth in Django except critical fixes.
- Define "parity slices" by workflow, not by old apps.
- Migrate in this order:
- Quote to Order conversion lifecycle
- Order item operations + driver loop
- Purchase order + supplier communications
- Monitoring and alerts via n8n
- Optional legacy modules (repairs/POS/service) only if still needed
- Keep PocketBase as source of truth for transactional state.
- Move automations to n8n and keep Next.js API minimal and deterministic.
Immediate Deliverables Added in This Repo
/D:/NEWBUILD/wfnextjs/src/app/api/v1/*REST starter routes for agents./D:/NEWBUILD/wfnextjs/src/app/api/mcp/route.tsMCP-style JSON-RPC gateway.- Normalizer accepting both
driver_statusanddrv_statusfor transition safety.