Corteksa

Smart catalog deleted items — frontend integration

Smart catalog deleted items — frontend integration

A smart-catalog line whose source record was deleted used to read "(removed)" and nothing else, so an invoice line said something was bought but never what. The name is now part of resolved_label.

No shape change, no new key, no flag to opt into — the same field carries a better string.


1. What changed

// before
{
  "source_object_slug": "products",
  "source_record_slug": "a46f8e945a21",
  "resolved_label": "(removed)",
  "source_removed": true
}

// now
{
  "source_object_slug": "products",
  "source_record_slug": "a46f8e945a21",
  "resolved_label": "Fire Panel (removed)",
  "source_removed": true
}

The name comes from the trashed record itself, read live — not from a snapshot taken at pick time — so it is still correct if the item was renamed before it was deleted.

resolved_label falls back to a bare "(removed)" only when the name is genuinely unrecoverable: the record was purged from the trash, or the whole source object was deleted (its table is dropped with it).

Everything else about a removed line is unchanged: it stays in the list, keeps its frozen quantity / unit_price / line_total, and still counts toward subtotal, VAT and grand total.

2. What you may need to change

If the UI renders its own "(removed)" badge or suffix from source_removed, drop the suffix — otherwise the line now reads "Fire Panel (removed) (removed)". Render resolved_label as-is.

source_removed: true is still the styling signal — keep using it for the grey treatment and the tooltip ("This catalog item was deleted; the price is preserved from when it was added"). It is a flag, not text.

3. Where it shows up

Every read surface, since they all go through the one enrichment path: the record view and list cells, the line-items widget, the changelog / audit summary, generated documents and invoice PDFs, exports, and AI answers.

4. What did NOT change

  • Writes. A deleted item still cannot be picked or saved — posting its slug fails with INVALID_CATALOG_ITEM, exactly as before. The name is recovered on the read path only.
  • Totals. Frozen snapshot math is untouched.
  • Permissions. Unchanged; a stored line keeps rendering for whoever can read the host record (it passed its permission check when it was written).

On this page