fix(SPG-618) Error pada saat mengkonfirmasi / save pengembalian wahana baru
parent
000c3f1800
commit
ef2697a3b1
|
@ -30,6 +30,19 @@ export class CreateRefundManager extends BaseCreateManager<RefundEntity> {
|
||||||
refund_items: refund_items,
|
refund_items: refund_items,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const exist = await this.dataService.getOneByOptions({
|
||||||
|
where: {
|
||||||
|
transaction_id: this.data.transaction.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (exist) {
|
||||||
|
throw new UnprocessableEntityException({
|
||||||
|
statusCode: HttpStatus.UNPROCESSABLE_ENTITY,
|
||||||
|
message: `Failed! refund transaction with invoice ${this.data.transaction.invoice_code} already exist`,
|
||||||
|
error: 'Unprocessable Entity',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const transaction = await this.dataServiceFirstOpt.getOneByOptions({
|
const transaction = await this.dataServiceFirstOpt.getOneByOptions({
|
||||||
where: {
|
where: {
|
||||||
id: this.data.transaction.id,
|
id: this.data.transaction.id,
|
||||||
|
|
Loading…
Reference in New Issue