Thin isolation layer over the optional PhoenixKitComments module for
Manufacturing resources.
A simplified adaptation of PhoenixKitWarehouse.Comments: same
kind-parameterized shape, but with a single resource kind (:machine)
today. The parameterization is kept (rather than collapsing to
machine-only functions) so a future :operation/:defect_reason kind
can be added here without reshaping callers — mirrors the precedent.
Every function degrades gracefully when phoenix_kit_comments is absent
or disabled, so callers never special-case it.
Summary
Functions
True when the comments module is installed and enabled.
Comment count for one resource. Returns 0 when unavailable.
Comment counts for many resources of the same kind, as a uuid => count
map. Every requested uuid is present (value 0 when it has no comments).
Returns an empty map when the module is unavailable.
The comment resource_type string used for the given resource kind.
Subscribes the calling process to cross-session comment activity for the given resource uuids. No-op when the module is unavailable.
Unsubscribes the calling process from the given resource uuids.
Types
Functions
@spec available?() :: boolean()
True when the comments module is installed and enabled.
@spec count(kind(), binary()) :: non_neg_integer()
Comment count for one resource. Returns 0 when unavailable.
@spec counts(kind(), [binary()]) :: %{optional(binary()) => non_neg_integer()}
Comment counts for many resources of the same kind, as a uuid => count
map. Every requested uuid is present (value 0 when it has no comments).
Returns an empty map when the module is unavailable.
The comment resource_type string used for the given resource kind.
Subscribes the calling process to cross-session comment activity for the given resource uuids. No-op when the module is unavailable.
Unsubscribes the calling process from the given resource uuids.