first commit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
20
libs/api/tracker/domain/src/lib/events/index.ts
Normal file
20
libs/api/tracker/domain/src/lib/events/index.ts
Normal 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';
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
16
libs/api/tracker/domain/src/lib/events/issue-linked.event.ts
Normal file
16
libs/api/tracker/domain/src/lib/events/issue-linked.event.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
12
libs/api/tracker/domain/src/lib/events/tracker.event.ts
Normal file
12
libs/api/tracker/domain/src/lib/events/tracker.event.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user