From abc795b4a7a433cd4bd589dd47454822035b32fd Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 18 Mar 2026 00:10:15 -0500 Subject: [PATCH] workbench rebalance --- CHANGELOG.md | 3 + README.md | 10 +- ROADMAP.md | 6 +- SHIPPED.md | 4 +- client/src/lib/api.ts | 8 + .../manufacturing/ManufacturingPage.tsx | 45 +++ .../manufacturing/WorkOrderDetailPage.tsx | 69 +++- .../src/modules/workbench/WorkbenchPage.tsx | 172 +++++++++- .../migration.sql | 3 + server/prisma/schema.prisma | 3 + server/src/modules/gantt/service.ts | 22 +- server/src/modules/manufacturing/router.ts | 29 ++ server/src/modules/manufacturing/service.ts | 300 ++++++++++++++++-- shared/src/manufacturing/types.ts | 14 + 14 files changed, 640 insertions(+), 48 deletions(-) create mode 100644 server/prisma/migrations/20260318001000_station_capacity_and_calendar/migration.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index e9f3986..7235e91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ This file is the running release and change log for CODEXIUM. Keep it updated wh - Project cockpit section on project detail pages for commercial, supply, execution, delivery, purchasing, readiness-risk, and project cost snapshot rollups, plus direct launch paths into prefilled work-order and purchase-order follow-through and a chronological project activity timeline - Planning workbench replacing the old one-note planning screen with mode switching, dense exception rail, heatmap load view, agenda view, and focus drawer - Planning workbench dispatch upgrade with station load summaries, readiness scoring, release-ready and blocker filters, richer planner rows, and inline release/build/buy actions +- Manufacturing finite-capacity slice with station daily capacity, parallel capacity, working-day calendars, calendar-aware operation scheduling, and operation-level rescheduling from the work-order detail page +- Workbench rebalance controls for operation rows, including planner-side datetime rescheduling, quick shift moves, and heatmap-day targeting without leaving the dispatch surface +- Workbench station-to-station rebalance so planners can move an operation onto another active work center and rebuild the downstream chain from the same dispatch surface - Project milestones with status, due dates, notes, and edit-time sequencing inside the project workflow - Project-side milestone and work-order rollups surfaced on project list and detail pages - Inventory SKU master builder with family-level sequence codes, branch-aware taxonomy management, and generated SKU previews on the item form diff --git a/README.md b/README.md index fa4c14d..ca97f45 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ Current foundation scope includes: - purchase-order supporting documents for vendor invoices, acknowledgements, certifications, and backup files - shipping shipments linked to sales orders with packing slips, shipping labels, bills of lading, and logistics attachments - projects with customer/commercial/shipment linkage, owners, due dates, milestones, rollups, notes, and attachments -- manufacturing work orders with project linkage, station-based operation templates, material issue posting, completion posting, and work-order attachments -- planning workbench with live project/manufacturing schedule data, exception rail, heatmap load view, agenda view, focus drawer, station load grouping, readiness filters, and inline dispatch actions +- manufacturing work orders with project linkage, station-based operation templates, station calendars/capacity settings, calendar-aware operation scheduling, material issue posting, completion posting, operation rescheduling, and work-order attachments +- planning workbench with live project/manufacturing schedule data, exception rail, heatmap load view, agenda view, focus drawer, station load grouping, readiness filters, overload visibility, inline dispatch actions, and planner-side operation rebalance controls including station-to-station moves - sales-order demand planning with multi-level BOM explosion, stock/open-supply netting, and build/buy recommendations - planner-assisted conversion of demand-planning recommendations into prefilled work-order and purchase-order drafts - pegged WO/PO supply tracking back to sales demand with preferred-vendor sourcing on inventory items @@ -110,7 +110,7 @@ Next expansion areas: ## Manufacturing Direction -Manufacturing is now a separate execution subsystem rather than being collapsed into Projects. The current slice ships work-order records with build-item linkage, optional project linkage, warehouse/location output posting, BOM-based material requirement visibility, station master data, item-level operation templates, automatic work-order operation plans, material issue posting, completion posting, work-order attachments, and dashboard visibility. +Manufacturing is now a separate execution subsystem rather than being collapsed into Projects. The current slice ships work-order records with build-item linkage, optional project linkage, warehouse/location output posting, BOM-based material requirement visibility, station master data, item-level operation templates, station calendars and capacity settings, automatic work-order operation plans, operation-level rescheduling, material issue posting, completion posting, work-order attachments, and dashboard visibility. Current interactions: @@ -122,11 +122,11 @@ Next expansion areas: - Purchasing: shortages and buyout demand should surface from manufacturing execution - Shipping: completed manufacturing should feed shipment readiness -- Planning: manufacturing orders, routings, and work centers should drive capacity and schedule views +- Planning: manufacturing orders, routings, and work centers now drive the first capacity/load layer and should continue expanding into fuller finite-capacity scheduling ## Planning Direction -Planning is now the live scheduling and visibility layer over projects and manufacturing instead of a placeholder wrapper. The current slice ships a planning workbench backed by active projects, due-date milestones, linked work orders, standalone manufacturing queue visibility, exception rails, dense load heatmaps, station load summaries, readiness scoring, focus-drawer inspection, inline release/build/buy follow-through, and agenda sequencing. +Planning is now the live scheduling and visibility layer over projects and manufacturing instead of a placeholder wrapper. The current slice ships a planning workbench backed by active projects, due-date milestones, linked work orders, standalone manufacturing queue visibility, exception rails, dense load heatmaps, station load summaries, readiness scoring, overload visibility, focus-drawer inspection, planner-side operation rebalance controls including station reassignment, inline release/build/buy follow-through, and agenda sequencing. Current interactions: diff --git a/ROADMAP.md b/ROADMAP.md index a4a72b5..5a3f162 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -103,12 +103,12 @@ This file tracks work that still needs to be completed. Shipped phase history an - Task dependencies, milestones, and progress updates - Manufacturing calendar views and deeper bottleneck visibility beyond the shipped station load and overload workbench summaries -- Labor and machine scheduling support +- Labor and machine scheduling support beyond the shipped station calendar/capacity foundation - Theme-compliant workbench scheduling surfaces for light/dark mode - Collapsible schedule groupings and saved planner views -- Drag-and-drop rescheduling improvements +- Conflict-aware drag-and-drop rescheduling improvements beyond the shipped planner-side station reassignment controls - Critical-path and overdue highlighting -- Richer finite-capacity warnings and rescheduling controls beyond the shipped workbench overload indicators +- Richer finite-capacity warnings, automated rebalance logic, and station drag-rescheduling beyond the shipped overload indicators and workbench rebalance controls - Better mobile and tablet behavior for shop-floor lookups - Faster filtering by project, customer, work center, and status diff --git a/SHIPPED.md b/SHIPPED.md index da8839a..5aa0e38 100644 --- a/SHIPPED.md +++ b/SHIPPED.md @@ -37,7 +37,7 @@ This file tracks roadmap phases, slices, and major foundations that have already - Project cockpit section on detail pages for commercial, supply, execution, delivery, purchasing, readiness-risk, and cost-snapshot visibility, with direct launch paths into prefilled project work orders and demand-linked purchase orders plus a project activity timeline - Project list/detail/create/edit workflows and dashboard program widgets - Manufacturing foundation with work orders, project linkage, material issue posting, completion posting, and work-order attachments -- Manufacturing stations, item routing templates, and automatic work-order operation planning for the workbench schedule +- Manufacturing stations, item routing templates, station calendars/capacity settings, automatic work-order operation planning, and operation-level rescheduling for the workbench schedule - Vendor invoice/supporting-document attachments directly on purchase orders - Vendor-detail purchasing visibility with recent purchase-order activity - Revision comparison UX for changed sales and purchasing documents, including purchase-order revision persistence @@ -56,6 +56,8 @@ This file tracks roadmap phases, slices, and major foundations that have already - Full-site density normalization pass across active CRM, inventory, settings, dashboard, and login screens - Live planning workbench timelines driven by project and manufacturing data - Planning workbench with heatmap, overview, and agenda modes plus exception rail, focus drawer, station load grouping, readiness scoring, and inline dispatch actions +- Finite-capacity foundation with station working-day calendars, daily/parallel capacity settings, and calendar-aware operation scheduling +- Planner-side workbench rebalance controls for operation scheduling, with quick shift moves, heatmap-day targeting, and station-to-station reassignment - Sales-order demand planning with multi-level BOM explosion, stock/open-supply netting, and build/buy recommendations - Multi-stage Docker packaging and migration-aware entrypoint - Docker image validated locally with successful app startup and login flow diff --git a/client/src/lib/api.ts b/client/src/lib/api.ts index 7928f0c..aa0100b 100644 --- a/client/src/lib/api.ts +++ b/client/src/lib/api.ts @@ -61,6 +61,7 @@ import type { WorkOrderCompletionInput, WorkOrderDetailDto, WorkOrderInput, + WorkOrderOperationScheduleInput, WorkOrderMaterialIssueInput, WorkOrderStatus, WorkOrderSummaryDto, @@ -639,6 +640,13 @@ export const api = { token ); }, + updateWorkOrderOperationSchedule(token: string, workOrderId: string, operationId: string, payload: WorkOrderOperationScheduleInput) { + return request( + `/api/v1/manufacturing/work-orders/${workOrderId}/operations/${operationId}/schedule`, + { method: "PATCH", body: JSON.stringify(payload) }, + token + ); + }, issueWorkOrderMaterial(token: string, workOrderId: string, payload: WorkOrderMaterialIssueInput) { return request( `/api/v1/manufacturing/work-orders/${workOrderId}/issues`, diff --git a/client/src/modules/manufacturing/ManufacturingPage.tsx b/client/src/modules/manufacturing/ManufacturingPage.tsx index 57f199b..859c9d9 100644 --- a/client/src/modules/manufacturing/ManufacturingPage.tsx +++ b/client/src/modules/manufacturing/ManufacturingPage.tsx @@ -10,6 +10,9 @@ const emptyStationInput: ManufacturingStationInput = { name: "", description: "", queueDays: 0, + dailyCapacityMinutes: 480, + parallelCapacity: 1, + workingDays: [1, 2, 3, 4, 5], isActive: true, }; @@ -72,6 +75,8 @@ export function ManufacturingPage() {
{station.queueDays} expected wait day(s)
+
{station.dailyCapacityMinutes} min/day x {station.parallelCapacity}
+
Days {station.workingDays.join(",")}
{station.isActive ? "Active" : "Inactive"}
@@ -96,6 +101,46 @@ export function ManufacturingPage() { Expected Wait (Days) setForm((current) => ({ ...current, queueDays: Number.parseInt(event.target.value, 10) || 0 }))} className="w-full rounded-2xl border border-line/70 bg-page px-2 py-2 text-text outline-none transition focus:border-brand" /> +
+ + +
+