@@ -281,6 +281,18 @@ export class IssuanceService {
281
281
282
282
if ( allSuccessful ) {
283
283
finalStatusCode = HttpStatus . CREATED ;
284
+ const context = payload ?. credentialData [ 0 ] ?. credential ?. [ '@context' ] as string [ ] ;
285
+
286
+ if ( Array . isArray ( context ) && context . includes ( CommonConstants . W3C_SCHEMA_URL ) ) {
287
+ const filterData = context . filter ( ( item ) => CommonConstants . W3C_SCHEMA_URL !== item ) ;
288
+ const [ schemaId ] = filterData ;
289
+ results . forEach ( ( record ) => {
290
+ if ( PromiseResult . FULFILLED === record . status && record ?. value ?. threadId ) {
291
+ this . issuanceRepository . updateSchemaIdByThreadId ( record ?. value ?. threadId , schemaId ) ;
292
+ }
293
+ } ) ;
294
+ }
295
+
284
296
finalMessage = ResponseMessages . issuance . success . create ;
285
297
} else if ( allFailed ) {
286
298
finalStatusCode = HttpStatus . BAD_REQUEST ;
@@ -889,7 +901,6 @@ export class IssuanceService {
889
901
890
902
await this . delay ( 500 ) ; // Wait for 0.5 seconds
891
903
const sendOobOffer = await this . sendEmailForCredentialOffer ( sendEmailCredentialOffer ) ;
892
-
893
904
arraycredentialOfferResponse . push ( sendOobOffer ) ;
894
905
}
895
906
if ( 0 < errors . length ) {
@@ -1064,6 +1075,20 @@ export class IssuanceService {
1064
1075
return false ;
1065
1076
}
1066
1077
1078
+ if ( isEmailSent ) {
1079
+ const w3cSchemaId = outOfBandIssuancePayload ?. credentialFormats ?. jsonld ?. credential ?. [ '@context' ] as string [ ] ;
1080
+ if ( w3cSchemaId && w3cSchemaId . includes ( CommonConstants . W3C_SCHEMA_URL ) ) {
1081
+ const filterData = w3cSchemaId . filter ( ( item ) => CommonConstants . W3C_SCHEMA_URL !== item ) ;
1082
+ const [ schemaId ] = filterData ;
1083
+ if ( credentialCreateOfferDetails . response . credentialRequestThId ) {
1084
+ this . issuanceRepository . updateSchemaIdByThreadId (
1085
+ credentialCreateOfferDetails . response . credentialRequestThId ,
1086
+ schemaId
1087
+ ) ;
1088
+ }
1089
+ }
1090
+ }
1091
+
1067
1092
return isEmailSent ;
1068
1093
} catch ( error ) {
1069
1094
const iterationNoMessage = ` at position ${ iterationNo } ` ;
0 commit comments