mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[API] Configure Promotion Archiving and Restoring endpoints
This commit is contained in:
parent
a321c7281a
commit
30b62ca104
2 changed files with 70 additions and 31 deletions
|
|
@ -30,6 +30,76 @@
|
|||
</normalizationContext>
|
||||
</operation>
|
||||
|
||||
<operation
|
||||
class="ApiPlatform\Metadata\Patch"
|
||||
uriTemplate="/admin/promotions/{code}/archive"
|
||||
input="false"
|
||||
controller="Sylius\Bundle\ApiBundle\Applicator\ArchivingPromotionApplicatorInterface::archive"
|
||||
>
|
||||
<validationContext>
|
||||
<values>
|
||||
<value name="groups">
|
||||
<values>
|
||||
<value>sylius</value>
|
||||
<value>sylius_api</value>
|
||||
</values>
|
||||
</value>
|
||||
</values>
|
||||
</validationContext>
|
||||
|
||||
<openapiContext>
|
||||
<values>
|
||||
<value name="summary">Archives Promotion.</value>
|
||||
</values>
|
||||
</openapiContext>
|
||||
|
||||
<normalizationContext>
|
||||
<values>
|
||||
<value name="groups">
|
||||
<values>
|
||||
<value>sylius:admin:promotion:show</value>
|
||||
</values>
|
||||
</value>
|
||||
<value name="skip_null_values">true</value>
|
||||
</values>
|
||||
</normalizationContext>
|
||||
</operation>
|
||||
|
||||
<operation
|
||||
class="ApiPlatform\Metadata\Patch"
|
||||
uriTemplate="/admin/promotions/{code}/restore"
|
||||
input="false"
|
||||
controller="Sylius\Bundle\ApiBundle\Applicator\ArchivingPromotionApplicatorInterface::restore"
|
||||
>
|
||||
<validationContext>
|
||||
<values>
|
||||
<value name="groups">
|
||||
<values>
|
||||
<value>sylius</value>
|
||||
<value>sylius_api</value>
|
||||
</values>
|
||||
</value>
|
||||
</values>
|
||||
</validationContext>
|
||||
|
||||
<openapiContext>
|
||||
<values>
|
||||
<value name="summary">Restores Archived Promotion.</value>
|
||||
</values>
|
||||
</openapiContext>
|
||||
|
||||
<normalizationContext>
|
||||
<values>
|
||||
<value name="groups">
|
||||
<values>
|
||||
<value>sylius:admin:promotion:show</value>
|
||||
</values>
|
||||
</value>
|
||||
<value name="skip_null_values">true</value>
|
||||
</values>
|
||||
</normalizationContext>
|
||||
</operation>
|
||||
|
||||
<operation
|
||||
class="ApiPlatform\Metadata\Delete"
|
||||
uriTemplate="/admin/promotions/{code}"
|
||||
|
|
|
|||
|
|
@ -142,37 +142,6 @@ Example configuration for `order_fixed_discount` action type:
|
|||
</attribute>
|
||||
</attribute>
|
||||
</itemOperation>
|
||||
|
||||
<itemOperation name="admin_archive">
|
||||
<attribute name="method">PATCH</attribute>
|
||||
<attribute name="path">/promotions/{code}/archive</attribute>
|
||||
<attribute name="input">false</attribute>
|
||||
<attribute name="controller">Sylius\Bundle\ApiBundle\Applicator\ArchivingPromotionApplicatorInterface::archive</attribute>
|
||||
<attribute name="openapi_context">
|
||||
<attribute name="summary">Archives Promotion.</attribute>
|
||||
</attribute>
|
||||
<attribute name="normalization_context">
|
||||
<attribute name="groups">
|
||||
<attribute>admin:promotion:read</attribute>
|
||||
<attribute>sylius:admin:promotion:read</attribute>
|
||||
</attribute>
|
||||
</attribute>
|
||||
</itemOperation>
|
||||
<itemOperation name="admin_restore">
|
||||
<attribute name="method">PATCH</attribute>
|
||||
<attribute name="path">/promotions/{code}/restore</attribute>
|
||||
<attribute name="input">false</attribute>
|
||||
<attribute name="controller">Sylius\Bundle\ApiBundle\Applicator\ArchivingPromotionApplicatorInterface::restore</attribute>
|
||||
<attribute name="openapi_context">
|
||||
<attribute name="summary">Restores Archived Promotion.</attribute>
|
||||
</attribute>
|
||||
<attribute name="normalization_context">
|
||||
<attribute name="groups">
|
||||
<attribute>admin:promotion:read</attribute>
|
||||
<attribute>sylius:admin:promotion:read</attribute>
|
||||
</attribute>
|
||||
</attribute>
|
||||
</itemOperation>
|
||||
</itemOperations>
|
||||
|
||||
<subresourceOperations>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue