Sherelle-S / Sherelle-s

0 stars 0 forks source link

create the api #2

Open Sherelle-S opened 1 year ago

Sherelle-S commented 1 year ago

Issues faced:

when generating the watchlist model i needed to find a way to generate a unique id for each item which meant creating a UUID for each item, i appended it to the time it was created to make sure the UUIDs were unique.

issues arose when testing to see that two items with the same stockName that were generated at the same time generated the same UUID and would therefore fail the test. This meant adding a hashMap to the watchlist which took in the item stockName and a default value and creating a method to create the stock name. This now means that every time a stockName is added a number is also attached, each time the number is attached it increments the number attached to the stockName. This means that two items with exactly the same stockName will have different UUIDs generated because we would have added a unique number to the stockName when it generates the UUID for each watchlist item.