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

Schema for post mentions (tagged users).

Tags users related to a post - either as contributors who helped create it,
or mentions of people featured in the content.

## Mention Types

- `contributor` - User helped create/contribute to the post
- `mention` - User is mentioned/tagged in the post

## Fields

- `post_uuid` - Reference to the post
- `user_uuid` - Reference to the mentioned user
- `mention_type` - contributor/mention

## Examples

    # Contributor mention
    %PostMention{
      post_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
      user_uuid: "018e3c4a-1234-5678-abcd-ef1234567890",
      mention_type: "contributor"
    }

    # Regular mention
    %PostMention{
      post_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
      user_uuid: "018e3c4a-5678-1234-abcd-ef1234567890",
      mention_type: "mention"
    }

# `t`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.62/lib/modules/posts/schemas/post_mention.ex#L40)

```elixir
@type t() :: %PhoenixKit.Modules.Posts.PostMention{
  __meta__: term(),
  inserted_at: DateTime.t() | nil,
  mention_type: String.t(),
  post: PhoenixKit.Modules.Posts.Post.t() | Ecto.Association.NotLoaded.t(),
  post_uuid: UUIDv7.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.62/lib/modules/posts/schemas/post_mention.ex#L81)

Changeset for creating or updating a mention.

## Required Fields

- `post_uuid` - Reference to post
- `user_uuid` - Reference to mentioned user
- `mention_type` - Must be: "contributor" or "mention"

## Validation Rules

- Mention type must be valid (contributor/mention)
- Unique constraint on (post_uuid, user_uuid) - one mention per user per post

# `contributor?`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.62/lib/modules/posts/schemas/post_mention.ex#L97)

Check if mention is a contributor.

---

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