This commit is contained in:
mmrbnjd
2025-07-07 22:04:07 +03:30
parent 2432ab293f
commit 1924c88e7a
8 changed files with 94 additions and 10 deletions

View File

@@ -22,6 +22,13 @@ namespace Hushian.Application.Services
private readonly VerificationService _VerificationService;
private readonly IMapper _mapper;
public CompanyService(IGenericRepository<Company> companyRepository, VerificationService verificationService, IMapper mapper)
{
_CompanyRepository = companyRepository;
_VerificationService = verificationService;
_mapper = mapper;
}
public async Task<ResponseBase<int>> RegisterCompany(RegisterCompanyDto dto)
{
ResponseBase<int> Response = new();
@@ -197,6 +204,8 @@ namespace Hushian.Application.Services
}
public async Task<bool> AnyCompany(int CompanyID)
=>await _CompanyRepository.Get().AnyAsync(a=>a.ID==CompanyID);
public async Task<bool> AllowBot(int CompanyID)
=> await _CompanyRepository.Get().AnyAsync(a => a.ID == CompanyID && a.allowBot);
private async Task<int> Verifi(string Mobile) => await _VerificationService.GenerateCodeByPhoneNumberConfirmed(Mobile);
}