feat: a calendar to subscribe to, and the backlog's corners

- Each person can subscribe their dates in Google Calendar, Outlook or
  Apple Calendar: GET /api/calendar/{token}.ics (no session) brings
  their unfinished tickets with a due date (assigned or followed), the
  planned and running sprints and the planned releases of their
  projects, as all-day events linking to the web. The token is made,
  renewed or dropped under /me/calendar (and in GraphQL); in the web,
  from «Calendario» in «Mi trabajo».
- The backlog panel keeps the selected rows' background inside its
  rounded corners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 22:48:33 +02:00
parent 993f80b4b9
commit f45069a327
38 changed files with 1417 additions and 54 deletions

View File

@@ -0,0 +1,36 @@
import { Injectable } from '@nestjs/common';
import { CommandBus, QueryBus } from '@nestjs/cqrs';
import {
CreateCalendarFeedCommand,
GetCalendarIcsQuery,
GetMyCalendarFeedQuery,
RevokeCalendarFeedCommand,
} from './calendar/calendar';
import { CalendarFeed } from './ports/calendar-feeds.repository';
/** A person's calendar subscription (iCalendar), behind a secret URL. */
@Injectable()
export class CalendarService {
constructor(
private readonly commandBus: CommandBus,
private readonly queryBus: QueryBus,
) {}
mine(userId: string): Promise<CalendarFeed | null> {
return this.queryBus.execute(new GetMyCalendarFeedQuery(userId));
}
/** A new secret URL; the previous one, if any, stops working. */
create(userId: string): Promise<CalendarFeed> {
return this.commandBus.execute(new CreateCalendarFeedCommand(userId));
}
revoke(userId: string): Promise<void> {
return this.commandBus.execute(new RevokeCalendarFeedCommand(userId));
}
/** The calendar behind `token`, or null if no feed has it. */
ics(token: string, webUrl: string): Promise<string | null> {
return this.queryBus.execute(new GetCalendarIcsQuery(token, webUrl));
}
}