mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
[API] Implement filtering payments by channel feature
This commit is contained in:
parent
559744a9b1
commit
5886d23f94
5 changed files with 15 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -69,6 +69,14 @@ final class ManagingPaymentsContext implements Context
|
|||
$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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue