feat: «Recordármelo», a reminder of a ticket only for me

On a ticket, «Recordármelo» offers in an hour, this evening, tomorrow or
next Monday at 9, in a week, or any date and time, with an optional note.
The ticket shows the waiting one («Te lo recordaré el mié 21 a las 9:00»)
to change or drop. Every minute a scheduler tells the ones whose time
came as a REMINDER notification (bell, push, e-mail), once, and forgets
those whose ticket went to the trash or out of reach. One per person and
ticket, private, no history (Mongo `issue_reminders`).

API: setReminder / clearReminder, Issue.myReminder, myReminders;
PUT/DELETE /api/issues/{issue}/reminder, GET /api/me/reminders. MCP:
remind_me.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 20:08:50 +02:00
parent d79ef418d3
commit b88296c22b
37 changed files with 2020 additions and 50 deletions

View File

@@ -1552,6 +1552,21 @@ export class PushEndpointDto {
endpoint!: string;
}
export class SetReminderDto {
@ApiProperty({
format: 'date-time',
description: 'When to tell me; in the future, at most a year ahead',
})
@IsISO8601()
at!: string;
@ApiPropertyOptional({ maxLength: 280, description: 'What to remember' })
@IsOptional()
@IsString()
@MaxLength(280)
note?: string;
}
export class ResolveThreadDto {
@ApiPropertyOptional({
description:

View File

@@ -1417,3 +1417,13 @@ export class AlertOutcomeDto {
@ApiProperty({ type: String, nullable: true, example: 'WEB-42' })
issueKey!: string | null;
}
export class IssueReminderDto {
@ApiProperty({ format: 'date-time' }) at!: string;
@ApiProperty({ type: String, nullable: true }) note!: string | null;
}
export class ReminderOnIssueDto {
@ApiProperty({ type: IssueReminderDto }) reminder!: IssueReminderDto;
@ApiProperty({ type: () => IssueDto }) issue!: IssueDto;
}

View File

@@ -34,6 +34,7 @@ import {
IssuesService,
PinsService,
TreeFollowsService,
IssueRemindersService,
PresenceService,
ProjectsService,
} from '@task-stream/api/tracker/application';
@@ -47,6 +48,7 @@ import {
AddCommentDto,
CreateIssueDto,
DecisionsQueryDto,
SetReminderDto,
IssueSearchQueryDto,
PresenceBodyDto,
LinkIssueDto,
@@ -66,6 +68,8 @@ import {
CommentDto,
CommentPageDto,
DecisionDto,
IssueReminderDto,
ReminderOnIssueDto,
EpicDto,
IssueDto,
IssuePageDto,
@@ -101,6 +105,7 @@ export class IssuesController {
private readonly projects: ProjectsService,
private readonly pins: PinsService,
private readonly treeFollows: TreeFollowsService,
private readonly reminders: IssueRemindersService,
) {}
@Get('me/home')
@@ -205,6 +210,55 @@ export class IssuesController {
await this.pins.pin(me.id, await this.refs.issueId(me.id, issue), false);
}
@Get('me/reminders')
@ApiOperation({ summary: 'My waiting reminders on tickets, soonest first' })
@ApiOkResponse({ type: [ReminderOnIssueDto] })
@ApiReadErrors()
async myReminders(@CurrentUser() me: User) {
const mine = await this.reminders.mine(me.id);
const issues = await this.refs.issueDtos(
mine.map((m) => m.issue),
viewerOf(me),
);
return mine.map((m, i) => ({
reminder: { at: m.reminder.at, note: m.reminder.note },
issue: issues[i],
}));
}
@Put('issues/:issue/reminder')
@ISSUE
@ApiOperation({
summary: 'Remind me of a ticket at a date and time',
description:
'A notification (bell, push, e-mail) when the time comes. One per ticket: it replaces the waiting one. Private to me.',
})
@ApiOkResponse({ type: IssueReminderDto })
@ApiCommandErrors()
async setReminder(
@CurrentUser() me: User,
@Param('issue') issue: string,
@Body() body: SetReminderDto,
) {
const reminder = await this.reminders.set(
me.id,
await this.refs.issueId(me.id, issue),
body.at,
body.note ?? null,
);
return { at: reminder.at, note: reminder.note };
}
@Delete('issues/:issue/reminder')
@HttpCode(204)
@ISSUE
@ApiOperation({ summary: 'Drop my reminder on a ticket' })
@ApiNoContentResponse()
@ApiCommandErrors()
async clearReminder(@CurrentUser() me: User, @Param('issue') issue: string) {
await this.reminders.clear(me.id, await this.refs.issueId(me.id, issue));
}
@Put('issues/:issue/follow-tree')
@HttpCode(204)
@ISSUE