Skip to content

DGS-429 Warn on empty pickup point import and keep existing points#171

Open
TLabutis wants to merge 1 commit into
DPDBaltics:release-3.3.1from
TLabutis:DGS-429-pickup-import-empty-warning
Open

DGS-429 Warn on empty pickup point import and keep existing points#171
TLabutis wants to merge 1 commit into
DPDBaltics:release-3.3.1from
TLabutis:DGS-429-pickup-import-empty-warning

Conversation

@TLabutis

@TLabutis TLabutis commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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 ok but with 0 pickup points. The module reported "Successfully imported 0 parcel shops" and, because updateParcels deletes 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.

  • No frontend change: the existing JS already routes success:false to showErrorMessage.

Test

Ran the real ParcelShopImport against stubbed API/DB:

  • ok + 0 shops -> success:false, updateParcels NOT called (points kept), warning logged
  • ok + N shops -> success:true, import runs as before
  • status:err -> existing behavior preserved

8/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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant