Skip to content

Commit

Permalink
task: Added Release Plan Template events (#8668)
Browse files Browse the repository at this point in the history
As part of the release plan template work. This PR adds the three events
for actions with the templates.

Actually activating milestones should probably trigger existing
FeatureStrategyAdd events when adding and FeatureStrategyRemove when
changing milestones.
  • Loading branch information
chriswk authored Nov 6, 2024
1 parent 328fac3 commit 4ed5b1b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/lib/types/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ export const ACTIONS_CREATED = 'actions-created' as const;
export const ACTIONS_UPDATED = 'actions-updated' as const;
export const ACTIONS_DELETED = 'actions-deleted' as const;

export const RELEASE_PLAN_TEMPLATE_CREATED =
'release-plan-template-created' as const;
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 USER_PREFERENCE_UPDATED = 'user-preference-updated' as const;

export const IEventTypes = [
Expand Down Expand Up @@ -353,6 +359,9 @@ export const IEventTypes = [
ACTIONS_CREATED,
ACTIONS_UPDATED,
ACTIONS_DELETED,
RELEASE_PLAN_TEMPLATE_CREATED,
RELEASE_PLAN_TEMPLATE_UPDATED,
RELEASE_PLAN_TEMPLATE_DELETED,
USER_PREFERENCE_UPDATED,
] as const;
export type IEventType = (typeof IEventTypes)[number];
Expand Down Expand Up @@ -2012,6 +2021,42 @@ export class GroupDeletedEvent extends BaseEvent {
}
}

export class ReleasePlanTemplateCreatedEvent extends BaseEvent {
readonly data: any;
constructor(eventData: {
data: any;
auditUser: IAuditUser;
}) {
super(RELEASE_PLAN_TEMPLATE_CREATED, eventData.auditUser);
this.data = eventData.data;
}
}

export class ReleasePlanTemplateUpdatedEvent extends BaseEvent {
readonly preData: any;
readonly data: any;
constructor(eventData: {
data: any;
preData: any;
auditUser: IAuditUser;
}) {
super(RELEASE_PLAN_TEMPLATE_UPDATED, eventData.auditUser);
this.data = eventData.data;
this.preData = eventData.preData;
}
}

export class ReleasePlanTemplateDeletedEvent extends BaseEvent {
readonly preData: any;
constructor(eventData: {
preData: any;
auditUser: IAuditUser;
}) {
super(RELEASE_PLAN_TEMPLATE_DELETED, eventData.auditUser);
this.preData = eventData.preData;
}
}

interface IUserEventData
extends Pick<
IUserWithRootRole,
Expand Down

0 comments on commit 4ed5b1b

Please sign in to comment.