Merge remote-tracking branch 'origin/development' into development
# Conflicts: # src/transaction/transaction.service.ts
This commit is contained in:
commit
fd47c34453
|
@ -155,6 +155,23 @@ export class TransactionController {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('check-bill-history/:id')
|
||||||
|
async getCheckBillHistory(
|
||||||
|
@Param('id') id: string,
|
||||||
|
@Request() req,
|
||||||
|
) {
|
||||||
|
const data = await this.transactionService.findOne(
|
||||||
|
req.user.userId,
|
||||||
|
id,
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...data,
|
||||||
|
statusCode: HttpStatus.OK,
|
||||||
|
message: 'success',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Get('history-user/:id')
|
@Get('history-user/:id')
|
||||||
async getHistoryTransactionUserByParam(
|
async getHistoryTransactionUserByParam(
|
||||||
@Query('page') page: number,
|
@Query('page') page: number,
|
||||||
|
|
|
@ -1380,6 +1380,25 @@ export class TransactionService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async findOne(user: string, id: string) {
|
||||||
|
try {
|
||||||
|
return this.checkBillHistoryRepository.findOneOrFail({
|
||||||
|
where: {
|
||||||
|
trx_id: id,
|
||||||
|
user: user,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
throw new HttpException(
|
||||||
|
{
|
||||||
|
statusCode: HttpStatus.NOT_FOUND,
|
||||||
|
error: 'Billing not found',
|
||||||
|
},
|
||||||
|
HttpStatus.NOT_FOUND,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async topUpHistoryByUser(
|
async topUpHistoryByUser(
|
||||||
page: number,
|
page: number,
|
||||||
user: string,
|
user: string,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user