This week is also about UI.
I created a new button to separate the purchaseInvoice different options. One which focuses on purchaseInvoice from purchaseOrder and another from GoodsReceived.
purchaseInvoice from purchaseOrder creation is created completely in other words creating a new purchaseInvoice and GoodsReceived. However, when updating the tests created previously, the tests failed due to the supplier entity and supplierId being 0.
At first, I couldn’t understand the reason why it is zero, but with the help of my supervisor, I found out that my mistake was that I did not include the supplierId and entity nor did I map it to the purchaseInvoice.
I also created an integration test for purchase invoice from purchase order. This test is more into testing the UI of the system. Checking whether when the intended button are clicked they perform and function as required.
I was also exposed to adding relationships in the database. I mean, when I set relationships in the entities file, some relationship will get ignored or confused by the entity framework if not fixed and identified properly in the Config files. Such that relationships such as one-to-many and many-to-many need to be written in the config files, along with their foreign keys, to ensure that the relationship is properly understood by the framework.
The main purpose behind using the Linq properties Include and ThenInclude is to ensure that the wanted properties to be retrieved are not null.
Lastly, I have refactored the codes in my module, such that all event functions are placed in the Events folder instead of Parameters folder.
When using the functions in the Events folder, I was introduced to using the enum, which is a special class that groups a group of related variables together. These, variables can be separated by a comma as follows:
public enum Level () { Low, Medium, High, }
The items in enum can be later on used or retrieved by using dot operation to get access to the enum class then the item.
