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

    Module helpers/supplierFilters

    Functions - Helpers

    shippingCovers

    Whether a supplier's shipping scope fulfills a requested one, treating scope as a hierarchy: a scope covers itself and every narrower scope (worldwide covers all, local covers only local).

    suppliersExcludedBySearchFilters

    The supplier class names ruled out by the active shipping-type and/or country filters. A supplier is excluded when a non-empty shipping filter names no scope its own scope can fulfill (per the shippingCovers hierarchy), or a non-empty country filter doesn't list its country. An empty filter constrains nothing.

    fulfillableShippingRanges

    The shipping-type options the given suppliers can fulfill: every scope at or below the broadest selected supplier's scope (per the shippingCovers hierarchy). Used to decide which shipping options stay selectable — an option no selected supplier can fulfill is disabled. Empty in ⇒ empty out (no supplier constraint).

    countriesForSuppliers

    The distinct home countries of the given suppliers. Used to decide which country options are still reachable: a country no selected supplier resides in can be disabled. Empty in ⇒ empty out (no supplier constraint).

    resolveSupplierSelection

    Resolves the drawer's supplier selection to the list of suppliers to search. Normally the selection itself (empty meaning "all"). When invert is set and something is selected, the selection is an exclusion list: every other supplier. Suppliers the user disabled, or that don't ship to them, are removed later by SupplierFactory, so inverting never re-enables them. Inverting a selection that covers every supplier leaves nothing to search, reported by none so the caller doesn't fall back to the empty-means-all behavior.

    Interfaces

    SupplierShippingMeta

    One supplier's home country and coarse shipping scope.

    Type Aliases

    SupplierMetaMap

    Map of supplier class name → its SupplierShippingMeta.