mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	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.
		
			
				
	
	
		
			20 lines
		
	
	
		
			520 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			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[]>;
 | |
| }
 |