List Serials

Returns every serial number in the system as a flat array of enriched objects. Each serial is augmented with its parent job name, path name, current step name, and operator assignment — eliminating the need for separate lookups when building serial listing pages, search results, or dashboard views.

The enrichment process resolves job and path references server-side, so the response contains human-readable names alongside the raw IDs. Serial status is normalized to a display-friendly format: "in-progress", "completed", or "scrapped" (note the hyphen in in-progress — this differs from the stored in_progress format).

This endpoint does not accept any query parameters or support pagination — it always returns the complete list. For a single serial with certificate data, use Get Serial instead.

Request

This endpoint accepts no path parameters, query parameters, or request body.

Response

200 OK

Returned when the request is successful. The response is always an array, even if no serials exist (in which case an empty array [] is returned).

FieldTypeDescription
idstringUnique serial identifier (e.g. "SN-00001")
jobIdstringID of the parent job
jobNamestringHuman-readable name of the parent job (e.g. "JOB-2024-001")
pathIdstringID of the manufacturing path this serial follows
pathNamestringHuman-readable name of the path (e.g. "Main Route")
currentStepIndexnumberZero-based index of the serial's current step. -1 when completed.
currentStepNamestringDisplay name of the current step (e.g. "Welding"). Shows "Completed" for completed serials and "Scrapped" for scrapped serials.
assignedTostring | undefinedUser ID of the operator assigned to the serial's current step, if any
status"in-progress" | "completed" | "scrapped"Display-friendly status. Note: uses hyphen (in-progress) not underscore.
scrapReasonstring | undefinedScrap reason code, present only for scrapped serials
forceCompletedboolean | undefinedtrue if the serial was force-completed, omitted otherwise
createdAtstringISO 8601 timestamp of when the serial was created

400 Bad Request

Returned if an unexpected validation error occurs during the request.

ConditionMessage
Internal validation failureVaries — describes the specific validation issue

500 Internal Server Error

Returned if an unhandled error occurs while fetching or enriching serial data.

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

Examples

Request

curl -X GET http://localhost:3000/api/serials \
  -H "Accept: application/json"

Response

[
  {
    "id": "SN-00001",
    "jobId": "job_abc123",
    "jobName": "JOB-2024-001",
    "pathId": "path_xyz789",
    "pathName": "Main Route",
    "currentStepIndex": 1,
    "currentStepName": "Welding",
    "assignedTo": "user_op1",
    "status": "in-progress",
    "createdAt": "2024-01-15T11:00:00.000Z"
  },
  {
    "id": "SN-00002",
    "jobId": "job_abc123",
    "jobName": "JOB-2024-001",
    "pathId": "path_xyz789",
    "pathName": "Main Route",
    "currentStepIndex": -1,
    "currentStepName": "Completed",
    "status": "completed",
    "createdAt": "2024-01-15T11:00:00.000Z"
  },
  {
    "id": "SN-00003",
    "jobId": "job_def456",
    "jobName": "JOB-2024-002",
    "pathId": "path_abc111",
    "pathName": "Rework Path",
    "currentStepIndex": 0,
    "currentStepName": "Scrapped",
    "status": "scrapped",
    "scrapReason": "process_defect",
    "createdAt": "2024-01-16T09:30:00.000Z"
  },
  {
    "id": "SN-00004",
    "jobId": "job_def456",
    "jobName": "JOB-2024-002",
    "pathId": "path_abc111",
    "pathName": "Rework Path",
    "currentStepIndex": -1,
    "currentStepName": "Completed",
    "status": "completed",
    "forceCompleted": true,
    "createdAt": "2024-01-16T09:30:00.000Z"
  }
]

Notes

  • The status field uses hyphenated format ("in-progress") for display purposes, which differs from the stored domain format ("in_progress"). Client code should handle both formats or normalize on receipt.
  • The currentStepName is resolved by matching the serial's currentStepIndex against the path's step array. If the path or step cannot be found (e.g. data inconsistency), the step name defaults to an empty string "".
  • The assignedTo field reflects the operator assigned to the serial's current step, not the serial itself. If the current step has no assignment, this field is omitted.
  • Job and path names are resolved via in-memory lookup maps built during the request. If a job or path has been deleted but serials still reference it, the name fields will be empty strings.
  • This endpoint returns all serials with no filtering or pagination. For large production environments, consider implementing client-side filtering or using the serial browser page which provides search and filter capabilities.