feat: due-date reminders
Every hour the API reminds whoever has a ticket, and whoever follows it, the day before its due date, on the day and once when it is overdue, in the app and by e-mail for those who asked. Cards on the board flag what is due soon or late. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -238,6 +238,18 @@ export class MongoFindIssuesRepository extends FindIssuesRepository {
|
||||
return docs.map(issueFromDoc);
|
||||
}
|
||||
|
||||
async findDueBy(day: string): Promise<IssueReadModel[]> {
|
||||
const docs = await this.issues
|
||||
.find({
|
||||
dueDate: { $ne: null, $lte: `${day}\uffff` },
|
||||
statusCategory: { $nin: FINISHED },
|
||||
$or: [{ assignee: { $ne: null } }, { 'watchers.0': { $exists: true } }],
|
||||
})
|
||||
.limit(5000)
|
||||
.lean<IssueDoc[]>();
|
||||
return docs.map(issueFromDoc);
|
||||
}
|
||||
|
||||
async findByProject(projectId: string): Promise<IssueReadModel[]> {
|
||||
const docs = await this.issues.find({ projectId }).lean<IssueDoc[]>();
|
||||
return docs.map(issueFromDoc);
|
||||
|
||||
Reference in New Issue
Block a user