feat: per-project workflow settings, statistics and "my work" home

Per-project settings (owners/admins, «Configuración» tab):
- Statuses with category (TODO, IN_PROGRESS, QA, DONE, CANCELLED), colour and
  "requires reason"; configurable transitions; ticket types (icon, colour) and
  areas. Defaults are the previous fixed values; projects created before keep
  them without migration.
- Values are archived, never deleted: tickets, history and statistics keep
  referring to them. Validated in the domain (ProjectSettingsChangedEvent).
- Releases, board, tracking and "my work" use categories, so custom statuses
  keep working. Status changes carry name/category metadata for history.
- GraphQL: status/type/area are strings (breaking for clients sending enum
  literals); Project.settings, updateProjectSettings, statusCategory,
  myIssues(categories). REST: PUT /projects/{project}/settings, category filters.
- Read model: statusCategory on issues (backfilled at startup).

Statistics («Estadísticas» tab):
- New issue_timeline projection; pure functions compute created vs resolved,
  cumulative flow, cycle/lead time (avg + p85), throughput per person, QA
  pass/fail and release burnup. GraphQL Project.analytics(days),
  Release.burnup; REST /projects/{project}/analytics, /releases/{id}/burnup.
- Web: SVG charts with validated light/dark palette, crosshair tooltip,
  keyboard navigation, legend and data table.

Home "Mi trabajo": my open tickets across projects grouped by category (QA
failures first), tickets waiting for QA, upcoming releases and "Ir a…".

Tests: domain/application specs, e2e scenario for settings and analytics,
facade tests. Docs, READMEs, schema.gql/openapi.json and Word/PDF updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 20:53:45 +02:00
parent 240ea9a539
commit 0e301ad545
143 changed files with 10291 additions and 1052 deletions

View File

@@ -1,18 +1,18 @@
import {
IssueArea,
IssuePriority,
IssueReadModel,
IssueStatus,
IssueType,
ProjectStatsReadModel,
ReleaseProgressReadModel,
StatusCategory,
} from '@task-stream/api/tracker/domain';
export interface IssueFilter {
projectId: string;
statuses?: IssueStatus[];
types?: IssueType[];
areas?: IssueArea[];
/** Status, type and area ids of the project's settings. */
statuses?: string[];
categories?: StatusCategory[];
types?: string[];
areas?: string[];
priorities?: IssuePriority[];
assigneeId?: string;
unassigned?: boolean;
@@ -23,6 +23,16 @@ export interface IssueFilter {
offset: number;
}
/** Tickets across several projects (the viewer's "my work"). */
export interface CrossProjectIssueFilter {
projectIds: string[];
assigneeId?: string;
statuses?: string[];
categories?: StatusCategory[];
limit: number;
offset: number;
}
export interface Page<T> {
items: T[];
total: number;
@@ -33,7 +43,12 @@ export abstract class FindIssuesRepository {
abstract findByKey(key: string): Promise<IssueReadModel | null>;
abstract findByIds(ids: string[]): Promise<IssueReadModel[]>;
abstract search(filter: IssueFilter): Promise<Page<IssueReadModel>>;
abstract searchAcross(
filter: CrossProjectIssueFilter,
): Promise<Page<IssueReadModel>>;
abstract stats(projectId: string): Promise<ProjectStatsReadModel>;
/** Every ticket of a project (statistics). */
abstract findByProject(projectId: string): Promise<IssueReadModel[]>;
abstract releaseProgress(
releaseId: string,
): Promise<ReleaseProgressReadModel>;

View File

@@ -3,4 +3,9 @@ import { ReleaseReadModel } from '@task-stream/api/tracker/domain';
export abstract class FindReleasesRepository {
abstract findById(id: string): Promise<ReleaseReadModel | null>;
abstract findByProject(projectId: string): Promise<ReleaseReadModel[]>;
/** Planned releases of these projects, soonest target date first (undated last). */
abstract findUpcoming(
projectIds: string[],
limit: number,
): Promise<ReleaseReadModel[]>;
}

View File

@@ -0,0 +1,6 @@
import { IssueTimelineEntry } from '@task-stream/api/tracker/domain';
export abstract class FindTimelineRepository {
/** Every step of every ticket of the project, oldest first. */
abstract findByProject(projectId: string): Promise<IssueTimelineEntry[]>;
}

View File

@@ -14,3 +14,5 @@ export * from './upsert-materialized-activity.repository';
export * from './change-feed';
export * from './user-directory';
export * from './release-issues.repository';
export * from './upsert-materialized-timeline.repository';
export * from './find-timeline.repository';

View File

@@ -1,6 +1,7 @@
import {
IssueLinkReadModel,
IssueReadModel,
StatusCategory,
} from '@task-stream/api/tracker/domain';
export abstract class UpsertMaterializedIssueRepository {
@@ -19,6 +20,11 @@ export abstract class UpsertMaterializedIssueRepository {
issueId: string,
commentCount: number,
): Promise<void>;
/** A project's statuses changed category: update its tickets' `statusCategory`. */
abstract recategorize(
projectId: string,
categories: Record<string, StatusCategory>,
): Promise<void>;
/** Keeps the denormalised release name of every issue in sync. */
abstract renameRelease(releaseId: string, name: string): Promise<void>;
}

View File

@@ -0,0 +1,6 @@
import { IssueTimelineEntry } from '@task-stream/api/tracker/domain';
export abstract class UpsertMaterializedTimelineRepository {
/** Stores a step of a ticket's life (idempotent by `entry.id`). */
abstract record(entry: IssueTimelineEntry): Promise<void>;
}