Skip to content

MS-250/Refactor(shippingbo): externalize processing config, improve order eligibility query and clean up ShippingboOrderServiceImpl

salaheddine zidani a demandé de fusionner feature/MS-250 vers develop

Summary

This MR refactors the Shippingbo order processing pipeline to improve configurability, correctness, and maintainability.


Changes

ShippingboOrderServiceImpl

  • Removed unused injected dependencies (EmailService, EmailTemplateConstants)
  • Removed dead code (applicationStartTime, unused imports)
  • Externalized scheduler fixedDelay via fixedDelayString to allow runtime configuration
  • Added processingEnabled flag to allow disabling the scheduler without redeployment
  • Replaced findAllByStatusAndSentToShippingboAndCreatedAtAfter with findAllByStatusAndNotSentAndCreatedAtOrRecentStatusChange to also capture orders whose status recently changed to IN_PROGRESS

OrderRepository

  • Added findAllByStatusAndNotSentAndCreatedAtOrRecentStatusChange native query — fetches orders not sent to Shippingbo where either the order was created after the threshold OR its status was updated to IN_PROGRESS after the threshold

FailedShippingboOrdersReportServiceImpl

  • No modifications — kept as reference for shared days-threshold config key

Why

The previous implementation silently excluded orders older than 7 days even if they had recently been set to IN_PROGRESS. This caused legitimate orders to never be sent to Shippingbo without any alert until the weekly report.


Testing

  • Verify scheduler fires correctly with new fixedDelayString
  • Verify processingEnabled=false properly skips execution
  • Verify orders with recent IN_PROGRESS status changes are now picked up

Related Issues

Closes MS-250

Modification effectuée par anas elhaddad

Rapports de requête de fusion