Skip to content

Comments

#3887 Material Autocomplete#3977

Open
nunnyu wants to merge 15 commits intofeature/bom-improvementsfrom
#3887-Material-Autocomplete
Open

#3887 Material Autocomplete#3977
nunnyu wants to merge 15 commits intofeature/bom-improvementsfrom
#3887-Material-Autocomplete

Conversation

@nunnyu
Copy link
Contributor

@nunnyu nunnyu commented Feb 17, 2026

Changes

When you create a reimbursement request, for "Purchased Products", when you select a project, rather than it being a vague description, there is an autocomplete dropdown that contains all materials linked to that project. The other categories still just do the basic description variant with no drop down.

Screenshots

image image image

Closes #3887

@nunnyu nunnyu self-assigned this Feb 17, 2026
@nunnyu nunnyu requested a review from wavehassman February 17, 2026 03:39
@nunnyu nunnyu changed the base branch from develop to feature/bom-improvements February 17, 2026 03:46
Copy link
Contributor

@wavehassman wavehassman left a comment

Choose a reason for hiding this comment

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

Looks awesome! Just a small change

@rbessin
Copy link
Contributor

rbessin commented Feb 20, 2026

Made a quick mistake with commit name and then made it worse! The code should work however. Sorry about the confusion.

@wavehassman wavehassman requested a review from chpy04 February 20, 2026 15:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a project-specific material autocomplete to the Reimbursement Request “Purchased Items” workflow so that when a project (WBS) is selected, the product description is chosen from that project’s BOM materials.

Changes:

  • Updated reimbursement product validation copy to “Material / Description is required”.
  • Introduced a MaterialAutocomplete that fetches materials for a selected WBS element and uses it in the Purchased Items table for project-based items.
  • Kept the free-text “Product Name/Description” input for non-project (“Other Category”) items.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
src/frontend/src/pages/FinancePage/ReimbursementRequestForm/ReimbursementRequestForm.tsx Updates validation error text for reimbursement product name.
src/frontend/src/pages/FinancePage/ReimbursementRequestForm/ReimbursementProductTable.tsx Adds BOM-driven material autocomplete and switches project items from free-text to dropdown selection.

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

@rbessin rbessin review requested due to automatic review settings February 23, 2026 00:23
@rbessin
Copy link
Contributor

rbessin commented Feb 24, 2026

The reason why we were getting the bug when creating a new request but not when editing was because they have two different endpoints; create forces the body to include a materialId whereas edit allows either the name or the materialId to be passed. Since materialId was not being passed as a property when the code built the WBS reimbursement product objects, the backend ended up rejecting the requests every time when creating new reimbursement requests but not when editing them. Is it intended for the two endpoints to have different requirements? Shouldn't we enforce the edit to include a materialId? It's probably not possible to make this change since we would have to modify all existing data but I just wanted to point out this fact.

@wavehassman
Copy link
Contributor

The reason why we were getting the bug when creating a new request but not when editing was because they have two different endpoints; create forces the body to include a materialId whereas edit allows either the name or the materialId to be passed. Since materialId was not being passed as a property when the code built the WBS reimbursement product objects, the backend ended up rejecting the requests every time when creating new reimbursement requests but not when editing them. Is it intended for the two endpoints to have different requirements? Shouldn't we enforce the edit to include a materialId? It's probably not possible to make this change since we would have to modify all existing data but I just wanted to point out this fact.

Yes, the endpoints needs two different requirements because we only want reimbursement requests to be created with a materialId when it is on a project from this point forward. But, there are reimbursement requests that exist in the db that still just hold the name as a string, so we need to be able to handle both cases. You should make the create endpoint and edit endpoint work under these conditions. I have changed the schema to include materialId optionally, so you should only need to change the endpoints and potentially frontend types that I missed. For this ticket, you need to make sure the edit and view modals work for both string and material based data, but create only needs to work for material based data when creating a reimbursement request on a project.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOM Improvements] - Replace RR Product Text Input with Material Autocomplete

4 participants