# `PhoenixKit.Modules.Posts.PostComment`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/posts/schemas/post_comment.ex#L1)

Legacy schema for post comments.

Retained for backward compatibility with the `phoenix_kit_post_comments` table.
New comments should use `PhoenixKit.Modules.Comments.Comment` instead.

# `t`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/posts/schemas/post_comment.ex#L13)

```elixir
@type t() :: %PhoenixKit.Modules.Posts.PostComment{
  __meta__: term(),
  children: [t()] | Ecto.Association.NotLoaded.t(),
  content: String.t(),
  depth: integer(),
  dislike_count: integer(),
  dislikes:
    [PhoenixKit.Modules.Posts.CommentDislike.t()]
    | Ecto.Association.NotLoaded.t(),
  inserted_at: DateTime.t() | nil,
  like_count: integer(),
  likes:
    [PhoenixKit.Modules.Posts.CommentLike.t()] | Ecto.Association.NotLoaded.t(),
  parent: t() | Ecto.Association.NotLoaded.t() | nil,
  parent_uuid: UUIDv7.t() | nil,
  post: PhoenixKit.Modules.Posts.Post.t() | Ecto.Association.NotLoaded.t(),
  post_uuid: UUIDv7.t(),
  status: String.t(),
  updated_at: DateTime.t() | nil,
  user: PhoenixKit.Users.Auth.User.t() | Ecto.Association.NotLoaded.t(),
  user_uuid: UUIDv7.t() | nil,
  uuid: UUIDv7.t() | nil
}
```

# `changeset`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/posts/schemas/post_comment.ex#L78)

Changeset for creating or updating a comment.

## Required Fields

- `post_uuid` - Reference to post
- `user_uuid` - Reference to commenter
- `content` - Comment text

## Validation Rules

- Content must not be empty
- Status must be valid (published/hidden/deleted/pending)
- Depth automatically calculated from parent

# `deleted?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/posts/schemas/post_comment.ex#L110)

Check if comment is deleted.

# `published?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/posts/schemas/post_comment.ex#L104)

Check if comment is published.

# `reply?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/posts/schemas/post_comment.ex#L92)

Check if comment is a reply (has parent).

# `top_level?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/modules/posts/schemas/post_comment.ex#L98)

Check if comment is top-level (no parent).

---

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