fix(SPG-736) Cancel rekon statu Pending terkena validasi data pemesanan harus settled
parent
d413bd771b
commit
03ec533e86
|
@ -23,10 +23,13 @@ export class BatchCancelReconciliationManager extends BaseBatchUpdateStatusManag
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if ([STATUS.SETTLED, STATUS.WAITING].includes(transaction.status)) {
|
if (
|
||||||
|
![STATUS.SETTLED, STATUS.WAITING].includes(transaction.status) &&
|
||||||
|
!data.is_recap_transaction
|
||||||
|
) {
|
||||||
throw new UnprocessableEntityException({
|
throw new UnprocessableEntityException({
|
||||||
statusCode: HttpStatus.UNPROCESSABLE_ENTITY,
|
statusCode: HttpStatus.UNPROCESSABLE_ENTITY,
|
||||||
message: `Gagal! tidak bisa batalkan, karena status transaksi tidak settled`,
|
message: `Gagal! tidak bisa batalkan, karena status transaksi tidak settled atau waiting`,
|
||||||
error: 'Unprocessable Entity',
|
error: 'Unprocessable Entity',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,10 +27,13 @@ export class CancelReconciliationManager extends BaseUpdateStatusManager<Transac
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if ([STATUS.SETTLED, STATUS.WAITING].includes(transaction.status)) {
|
if (
|
||||||
|
![STATUS.SETTLED, STATUS.WAITING].includes(transaction.status) &&
|
||||||
|
!this.data.is_recap_transaction
|
||||||
|
) {
|
||||||
throw new UnprocessableEntityException({
|
throw new UnprocessableEntityException({
|
||||||
statusCode: HttpStatus.UNPROCESSABLE_ENTITY,
|
statusCode: HttpStatus.UNPROCESSABLE_ENTITY,
|
||||||
message: `Gagal! tidak bisa batalkan, karena status transaksi tidak settled`,
|
message: `Gagal! tidak bisa batalkan, karena status transaksi tidak settled atau waiting`,
|
||||||
error: 'Unprocessable Entity',
|
error: 'Unprocessable Entity',
|
||||||
});
|
});
|
||||||
} else if (this.data.is_recap_transaction) {
|
} else if (this.data.is_recap_transaction) {
|
||||||
|
|
Loading…
Reference in New Issue