DGS-429 Warn on empty pickup point import and keep existing points#171
Open
TLabutis wants to merge 1 commit into
Open
DGS-429 Warn on empty pickup point import and keep existing points#171TLabutis wants to merge 1 commit into
TLabutis wants to merge 1 commit into
Conversation
When DPD returns status ok with 0 pickup points, the import now returns a warning instead of a false success and skips the destructive update so existing points are preserved. Logs a warning for traceability.
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
Improves the pickup point import so an empty DPD response no longer reports a false success and no longer wipes existing pickup points.
Why
Found while investigating SDESK-231 (account ASAPPOOD, live mode). The import call succeeds and DPD returns status
okbut with 0 pickup points. The module reported "Successfully imported 0 parcel shops" and, becauseupdateParcelsdeletes the country's shops before inserting, existing points could be wiped while the UI showed success.Verified the empty response is account-specific: the same live endpoint (integration.dpd.ee) returns 358 EE points for the DPD test account but 0 for ASAPPOOD.
Change
ParcelShopImport::importParcelShops: when DPD returns a valid response with 0 parcel shops, return a warning instead of success before the destructive update, so existing points are kept. A warning is logged for traceability.success:falsetoshowErrorMessage.Test
Ran the real
ParcelShopImportagainst stubbed API/DB:ok+ 0 shops ->success:false,updateParcelsNOT called (points kept), warning loggedok+ N shops ->success:true, import runs as beforestatus:err-> existing behavior preserved8/8 assertions passed. Next phase: QA to verify in a live/staging back office.
Changelog
Added entry under [3.3.1].
Related: SDESK-231, DGS-429