first commit

This commit is contained in:
2026-10-03 13:40:26 +02:00
parent 732a5b5a16
commit 566f415fa7
555 changed files with 62704 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { CommentProps } from '../comment/comment';
import { TrackerEvent } from './tracker.event';
/** Someone commented on a ticket. */
@AutowiredEvent
export class CommentAddedEvent extends TrackerEvent {
constructor(
actorId: string,
readonly comment: CommentProps,
) {
super(actorId, comment.id, comment.projectId);
}
}

View File

@@ -0,0 +1,15 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { TrackerEvent } from './tracker.event';
/** A comment was deleted. */
@AutowiredEvent
export class CommentDeletedEvent extends TrackerEvent {
constructor(
actorId: string,
commentId: string,
projectId: string,
readonly issueId: string,
) {
super(actorId, commentId, projectId);
}
}

View File

@@ -0,0 +1,16 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { TrackerEvent } from './tracker.event';
/** The author edited a comment. */
@AutowiredEvent
export class CommentEditedEvent extends TrackerEvent {
constructor(
actorId: string,
commentId: string,
projectId: string,
readonly issueId: string,
readonly body: string,
) {
super(actorId, commentId, projectId);
}
}

View File

@@ -0,0 +1,20 @@
export * from './tracker.event';
export * from './project-created.event';
export * from './project-updated.event';
export * from './project-member-added.event';
export * from './project-member-removed.event';
export * from './project-member-role-changed.event';
export * from './issue-created.event';
export * from './issue-updated.event';
export * from './issue-status-changed.event';
export * from './issue-assigned.event';
export * from './issue-linked.event';
export * from './issue-unlinked.event';
export * from './issue-release-changed.event';
export * from './comment-added.event';
export * from './comment-edited.event';
export * from './comment-deleted.event';
export * from './release-created.event';
export * from './release-updated.event';
export * from './release-shipped.event';
export * from './release-archived.event';

View File

@@ -0,0 +1,16 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { TrackerEvent } from './tracker.event';
/** A ticket was assigned (or unassigned when assigneeId is null). */
@AutowiredEvent
export class IssueAssignedEvent extends TrackerEvent {
constructor(
actorId: string,
issueId: string,
projectId: string,
readonly assigneeId: string | null,
readonly previousAssigneeId: string | null,
) {
super(actorId, issueId, projectId);
}
}

View File

@@ -0,0 +1,14 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { IssueProps } from '../issue/issue';
import { TrackerEvent } from './tracker.event';
/** A ticket was reported (bug, feature, UI change...). */
@AutowiredEvent
export class IssueCreatedEvent extends TrackerEvent {
constructor(
actorId: string,
readonly issue: IssueProps,
) {
super(actorId, issue.id, issue.projectId);
}
}

View File

@@ -0,0 +1,16 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { IssueLink } from '../issue/issue';
import { TrackerEvent } from './tracker.event';
/** Two tickets were related (e.g. FE DEPENDS_ON BE). */
@AutowiredEvent
export class IssueLinkedEvent extends TrackerEvent {
constructor(
actorId: string,
issueId: string,
projectId: string,
readonly link: IssueLink,
) {
super(actorId, issueId, projectId);
}
}

View File

@@ -0,0 +1,16 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { TrackerEvent } from './tracker.event';
/** A ticket was moved in or out of a release. */
@AutowiredEvent
export class IssueReleaseChangedEvent extends TrackerEvent {
constructor(
actorId: string,
issueId: string,
projectId: string,
readonly releaseId: string | null,
readonly previousReleaseId: string | null,
) {
super(actorId, issueId, projectId);
}
}

View File

@@ -0,0 +1,18 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { IssueStatus } from '../issue/issue.enums';
import { TrackerEvent } from './tracker.event';
/** A ticket moved through the workflow (incl. QA). */
@AutowiredEvent
export class IssueStatusChangedEvent extends TrackerEvent {
constructor(
actorId: string,
issueId: string,
projectId: string,
readonly from: IssueStatus,
readonly to: IssueStatus,
readonly reason: string | null,
) {
super(actorId, issueId, projectId);
}
}

View File

@@ -0,0 +1,16 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { IssueLink } from '../issue/issue';
import { TrackerEvent } from './tracker.event';
/** A relation between tickets was removed. */
@AutowiredEvent
export class IssueUnlinkedEvent extends TrackerEvent {
constructor(
actorId: string,
issueId: string,
projectId: string,
readonly link: IssueLink,
) {
super(actorId, issueId, projectId);
}
}

View File

@@ -0,0 +1,16 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { IssueDetails } from '../issue/issue';
import { TrackerEvent } from './tracker.event';
/** Editable fields of a ticket changed. */
@AutowiredEvent
export class IssueUpdatedEvent extends TrackerEvent {
constructor(
actorId: string,
issueId: string,
projectId: string,
readonly changes: IssueDetails,
) {
super(actorId, issueId, projectId);
}
}

View File

@@ -0,0 +1,14 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { ProjectProps } from '../project/project';
import { TrackerEvent } from './tracker.event';
/** A project was created. */
@AutowiredEvent
export class ProjectCreatedEvent extends TrackerEvent {
constructor(
actorId: string,
readonly project: ProjectProps,
) {
super(actorId, project.id, project.id);
}
}

View File

@@ -0,0 +1,16 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { ProjectRole } from '../project/project-role';
import { TrackerEvent } from './tracker.event';
/** A Pireon user joined the project. */
@AutowiredEvent
export class ProjectMemberAddedEvent extends TrackerEvent {
constructor(
actorId: string,
projectId: string,
readonly userId: string,
readonly role: ProjectRole,
) {
super(actorId, projectId, projectId);
}
}

View File

@@ -0,0 +1,14 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { TrackerEvent } from './tracker.event';
/** A member left or was removed. */
@AutowiredEvent
export class ProjectMemberRemovedEvent extends TrackerEvent {
constructor(
actorId: string,
projectId: string,
readonly userId: string,
) {
super(actorId, projectId, projectId);
}
}

View File

@@ -0,0 +1,17 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { ProjectRole } from '../project/project-role';
import { TrackerEvent } from './tracker.event';
/** A member got a new role. */
@AutowiredEvent
export class ProjectMemberRoleChangedEvent extends TrackerEvent {
constructor(
actorId: string,
projectId: string,
readonly userId: string,
readonly role: ProjectRole,
readonly previousRole: ProjectRole,
) {
super(actorId, projectId, projectId);
}
}

View File

@@ -0,0 +1,15 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { ProjectProps } from '../project/project';
import { TrackerEvent } from './tracker.event';
/** Name or description changed. */
@AutowiredEvent
export class ProjectUpdatedEvent extends TrackerEvent {
constructor(
actorId: string,
projectId: string,
readonly changes: Partial<Pick<ProjectProps, 'name' | 'description'>>,
) {
super(actorId, projectId, projectId);
}
}

View File

@@ -0,0 +1,10 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { TrackerEvent } from './tracker.event';
/** The release was archived. */
@AutowiredEvent
export class ReleaseArchivedEvent extends TrackerEvent {
constructor(actorId: string, releaseId: string, projectId: string) {
super(actorId, releaseId, projectId);
}
}

View File

@@ -0,0 +1,14 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { ReleaseProps } from '../release/release';
import { TrackerEvent } from './tracker.event';
/** A release (version) was planned. */
@AutowiredEvent
export class ReleaseCreatedEvent extends TrackerEvent {
constructor(
actorId: string,
readonly release: ReleaseProps,
) {
super(actorId, release.id, release.projectId);
}
}

View File

@@ -0,0 +1,15 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import { TrackerEvent } from './tracker.event';
/** The release went out. */
@AutowiredEvent
export class ReleaseShippedEvent extends TrackerEvent {
constructor(
actorId: string,
releaseId: string,
projectId: string,
readonly unfinishedIssues: number,
) {
super(actorId, releaseId, projectId);
}
}

View File

@@ -0,0 +1,18 @@
import { AutowiredEvent } from '@task-stream/api/shared/domain';
import type { ReleaseProps } from '../release/release';
import { TrackerEvent } from './tracker.event';
/** Release details changed. */
@AutowiredEvent
export class ReleaseUpdatedEvent extends TrackerEvent {
constructor(
actorId: string,
releaseId: string,
projectId: string,
readonly changes: Partial<
Pick<ReleaseProps, 'name' | 'description' | 'targetDate'>
>,
) {
super(actorId, releaseId, projectId);
}
}

View File

@@ -0,0 +1,12 @@
import { DomainEvent } from '@task-stream/api/shared/domain';
/** Every tracker event says which aggregate changed and in which project. */
export abstract class TrackerEvent extends DomainEvent {
constructor(
actorId: string,
readonly aggregateId: string,
readonly projectId: string,
) {
super(actorId);
}
}