@@ -583,6 +583,31 @@ async function activateProject (projectId, currentUser, name, description) {
583
583
}
584
584
}
585
585
586
+ /**
587
+ * Update self service project info
588
+ * @param {* } projectId the project id
589
+ * @param {* } workItemPlannedEndDate the planned end date of the work item
590
+ * @param {* } currentUser the current user
591
+ */
592
+ async function updateSelfServiceProjectInfo ( projectId , workItemPlannedEndDate , currentUser ) {
593
+ const project = await ensureProjectExist ( projectId , currentUser )
594
+ const payment = await getProjectPayment ( projectId )
595
+ const token = await getM2MToken ( )
596
+ const url = `${ config . PROJECTS_API_URL } /${ projectId } `
597
+ const res = await axios . patch ( url , {
598
+ details : {
599
+ ...project . details ,
600
+ paymentProvider : config . DEFAULT_PAYMENT_PROVIDER ,
601
+ paymentId : payment . id ,
602
+ paymentIntentId : payment . paymentIntentId ,
603
+ paymentAmount : payment . amount ,
604
+ paymentCurrency : payment . currency ,
605
+ paymentStatus : payment . status ,
606
+ workItemPlannedEndDate
607
+ }
608
+ } , { headers : { Authorization : `Bearer ${ token } ` } } )
609
+ }
610
+
586
611
/**
587
612
* Get resource roles
588
613
* @returns {Promise<Array> } the challenge resources
@@ -1257,5 +1282,6 @@ module.exports = {
1257
1282
sendSelfServiceNotification,
1258
1283
getMemberByHandle,
1259
1284
submitZendeskRequest,
1260
- getMemberById
1285
+ getMemberById,
1286
+ updateSelfServiceProjectInfo
1261
1287
}
0 commit comments