CADELmx / GPD_BACKEND

This is a NESTjs project that implements the GPD project's backend logic
MIT License
1 stars 0 forks source link

CRUD Implementation for Areas with DTO and JSDoc Documentation #26

Closed coby111 closed 2 months ago

coby111 commented 2 months ago

Overview

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

Details

  1. 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.
  2. 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.
  3. CreateAreaDto

    • name: Validates that the name field is a non-empty string.
  4. UpdateAreaDto

    • name: Validates that the name field is a non-empty string.
  5. JSDoc Documentation

    • Added detailed documentation to all methods and classes in the AreasService and AreasController for better understanding and maintenance.

Related Issues

Thank you for reviewing this pull request. I look forward to your feedback.

github-actions[bot] commented 2 months ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files