Skip to content

OBPIH-7307 To Count and To Resolve products visible and disabled on All Products tab#5278

Merged
awalkowiak merged 6 commits intodevelopfrom
OBPIH-7307
May 28, 2025
Merged

OBPIH-7307 To Count and To Resolve products visible and disabled on All Products tab#5278
awalkowiak merged 6 commits intodevelopfrom
OBPIH-7307

Conversation

@SebastianLib
Copy link
Collaborator

✨ Description of Change

Link to GitHub issue or Jira ticket:

Description:


📷 Screenshots & Recordings (optional)

@github-actions github-actions bot added domain: frontend Changes or discussions relating to the frontend UI domain: backend Changes or discussions relating to the backend server domain: l10n Changes or discussions relating to localization & Internationalization labels May 26, 2025

// Products from the "To Count" and "To Resolve" tabs can have negative quantity,
// so we want to include them in the results.
if (command.includeNullStatus) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't really like the name of this boolean, I'm still wondering what to change it to

@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.37%. Comparing base (de2c842) to head (c7e686b).
⚠️ Report is 134 commits behind head on develop.

Files with missing lines Patch % Lines
...g/pih/warehouse/inventory/CycleCountService.groovy 0.00% 10 Missing ⚠️
.../inventory/CycleCountCandidateFilterCommand.groovy 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5278      +/-   ##
============================================
+ Coverage       8.32%   8.37%   +0.05%     
- Complexity       976     996      +20     
============================================
  Files            642     646       +4     
  Lines          43311   43406      +95     
  Branches       10523   10537      +14     
============================================
+ Hits            3604    3637      +33     
- Misses         39156   39204      +48     
- Partials         551     565      +14     

☔ 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.

or {
if (command.statuses) {
inList("status", command.statuses)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

in the code above when checking statuses, you say that if showCountAndResolveProducts, then show cycle counts with null status. Here you do something opposite. Could you explain the reason for double checking statuses here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to include all products that have statuses listed in command.statuses regardless of includeStockOnHandOrNegativeStock. For the rest, we filter (with statuses null) by hasStockOnHandOrNegativeStock, thanks to this the backend returns good results to me. am I right? Can i do it better?

if (command.statuses) {
inList("status", command.statuses)
}
and {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the purpose of that and if you have only one statement inside?

CycleCountCandidateStatus.COUNTED,
CycleCountCandidateStatus.INVESTIGATING,
],
showCountAndResolveProducts: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

btw I think something like showCycleCountsInProgress would sound better than "countAndResolve", since we might have also the approve step in the future and this would have to be changed if the cycle counts at the approval step should also be a part of that statement.

if (
status === CycleCountCandidateStatus.CREATED
|| status === CycleCountCandidateStatus.REQUESTED
|| status === CycleCountCandidateStatus.COUNTING
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe it'd be a good idea to create some simple util methods to say "isInProgress", "isCounting" etc.

@SebastianLib SebastianLib requested a review from kchelstowski May 27, 2025 08:24
// but we want to include them in the results
if (command.showCycleCountsInProgress) {
or {
inList("status", command.statuses)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is unnecessary - this is handled in lines 81-86. I think you need only eq here. I might be wrong so please confirm if I'm right, but for me it looks like we write inList("status"....) twice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

without this not all results from count and resolve are returned. example:
image
image

@SebastianLib SebastianLib requested a review from kchelstowski May 27, 2025 11:01
@awalkowiak awalkowiak merged commit a7a7aa8 into develop May 28, 2025
8 checks passed
@awalkowiak awalkowiak deleted the OBPIH-7307 branch May 28, 2025 08:48
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 domain: frontend Changes or discussions relating to the frontend UI domain: l10n Changes or discussions relating to localization & Internationalization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants