wallet creadit request list

This commit is contained in:
2026-07-04 12:49:00 +03:30
parent 5b6fb16f5c
commit 82f53a1642
6 changed files with 174 additions and 0 deletions
@@ -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;