ื“ืœื’ ืœืชื•ื›ืŸ ื”ืจืืฉื™

Comment & Mention Endpoints

Manage comments, @mentions, and reactions on entities (tasks, projects, etc.).

Base Pathsโ€‹

ResourcePath
Comments/api/comment
Mentions/api/mention
Reactions/api/reaction

Comment Endpointsโ€‹

List Commentsโ€‹

GET /api/comment
Authorization: Bearer {token}

Query Parameters:

ParameterTypeDescription
entitystringEntity type (e.g., Task, Project)
entityIdstringID of the parent entity
relationsarrayRelations to include

Get Comment by IDโ€‹

GET /api/comment/:id
Authorization: Bearer {token}

Create Commentโ€‹

POST /api/comment
Authorization: Bearer {token}
Content-Type: application/json

{
"entity": "Task",
"entityId": "task-uuid",
"comment": "This looks great! Let's proceed with the implementation.",
"members": ["employee-uuid-1"],
"parentId": null
}

Response 201 Created.

Update Commentโ€‹

PUT /api/comment/:id
Authorization: Bearer {token}
Content-Type: application/json

{
"comment": "Updated comment text",
"editedAt": "2024-03-15T10:00:00.000Z"
}

Delete Commentโ€‹

DELETE /api/comment/:id
Authorization: Bearer {token}

Mention Endpointsโ€‹

List Mentionsโ€‹

GET /api/mention
Authorization: Bearer {token}

Create Mentionโ€‹

POST /api/mention
Authorization: Bearer {token}
Content-Type: application/json

{
"entityId": "comment-uuid",
"entity": "Comment",
"mentionedUserId": "user-uuid"
}

Reaction Endpointsโ€‹

List Reactionsโ€‹

GET /api/reaction
Authorization: Bearer {token}

Add Reactionโ€‹

POST /api/reaction
Authorization: Bearer {token}
Content-Type: application/json

{
"entity": "Comment",
"entityId": "comment-uuid",
"emoji": "๐Ÿ‘"
}

Remove Reactionโ€‹

DELETE /api/reaction/:id
Authorization: Bearer {token}

Data Modelโ€‹

interface IComment {
id: string;
entity: string;
entityId: string;
comment: string;
actorType?: ActorTypeEnum;
resolved?: boolean;
resolvedAt?: Date;
editedAt?: Date;

// Relations
parentId?: string;
parent?: IComment;
replies?: IComment[];
members?: IEmployee[];
creatorId?: string;
tenantId: string;
organizationId: string;
}

interface IMention {
id: string;
entityId: string;
entity: string;
mentionedUserId: string;
mentionById?: string;
parentEntityId?: string;
parentEntityType?: string;
}

interface IReaction {
id: string;
entity: string;
entityId: string;
emoji: string;
creatorId: string;
}