ChemPal Documentation - v1.7.0
    Preparing search index...

    Module helpers/excludedProducts

    Functions - Helpers

    loadExcludedProducts

    Load the excluded-products map from IndexedDB. Returns an empty object if the store is empty or the read fails, so callers can treat the result as always-valid.

    loadExcludedProductKeys

    Load just the set of exclusion keys — convenient for hot-path membership checks (e.g. inside SupplierBase.getProductData) where the full metadata is not needed.

    countExcludedProductsForSupplier

    Count how many excluded entries were ignored from a given supplier. Used by SupplierBase.execute to over-fetch from queryProducts so that dropping previously-ignored rows still leaves the caller with limit survivors instead of a short list.

    addExcludedProduct

    Add a product to the excluded list in IndexedDB, keyed by the supplier's stable product identity (getProductIdentityKey) — the same key that keys the product-detail cache. Idempotent: re-excluding an already-ignored product just refreshes its excludedAt and last-known title. Returns the exclusion key for the caller's logging convenience.

    removeExcludedProduct

    Remove a single entry from the excluded-products map in IndexedDB. Load → delete → put, matching addExcludedProduct's read-modify-write shape so a caller holding a stale map cannot clobber concurrent writes. No-op (and no write) when the key is absent, so repeated removals are safe. Errors are logged, not thrown — callers don't need to try/catch.

    Interfaces - Helpers

    ExcludedProductEntry

    Minimal metadata stored for each excluded product so the user can review (and eventually un-exclude) their ignore list from settings.

    Type Aliases - Helpers

    ExcludedProductsMap

    Map of exclusion-key → excluded product entry, as persisted in the excludedProducts IndexedDB object store (via @/utils/idbCache).