Skip to content
Merged
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
6 changes: 3 additions & 3 deletions 0023-cqrs-api-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ To allow knowing the association between languages and language IDs a `/language

### HTTP methods


Read operations use **GET** method and should use `PrestaShopBundle\ApiPlatform\Metadata\CQRSGet`<br />
Creation operations use **POST** method (without ID specified) and should use `PrestaShopBundle\ApiPlatform\Metadata\CQRSCreate`<br />
Full update operations use **PUT** method (ex: PUT `/products/{productId}`) and should use `PrestaShopBundle\ApiPlatform\Metadata\CQRSUpdate`<br />
Partial update operations use **PATCH** method (ex: PATCH `/products/{productId}`) and should use `PrestaShopBundle\ApiPlatform\Metadata\CQRSPartialUpdate`<br />
Delete operations use **DELETE** method (ex: DELETE `/products/{productId}`) and should use `PrestaShopBundle\ApiPlatform\Metadata\CQRSDelete`
Delete operations use **DELETE** method (ex: DELETE `/products/{productId}`) and should use `PrestaShopBundle\ApiPlatform\Metadata\CQRSDelete`<br />
Duplicate operations use **POST** method with ID specified (ex: POST `/products/{productId}/duplicate`) and should use `PrestaShopBundle\ApiPlatform\Metadata\CQRSCreate`

### Custom operations

To simplify the integration of our custom CQRS based implementation some custom operations were developed, they must be used in the core endpoints to remain consistent.

- `PrestaShopBundle\ApiPlatform\Metadata\CQRSGet` for read operations on a single resource
- `PrestaShopBundle\ApiPlatform\Metadata\CQRSGetCollection` for read operations on a list of resources (not paginated)
- `PrestaShopBundle\ApiPlatform\Metadata\CQRSCreate` for creation operations
- `PrestaShopBundle\ApiPlatform\Metadata\CQRSCreate` for creation and duplication operations
- `PrestaShopBundle\ApiPlatform\Metadata\CQRSUpdate` for full update operations
- `PrestaShopBundle\ApiPlatform\Metadata\CQRSPartialUpdate` for partial update operations
- `PrestaShopBundle\ApiPlatform\Metadata\CQRSDelete` for delete operations
Expand Down