Skip to content

Add carrier toggle endpoints#148

Open
luigimassa wants to merge 11 commits into
PrestaShop:devfrom
bwlab:add-carrier-toggle-endpoints
Open

Add carrier toggle endpoints#148
luigimassa wants to merge 11 commits into
PrestaShop:devfrom
bwlab:add-carrier-toggle-endpoints

Conversation

@luigimassa
Copy link
Copy Markdown

Questions Answers
Description? Added two new PUT endpoints to toggle carrier status and isFree flag: PUT /carriers/{carrierId}/toggle-status (maps to ToggleCarrierStatusCommand) and PUT /carriers/{carrierId}/toggle-is-free (maps to ToggleCarrierIsFreeCommand). Both endpoints return 204 No Content, require scope carrier_write, and return 404 if the carrier does not exist. Integration tests added for both endpoints.
Type? new feature
BC breaks? no
Deprecations? no
Fixed ticket? N/A
Sponsor company bwlab (luigi massa)
How to test? 1. Authenticate with scope carrier_write and carrier_read. 2. PUT /api/carriers/{id}/toggle-status → expect 204; call GET /api/carriers/{id} and verify active has been toggled. 3. PUT /api/carriers/{id}/toggle-is-free → expect 204; call GET /api/carriers/{id} and verify isFree has been toggled. 4. Call either endpoint with a non-existent carrier ID → expect 404. 5. Call either endpoint without carrier_write scope → expect 401/403. Run integration tests: vendor/bin/phpunit tests/Integration/ApiPlatform/CarrierEndpointTest.php

luigimassa and others added 11 commits March 5, 2026 17:20
| Questions     | Answers
| ------------- | -------------------------------------------
| Description?  | Add GetRequiredFieldsForAddress CQRS endpoint
| Type?         | new feature
| BC breaks?    | no
| Deprecations? | no
| Fixed ticket? | N/A
| Sponsor company | @PrestaShopCorp
| How to test?  | Ask a dev
Expose ToggleCarrierStatusCommand and ToggleCarrierIsFreeCommand via
PUT /carriers/{carrierId}/toggle-status and
PUT /carriers/{carrierId}/toggle-is-free endpoints with carrier_write scope.
Add integration tests for both toggle endpoints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ps-jarvis
Copy link
Copy Markdown

Hello @luigimassa!

This is your first pull request on ps_apiresources repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

Copy link
Copy Markdown
Contributor

@tleon tleon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant to split you commit but something went wrong.
I guess all my comments in #160 (review) are applicable in this PR also ?

@nicosomb
Copy link
Copy Markdown
Contributor

nicosomb commented May 7, 2026

@luigimassa the CI is red, could you have a look please?

@ps-jarvis ps-jarvis moved this from Ready for review to Waiting for author in PR Dashboard May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting for author

Development

Successfully merging this pull request may close these issues.

5 participants