Progress on Implemented Feature: Developing Get List Query for the entity

Continuing from the previous week, while wrapping up the implementation of a new feature, I encountered an issue stemming from an outdated wrapper that constrained my ability to configure it according to my requirements. To address this, I took the initiative to create a new wrapper tailored specifically for the feature. However, this decision necessitated adding mappings for the new wrapper. As I approached the final mapping for the feature, Mr. Peter noticed that I had been using the wrong service throughout the process. This led to me creating a read operation for the entity’s list using the CQRS pattern. To guide me, Mr. Peter provided a similarly-pattern example from another entity.

I started by making a specific folder for the entity’s Get List Query, initialising the properties query, and creating the List Dto. The Get List Query Handler class that I created later implemented the IRequestHandler interface and took control of handling the request to obtain a list of entities. It used a particular service interface and the IMapper. I followed the example given within the Handle function, but I soon realised that a new service was needed to obtain the entity list because the current service was unable to satisfy the conditions required. Additionally, I also added a new controller responsible for handling GET requests to retrieve a list of entities based on query and also provide Swagger documentation for the API.

My next step involved creating a new service exclusively for retrieving the entity’s list. Initially, I designed a straightforward query to retrieve the list without any specific conditions. Nevertheless, I made sure the methods were implemented asynchronously.  By implementing these methods in an asynchronous manner, I ensure that the retrieval operations can be performed efficiently and non-blocking. This enables better scalability and responsiveness in the application, especially when dealing with a large number of entities or concurrent requests. To validate the correctness of my implementation, I incorporated unit tests that verified successful scenarios for Read List methods. These tests employed a client to emulate HTTP requests and validate the returned status codes and data.

With the foundational work on the backend completed, I shifted my focus to the UI to confirm that data was being transmitted correctly as intended. After some debugging, I successfully verified its functionality and the data was passing. However, the week concluded, and in the upcoming week, my priority is to ensure that the query for retrieving the list functions flawlessly before I can proceed to the next task.

Leave a Reply