add : business list for super admin
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user