Merge branch 'development' into 'devops-staging'

Development

See merge request empatnusabangsa/ppob/ppob-backend!79
This commit is contained in:
ilham dwi pratama 2022-01-03 05:49:57 +00:00
commit f25c48404d
2 changed files with 29 additions and 25 deletions

View File

@ -125,6 +125,29 @@ export class TransactionController {
};
}
@Get('history-user/:id')
async getHistoryTransactionUserByParam(
@Query('page') page: number,
@Query('pageSize') pageSize: number,
@Query('start') startDate: string,
@Query('end') endDate: string,
@Param('id', ParseUUIDPipe) id: string,
) {
const data = await this.transactionService.transactionHistoryByUser(
page,
id,
startDate == 'null' ? null : startDate,
endDate == 'null' ? null : endDate,
pageSize,
);
return {
...data,
statusCode: HttpStatus.OK,
message: 'success',
};
}
@Get('history-deposit')
async getHistoryDepositUser(
@Query('page') page: number,
@ -219,29 +242,6 @@ export class TransactionController {
};
}
@Get('history-user/:id')
async getHistoryTransactionUserByParam(
@Query('page') page: number,
@Query('pageSize') pageSize: number,
@Query('start') startDate: string,
@Query('end') endDate: string,
@Param('id', ParseUUIDPipe) id: string,
) {
const data = await this.transactionService.transactionHistoryByUser(
page,
id,
startDate == 'null' ? null : startDate,
endDate == 'null' ? null : endDate,
pageSize,
);
return {
...data,
statusCode: HttpStatus.OK,
message: 'success',
};
}
@Put('deposit-return/confirmation/:id/:status')
async confirmDepositReturn(
@Param('id', ParseUUIDPipe) id: string,

View File

@ -1058,7 +1058,9 @@ export class TransactionService {
const baseQuery = this.transactionRepository
.createQueryBuilder('transactions')
.innerJoin('transactions.product_price', 'product_price')
.where('transactions.type = 1 and partner_trx_id is NULL');
.where(
'transactions.type = 1 and partner_trx_id is NULL and transactions.status = 1',
);
const data = await baseQuery
.select('SUM(transactions.amount) as total_amount')
@ -1088,7 +1090,9 @@ export class TransactionService {
const baseQuery = this.transactionRepository
.createQueryBuilder('transactions')
.innerJoin('transactions.product_price', 'product_price')
.where('transactions.type = 1 and partner_trx_id is not NULL');
.where(
'transactions.type = 1 and partner_trx_id is not NULL and transactions.status = 1',
);
const data = await baseQuery
.select('SUM(transactions.amount) as total_amount')