1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00
unleash.unleash/src/lib/features/change-request-segment-usage-service/change-request-segment-usage-read-model.ts
Thomas Heartman f46d5a9269
chore: update segment cr return values (#5405)
This PR updates the returned value about segments to also include the CR
title and to be one list item per strategy per change request. This
means that if the same strategy is used multiple times in multiple
change requests, they each get their own line (as has been discussed
with Nicolae).

Because of this, this pr removes a collection step in the query and
fixes some test cases.
2023-11-27 11:20:39 +01:00

20 lines
520 B
TypeScript

type ChangeRequestInfo = { id: number; title: string | null };
type NewStrategy = {
projectId: string;
featureName: string;
strategyName: string;
environment: string;
changeRequest: ChangeRequestInfo;
};
type ExistingStrategy = NewStrategy & { id: string };
export type ChangeRequestStrategy = NewStrategy | ExistingStrategy;
export interface IChangeRequestSegmentUsageReadModel {
getStrategiesUsedInActiveChangeRequests(
segmentId: number,
): Promise<ChangeRequestStrategy[]>;
}