@@ -96,7 +96,7 @@ export class FlowService {
96
96
const refDirection = orderBy . direction ?? 'source' ;
97
97
98
98
let entityIDsSorted : number [ ] = [ ] ;
99
-
99
+ let entityCondKeyFlowObjectType : FlowObjectType ;
100
100
switch ( entity ) {
101
101
case 'emergency' : {
102
102
columns = getTableColumns ( database . emergency ) ;
@@ -119,6 +119,7 @@ export class FlowService {
119
119
} ) ;
120
120
121
121
entityIDsSorted = emergencies . map ( ( emergency ) => emergency . id ) ;
122
+ entityCondKeyFlowObjectType = 'emergency' satisfies FlowObjectType ;
122
123
break ;
123
124
}
124
125
case 'globalCluster' : {
@@ -143,6 +144,8 @@ export class FlowService {
143
144
entityIDsSorted = globalClusters . map (
144
145
( globalCluster ) => globalCluster . id
145
146
) ;
147
+ entityCondKeyFlowObjectType = 'globalCluster' satisfies FlowObjectType ;
148
+
146
149
break ;
147
150
}
148
151
case 'governingEntity' : {
@@ -167,6 +170,9 @@ export class FlowService {
167
170
entityIDsSorted = governingEntities . map (
168
171
( governingEntity ) => governingEntity . id
169
172
) ;
173
+ entityCondKeyFlowObjectType =
174
+ 'governingEntity' satisfies FlowObjectType ;
175
+
170
176
break ;
171
177
}
172
178
case 'location' : {
@@ -189,6 +195,8 @@ export class FlowService {
189
195
} ) ;
190
196
191
197
entityIDsSorted = locations . map ( ( location ) => location . id ) ;
198
+ entityCondKeyFlowObjectType = 'location' satisfies FlowObjectType ;
199
+
192
200
break ;
193
201
}
194
202
case 'organization' : {
@@ -211,6 +219,8 @@ export class FlowService {
211
219
} ) ;
212
220
213
221
entityIDsSorted = organizations . map ( ( organization ) => organization . id ) ;
222
+ entityCondKeyFlowObjectType = 'organization' satisfies FlowObjectType ;
223
+
214
224
break ;
215
225
}
216
226
case 'plan' : {
@@ -233,6 +243,8 @@ export class FlowService {
233
243
} ) ;
234
244
235
245
entityIDsSorted = plans . map ( ( plan ) => plan . id ) ;
246
+ entityCondKeyFlowObjectType = 'plan' satisfies FlowObjectType ;
247
+
236
248
break ;
237
249
}
238
250
case 'project' : {
@@ -255,6 +267,8 @@ export class FlowService {
255
267
} ) ;
256
268
257
269
entityIDsSorted = projects . map ( ( project ) => project . id ) ;
270
+ entityCondKeyFlowObjectType = 'project' satisfies FlowObjectType ;
271
+
258
272
break ;
259
273
}
260
274
case 'usageYear' : {
@@ -277,6 +291,8 @@ export class FlowService {
277
291
} ) ;
278
292
279
293
entityIDsSorted = usageYears . map ( ( usageYear ) => usageYear . id ) ;
294
+ entityCondKeyFlowObjectType = 'usageYear' satisfies FlowObjectType ;
295
+
280
296
break ;
281
297
}
282
298
case 'planVersion' : {
@@ -304,6 +320,8 @@ export class FlowService {
304
320
} ) ;
305
321
306
322
entityIDsSorted = planVersions . map ( ( planVersion ) => planVersion . planId ) ;
323
+ entityCondKeyFlowObjectType = 'plan' satisfies FlowObjectType ;
324
+
307
325
break ;
308
326
}
309
327
default : {
@@ -313,8 +331,6 @@ export class FlowService {
313
331
314
332
// After getting the sorted entityID list
315
333
// we can now get the flowObjects
316
- const entityCondKey = orderBy . entity as unknown ;
317
- const entityCondKeyFlowObjectType = entityCondKey as FlowObjectType ;
318
334
319
335
// Order map
320
336
const orderMap = new Map < number , number > ( ) ;
0 commit comments