Skip to content

Commit c13faa4

Browse files
authored
Merge pull request #20 from topcoder-platform/PM-921_qa-fixes
PM-921 - make sure to account for the updated payment status
2 parents 60b5ac2 + 68e8c6a commit c13faa4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/admin-winning/adminWinning.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export class AdminWinningService {
337337
}
338338

339339
let version = payment.version ?? 1;
340+
let paymentStatus = payment.payment_status as PaymentStatus;
340341
// Update Payment Status if requested
341342
if (body.paymentStatus) {
342343
let errMessage = '';
@@ -394,6 +395,7 @@ export class AdminWinningService {
394395
),
395396
);
396397
version += 1;
398+
paymentStatus = body.paymentStatus as PaymentStatus;
397399

398400
if (body.paymentStatus === PaymentStatus.OWED) {
399401
needsReconciliation = true;
@@ -420,7 +422,7 @@ export class AdminWinningService {
420422
PaymentStatus.OWED,
421423
PaymentStatus.ON_HOLD,
422424
PaymentStatus.ON_HOLD_ADMIN,
423-
].includes(payment.payment_status as PaymentStatus)
425+
].includes(paymentStatus)
424426
) {
425427
throw new BadRequestException(
426428
`Cannot update release date for payment unless it's in one of the states: ${[

0 commit comments

Comments
 (0)