MS-250/Refactor(shippingbo): externalize processing config, improve order eligibility query and clean up ShippingboOrderServiceImpl
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
fixedDelayviafixedDelayStringto allow runtime configuration - Added
processingEnabledflag to allow disabling the scheduler without redeployment - Replaced
findAllByStatusAndSentToShippingboAndCreatedAtAfterwithfindAllByStatusAndNotSentAndCreatedAtOrRecentStatusChangeto also capture orders whose status recently changed toIN_PROGRESS
OrderRepository
- Added
findAllByStatusAndNotSentAndCreatedAtOrRecentStatusChangenative query — fetches orders not sent to Shippingbo where either the order was created after the threshold OR its status was updated toIN_PROGRESSafter the threshold
FailedShippingboOrdersReportServiceImpl
- No modifications — kept as reference for shared
days-thresholdconfig 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=falseproperly skips execution -
Verify orders with recent IN_PROGRESSstatus changes are now picked up
Related Issues
Closes MS-250