Skip to content

Commit

Permalink
feature #11217 [API][Payment] Implement filtering payments by channel…
Browse files Browse the repository at this point in the history
… feature (GSadee)

This PR was merged into the api branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | api
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT


Commits
-------

a81b859 [API] Implement filtering payments by channel feature
  • Loading branch information
Zales0123 committed Mar 12, 2020
2 parents 116a360 + a81b859 commit 443b6c1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Feature: Filtering payments by channel
And there is an "#00000002" order with "Orange" product in "Canada" channel
And I am logged in as an administrator

@ui
@ui @api
Scenario: Filtering payments by channel on index
When I browse payments
And I choose "Canada" as a channel filter
And I filter
Then I should see a single payment in the list
And I should see the payment of the "#00000002" order
But I should not see a payment of order "#00000001"
But I should not see the payment of the "#00000001" order
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ public function iChooseAsAPaymentState(string $state): void
$this->client->buildFilter(['state' => $state]);
}

/**
* @When I choose :channel as a channel filter
*/
public function iChooseChannelAsAChannelFilter(ChannelInterface $channel): void
{
$this->client->buildFilter(['order.channel.code' => $channel->getCode()]);
}

/**
* @When I filter
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<property name="id" identifier="false" writable="false" />
<property name="number" identifier="true" writable="false" />
<property name="channel" writable="false" />
<property name="customer" writable="false" />
</resource>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<attribute name="number">
<group>order:read</group>
</attribute>
<attribute name="channel">
<group>order:read</group>
</attribute>
<attribute name="customer">
<group>order:read</group>
</attribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<service id="sylius.api.search_payment_filter" parent="api_platform.doctrine.orm.search_filter">
<argument type="collection">
<argument key="state">exact</argument>
<argument key="order.channel.code">exact</argument>
</argument>
<tag name="api_platform.filter" />
</service>
Expand Down

0 comments on commit 443b6c1

Please sign in to comment.