For this week, I was able to implement the logic of calculating the original quantities for history and proceeded to implement logic for previous histories quantities calculation.
Started off by running an SQL script to include additional columns. Updated the overridden AddAsync method to populate the additional fields in a history according to business rule. Made use of edge cases to test the logic in the repository, some bugs were discovered that prevented the detection of previous locations for both the source and the destination, and fixed it.
Moreover, I was struggling to understand how to test the repository’s create logic because I was currently using the UI to test the logic, which is not a good method. Mr. Peter was able to clarify this for me. Created HistoryRespositoryTests and added testcases to test the repository logic through various conditions and edge cases. Furthermore, discussed the importance of populating existing history data quantities.
Lastly, I realized I had hardcoded the disable property in barcode, so I converted it to a boolean property and binded it to the IsEnabled property. Moved onto a new task to populate previous history quantities. Added a button to the UI which on interaction will retrieve all histories and populate their original quantities. I was able to successfully retrieve all histories from the database and display them in the UI.
