add : business list for super admin

This commit is contained in:
2026-03-16 14:48:51 +03:30
parent 9ab0078b43
commit ba9aa004fe
8 changed files with 172 additions and 8 deletions
@@ -14,6 +14,7 @@ import { BusinessStaff } from "../entities/business-staff.entity";
import { Business } from "../entities/business.entity";
import { IDanakCheckAccessResponse } from "../interfaces/IBusiness";
import { BusinessRepository } from "../repositories/business.repository";
import { FindBusinessesDto } from "../DTO/find-businesses.dto";
@Injectable()
export class BusinessesService {
@@ -24,7 +25,7 @@ export class BusinessesService {
private readonly httpService: HttpService,
private readonly em: EntityManager,
private readonly quotaPurchaseService: QuotaPurchaseService,
) {}
) { }
async getBusinessByDanakSubscriptionId(danakSubscriptionId: string) {
const business = await this.businessRepository.findOne({ danakSubscriptionId, deletedAt: null });
@@ -162,4 +163,8 @@ export class BusinessesService {
return this.quotaPurchaseService.purchaseQuota(business, purchaseDto);
}
//********************************************* */
async findBusinesses(query: FindBusinessesDto) {
return this.businessRepository.findAllPaginated(query)
}
}