# `PhoenixKitManufacturing.Comments`
[🔗](https://github.com/BeamLabEU/phoenix_kit_manufacturing/blob/0.4.1/lib/phoenix_kit_manufacturing/comments.ex#L1)

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.

# `kind`

```elixir
@type kind() :: :machine
```

# `available?`

```elixir
@spec available?() :: boolean()
```

True when the comments module is installed and enabled.

# `count`

```elixir
@spec count(kind(), binary()) :: non_neg_integer()
```

Comment count for one resource. Returns 0 when unavailable.

# `counts`

```elixir
@spec counts(kind(), [binary()]) :: %{optional(binary()) =&gt; 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.

# `resource_type`

```elixir
@spec resource_type(kind()) :: String.t()
```

The comment `resource_type` string used for the given resource kind.

# `subscribe`

```elixir
@spec subscribe(kind(), [binary()]) :: :ok
```

Subscribes the calling process to cross-session comment activity for the
given resource uuids. No-op when the module is unavailable.

# `unsubscribe`

```elixir
@spec unsubscribe(kind(), [binary()]) :: :ok
```

Unsubscribes the calling process from the given resource uuids.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
