@@ -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 } from '../identities/_enums/lifecycle.enum' ;
17+ import { IdentityLifecycleDefault , IdentityLifecycleDefaultList } from '../identities/_enums/lifecycle.enum' ;
1818import { Lifecycle , LifecycleRefId } from './_schemas/lifecycle.schema' ;
1919import { ConfigService } from '@nestjs/config' ;
2020import dayjs from 'dayjs' ;
@@ -316,16 +316,14 @@ export class LifecycleService extends AbstractServiceSchema implements OnApplica
316316 public getAllAvailableStates ( ) : Array < { key : string ; label : string ; description : string } > {
317317 const allStates : Array < { key : string ; label : string ; description : string } > = [ ] ;
318318
319- // Ajouter les états par défaut de l'enum
320- Object . entries ( IdentityLifecycleDefault ) . forEach ( ( [ enumKey , enumValue ] ) => {
319+ IdentityLifecycleDefaultList . forEach ( state => {
321320 allStates . push ( {
322- key : enumValue ,
323- label : enumKey ,
324- description : `Default lifecycle state: ${ enumKey } ` ,
321+ key : state . key ,
322+ label : state . label ,
323+ description : state . description ,
325324 } ) ;
326325 } ) ;
327326
328- // Ajouter les états custom
329327 this . customStates . forEach ( customState => {
330328 allStates . push ( {
331329 key : customState . key ,
@@ -334,7 +332,6 @@ export class LifecycleService extends AbstractServiceSchema implements OnApplica
334332 } ) ;
335333 } ) ;
336334
337- this . logger . debug ( `Retrieved <${ allStates . length } > total available lifecycle states` ) ;
338335 return allStates ;
339336 }
340337
@@ -361,8 +358,7 @@ export class LifecycleService extends AbstractServiceSchema implements OnApplica
361358 * @returns An array of custom lifecycle states with their details
362359 */
363360 public getCustomStates ( ) : LifecycleStateDTO [ ] {
364- this . logger . debug ( `Retrieved <${ this . customStates . length } > custom lifecycle states` ) ;
365- return [ ...this . customStates ] ; // Return a copy to prevent external modification
361+ return [ ...this . customStates ] ;
366362 }
367363
368364 /**
0 commit comments