@@ -96,7 +96,7 @@ export class FlowService {
9696    const  refDirection  =  orderBy . direction  ??  'source' ; 
9797
9898    let  entityIDsSorted : number [ ]  =  [ ] ; 
99- 
99+      let   entityCondKeyFlowObjectType :  FlowObjectType ; 
100100    switch  ( entity )  { 
101101      case  'emergency' : { 
102102        columns  =  getTableColumns ( database . emergency ) ; 
@@ -119,6 +119,7 @@ export class FlowService {
119119        } ) ; 
120120
121121        entityIDsSorted  =  emergencies . map ( ( emergency )  =>  emergency . id ) ; 
122+         entityCondKeyFlowObjectType  =  'emergency'  satisfies  FlowObjectType ; 
122123        break ; 
123124      } 
124125      case  'globalCluster' : { 
@@ -143,6 +144,8 @@ export class FlowService {
143144        entityIDsSorted  =  globalClusters . map ( 
144145          ( globalCluster )  =>  globalCluster . id 
145146        ) ; 
147+         entityCondKeyFlowObjectType  =  'globalCluster'  satisfies  FlowObjectType ; 
148+ 
146149        break ; 
147150      } 
148151      case  'governingEntity' : { 
@@ -167,6 +170,9 @@ export class FlowService {
167170        entityIDsSorted  =  governingEntities . map ( 
168171          ( governingEntity )  =>  governingEntity . id 
169172        ) ; 
173+         entityCondKeyFlowObjectType  = 
174+           'governingEntity'  satisfies  FlowObjectType ; 
175+ 
170176        break ; 
171177      } 
172178      case  'location' : { 
@@ -189,6 +195,8 @@ export class FlowService {
189195        } ) ; 
190196
191197        entityIDsSorted  =  locations . map ( ( location )  =>  location . id ) ; 
198+         entityCondKeyFlowObjectType  =  'location'  satisfies  FlowObjectType ; 
199+ 
192200        break ; 
193201      } 
194202      case  'organization' : { 
@@ -211,6 +219,8 @@ export class FlowService {
211219        } ) ; 
212220
213221        entityIDsSorted  =  organizations . map ( ( organization )  =>  organization . id ) ; 
222+         entityCondKeyFlowObjectType  =  'organization'  satisfies  FlowObjectType ; 
223+ 
214224        break ; 
215225      } 
216226      case  'plan' : { 
@@ -233,6 +243,8 @@ export class FlowService {
233243        } ) ; 
234244
235245        entityIDsSorted  =  plans . map ( ( plan )  =>  plan . id ) ; 
246+         entityCondKeyFlowObjectType  =  'plan'  satisfies  FlowObjectType ; 
247+ 
236248        break ; 
237249      } 
238250      case  'project' : { 
@@ -255,6 +267,8 @@ export class FlowService {
255267        } ) ; 
256268
257269        entityIDsSorted  =  projects . map ( ( project )  =>  project . id ) ; 
270+         entityCondKeyFlowObjectType  =  'project'  satisfies  FlowObjectType ; 
271+ 
258272        break ; 
259273      } 
260274      case  'usageYear' : { 
@@ -277,6 +291,8 @@ export class FlowService {
277291        } ) ; 
278292
279293        entityIDsSorted  =  usageYears . map ( ( usageYear )  =>  usageYear . id ) ; 
294+         entityCondKeyFlowObjectType  =  'usageYear'  satisfies  FlowObjectType ; 
295+ 
280296        break ; 
281297      } 
282298      case  'planVersion' : { 
@@ -304,6 +320,8 @@ export class FlowService {
304320        } ) ; 
305321
306322        entityIDsSorted  =  planVersions . map ( ( planVersion )  =>  planVersion . planId ) ; 
323+         entityCondKeyFlowObjectType  =  'plan'  satisfies  FlowObjectType ; 
324+ 
307325        break ; 
308326      } 
309327      default : { 
@@ -313,8 +331,6 @@ export class FlowService {
313331
314332    // After getting the sorted entityID list 
315333    // we can now get the flowObjects 
316-     const  entityCondKey  =  orderBy . entity  as  unknown ; 
317-     const  entityCondKeyFlowObjectType  =  entityCondKey  as  FlowObjectType ; 
318334
319335    // Order map 
320336    const  orderMap  =  new  Map < number ,  number > ( ) ; 
0 commit comments