CADELmx / GPD_BACKEND

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

Added validations to PartialTemplate CRUD #24

Closed elisa242003 closed 2 months ago

elisa242003 commented 2 months ago

Overview

This pull request implements the functionalities for the ParcialTemplate. It includes a filter to search by state, restrictions to assign hours depending on the state and also includes validations for all registration and update fields, and validations of id - foreign keys.

Changes

Details

  1. Partial Template Controller

    • create(): Handles POST requests to create new partial template.
    • findAll(): Handles GET requests to retrieve all partial templates.
    • findOne(): Handles GET requests to retrieve partial template by ID.
    • update(): Handles PATCH requests to update a partial template by ID.
    • delete(): Remove a partial template by ID.
  2. Partial Template Service

    • create(): Validates and creates a new partial template.
    • findAll(): Validates and recovers all partial templates, optionally be filtered by status.
    • findOne(): Validates and retrieves a partial template by ID, verifying that it exists.
    • update(): Validates and updates the information of a partial template by ID.
    • remove(): Remove a partial template by ID.
    • validateId(): Validate the id, to know if it exists.
    • validateForeignKeys(): Validate the existence of templateId.
    • validateTotalByPosition(): Validate the total entered with respect to the position.
  3. DTOs

    • CreatePartialTemplate(): Defines the data structure to create a Partial Template. Including the type of data you expect, to implement data validation.
    • UpdatePartialTemplate(): Defines the data structure to update a Partial Template. Including the type of data you expect, to implement data validation.
  4. JSDoc Documentation

    • Added detailed documentation to all methods and classes in the PartialTemplateController and PartialTemplateService 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

DiegoSHS commented 2 months ago

Pretty good update, waiting for my colaborator @coby111 to perform his Review