Beispiel #1
0
        public async Task <Response <CompanyViewModel> > Handle(GetCompanyinfoQuery request,
                                                                CancellationToken cancellationToken)
        {
            var currentUser = await _authenticatedUserService.GetCurentApplicationUser();

            var company = await _companyRepository.GetByIdAsync(currentUser.CompanyId.Value);

            var result = new CompanyViewModel
            {
                Id              = company.Id,
                Name            = company.Name,
                Address         = company.Address,
                PhoneNumber     = company.PhoneNumber,
                TaxCode         = company.TaxCode,
                BankAccount     = company.BankAccount,
                BusinessLicense = company.BusinessLicense,
                Email           = company.Email
            };

            return(new Response <CompanyViewModel>(result));
        }
 public async Task <IActionResult> GetInfo([FromQuery] GetCompanyinfoQuery query)
 {
     return(Ok(await _mediator.Send(query)));
 }