Skip to content

Commit

Permalink
inquiry can be now associated with the customer user
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin committed Nov 6, 2024
1 parent bf9150a commit 1e465a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Model/Mutation/Inquiry/CreateInquiryMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Overblog\GraphQLBundle\Definition\Argument;
use Psr\Log\LoggerInterface;
use Shopsys\FrameworkBundle\Component\Domain\Domain;
use Shopsys\FrameworkBundle\Model\Customer\User\CurrentCustomerUser;
use Shopsys\FrameworkBundle\Model\Inquiry\InquiryData;
use Shopsys\FrameworkBundle\Model\Inquiry\InquiryDataFactory;
use Shopsys\FrameworkBundle\Model\Inquiry\InquiryFacade;
Expand All @@ -25,6 +26,7 @@ class CreateInquiryMutation extends AbstractMutation
* @param \Shopsys\FrameworkBundle\Model\Product\ProductFacade $productFacade
* @param \Shopsys\FrameworkBundle\Model\Inquiry\Mail\InquiryMailFacade $inquiryMailFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\Customer\User\CurrentCustomerUser $currentCustomerUser
*/
public function __construct(
protected readonly LoggerInterface $logger,
Expand All @@ -33,6 +35,7 @@ public function __construct(
protected readonly ProductFacade $productFacade,
protected readonly InquiryMailFacade $inquiryMailFacade,
protected readonly Domain $domain,
protected readonly CurrentCustomerUser $currentCustomerUser,
) {
}

Expand Down Expand Up @@ -73,6 +76,7 @@ protected function createInquiryDataFromArgument(Argument $argument): InquiryDat
$inquiryData->companyNumber = $input['companyNumber'] ?? null;
$inquiryData->companyTaxNumber = $input['companyTaxNumber'] ?? null;
$inquiryData->note = $input['note'] ?? null;
$inquiryData->customerUser = $this->currentCustomerUser->findCurrentCustomerUser();
$inquiryData->product = $product;

return $inquiryData;
Expand Down

0 comments on commit 1e465a3

Please sign in to comment.