From bbdb5e635b6bb58266a0c5c523b554815da73025 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Tue, 13 Aug 2024 12:43:49 +0300 Subject: [PATCH] feat: update feature completed payload to have boolean instead of string (#7855) For easy gitar integration, we need to have boolean in the event payload. We might rethink it when we add variants, but currently enabled with variants is not used. --- .../features/feature-lifecycle/feature-lifecycle-service.ts | 2 +- src/lib/types/events.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/features/feature-lifecycle/feature-lifecycle-service.ts b/src/lib/features/feature-lifecycle/feature-lifecycle-service.ts index ae33e19b83..dd0f8d8865 100644 --- a/src/lib/features/feature-lifecycle/feature-lifecycle-service.ts +++ b/src/lib/features/feature-lifecycle/feature-lifecycle-service.ts @@ -186,7 +186,7 @@ export class FeatureLifecycleService { new FeatureCompletedEvent({ project: projectId, featureName: feature, - data: status, + data: { ...status, kept: status.status === 'kept' }, auditUser, }), ); diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index bdd74a72b3..711fa2ac1a 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -8,9 +8,9 @@ import type { } from './model'; import type { IApiToken } from './models/api-token'; import type { IAuditUser, IUserWithRootRole } from './user'; -import type { FeatureLifecycleCompletedSchema } from '../openapi'; import type { ITagType } from '../features/tag-type/tag-type-store-type'; import type { IFeatureAndTag } from './stores/feature-tag-store'; +import type { FeatureLifecycleCompletedSchema } from '../openapi'; export const APPLICATION_CREATED = 'application-created' as const; @@ -749,13 +749,13 @@ export class FeatureTagImport extends BaseEvent { export class FeatureCompletedEvent extends BaseEvent { readonly featureName: string; - readonly data: FeatureLifecycleCompletedSchema; + readonly data: FeatureLifecycleCompletedSchema & { kept: boolean }; readonly project: string; constructor(p: { project: string; featureName: string; - data: FeatureLifecycleCompletedSchema; + data: FeatureLifecycleCompletedSchema & { kept: boolean }; auditUser: IAuditUser; }) { super(FEATURE_COMPLETED, p.auditUser);