Internship (Week 9): Enhance transfer order processes

Starting for this week, I continue doing the transfer order tasks. After the discussion with Mr. Peter last week, there are several commands needed for transfer orders, transfer delivery orders and transfer receive. So, I start to create the necessary commands and update the transfer order services and controllers. Meanwhile, I also create some empty file folder for all transfer repositories and services. These files are just as a reminder for future me while priortizing the transfer order tasks. After that, I spend time familiarising myself with the existing System again to ensure that the retail functionalities align with the system. I then perform a git pull to fetch the additional item file given to review the file changes. Meanwhile, I add the necessary migrations to update the database but I encounter some issues when updating. I try to truncate the affected table and restart the identity and the database updates are build succeed. Next, I also try to understand the new tables along with the item repositories and services.

Moreover, I continue working on the cancel commands. The cancel command are somewhat complex due to their relationship with the commands. I spend time on analysing the problem, trying various solutions and eventually I succeed in maintaining the relationship. Additionally, I update the create commands to validate input for prevent same item barcodes are being input. Afterward, I update the functionality to ensure proper interaction with the database, I plan to finalise it this week. Similarly, I also work on the undo commands by updating their logic and testing their flow. Once these updates were successful, I move on to the other service. This task also particularly challenging because it also required interaction with the database. I also plan to complete the necessary database-related work for command by this week.

Besides that, I continue on refining and updating the logic for the transfer order services. I then return to the service and add extra collections such as along with their respective repositories, commands, controllers and services. So, when every command API call related would create details in the collection, while undoing command would remove those details. However, after discussing this approach with Mr. Peter, he suggested that creating additional collections would add unnecessary complexity. Instead, he advised extending the information within MongoDB itself. Although I initially found this feedback a bit disappointing because I had worked hard to create additional collections, I realise that simplifying the architecture would benefit the entire project in the long run. His advice made me reflect on the importance of seeking guidance early to avoid wasted effort.

Apart from that, I keep refining various commands and removing unnecessary work to streamline the process. Then, I revisit the doing for the commands, I add the necessary item repository function so that they can interact with the database to validate item quantities in the respective stores. After successfully implementing these changes, I update the transfer order MongoDB schema by adding additional information. Then, I continue working on the services. Once the command and undo command functionalities are fully operational, I explore the database to verify what data was being created and updated. During my discussions with Mr. Peter, he suggested separating the logic for items with the same line item to avoid user confusion when processing inputs. Additionally, he advised using the correct repository for database interactions within command and moving some of the logic from the handler to the service layer. Lastly, he also recommended using the updateOne method instead of replaceOne in certain service updates.

Conclusion

In conclusion, there were moments of complexity and setbacks, especially when dealing with architecture adjustments. Despite these challenges, I feel that I’ve made solid progress and tackled significant aspects of the transfer order tasks at hand, even though some remain incomplete.