skuIdMap Pattern
Forquoting_extension tools that work with known SKU codes, the recommended pattern is:
- At tool init, call
products.list()and build a local{ [sku]: productId }lookup. - Your tool’s internal logic works with human-readable SKU codes (from a pricing spreadsheet, config object, or product catalogue).
- When building lines for
quotes.addLines, look up each SKU inskuIdMapand pass bothproductCode(the SKU string) andproductId(the GUID). This triggers task template injection on the host. - Fall back gracefully: if a SKU is not found in
skuIdMap, send the line withoutproductId. The line still appears in the quote as free-form text — no task injection, but no error.
DTO Shapes
Three line kinds (lineType)
lineType | linkedItemId resolves to | Behaviour |
|---|---|---|
"product" (default) | Stock_SKU.IdGuid | If the linked SKU has a task sequence configured, the host auto-injects its task template lines (e.g. installation tasks). |
"task" | G_Task_Templates.IdGuid | The line is the task itself. No auto-injection. Use for explicit installation, removal, configuration tasks. |
"cost" | COB_Items.IdGuid | The line is a cost-of-business item (shipping, travel, disposal, site visit, etc.). No auto-injection. |
lineType is omitted (or set to "product") and linkedItemId is null, the host falls back to the legacy productId field — keeping Ziptrak v2.1.2 and earlier extensions working unchanged.
Section grouping
Quote lines are visually grouped bysection in both the operator’s quote editor and the customer-facing quote preview. Use a small set of stable labels per tool — e.g. for an indoor blinds extension: "Blinds", "Motorisation", "Installation", "Removal", "Extras". Lines with no section render in a trailing “Ungrouped” block.