Last Week!

16 weeks have passed since I’ve first written my first blog.

Throughout the 4 months, I’ve learnt a lot. I started with zero knowledge about MVVM and TDD, but after 16 weeks I can proudly say that I’ve at least understood the basic concepts of how they work.

For the last week, I implemented the logic of displaying a dialogue box when a PurchaseInvoice cannot be created due to an invoice previously created for the GoodsReceived.

When trying to navigate through different pages in the codes, event aggregators are used, because we have changed the way the module is used to be tabs, hence, we need to specify the exact tab that we want to be navigated to when we press a button or a call function.

I have also fixed few functions that I realised where not working well by checking the tests written for the last time.

Lastly, I would like to thank Tong Hin for giving me the opportunity to conduct my internship with them, especially my supervisor Mr. Peter, for having the patience with me, guiding and instructing me throughout my training.

I would like to thank everyone who has worked and ensured that my time at Tong Hin was smooth and memorable.

Thank you once again.

Integration and checking of errors

For the past week I have worked on integration tests as well as checking the creation of modules for errors.

The checking involved checking whether a Tax, Supplier, PurchaseOrder, GoodsReceived and PurchaseInvoice can be created successfully without any errors, as well as checking the content inserted into the views.

When using tab navigation, the tests created will not be able to mock the NavigationContext, which will always lead the test being run to use the default value instead of navigating to the wanted and requested view of PurchaseInvoice, either from PurchaseOrder or GoodsReceived. Hence, to solve this problem another method is creating which includes parameters that carry the designated values, which will then be called from the method which includes the NavigationContext.

Next, when adding LineItems using the Add button in PurchaseInvoice from GoodsReceived, only 1 line item is updated and the errors lied because I did not map the LineItemId.

Lastly, I started working on displaying a dialogue box when a PurchaseInvoice already exists. The test has been created with the help of my supervisor.

See you all on my last blog Next week 🙂

Navigation Concept and More of Errors Solving

Since I have completed the PurchaseInvoice module, I needed to fix errors that are present and check the codes again.

Firstly, I started by checking the property isAllPurchaseInvoiceReceived, by checking from the UI to see if the property gets flagged when all invoices are received, and hence after checking, I had to change the logical property of quantity to ensure that if a quantity more than ordered is received the property, then it will not be flagged or be true in its boolean expression.

Next, another error which was found is that when a user creates a GoodsReceive and PurchaseInvoice from PurchaseOrder, the GoodsReceive can afterwards be used when creating a PurchaseInvoice from GoodsReceive, which will result in having an Invoice with the same quantity number received but different cost which is a conflict. To solve the error, the relationship between GoodsReceive and PurchaseInvoice was adjusted by using the EF Core concept of relationships One-to-One by defining the relationship in the config file.

I have also pulled codes from Git and adjusted few parts, that resulted in the project to be using tabs navigation concept instead of dialogues. Such that a user, can have multiple tabs opened at the same time and each is independent on the other. At the same time, this current navigation is more user friendly.

WPF allows the concept of using a ViewModel without getting access to its View. In other words, it loads the codes and knowledge from a ViewModel without taking the view into consideration.

Another information I learnt from GitHub was when pulling if we are not present in the designated branch then we won’t be able to see the changes that have been to the codes. As pulling without being in the branch does not grant us access to the changes made.

See you all next week 🙂