Merge the SqlRequestSettings endpoints into one domain resource - #415
Open
PrestaEdit wants to merge 4 commits into
Open
PrestaEdit wants to merge 4 commits into
PrestaEdit wants to merge 4 commits into
Conversation
PUT /sql-request-settings (SaveSqlRequestSettingsCommand) sets the SQL manager export file encoding (utf-8 / iso-8859-1) and separator. A singleton resource. The integration test updates the settings and verifies them via Configuration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The handler maps the charset to an int (utf-8 => 1, iso-8859-1 => 2), so assert the integer value. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Expose GetSqlRequestSettings as GET /sql-request-settings (scope sql_management_read): return the file encoding and separator used to export SQL request results. Related to PrestaShop/PrestaShop#39630 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Consolidates PrestaShop#280 (PUT /sql-request-settings) and PrestaShop#335 (GET /sql-request-settings) into a single SqlRequestSettings domain resource: - one resource class instead of SqlRequestSettings + SqlRequestSettingsRead, since both declared the same two properties - the PUT now replays GetSqlRequestSettings and returns the updated settings (200) instead of an empty 204, so read and write share the same URI and mapping - a single integration test covering GET, PUT, the GET of the updated settings and the rejection of an unsupported encoding, asserting the full JSON structure and building every fixture through the API alone (no Configuration:: reads, no SQL) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 20, 2026
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.
What this PR does
Merges #280 (
PUT /sql-request-settings) and #335 (GET /sql-request-settings) into one PR, then reworks the resource and the tests as a whole, following the mutualisation done on the Product domain in #410.Endpoints
/sql-request-settingsGetSqlRequestSettingssql_management_read/sql-request-settingsSaveSqlRequestSettingsCommand+GetSqlRequestSettingssql_management_writeDesign decisions
SqlRequestSettingsreplaces theSqlRequestSettings/SqlRequestSettingsReadpair from the two source PRs. Both declared the exact same two properties.PUTno longer answers an empty204. It declaresCQRSQuery: GetSqlRequestSettings::class, so the command result is replayed through the GET query and the endpoint returns the updated settings with a200.read: falseon the update since there is nothing to provide before the command runs.SqlRequestSettingsConstraintException→422mapping is kept: unlike some other settings commands,SaveSqlRequestSettingsCommandreally does validate its input, and the test covers it.Tests
SqlRequestSettingsEndpointTestreplacesSqlRequestSettingsEndpointTest+SqlRequestSettingsReadEndpointTest. It coversGET,PUT, theGETof the updated settings and the rejection of an unsupported encoding, chained with@depends:\Configuration::get(), which is gone;utf-8→1) and mapped back to its string value on read, so asserting thePUTresponse against theGETis what actually pins that round-trip;GETasserting nothing changed.How to test
Covered by
SqlRequestSettingsEndpointTest.Supersedes
Both will be closed once the CI is green here.