Skip to content

OBPIH-7032 Complete count after count with no discrepancy or after recount#5109

Merged
ewaterman merged 4 commits intodevelopfrom
ft/OBPIH-7032/cycle-count-no-approval
Mar 12, 2025
Merged

OBPIH-7032 Complete count after count with no discrepancy or after recount#5109
ewaterman merged 4 commits intodevelopfrom
ft/OBPIH-7032/cycle-count-no-approval

Conversation

@ewaterman
Copy link
Member

✨ Description of Change

Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-7032

Description: We're implementing the review and approval flows in 0.9.5 so this is a simple refactor to move the count straight to the COMPLETED state after a count is submitted with no discrepancies or after a recount is submitted (with or without discrepancies).

Please merge this after #5092. It fixes a bug in the product availability flow that this change uses.


📷 Screenshots & Recordings (optional)

https://jam.dev/c/1eb79d37-3ef4-4e77-bae7-9ebbbb9cb424

(There are two product inventories because I tested the same product twice.)

@ewaterman ewaterman self-assigned this Mar 10, 2025
@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 labels Mar 10, 2025
@codecov
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 8.13%. Comparing base (f94fb86) to head (ebfc1a8).
Report is 174 commits behind head on develop.

Files with missing lines Patch % Lines
...g/pih/warehouse/inventory/CycleCountService.groovy 0.00% 11 Missing ⚠️
...main/org/pih/warehouse/inventory/CycleCount.groovy 0.00% 2 Missing ⚠️
...rg/pih/warehouse/inventory/CycleCountStatus.groovy 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5109      +/-   ##
============================================
+ Coverage       8.09%   8.13%   +0.03%     
- Complexity       934     942       +8     
============================================
  Files            636     636              
  Lines          43086   43098      +12     
  Branches       10477   10478       +1     
============================================
+ Hits            3488    3505      +17     
+ Misses         39057   39050       -7     
- Partials         541     543       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@awalkowiak awalkowiak requested a review from alannadolny March 11, 2025 09:50
Copy link
Collaborator

@awalkowiak awalkowiak left a comment

Choose a reason for hiding this comment

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

overall looks ok, but I have a minor question


// The count completed successfully so update the request status to match and commit the adjustments.
cycleCount.cycleCountRequest.status = CycleCountRequestStatus.COMPLETED
cycleCountTransactionService.createTransactions(cycleCount, refreshQuantityOnHand)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it not be better to create a transaction and close afterward?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure I can flip these but this whole call is wrapped in a @Transactional so ultimately the order shouldn't matter much. If it fails at any point the whole thing should get rolled back

@ewaterman
Copy link
Member Author

I'm merging this as the only real change I made was addressing the one comment

@ewaterman ewaterman merged commit 502037d into develop Mar 12, 2025
9 checks passed
@ewaterman ewaterman deleted the ft/OBPIH-7032/cycle-count-no-approval branch March 12, 2025 01:11
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 type: feature A new piece of functionality for the app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants