From 11d264541d0c51e21ae750bcbed95fa97074e8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Tue, 12 Nov 2024 08:59:36 +0000 Subject: [PATCH] chore: add release plan events (#8715) Adds new release plan events. These will be triggered by the new release plans API. --- src/lib/types/events.ts | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index 3ddee00068..e9804baf40 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -210,6 +210,12 @@ export const RELEASE_PLAN_TEMPLATE_UPDATED = 'release-plan-template-updated' as const; export const RELEASE_PLAN_TEMPLATE_DELETED = 'release-plan-template-deleted' as const; + +export const RELEASE_PLAN_ADDED = 'release-plan-added' as const; +export const RELEASE_PLAN_REMOVED = 'release-plan-removed' as const; +export const RELEASE_PLAN_MILESTONE_STARTED = + 'release-plan-milestone-started' as const; + export const USER_PREFERENCE_UPDATED = 'user-preference-updated' as const; export const IEventTypes = [ @@ -362,6 +368,9 @@ export const IEventTypes = [ RELEASE_PLAN_TEMPLATE_CREATED, RELEASE_PLAN_TEMPLATE_UPDATED, RELEASE_PLAN_TEMPLATE_DELETED, + RELEASE_PLAN_ADDED, + RELEASE_PLAN_REMOVED, + RELEASE_PLAN_MILESTONE_STARTED, USER_PREFERENCE_UPDATED, ] as const; export type IEventType = (typeof IEventTypes)[number]; @@ -2057,6 +2066,42 @@ export class ReleasePlanTemplateDeletedEvent extends BaseEvent { } } +export class ReleasePlanAddedEvent extends BaseEvent { + readonly data: any; + constructor(eventData: { + data: any; + auditUser: IAuditUser; + }) { + super(RELEASE_PLAN_ADDED, eventData.auditUser); + this.data = eventData.data; + } +} + +export class ReleasePlanRemovedEvent extends BaseEvent { + readonly preData: any; + constructor(eventData: { + preData: any; + auditUser: IAuditUser; + }) { + super(RELEASE_PLAN_REMOVED, eventData.auditUser); + this.preData = eventData.preData; + } +} + +export class ReleasePlanMilestoneStartedEvent extends BaseEvent { + readonly preData: any; + readonly data: any; + constructor(eventData: { + preData: any; + data: any; + auditUser: IAuditUser; + }) { + super(RELEASE_PLAN_MILESTONE_STARTED, eventData.auditUser); + this.preData = eventData.preData; + this.data = eventData.data; + } +} + interface IUserEventData extends Pick< IUserWithRootRole,