# PipelineItemComment

## Description

PipelineItemComment is a user-authored comment attached to an item. Comments form a chronological discussion thread on the item and can be edited or deleted by their author. The model is intentionally generic — visibility scoping (e.g., internal-only vs externally visible) is left to consuming domain modules, which can hold a foreign key to PipelineItemComment and add their own metadata fields.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [CreatePipelineItemComment](../command/CreatePipelineItemComment.md) - Create a new comment on an item
- [UpdatePipelineItemComment](../command/UpdatePipelineItemComment.md) - Update the body of an existing comment
- [DeletePipelineItemComment](../command/DeletePipelineItemComment.md) - Delete an existing comment

### Query Definitions

- [ListPipelineItemCommentsByItem](../query/ListPipelineItemCommentsByItem.md) - List all comments on an item, ordered by createdAt ascending

### Models

- PipelineItemComment

### Invariants

- PipelineItem ID is required and must reference an existing item
- Body is required and must be non-empty
- Author user ID is required; it is stamped from the executing actor (`ctx.actorId`) and is not separately validated against user-management
- `createdAt` is set automatically at creation and never changes
- `updatedAt` is set on every body update
- A comment can only be edited by its original author
- A comment can only be deleted by its original author

### Relationships

- **Belongs To PipelineItem**: Each comment belongs to an item via `itemId`
- **References User**: Each comment has an author via `authorUserId` from the user-management module
