@@ -51,6 +51,7 @@ export class IdentitiesService extends AbstractServiceSchema {
5151 data ?: IdentitiesUpsertDto ,
5252 options ?: QueryOptions < T > ,
5353 ) : Promise < [ HttpStatus . OK | HttpStatus . CREATED , ModifyResult < Query < T , T , any , T > > ] > {
54+ console . log ( 'data' , data ) ;
5455 data = this . transformNullsToString ( data ) ;
5556 const identity = await this . model . findOne < Identities > ( filters ) . exec ( ) ;
5657 this . logger . log ( `Upserting identity with filters ${ JSON . stringify ( filters ) } ` ) ;
@@ -68,13 +69,12 @@ export class IdentitiesService extends AbstractServiceSchema {
6869 ] ) ,
6970 } ) ;
7071
71- // console.log('data', data);
72-
7372 if ( ! data ?. inetOrgPerson ?. employeeNumber || ! data ?. inetOrgPerson ?. employeeType ) {
7473 throw new BadRequestException (
7574 'inetOrgPerson.employeeNumber and inetOrgPerson.employeeType are required for create identity.' ,
7675 ) ;
7776 }
77+ console . log ( 'data.inetOrgPerson?.employeeNumber' , data . inetOrgPerson ?. employeeNumber )
7878 if ( data . inetOrgPerson ?. employeeNumber . indexOf ( '174981' ) >= 0 || data . inetOrgPerson ?. employeeNumber . indexOf ( '162982' ) >= 0 ) {
7979 console . log ( 'test' ) ;
8080 }
@@ -108,6 +108,18 @@ export class IdentitiesService extends AbstractServiceSchema {
108108 ) ;
109109 await this . checkFingerprint ( filters , fingerprint ) ;
110110
111+ console . log ( 'insert' , {
112+ $setOnInsert : {
113+ ...crushedSetOnInsert ,
114+ // 'state': IdentityState.TO_CREATE,
115+ } ,
116+ $set : {
117+ ...crushedUpdate ,
118+ 'additionalFields.objectClasses' : data . additionalFields . objectClasses ,
119+ lastSync : new Date ( ) ,
120+ } ,
121+ } )
122+
111123 const upserted = await super . upsert (
112124 filters ,
113125 {
0 commit comments