Add carrier toggle endpoints#148
Open
luigimassa wants to merge 11 commits into
Open
Conversation
| 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>
|
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! |
tleon
requested changes
Mar 23, 2026
Contributor
tleon
left a comment
There was a problem hiding this comment.
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 ?
Contributor
|
@luigimassa the CI is red, could you have a look please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PUT /carriers/{carrierId}/toggle-status(maps toToggleCarrierStatusCommand) andPUT /carriers/{carrierId}/toggle-is-free(maps toToggleCarrierIsFreeCommand). Both endpoints return 204 No Content, require scopecarrier_write, and return 404 if the carrier does not exist. Integration tests added for both endpoints.carrier_writeandcarrier_read. 2.PUT /api/carriers/{id}/toggle-status→ expect 204; callGET /api/carriers/{id}and verifyactivehas been toggled. 3.PUT /api/carriers/{id}/toggle-is-free→ expect 204; callGET /api/carriers/{id}and verifyisFreehas been toggled. 4. Call either endpoint with a non-existent carrier ID → expect 404. 5. Call either endpoint withoutcarrier_writescope → expect 401/403. Run integration tests:vendor/bin/phpunit tests/Integration/ApiPlatform/CarrierEndpointTest.php