Thin isolation layer over the optional PhoenixKitComments module for every
warehouse document kind.
Consolidates what were 5 near-byte-identical *_comments.ex wrapper
modules in Andi (goods_issue_comments.ex, goods_receipt_comments.ex,
internal_order_comments.ex, supplier_order_comments.ex,
inventory_comments.ex) into one module parameterized by a kind atom.
Every function degrades gracefully when the comments module 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 document. Returns 0 when unavailable.
Comment counts for many documents 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 document kind.
Subscribes the calling process to cross-session comment activity for the given document uuids. No-op when the module is unavailable.
Unsubscribes the calling process from the given document 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 document. Returns 0 when unavailable.
@spec counts(kind(), [binary()]) :: %{optional(binary()) => non_neg_integer()}
Comment counts for many documents 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 document kind.
Subscribes the calling process to cross-session comment activity for the given document uuids. No-op when the module is unavailable.
Unsubscribes the calling process from the given document uuids.