Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: update methodType to use MethodType type for improved type safety

naveenkash98e42ce1419c
diff --git a/apps/erp/app/modules/production/production.service.ts b/apps/erp/app/modules/production/production.service.ts
index ad349874fe..c2068f31ed 100644
--- a/apps/erp/app/modules/production/production.service.ts
+++ b/apps/erp/app/modules/production/production.service.ts
@@ -12,6 +12,7 @@ import { sanitize } from "~/utils/supabase";
import { getDefaultStorageUnitForJob } from "../inventory";
import { getEmployeeJob } from "../people";
import type {
+ MethodType,
operationParameterValidator,
operationStepValidator,
operationToolValidator
@@ -999,7 +1000,7 @@ type JobItemAvailability = {
// Pull-from-Inventory lines consume on-hand before other (e.g. Purchase to Order)
// lines, matching their sourcing intent.
-function methodAllocationRank(methodType: string | null): number {
+function methodAllocationRank(methodType: MethodType | null): number {
return methodType === "Pull from Inventory" ? 0 : 1;
}
@@ -1061,7 +1062,7 @@ export async function getJobMaterialShortfallByItem(
type Line = {
materialId: string;
remaining: number;
- methodType: string | null;
+ methodType: MethodType | null;
};
const demandByItem = new Map<string, Map<string, Demand>>();
const thisJobLinesByItem = new Map<string, Line[]>();
@@ -1144,7 +1145,7 @@ export async function getJobMaterialShortfallByItem(
type OrderStatusMaterial = {
itemTrackingType: string | null;
- methodType: string | null;
+ methodType: MethodType | null;
estimatedQuantity: number | null;
quantityIssued: number | null;
};
diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
index 32d1de857e..3cbd9c1cf6 100644
--- a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
@@ -1,5 +1,5 @@
{
- "generated": "2026-06-25T10:12:48.779Z",
+ "generated": "2026-06-26T12:05:49.700Z",
"totalTools": 1215,
"modules": 15,
"tools": [