Skip to content

feature/OBPIH-6516 Infer lot number based on provided bin location#4812

Merged
awalkowiak merged 1 commit intofeature/outbound-importfrom
feature/OBPIH-6516-inferring-lot-in-packing-list-import-for-full-outbound
Aug 30, 2024
Merged

feature/OBPIH-6516 Infer lot number based on provided bin location#4812
awalkowiak merged 1 commit intofeature/outbound-importfrom
feature/OBPIH-6516-inferring-lot-in-packing-list-import-for-full-outbound

Conversation

@drodzewicz
Copy link
Collaborator

@drodzewicz drodzewicz commented Aug 30, 2024

✨ Description of Change

A concise summary of what is being changed. Please provide enough context for reviewers to be able to understand the change and why it is necessary. If the issue/ticket already provides enough information, you can put "See ticket" as the description.

Link to GitHub issue or Jira ticket: OBPIH-6513

Description:

Added an ability to handle a case where user does not provide a lot number.
If provided binLocation has only one inventoryItem then we infer it since this is the only possible choice a user can make.


📷 Screenshots & Recordings (optional)

If this PR contains a UI change, consider adding one or more screenshots here or link to a screen recording to help reviewers visualize the change. Otherwise, you can remove this section.


📈 Test Plan

We require that all code changes come paired with a method of testing them. Please select which of the following testing approaches you've included with this change:

  • Frontend automation tests (unit)
  • Backend automation tests (unit, API, smoke)
  • End-to-end tests (Playwright)
  • Manual tests (please describe below)
  • Not Applicable

Description of test plan (if applicable):


✅ Quality Checks

Please confirm and check each of the following to ensure that your change conforms to the coding standards of the project:

  • The pull request title is prefixed with the issue/ticket number (Ex: [OBS-123] for Jira, [#0000] for GitHub, or [OBS-123, OBPIH-123] if there are multiple), or with [N/A] if not applicable
  • The pull request description has enough information for someone without context to be able to understand the change and why it is needed
  • The change has tests that prove the issue is fixed / the feature works as intended

@drodzewicz drodzewicz self-assigned this Aug 30, 2024
@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 Aug 30, 2024
Comment on lines +26 to +43
@BindUsing({ obj, source ->
// set provided lot number
if (source['lotNumber']) {
return source['lotNumber']
}

// otherwise infer inventory item based on provided bin-location
Location internalLocation = Location.findByNameAndParentLocation(source['binLocation'], obj.origin)
Product product = Product.findByProductCode(source['product'])
List<ProductAvailability> items = ProductAvailability.findAllByProductAndBinLocation(product, internalLocation)

// infer lot-number only if there is a single possible inventory
if (items.size() == 1) {
return items.first().lotNumber
}

return null
})
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's worth moving to a separate method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are many more larger binder methods and we will tackle this issue later in a separate tech-debt ticket

@awalkowiak awalkowiak merged commit 6cbb9d7 into feature/outbound-import Aug 30, 2024
@awalkowiak awalkowiak deleted the feature/OBPIH-6516-inferring-lot-in-packing-list-import-for-full-outbound branch August 30, 2024 15:42
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.

3 participants