<!-- Device Inventory Manager — https://wiki.cyberguard.srl/dim/inventory/catalog/ -->

# Catalogue Management

Categories, sub-categories, and vendors used by the Inventory module live in a shared catalogue, scoped to your organization. This page covers how to manage it from **Inventory → Manage Catalogue**.

---

## Self-populating, never pre-set

There is no catalogue setup step. The first time you create an asset (or import a CSV) with a category, sub-category, or vendor name that doesn't exist yet, that name is created automatically in the catalogue — matching is case-insensitive, so "SIM" and "sim" resolve to the same entry.

If you'd rather start from a small set of common categories, the catalogue page offers a **"Add default categories"** button that creates a short predefined list (SIM, Software, Subscription, Badge) in one click, already configured with icons and contextual field labels (see below). This is an explicit action you choose to take — nothing is seeded silently in the background. Running it again never creates duplicates, and it never overwrites a category you've already customized.

---

## Renaming

Any catalogue entry — category, sub-category, or vendor — can be renamed at any time. Every asset already using that entry picks up the new name immediately; nothing needs to be re-saved.

Renaming to a name that already exists in the same scope (same type, same parent for sub-categories) is rejected — use **Merge** instead.

---

## Merging

When two entries mean the same thing — a typo, or two names entered independently ("Sim" and "SIM Card") — merge them into one. Before confirming, the portal shows exactly how many assets will be moved from the source entry to the destination.

- Merging two **categories** that each have a sub-category with the same name automatically merges those matching sub-categories into one as well — the confirmation dialog lists which sub-categories will be merged this way before you confirm, so nothing is folded in as a surprise.
- Merging a **sub-category** is only allowed between sub-categories that share the same parent category. Two sub-categories with different parents cannot be merged directly — merge their parent categories first (which cascades the sub-categories as described above), or rename one of them into the correct parent's scope first.
- The source entry is removed once the merge completes; the destination entry keeps its own name, icon, and contextual labels.

Merging is permanent: there is no undo beyond restoring from a backup.

---

## Deactivating (never deleting)

A catalogue entry that is still referenced by at least one asset **cannot be deleted** — this is a deliberate design choice: nothing in the catalogue is ever destroyed once it has been used, because that would silently orphan the assets pointing to it.

Instead, an entry can be **deactivated**. A deactivated entry:

- No longer appears in the autocomplete suggestions when creating or editing an asset
- Still appears in the catalogue management page, marked as inactive
- Leaves every asset that already uses it completely untouched and visible

Deactivating and reactivating is instant and reversible from the same button.

---

## Contextual field labels

Categories can carry their own icon and field labels, so the same form reads naturally for very different kinds of assets. For example:

| Category | Name field shows as | Serial Number field shows as |
|----------|---------------------|-------------------------------|
| `SIM` | "Phone Number" | "Serial (ICCID)" |
| `Software` | "Product Name" | "Licence Key" |

These labels — and an optional help text shown under the form fields — are edited from the catalogue page, per category. They are your data, not fixed product text: leave them blank on a category and the generic default labels ("Name", "Serial Number") are used instead.

---

## Who can manage the catalogue

Catalogue management uses the same `Inventory` permission as the rest of the module — there is no separate permission key for it. Anyone who can create an asset can already create catalogue entries implicitly, so a dedicated permission for renaming/merging/deactivating would only create a false sense of extra control.
