chore: add business logic

This commit is contained in:
Mahyargdz
2025-05-18 10:19:00 +03:30
parent 479c9c390a
commit 9eeab529a9
25 changed files with 350 additions and 74 deletions
@@ -0,0 +1,16 @@
import { BadRequestException, Injectable } from "@nestjs/common";
import { BusinessMessage } from "../../../common/enums/message.enum";
import { BusinessRepository } from "../repositories/business.repository";
@Injectable()
export class BusinessService {
constructor(private readonly businessRepository: BusinessRepository) {}
async getBusinessByDanakSubscriptionId(danakSubscriptionId: string) {
const business = await this.businessRepository.findOne({ danakSubscriptionId, deletedAt: null });
if (!business) throw new BadRequestException(BusinessMessage.NOT_FOUND);
return business;
}
}