@@ -148,6 +148,31 @@ export class ChallengesService {
148148 : WinningsCategory . REVIEW_BOARD_PAYMENT ;
149149 }
150150
151+ /**
152+ * Resolves the explicit payment status for task payments generated from
153+ * challenge-api-v6 challenge data.
154+ *
155+ * @param challenge Challenge details returned by challenge-api-v6.
156+ * @param category Winnings category selected for the generated payment.
157+ * @param currency Prize currency selected for the generated payment.
158+ * @returns OWED for USD TAAS task payments, ON_HOLD_ADMIN for other USD task
159+ * payments, and undefined when standard payout-readiness rules should apply.
160+ * @throws This method does not throw.
161+ */
162+ private getTaskPaymentStatus (
163+ challenge : Challenge ,
164+ category : WinningsCategory ,
165+ currency ?: PrizeType ,
166+ ) : PaymentStatus | undefined {
167+ if ( ! challenge . task ?. isTask || currency !== PrizeType . USD ) {
168+ return undefined ;
169+ }
170+
171+ return category === WinningsCategory . TAAS_PAYMENT
172+ ? PaymentStatus . OWED
173+ : PaymentStatus . ON_HOLD_ADMIN ;
174+ }
175+
151176 async getChallenge ( challengeId : string ) {
152177 if ( ! isUUID ( challengeId ) ) {
153178 throw new BadRequestException (
@@ -232,15 +257,15 @@ export class ChallengesService {
232257 ? ( type ?? defaultCategory )
233258 : WinningsCategory . POINTS_AWARD ;
234259
260+ const status = this . getTaskPaymentStatus ( challenge , winType , currency ) ;
261+
235262 return {
236263 handle : winner . handle ,
237264 amount : prizes [ winner . placement - 1 ] . value ,
238265 userId : winner . userId . toString ( ) ,
239266 type : winType ,
240267 currency,
241- ...( challenge . task ?. isTask && currency === PrizeType . USD
242- ? { status : PaymentStatus . ON_HOLD_ADMIN }
243- : { } ) ,
268+ ...( status ? { status } : { } ) ,
244269 description :
245270 challenge . type === 'Task'
246271 ? challenge . name
@@ -434,6 +459,12 @@ export class ChallengesService {
434459 currency ,
435460 ) ;
436461
462+ const status = this . getTaskPaymentStatus (
463+ challenge ,
464+ winType ,
465+ currency ,
466+ ) ;
467+
437468 return {
438469 handle : reviewer . memberHandle ,
439470 userId : reviewer . memberId . toString ( ) ,
@@ -446,9 +477,7 @@ export class ChallengesService {
446477 ) ,
447478 type : winType ,
448479 currency : placementPrizes ?. [ 0 ] ?. type ?? PrizeType . USD ,
449- ...( challenge . task ?. isTask && currency === PrizeType . USD
450- ? { status : PaymentStatus . ON_HOLD_ADMIN }
451- : { } ) ,
480+ ...( status ? { status } : { } ) ,
452481 description : `${ challenge . name } - ${ phaseReviews [ 0 ] . phaseName } ` ,
453482 } ;
454483 } ,
@@ -513,6 +542,10 @@ export class ChallengesService {
513542 ) ;
514543
515544 return payments . map ( ( payment ) => {
545+ const paymentStatus =
546+ payment . status ??
547+ this . getTaskPaymentStatus ( challenge , payment . type , payment . currency ) ;
548+
516549 return {
517550 winnerId : payment . userId . toString ( ) ,
518551 type :
0 commit comments