Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Model/Resolver/BecomeSeller.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ public function resolve(
->setUrl($args['url_key'])
->setCustomerId($args['customer_id']);

return $this->_createSeller->createSeller($sellerInterface, $args['customer_id']);
$data = $this->_createSeller->createSeller($sellerInterface, $args['customer_id']);
$code = 0;
$message = "We can not create seller account at now";
if ($data && $data->getSellerId()) {
$code = $data->getSellerId();
$message = "Your seller account was created successfully. We will connect with you soon.";
}
return [
"code" => $code,
"message" => $message
];
}


Expand Down
12 changes: 11 additions & 1 deletion Model/Resolver/CreateSeller.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ public function resolve(
->setEmail($customer['email'])
->setAddresses($addressArr);

return $this->_createSeller->registerSeller($customerInterface, $data, $password);
$data = $this->_createSeller->registerSeller($customerInterface, $data, $password);
$code = 0;
$message = "We can not register seller account at now";
if ($data && $data->getSellerId()) {
$code = $data->getSellerId();
$message = "Your seller account was registered successfully. We will connect with you soon.";
}
return [
"code" => $code,
"message" => $message
];
}
}
1 change: 1 addition & 0 deletions Model/Resolver/Customer/SendMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function resolve(
array $value = null,
array $args = null
) {

if (!$context->getExtensionAttributes()->getIsCustomer()) {
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
}
Expand Down
2 changes: 1 addition & 1 deletion Model/Resolver/DataProvider/CreateSeller.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function createSeller($data, $customerId)
* @param CustomerInterface $customer
* @param $data
* @param $password
* @return CustomerInterface
* @return \Lof\MarketPlace\Api\Data\SellerInterface|array|mixed|string|null
* @throws InputException
* @throws LocalizedException
* @throws InputMismatchException
Expand Down
6 changes: 4 additions & 2 deletions Model/Resolver/ReviewSeller.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ class ReviewSeller implements ResolverInterface
* @var SellerInterface
*/
private $sellerInterface;

/**
* @var RatingFactory
*/
private $_rateSeller;

/**
* @var SellersRepositoryInterface
* @var SellersFrontendRepositoryInterface
*/
private $sellerRepository;
/**
Expand Down Expand Up @@ -98,7 +100,7 @@ public function resolve(
throw new GraphQlInputException(__('"input" value should be specified'));
}
$args = $args['input'];
$seller = $this->sellerRepository->getById($args['seller_id']);
$seller = $this->sellerRepository->get((int)$args['seller_id']);
if (!isset($seller['seller_id']) || !$seller['seller_id']) {
return [
"code" => 1,
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,7 @@ mutation {
content : String!
}
) {
code
message
message_id
}
}
```
Expand All @@ -573,8 +572,7 @@ mutation {
content : String!
}
) {
code
message
created_at
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ type Mutation {

reviewSeller(input: ReviewInput!): MarketplaceOuput @resolver(class: "\\Lof\\MarketplaceGraphQl\\Model\\Resolver\\ReviewSeller") @doc(description: "Review Seller")

customerSendMessage(input: CustomerMessageInput!): MarketplaceOuput @resolver(class:"\\Lof\\MarketplaceGraphQl\\Model\\Resolver\\Customer\\SendMessage") @doc(description: "Customer send message to seller")
customerSendMessage(input: CustomerMessageInput!): SellerMessage @resolver(class:"\\Lof\\MarketplaceGraphQl\\Model\\Resolver\\Customer\\SendMessage") @doc(description: "Customer send message to seller")

customerReplyMessage(input: ReplyMessageInput!): MarketplaceOuput @resolver(class:"\\Lof\\MarketplaceGraphQl\\Model\\Resolver\\Customer\\ReplyMessage") @doc(description: "Customer reply Messaage")
customerReplyMessage(input: ReplyMessageInput!): SellerMessageDetail @resolver(class:"\\Lof\\MarketplaceGraphQl\\Model\\Resolver\\Customer\\ReplyMessage") @doc(description: "Customer reply Messaage")

}

Expand Down