{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnm-io/json-schema/arcnm-io-nest-run-detail-schema.json",
  "title": "NestRunDetail",
  "description": "A job nest in full: each material and thickness with its sheets and\nutilisation, each line's and each order's share of the sheets, and the\nremnants it used, holds and created.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnm-io-nesting-api-openapi.yml#/components/schemas/NestRunDetail",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "env_id": {
      "type": "string",
      "format": "uuid",
      "title": "Env Id",
      "description": "The costing environment it nests in."
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "queued",
        "running",
        "solved",
        "failed",
        "cancelled"
      ],
      "title": "Status",
      "description": "`draft`: kept, not queued — it was started while the month's runs were used, so it spends no run until `POST /nest-runs/{run_id}/start` starts it. `queued`: waiting to start. `running`: nesting, several materials and thicknesses at a time. `solved`: every material and thickness is nested. `failed`: it stopped, `error` says why; what it nested before stands. `cancelled`: stopped on request; what it nested before stands."
    },
    "allocation_rule": {
      "type": "string",
      "enum": [
        "area_proportional",
        "equal_per_sheet"
      ],
      "title": "Allocation Rule",
      "description": "How each sheet's cost is shared by the parts on it."
    },
    "group_budget_s": {
      "type": "number",
      "title": "Group Budget S",
      "description": "The longest each material and thickness may be nested for, in seconds of computing time."
    },
    "as_of": {
      "type": "string",
      "format": "date",
      "title": "As Of",
      "description": "The day its stock and prices are read at."
    },
    "created_by_user_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created By User Id"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Started At"
    },
    "finished_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finished At"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error",
      "description": "Why it stopped, when it did not finish."
    },
    "groups_total": {
      "type": "integer",
      "title": "Groups Total",
      "description": "Materials and thicknesses it nests — each is nested on its own."
    },
    "groups_done": {
      "type": "integer",
      "title": "Groups Done",
      "description": "Of those, the ones finished so far: nested, or not nestable."
    },
    "lines": {
      "type": "integer",
      "title": "Lines",
      "description": "Lines it nests."
    },
    "copies": {
      "type": "integer",
      "title": "Copies",
      "description": "Copies it nests, over all its lines."
    },
    "sheets": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sheets",
      "description": "Sheets and remnants the nested materials and thicknesses are cut from; set once the job nest ends."
    },
    "counts_toward_savings": {
      "type": "boolean",
      "title": "Counts Toward Savings",
      "description": "True once the job nest was released: its stock is booked and what it saves adds to the total saved by nesting. False: a simulation, whose saving is potential only.",
      "default": false
    },
    "counted_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Counted At",
      "description": "When it was released; null while a simulation."
    },
    "savings": {
      "anyOf": [
        {
          "$ref": "#/$defs/NestRunSavings"
        },
        {
          "type": "null"
        }
      ],
      "description": "What it saves, once it ends; null before, or where no line compares."
    },
    "left_out": {
      "items": {
        "$ref": "#/$defs/LeftOutLine"
      },
      "type": "array",
      "title": "Left Out",
      "description": "Calculations of the batch or folder it does not take, each with why."
    },
    "groups": {
      "items": {
        "$ref": "#/$defs/NestRunGroup"
      },
      "type": "array",
      "title": "Groups"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/NestRunLine"
      },
      "type": "array",
      "title": "Items"
    },
    "orders": {
      "items": {
        "$ref": "#/$defs/OrderTotal"
      },
      "type": "array",
      "title": "Orders",
      "description": "Each order's lines totalled, once the job nest ends."
    },
    "remnants_used": {
      "items": {
        "$ref": "#/$defs/RemnantPublic"
      },
      "type": "array",
      "title": "Remnants Used",
      "description": "Remnants from stock its sheets were cut from."
    },
    "remnants_held": {
      "items": {
        "$ref": "#/$defs/RemnantPublic"
      },
      "type": "array",
      "title": "Remnants Held",
      "description": "Remnants it holds while it runs, kept from other job nests."
    },
    "remnants_created": {
      "items": {
        "$ref": "#/$defs/RemnantPublic"
      },
      "type": "array",
      "title": "Remnants Created",
      "description": "The reusable rests its sheets left, now in stock."
    }
  },
  "type": "object",
  "required": [
    "id",
    "env_id",
    "status",
    "allocation_rule",
    "group_budget_s",
    "as_of",
    "created_by_user_id",
    "created_at",
    "started_at",
    "finished_at",
    "error",
    "groups_total",
    "groups_done",
    "lines",
    "copies",
    "left_out",
    "groups",
    "items",
    "orders",
    "remnants_used",
    "remnants_held",
    "remnants_created"
  ],
  "$defs": {
    "LeftOutLine": {
      "properties": {
        "calculation_id": {
          "type": "string",
          "format": "uuid",
          "title": "Calculation Id"
        },
        "reason": {
          "type": "string",
          "title": "Reason",
          "description": "Why: `not_succeeded` (not priced yet), `not_sheet` (not cut from sheet), `no_stored_layout` (no layout was stored with its price), `material_provided` (the customer supplies the material) or `missing_facts` (its price does not state the thickness, the material price or the spacing a job nest reads)."
        }
      },
      "type": "object",
      "required": [
        "calculation_id",
        "reason"
      ],
      "title": "LeftOutLine",
      "description": "A calculation of the batch or folder the job nest does not take."
    },
    "NestOrderSaving": {
      "properties": {
        "currency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Currency",
          "description": "The currency of the amounts; null where the compared lines were priced in more than one, and then the amounts are null too."
        },
        "lines": {
          "type": "integer",
          "title": "Lines",
          "description": "Lines with pieces on the sheets."
        },
        "lines_compared": {
          "type": "integer",
          "title": "Lines Compared",
          "description": "Of those, the lines whose rectangular blanks and nested figures are known in one currency: what `saved` covers."
        },
        "split_lines": {
          "type": "integer",
          "title": "Split Lines",
          "description": "Of the compared lines, those whose figure nested alone is known too: what `alone`, `saved_true_shape` and `saved_combining` cover. Where it equals `lines_compared`, `saved` is `saved_true_shape` plus `saved_combining`."
        },
        "copies": {
          "type": "integer",
          "title": "Copies",
          "description": "Pieces the compared lines have on the sheets."
        },
        "rectangular": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rectangular",
          "description": "Rectangular blanks: the whole sheets the pieces take cut part by part as rectangles, without nesting, at the job nest's price of new sheet."
        },
        "alone": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Alone",
          "description": "Each part nested alone: the whole sheets its own true-shape layout takes for its pieces, on the sheet formats the job nest can buy, at the job nest's price of new sheet."
        },
        "nested": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nested",
          "description": "Nested together: the lines' share of the sheets and remnants cut."
        },
        "saved": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Saved",
          "description": "`rectangular` less `nested`: what nesting saved against cutting each part from rectangular blanks; may be negative for one line or order — its share of shared sheets, stated as it is — or for a layout edited to cut more sheet."
        },
        "saved_true_shape": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Saved True Shape",
          "description": "`rectangular` less `alone`, over the lines in `split_lines`: what nesting each part to its true shape saved on its own."
        },
        "saved_combining": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Saved Combining",
          "description": "`alone` less `nested`, over the lines in `split_lines`: what nesting the orders' parts together saved on top."
        },
        "rectangular_kg": {
          "type": "number",
          "title": "Rectangular Kg"
        },
        "alone_kg": {
          "type": "number",
          "title": "Alone Kg"
        },
        "nested_kg": {
          "type": "number",
          "title": "Nested Kg"
        },
        "saved_kg": {
          "type": "number",
          "title": "Saved Kg",
          "description": "`rectangular_kg` less `nested_kg`."
        },
        "saved_true_shape_kg": {
          "type": "number",
          "title": "Saved True Shape Kg",
          "description": "`rectangular_kg` less `alone_kg`, over the lines in `split_lines`."
        },
        "saved_combining_kg": {
          "type": "number",
          "title": "Saved Combining Kg",
          "description": "`alone_kg` less `nested_kg`, over the lines in `split_lines`."
        },
        "rectangular_sheets": {
          "type": "integer",
          "title": "Rectangular Sheets",
          "description": "Sheets the lines take as rectangular blanks."
        },
        "alone_sheets": {
          "type": "integer",
          "title": "Alone Sheets",
          "description": "Sheets the lines in `split_lines` take nested alone."
        },
        "nested_sheets": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nested Sheets",
          "description": "Sheets and remnants cut nested together; null where not every placed line compared."
        },
        "order_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Order Ref",
          "description": "The order; null for the lines that name none."
        }
      },
      "type": "object",
      "required": [
        "currency",
        "lines",
        "lines_compared",
        "split_lines",
        "copies",
        "rectangular",
        "alone",
        "nested",
        "saved",
        "saved_true_shape",
        "saved_combining",
        "rectangular_kg",
        "alone_kg",
        "nested_kg",
        "saved_kg",
        "saved_true_shape_kg",
        "saved_combining_kg",
        "rectangular_sheets",
        "alone_sheets",
        "nested_sheets",
        "order_ref"
      ],
      "title": "NestOrderSaving",
      "description": "One order's lines, the same figures."
    },
    "NestRunGroup": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "position": {
          "type": "integer",
          "title": "Position"
        },
        "material_grade_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Material Grade Id",
          "description": "The material grade; null when the lines name a material category."
        },
        "material_category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Material Category",
          "description": "The material category."
        },
        "gauge_mm": {
          "type": "number",
          "title": "Gauge Mm",
          "description": "The thickness, in millimetres."
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "running",
            "solved",
            "failed",
            "cancelled"
          ],
          "title": "Status"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error",
          "description": "Why it could not be nested, when it failed."
        },
        "sheets": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sheets",
          "description": "Sheets and remnants its parts are cut from, once nested."
        },
        "utilisation_net": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Utilisation Net",
          "description": "The parts' area over the area of the sheets they are cut from, less the reusable rests that go back to stock; once nested."
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Started At"
        },
        "finished_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Finished At"
        },
        "active_revision": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Active Revision",
          "description": "The revision its sheets are read from: 1 is the job nest's own layout, every adjustment posted is the next. Null until nested."
        },
        "revisions": {
          "type": "integer",
          "title": "Revisions",
          "description": "Revisions it has.",
          "default": 0
        }
      },
      "type": "object",
      "required": [
        "id",
        "position",
        "material_grade_id",
        "material_category",
        "gauge_mm",
        "status",
        "error",
        "sheets",
        "utilisation_net",
        "started_at",
        "finished_at"
      ],
      "title": "NestRunGroup",
      "description": "One material and thickness of a job nest. Its lines are nested\ntogether, on the stocked sheets and the remnants of that material and\nthickness; lines of one material and thickness stated at different\nedge margins or spacings are nested apart."
    },
    "NestRunLine": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "group_id": {
          "type": "string",
          "format": "uuid",
          "title": "Group Id",
          "description": "The material and thickness it is nested in."
        },
        "calculation_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Calculation Id",
          "description": "The calculation it was read from; null once that is deleted."
        },
        "position": {
          "type": "integer",
          "title": "Position",
          "description": "Its place in the selection, from 0."
        },
        "quantity": {
          "type": "integer",
          "title": "Quantity",
          "description": "Copies asked for."
        },
        "order_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Order Ref"
        },
        "due": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Due"
        },
        "priority": {
          "type": "integer",
          "title": "Priority"
        },
        "allocation": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicNestLineAllocation"
            },
            {
              "type": "null"
            }
          ],
          "description": "Its share of the sheets, once its material and thickness is nested."
        }
      },
      "type": "object",
      "required": [
        "id",
        "group_id",
        "calculation_id",
        "position",
        "quantity",
        "order_ref",
        "due",
        "priority"
      ],
      "title": "NestRunLine",
      "description": "One line of a job nest and its share of the sheets it was nested\non. Its `id` is what a calculation names as `nest_item_id` to be priced\nat that share."
    },
    "NestRunSavings": {
      "properties": {
        "currency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Currency",
          "description": "The currency of the amounts; null where the compared lines were priced in more than one, and then the amounts are null too."
        },
        "lines": {
          "type": "integer",
          "title": "Lines",
          "description": "Lines with pieces on the sheets."
        },
        "lines_compared": {
          "type": "integer",
          "title": "Lines Compared",
          "description": "Of those, the lines whose rectangular blanks and nested figures are known in one currency: what `saved` covers."
        },
        "split_lines": {
          "type": "integer",
          "title": "Split Lines",
          "description": "Of the compared lines, those whose figure nested alone is known too: what `alone`, `saved_true_shape` and `saved_combining` cover. Where it equals `lines_compared`, `saved` is `saved_true_shape` plus `saved_combining`."
        },
        "copies": {
          "type": "integer",
          "title": "Copies",
          "description": "Pieces the compared lines have on the sheets."
        },
        "rectangular": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rectangular",
          "description": "Rectangular blanks: the whole sheets the pieces take cut part by part as rectangles, without nesting, at the job nest's price of new sheet."
        },
        "alone": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Alone",
          "description": "Each part nested alone: the whole sheets its own true-shape layout takes for its pieces, on the sheet formats the job nest can buy, at the job nest's price of new sheet."
        },
        "nested": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nested",
          "description": "Nested together: the lines' share of the sheets and remnants cut."
        },
        "saved": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Saved",
          "description": "`rectangular` less `nested`: what nesting saved against cutting each part from rectangular blanks; may be negative for one line or order — its share of shared sheets, stated as it is — or for a layout edited to cut more sheet."
        },
        "saved_true_shape": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Saved True Shape",
          "description": "`rectangular` less `alone`, over the lines in `split_lines`: what nesting each part to its true shape saved on its own."
        },
        "saved_combining": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Saved Combining",
          "description": "`alone` less `nested`, over the lines in `split_lines`: what nesting the orders' parts together saved on top."
        },
        "rectangular_kg": {
          "type": "number",
          "title": "Rectangular Kg"
        },
        "alone_kg": {
          "type": "number",
          "title": "Alone Kg"
        },
        "nested_kg": {
          "type": "number",
          "title": "Nested Kg"
        },
        "saved_kg": {
          "type": "number",
          "title": "Saved Kg",
          "description": "`rectangular_kg` less `nested_kg`."
        },
        "saved_true_shape_kg": {
          "type": "number",
          "title": "Saved True Shape Kg",
          "description": "`rectangular_kg` less `alone_kg`, over the lines in `split_lines`."
        },
        "saved_combining_kg": {
          "type": "number",
          "title": "Saved Combining Kg",
          "description": "`alone_kg` less `nested_kg`, over the lines in `split_lines`."
        },
        "rectangular_sheets": {
          "type": "integer",
          "title": "Rectangular Sheets",
          "description": "Sheets the lines take as rectangular blanks."
        },
        "alone_sheets": {
          "type": "integer",
          "title": "Alone Sheets",
          "description": "Sheets the lines in `split_lines` take nested alone."
        },
        "nested_sheets": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nested Sheets",
          "description": "Sheets and remnants cut nested together; null where not every placed line compared."
        },
        "by_order": {
          "items": {
            "$ref": "#/$defs/NestOrderSaving"
          },
          "type": "array",
          "title": "By Order",
          "description": "The same per order."
        }
      },
      "type": "object",
      "required": [
        "currency",
        "lines",
        "lines_compared",
        "split_lines",
        "copies",
        "rectangular",
        "alone",
        "nested",
        "saved",
        "saved_true_shape",
        "saved_combining",
        "rectangular_kg",
        "alone_kg",
        "nested_kg",
        "saved_kg",
        "saved_true_shape_kg",
        "saved_combining_kg",
        "rectangular_sheets",
        "alone_sheets",
        "nested_sheets"
      ],
      "title": "NestRunSavings",
      "description": "What a job nest saves on the sheet it cuts into, stated once it ends.\nBoth are the material bought, before the scrap and remnant credits\neither would earn."
    },
    "OrderTotal": {
      "properties": {
        "order_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Order Ref",
          "description": "The order; null for the lines that name none."
        },
        "currency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Currency",
          "description": "The currency of the amounts; null where the order's lines were priced in more than one."
        },
        "copies": {
          "type": "integer",
          "title": "Copies",
          "description": "Its copies on the job nest's sheets."
        },
        "purchased": {
          "type": "number",
          "title": "Purchased",
          "description": "Its share of the sheets bought."
        },
        "remnant_credit": {
          "type": "number",
          "title": "Remnant Credit",
          "description": "Its share of what the sheets' reusable rests are worth back in stock."
        },
        "scrap_credit": {
          "type": "number",
          "title": "Scrap Credit",
          "description": "Its share of what the sheets' skeleton sells for as scrap."
        },
        "net": {
          "type": "number",
          "title": "Net",
          "description": "`purchased` less the two credits."
        },
        "net_per_copy": {
          "type": "number",
          "title": "Net Per Copy",
          "description": "`net` over `copies`."
        }
      },
      "type": "object",
      "required": [
        "order_ref",
        "copies",
        "purchased",
        "remnant_credit",
        "scrap_credit",
        "net",
        "net_per_copy"
      ],
      "title": "OrderTotal",
      "description": "One order's lines totalled, across every material and thickness."
    },
    "PublicNestLineAllocation": {
      "properties": {
        "currency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Currency",
          "description": "The currency of the amounts."
        },
        "copies": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Copies",
          "description": "Copies of the line on the job nest's sheets — what the amounts are for. Fewer than the line's quantity when some could not be placed."
        },
        "purchased": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Purchased",
          "description": "Its share of the sheets bought."
        },
        "scrap_credit": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scrap Credit",
          "description": "Its share of what the sheets' skeleton sells for as scrap; zero unless the environment states that it sells its scrap."
        },
        "remnant_credit": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Remnant Credit",
          "description": "Its share of what the sheets' reusable rests are worth back in stock; zero unless the environment states that it returns remnants to stock."
        },
        "net": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Net",
          "description": "`purchased` less the two credits."
        },
        "net_per_copy": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Net Per Copy",
          "description": "What one copy of the part costs in material priced on this line, net of both credits: what a calculation created with the line's id books per piece as material less scrap credit. `net` over `copies` where the part's own sheet holds it no more densely than these shared sheets; less where it does, because a copy then pays only for the stock it uses and the rest of its share goes back on the rack."
        }
      },
      "type": "object",
      "title": "PublicNestLineAllocation",
      "description": "What one line of a job nest carries of the sheets it was nested on,\nall its copies together: its share of the sheets bought, less its share\nof what their skeleton sells for as scrap and of what their reusable\nrests are worth back in stock."
    },
    "RemnantPublic": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "env_id": {
          "type": "string",
          "format": "uuid",
          "title": "Env Id",
          "description": "The costing environment that holds it."
        },
        "length_mm": {
          "type": "number",
          "title": "Length Mm",
          "description": "Longer edge, in millimetres."
        },
        "width_mm": {
          "type": "number",
          "title": "Width Mm",
          "description": "Shorter edge, in millimetres."
        },
        "gauge_mm": {
          "type": "number",
          "title": "Gauge Mm",
          "description": "Thickness, in millimetres."
        },
        "material_grade_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Material Grade Id",
          "description": "The material grade; null when the remnant is stated for a whole material category."
        },
        "material_category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Material Category",
          "description": "The material category."
        },
        "quantity": {
          "type": "integer",
          "title": "Quantity",
          "description": "Pieces of this size."
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "reserved",
            "consumed",
            "scrapped"
          ],
          "title": "Status",
          "description": "`available`: in stock. `reserved`: held by a job nest while it runs. `consumed`: cut into parts by a job nest. `scrapped`: taken out of stock."
        },
        "origin_group_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Origin Group Id",
          "description": "The job nest group whose sheet left it; null for a remnant you stated."
        },
        "reserved_by_run_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reserved By Run Id",
          "description": "The job nest that holds or consumed it."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "consumed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Consumed At",
          "description": "When it left stock — consumed or scrapped."
        }
      },
      "type": "object",
      "required": [
        "id",
        "env_id",
        "length_mm",
        "width_mm",
        "gauge_mm",
        "material_grade_id",
        "material_category",
        "quantity",
        "status",
        "origin_group_id",
        "reserved_by_run_id",
        "created_at",
        "consumed_at"
      ],
      "title": "RemnantPublic",
      "description": "Rectangular rests of one thickness and material in one environment's\nstock."
    }
  }
}