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.

698 B
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-only
// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
// including ports, remain AGPLv3; serving them over a network requires releasing their source.

import type { ContractLine } from "./types";

/** A contract line as a column header or a row label: its description, else
 *  its service item's name. */
export function contractLineName(line: ContractLine) {
  return line.description || line.item?.name || line.itemId;
}

/** The editable cells' column key for the line at `index`. Line ids are not
 *  used: the Table treats a key with `_` as a nested path. */
export const lineColumnKey = (index: number) => `line${index}`;