This pull request implements the complete CRUD (Create, Read, Update, Delete) functionalities for the AreasService and AreasController modules. It includes the creation of new code to handle all CRUD operations related to areas, alongside the addition of DTOs for data validation and comprehensive JSDoc documentation for better understanding and maintenance.
Changes
Service: Added AreasService to handle CRUD operations for areas.
Controller: Added AreasController to handle HTTP requests related to areas.
DTOs: Added CreateAreaDto and UpdateAreaDto for validating input data.
Documentation: Added JSDoc documentation at the code level for better understanding and maintenance.
Details
AreasService
create(): Creates a new area.
findAll(): Retrieves all areas.
findOneById(): Retrieves an area by its ID.
findOneByName(): Retrieves areas matching a given name.
update(): Updates an area by its ID.
remove(): Deletes an area by its ID.
validateIfExistsAreaId(): Validates if an area exists by its ID.
AreasController
create(): Handles POST requests to create a new area.
find(): Handles GET requests to retrieve areas by ID or name, or all areas if no query parameters are provided.
update(): Handles PATCH requests to update an area by its ID.
remove(): Handles DELETE requests to delete an area by its ID.
CreateAreaDto
name: Validates that the name field is a non-empty string.
UpdateAreaDto
name: Validates that the name field is a non-empty string.
JSDoc Documentation
Added detailed documentation to all methods and classes in the AreasService and AreasController for better understanding and maintenance.
Related Issues
Closes #21
Thank you for reviewing this pull request. I look forward to your feedback.
Overview
This pull request implements the complete CRUD (Create, Read, Update, Delete) functionalities for the
AreasService
andAreasController
modules. It includes the creation of new code to handle all CRUD operations related to areas, alongside the addition of DTOs for data validation and comprehensive JSDoc documentation for better understanding and maintenance.Changes
AreasService
to handle CRUD operations for areas.AreasController
to handle HTTP requests related to areas.CreateAreaDto
andUpdateAreaDto
for validating input data.Details
AreasService
create()
: Creates a new area.findAll()
: Retrieves all areas.findOneById()
: Retrieves an area by its ID.findOneByName()
: Retrieves areas matching a given name.update()
: Updates an area by its ID.remove()
: Deletes an area by its ID.validateIfExistsAreaId()
: Validates if an area exists by its ID.AreasController
create()
: Handles POST requests to create a new area.find()
: Handles GET requests to retrieve areas by ID or name, or all areas if no query parameters are provided.update()
: Handles PATCH requests to update an area by its ID.remove()
: Handles DELETE requests to delete an area by its ID.CreateAreaDto
name
: Validates that the name field is a non-empty string.UpdateAreaDto
name
: Validates that the name field is a non-empty string.JSDoc Documentation
AreasService
andAreasController
for better understanding and maintenance.Related Issues
Thank you for reviewing this pull request. I look forward to your feedback.