OBLS-450 Publish CycleCountCompletedEvent by awalkowiak · Pull Request #6008 · openboxes/openboxes · GitHub
Skip to content

OBLS-450 Publish CycleCountCompletedEvent#6008

Open
awalkowiak wants to merge 3 commits into
feature/obaf-integrationfrom
feat/OBLS-450
Open

OBLS-450 Publish CycleCountCompletedEvent#6008
awalkowiak wants to merge 3 commits into
feature/obaf-integrationfrom
feat/OBLS-450

Conversation

@awalkowiak

Copy link
Copy Markdown
Contributor

I added a few things here besides the CycleCountCompletedEvent. I separated this into 3 commits:

  1. Adding @EnableAsync so we don't have to rely on jobs to run tasks asynchronously
  2. CycleCountCompletedEvent and CycleCountCompletedEventService
  3. Refactor InventoryAdjustmentEvent into TransactionEventCreated

This is ready for review, but I am marking this as do not merge, because I am still testing the last commit.

@awalkowiak awalkowiak added warn: do not merge Marks a pull request that is not yet ready to be merged status: ready for review Flags that a pull request is ready to be reviewed labels Jul 1, 2026
@github-actions github-actions Bot added type: feature A new piece of functionality for the app domain: backend Changes or discussions relating to the backend server flag: config change Hilights a pull request that contains a change to the app config stakeholder: vvg Issues or topics relating to VVG (velocity vehicle group) labels Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces Spring async support and refactors inventory/cycle-count webhook publishing from Quartz jobs + InventoryAdjustmentEvent toward async transactional application events (TransactionCreatedEvent, CycleCountCompletedEvent).

Changes:

  • Enable Spring @Async globally and register a configurable taskExecutor.
  • Add CycleCountCompletedEvent + listener service to publish cycle count completion webhooks.
  • Replace InventoryAdjustmentEvent/Quartz job flow with TransactionCreatedEvent + listener for adjustment webhooks.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/groovy/org/pih/warehouse/core/TransactionCreatedEvent.groovy Adds a new Spring ApplicationEvent for created transactions.
src/main/groovy/org/pih/warehouse/core/InventoryAdjustmentEvent.groovy Removes the legacy inventory adjustment event class.
src/main/groovy/org/pih/warehouse/core/CycleCountCompletedEvent.groovy Adds a new Spring ApplicationEvent for completed cycle counts.
grails-app/services/org/pih/warehouse/inventory/InventoryService.groovy Removes publishing of the legacy InventoryAdjustmentEvent.
grails-app/services/org/pih/warehouse/inventory/CycleCountService.groovy Publishes CycleCountCompletedEvent when closing counts; adds helper to fetch cycle-count transactions.
grails-app/services/org/pih/warehouse/importer/InventoryImportDataService.groovy Removes publishing of the legacy InventoryAdjustmentEvent after import adjustments.
grails-app/services/org/pih/warehouse/core/WebhookPublisherService.groovy Refactors inventory adjustment webhook payload generation; adjusts cycle count webhook payload semantics.
grails-app/services/org/pih/warehouse/core/TransactionCreatedEventService.groovy New async transactional listener to publish adjustment webhooks for qualifying transactions.
grails-app/services/org/pih/warehouse/core/InventoryAdjustmentEventService.groovy Removes legacy listener that triggered Quartz jobs per product.
grails-app/services/org/pih/warehouse/core/CycleCountCompletedEventService.groovy New async transactional listener to publish cycle count completed webhooks per product.
grails-app/jobs/org/pih/warehouse/jobs/PublishInventoryAdjustmentEventJob.groovy Removes Quartz job used to publish inventory adjustment webhook notifications.
grails-app/init/org/pih/warehouse/Application.groovy Enables Spring async processing via @EnableAsync.
grails-app/domain/org/pih/warehouse/inventory/Transaction.groovy Adds publishTransactionCreatedEvent() helper (but currently not invoked).
grails-app/controllers/org/pih/warehouse/inventory/InventoryController.groovy Removes publishing of the legacy InventoryAdjustmentEvent.
grails-app/conf/spring/resources.groovy Registers a named taskExecutor (ThreadPoolTaskExecutor) and wires config properties.
grails-app/conf/application.yml Adds async executor config defaults; removes config for the deleted Quartz job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread grails-app/domain/org/pih/warehouse/inventory/Transaction.groovy
Comment thread grails-app/services/org/pih/warehouse/core/TransactionCreatedEventService.groovy Outdated
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.32653% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.38%. Comparing base (5f61d78) to head (0b8e891).
⚠️ Report is 19 commits behind head on feature/obaf-integration.

Files with missing lines Patch % Lines
.../pih/warehouse/core/WebhookPublisherService.groovy 4.87% 36 Missing and 3 partials ⚠️
...ehouse/core/CycleCountCompletedEventService.groovy 0.00% 19 Missing ⚠️
...rehouse/core/TransactionCreatedEventService.groovy 47.61% 5 Missing and 6 partials ⚠️
...g/pih/warehouse/inventory/CycleCountService.groovy 0.00% 10 Missing ⚠️
...pih/warehouse/core/CycleCountCompletedEvent.groovy 0.00% 2 Missing ⚠️
...ain/org/pih/warehouse/inventory/Transaction.groovy 66.66% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##             feature/obaf-integration    #6008      +/-   ##
==============================================================
- Coverage                       10.43%   10.38%   -0.05%     
+ Complexity                       1711     1701      -10     
==============================================================
  Files                             901      917      +16     
  Lines                           51619    52201     +582     
  Branches                        12239    12373     +134     
==============================================================
+ Hits                             5384     5423      +39     
- Misses                          45379    45909     +530     
- Partials                          856      869      +13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server flag: config change Hilights a pull request that contains a change to the app config stakeholder: vvg Issues or topics relating to VVG (velocity vehicle group) status: ready for review Flags that a pull request is ready to be reviewed type: feature A new piece of functionality for the app warn: do not merge Marks a pull request that is not yet ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants