@@ -14,7 +14,7 @@ import { Identities } from '../identities/_schemas/identities.schema';
1414import { IdentitiesCrudService } from '../identities/identities-crud.service' ;
1515import { ConfigRulesObjectIdentitiesDTO , ConfigRulesObjectSchemaDTO } from './_dto/config-rules.dto' ;
1616import { ConfigStatesDTO , LifecycleStateDTO } from './_dto/config-states.dto' ;
17- import { IdentityLifecycleDefault , IdentityLifecycleDefaultList } from '../identities/_enums/lifecycle.enum' ;
17+ import { IdentityLifecycleDefault , IdentityLifecycleDefaultList , IdentityLifecycleState } from '../identities/_enums/lifecycle.enum' ;
1818import { Lifecycle , LifecycleRefId } from './_schemas/lifecycle.schema' ;
1919import { ConfigService } from '@nestjs/config' ;
2020import dayjs from 'dayjs' ;
@@ -313,26 +313,11 @@ export class LifecycleService extends AbstractServiceSchema implements OnApplica
313313 *
314314 * @returns An array containing all available lifecycle states
315315 */
316- public getAllAvailableStates ( ) : Array < { key : string ; label : string ; description : string } > {
317- const allStates : Array < { key : string ; label : string ; description : string , icon : string } > = [ ] ;
318-
319- IdentityLifecycleDefaultList . forEach ( state => {
320- allStates . push ( {
321- key : state . key ,
322- label : state . label ,
323- description : state . description ,
324- icon : state . icon ,
325- } ) ;
326- } ) ;
327-
328- this . customStates . forEach ( customState => {
329- allStates . push ( {
330- key : customState . key ,
331- label : customState . label ,
332- description : customState . description ,
333- icon : customState . icon || 'mdi-help-rhombus-outline' ,
334- } ) ;
335- } ) ;
316+ public getAllAvailableStates ( ) : Array < IdentityLifecycleState > {
317+ const allStates : Array < IdentityLifecycleState > = [
318+ ...IdentityLifecycleDefaultList ,
319+ ...this . customStates ,
320+ ] ;
336321
337322 return allStates ;
338323 }
@@ -359,7 +344,7 @@ export class LifecycleService extends AbstractServiceSchema implements OnApplica
359344 *
360345 * @returns An array of custom lifecycle states with their details
361346 */
362- public getCustomStates ( ) : LifecycleStateDTO [ ] {
347+ public getCustomStates ( ) : IdentityLifecycleState [ ] {
363348 return [ ...this . customStates ] ;
364349 }
365350
0 commit comments