Skip to content

Commit

Permalink
chore: add release plan events
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Nov 12, 2024
1 parent 76b7b24 commit a19cace
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/lib/types/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ 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_RUN = 'release-plan-milestone-run' as const;

export const USER_PREFERENCE_UPDATED = 'user-preference-updated' as const;

export const IEventTypes = [
Expand Down Expand Up @@ -362,6 +367,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_RUN,
USER_PREFERENCE_UPDATED,
] as const;
export type IEventType = (typeof IEventTypes)[number];
Expand Down Expand Up @@ -2057,6 +2065,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 ReleasePlanMilestoneRunEvent extends BaseEvent {
readonly preData: any;
readonly data: any;
constructor(eventData: {
preData: any;
data: any;
auditUser: IAuditUser;
}) {
super(RELEASE_PLAN_MILESTONE_RUN, eventData.auditUser);
this.preData = eventData.preData;
this.data = eventData.data;
}
}

interface IUserEventData
extends Pick<
IUserWithRootRole,
Expand Down

0 comments on commit a19cace

Please sign in to comment.