Update Advancement Mode

Updates only the advancement mode of an existing manufacturing path. This is a focused endpoint that changes how serial numbers advance through the path's steps without modifying the path's name, goal quantity, or step sequence. It delegates to the same pathService.updatePath() method as the general Update Path endpoint, but accepts only the advancementMode field.

Use this endpoint when production conditions change and you need to relax or tighten step enforcement on a path. For example, switching from "strict" to "flexible" mid-production allows operators to skip optional steps that are causing bottlenecks, without requiring a full path update.

Advancement Mode Reference

ModeBehavior
strictSerial numbers must complete every step in exact sequential order. No steps can be skipped or deferred. This is the safest mode for regulated manufacturing.
flexibleSerial numbers advance sequentially, but optional steps can be skipped and preferred-dependency steps can be deferred for later completion.
per_stepEach step's advancement behavior is determined by its individual dependencyType and optional settings. Provides the most granular control.

Request

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the path to update (e.g. "path_xyz789")

Request Body

FieldTypeRequiredDescription
advancementMode"strict" | "flexible" | "per_step"YesThe new advancement mode for the path. Must be one of the three valid mode strings.

Response

200 OK

Returned when the advancement mode is successfully updated. The response contains the complete Path object with all fields reflecting the current state after the update. The updatedAt timestamp is refreshed to the current time.

FieldTypeDescription
idstringUnique identifier for the path (unchanged)
jobIdstringThe parent job's ID (unchanged)
namestringThe path name (unchanged)
goalQuantitynumberThe goal quantity (unchanged)
advancementMode"strict" | "flexible" | "per_step"The newly applied advancement mode
stepsProcessStep[]The process steps (unchanged)
createdAtstringISO 8601 timestamp of original creation (unchanged)
updatedAtstringISO 8601 timestamp — refreshed to the current time on successful update

steps[] — Process Step objects (unchanged)

FieldTypeDescription
idstringUnique identifier for the step
namestringStep name
ordernumberZero-based position in the step sequence
locationstring | undefinedPhysical location, if set
assignedTostring | undefinedAssigned operator user ID, if set
optionalbooleanWhether the step is optional
dependencyType"physical" | "preferred" | "completion_gate"Dependency enforcement type

400 Bad Request

Returned when the request body contains an invalid advancement mode value.

ConditionMessage
advancementMode is missingValidation error describing the missing field
advancementMode is not a valid enum valueValidation error describing the invalid value

404 Not Found

Returned when no path exists with the given ID.

ConditionMessage
Path does not exist"Path not found: {id}"

500 Internal Server Error

Returned if an unhandled error occurs while persisting the update to the database.

ConditionMessage
Database write failure"Internal Server Error"
Unexpected runtime exception"Internal Server Error"

Examples

Request — Switch from strict to flexible

curl -X PATCH http://localhost:3000/api/paths/path_xyz789/advancement-mode \
  -H "Content-Type: application/json" \
  -d '{
    "advancementMode": "flexible"
  }'

Response — Switch from strict to flexible

{
  "id": "path_xyz789",
  "jobId": "job_abc123",
  "name": "Main Route",
  "goalQuantity": 40,
  "advancementMode": "flexible",
  "steps": [
    {
      "id": "step_001",
      "name": "CNC Machining",
      "order": 0,
      "location": "Bay 3",
      "assignedTo": "user_op1",
      "optional": false,
      "dependencyType": "physical"
    },
    {
      "id": "step_002",
      "name": "Deburring",
      "order": 1,
      "location": "Bay 3",
      "optional": false,
      "dependencyType": "preferred"
    },
    {
      "id": "step_003",
      "name": "QC Inspection",
      "order": 2,
      "location": "QC Lab",
      "assignedTo": "user_qc1",
      "optional": false,
      "dependencyType": "completion_gate"
    }
  ],
  "createdAt": "2024-01-15T11:00:00.000Z",
  "updatedAt": "2024-01-25T14:30:00.000Z"
}

Request — Switch to per_step mode

curl -X PATCH http://localhost:3000/api/paths/path_xyz789/advancement-mode \
  -H "Content-Type: application/json" \
  -d '{
    "advancementMode": "per_step"
  }'

Response — Switch to per_step mode

{
  "id": "path_xyz789",
  "jobId": "job_abc123",
  "name": "Main Route",
  "goalQuantity": 40,
  "advancementMode": "per_step",
  "steps": [
    {
      "id": "step_001",
      "name": "CNC Machining",
      "order": 0,
      "location": "Bay 3",
      "assignedTo": "user_op1",
      "optional": false,
      "dependencyType": "physical"
    },
    {
      "id": "step_002",
      "name": "Deburring",
      "order": 1,
      "location": "Bay 3",
      "optional": false,
      "dependencyType": "preferred"
    },
    {
      "id": "step_003",
      "name": "QC Inspection",
      "order": 2,
      "location": "QC Lab",
      "assignedTo": "user_qc1",
      "optional": false,
      "dependencyType": "completion_gate"
    }
  ],
  "createdAt": "2024-01-15T11:00:00.000Z",
  "updatedAt": "2024-01-25T15:00:00.000Z"
}

Request — Revert to strict mode

curl -X PATCH http://localhost:3000/api/paths/path_xyz789/advancement-mode \
  -H "Content-Type: application/json" \
  -d '{
    "advancementMode": "strict"
  }'

Response — Revert to strict mode

{
  "id": "path_xyz789",
  "jobId": "job_abc123",
  "name": "Main Route",
  "goalQuantity": 40,
  "advancementMode": "strict",
  "steps": [
    {
      "id": "step_001",
      "name": "CNC Machining",
      "order": 0,
      "location": "Bay 3",
      "assignedTo": "user_op1",
      "optional": false,
      "dependencyType": "physical"
    },
    {
      "id": "step_002",
      "name": "Deburring",
      "order": 1,
      "location": "Bay 3",
      "optional": false,
      "dependencyType": "preferred"
    },
    {
      "id": "step_003",
      "name": "QC Inspection",
      "order": 2,
      "location": "QC Lab",
      "assignedTo": "user_qc1",
      "optional": false,
      "dependencyType": "completion_gate"
    }
  ],
  "createdAt": "2024-01-15T11:00:00.000Z",
  "updatedAt": "2024-01-25T15:30:00.000Z"
}

Notes

  • Changing the advancement mode does not retroactively affect serial numbers that have already advanced past steps. It only affects future advancement operations. Serials that skipped steps under "flexible" mode will not be forced back to those steps if you switch to "strict".
  • This endpoint modifies only the advancementMode field and the updatedAt timestamp. The path name, goal quantity, and step sequence are never touched. For broader updates, use the general Update Path endpoint.
  • Setting the mode to "strict" on a path with optional steps effectively disables the optional behavior — all steps must be completed in order regardless of their optional flag.
  • Setting the mode to "per_step" gives the most granular control. In this mode, each step's optional and dependencyType fields determine whether it can be skipped, deferred, or must be completed as a gate.
  • The updatedAt timestamp is refreshed even if the new mode is the same as the current mode.
  • There is no optimistic concurrency control. If two clients update the advancement mode simultaneously, the last write wins.
  • Get Path — Retrieve the current path state to check the existing advancement mode
  • Update Path — Update multiple path properties at once, including advancement mode
  • Create Path — Create a new path with a specific advancement mode