Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task: Added Release Plan Template events #8668

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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