wallet creadit request list
This commit is contained in:
@@ -16,7 +16,9 @@ import { CreateExternalInvoice } from '../interface/external-invoice.interface';
|
||||
import { ChargeRequestDto } from '../dto/charge-request.dto';
|
||||
import { FinishChargeRequestDto } from '../dto/finish-charge-request.dto';
|
||||
import { FindRestaurantWalletTransactionsDto } from '../dto/find-restaurant-wallet-transactions.dto';
|
||||
import { FindRestaurantCreditRequestsDto } from '../dto/find-restaurant-credit-requests.dto';
|
||||
import { RestaurantCreditTransactionRepository } from '../repositories/restaurant-credit-transaction.repository';
|
||||
import { RestaurantCreditRequestRepository } from '../repositories/restaurant-credit-request.repository';
|
||||
import { RestMessage } from 'src/common/enums/message.enum';
|
||||
|
||||
@Injectable()
|
||||
@@ -28,6 +30,7 @@ export class RestaurantWalletService {
|
||||
private readonly httpService: HttpService,
|
||||
private readonly configService: ConfigService,
|
||||
private readonly restaurantCreditTransactionRepository: RestaurantCreditTransactionRepository,
|
||||
private readonly restaurantCreditRequestRepository: RestaurantCreditRequestRepository,
|
||||
) {}
|
||||
|
||||
async getCurrentBalance(restaurantId: string, em: EntityManager = this.defaultEm): Promise<number> {
|
||||
@@ -44,6 +47,10 @@ export class RestaurantWalletService {
|
||||
return this.restaurantCreditTransactionRepository.findAllPaginated(restaurantId, dto);
|
||||
}
|
||||
|
||||
getCreditRequests(restaurantId: string, dto: FindRestaurantCreditRequestsDto) {
|
||||
return this.restaurantCreditRequestRepository.findAllPaginated(restaurantId, dto);
|
||||
}
|
||||
|
||||
async createTransaction(params: {
|
||||
restaurant: Restaurant;
|
||||
amount: number;
|
||||
|
||||
Reference in New Issue
Block a user