#Java/Spring Project Help

1 messages · Page 1 of 1 (latest)

reef osprey
#

Hey Everyone,

I am hoping someone can help me figure out the issue with my project I am working on.
It is making a Spring application with Java backend to track inventory in a store.
I have majority running already but having issues with this part:

Incorporate Validations when between min & max that include the following

  • give error message of low inventory when adding/updating parts if the inventory goes under the min (DONE)
  • Give error message when adding/updating parts if the inventory goes over the max (DONE)
  • give error message for low inventory when adding and updating products that lowers associated parts below their min

The 3rd point is where I am struggling. I confirmed the parts & products are associated in the database. I lower all parts to their mins, in order to prepare an error when adjusting products, then try to "Buy Now" & "Update" on the products that have parts associated to them and it never gets caught to give the error message/deny the change. It allows the transaction/update and adjusts the product's inventory level, which neither should happen if any of the associated parts are at their min (they all are at min for my tests).

Been troubleshooting and debugging for days, feels like I am in an endless loop and can't figure it out. Would TRULY appreciate some help.Thanks in advance

willow mortarBOT
#

<@&1004656351647117403> please have a look, thanks.

outer crown
#

I think also if you were to show us some snippets of the area of code we're discussing it may help. Also maybe some understanding of your tech being used. You say you're using spring, how are you storing the data?

#

I think these questions may help you get a answer because the initial message may not have enough detail

reef osprey
# outer crown Trying to understand this question still. So you have an inventory and when a us...

Yeah I understand, I tried to give what I could without making the post too long. Im working on IntelliJ IDEA, H2 database, and the project only only has to work locally. It is not for an official store, just a project. The project is for a java frameworks course and instructions are very vague, and it is interpreted so many ways by everyone, so please bear with me. The official instructions say: "Display error messages when adding and updating parts if the inventory is greater than the maximum."
Here is another explanation I found on this section from someone who successfully did it:

"Part inventory that has been added to a product should be decremented when you increase Product quantity through the Update Product function.

To use an example from my project:

Santa Cruz classic board product has the following associated parts:
classic dot deck
classic truck
Bones wheel

If I want to build a Santa Cruz classic board to sell, I need my inventory management tool to check to make sure I've got enough of the right parts in stock: 1 deck, 1 truck, and 1 wheel. It should yell at me via validation message if I've let my supplies run out."

I have this across multiple files on the project (buyNow, part/product association, updateProductInventory, etc) so a snippet would be a little harder to include it all, but I feel like I may be overthinking it. Would appreciate any thoughts you may have.

#

if theres anything else I can provide to help you help me, lmk lol

pure knoll
#

u can link the git page of your project, there is no need to disect it to pieces. Also would let people reproduce it if needed

reef osprey
pure knoll
#

il'l have a look later. Squashing bugs atm ( helldivers 2 😉 )

reef osprey
reef osprey
pure knoll
#

pc

runic mangoBOT
#

Music queue cleared

reef osprey
# pure knoll pc

I need to hop on that game, im very behind by not playing it lol

#

when you get the chance to look at my code, can you review the instructions on readme first, I have a feeling i am trying to code it to do too much. ie coding to check associated parts for Buy Now but should only be when you update the product

reef osprey
#

changed back to private for now, hopefully didnt interupt anything. I am making some changes myself