Skip to content

Conversation

@logeecom
Copy link
Contributor

Changed

  • Changed logic in the shipping cost calculator to use postal code transformer for the delivery postal code before retrieving services from the Packlink API.
  • Separated country service into two services which deal with registration and warehouse countries separately. Separated country DTO into two DTOs, with base country DTO and registration country DTO, which adds additional information (registration link and platform country).
  • Modified user account service, update shipping services task, and warehouse controller to work with warehouse country service instead of country service.

$locationService = TestServiceRegister::getService(LocationService::CLASS_NAME);
$locations = $locationService->getLocations(1, 'NL', '1011AS');

$this->assertEmpty($locations);
Copy link
Contributor

Choose a reason for hiding this comment

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

why empty? should be it formatted to 1011-AS and obtain location?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because there are no drop-off locations for the selected country and postal code selection. The postal code does get transformed to the appropriate format, but the Packlink API returns an empty response for that request.

* @var array
*/
protected static $map = array(
'GB' => array(
Copy link
Contributor

Choose a reason for hiding this comment

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

Great bretain has another countries iso codes where this transformation should be applied:
ISLE_MAN = "IM"
JERSEY = "JE"
GUERNSEY = "GG"

(array would be the same that GB)

Copy link
Contributor

Choose a reason for hiding this comment

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

These ISO codes will be added to the postal code transformer.

@Moratojkd Moratojkd merged commit 0f338cb into packlink-dev:master Jan 18, 2021
kamikaziii added a commit to kamikaziii/ecommerce_module_core that referenced this pull request Dec 23, 2025
Adds killswitch pattern to prevent infinite wakeup loops when no tasks
are pending, reducing CPU usage by 90-97% on idle systems.

Changes:
- Add hasPendingTasks() method with LIMIT 1 optimization
- Modify wakeup() to check queue before scheduling next run
- Implement narrow fail-safe for query-specific exceptions
- Add comprehensive test coverage (5 unit tests)

Production validation:
- Before: 37,000 CPU seconds/day (17,280 wakeups)
- After: ~1,000 CPU seconds/day (~50 wakeups)
- Reduction: 97%

100% backward compatible - no breaking changes.

Fixes packlink-dev#57
kamikaziii added a commit to kodekrakan-commerce/packlink-integration-core that referenced this pull request Dec 24, 2025
Adds killswitch pattern to prevent infinite wakeup loops when no tasks
are pending, reducing CPU usage by 90-97% on idle systems.

Changes:
- Add hasPendingTasks() method with LIMIT 1 optimization
- Modify wakeup() to check queue before scheduling next run
- Implement narrow fail-safe for query-specific exceptions
- Add comprehensive test coverage (5 unit tests)

Production validation:
- Before: 37,000 CPU seconds/day (17,280 wakeups)
- After: ~1,000 CPU seconds/day (~50 wakeups)
- Reduction: 97%

100% backward compatible - no breaking changes.

Fixes packlink-dev#57
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.

5 participants