SpringBoardMentor114 / SpendWise

MIT License
2 stars 1 forks source link

Backend End: Category Management APIs #26

Open SpringBoardMentor114 opened 5 months ago

SpringBoardMentor114 commented 5 months ago

Acceptance Criteria:

  1. Insert new Category -> Validate if there is no existing category already present with the same name.
  2. Update new Category -> Validate if there is no duplication happening because of the edit and give an error response accordingly.
  3. Delete Category -> If any expense is already mapped with this category, don't allow the deletion and give the error response accordingly.
kunaldhondge commented 5 months ago

Here's a summary of the work completed and the remaining tasks:

  1. Insert new Category: Implemented validation to ensure no existing category with the same name is present before inserting a new category.
  2. Update Category: Implemented validation to prevent duplication resulting from category updates. This ensures that no duplicate categories are created due to edits.
  3. Delete Category (pending): Pending completion. Waiting for the expenses management backend to be finalized before implementing validation to prevent category deletion if any expenses are already mapped to the category.

Once the expenses management backend is completed, I'll integrate the necessary validation checks to prevent deletion of categories with associated expenses.

SpringBoardMentor114 commented 5 months ago

For deletion, use dummy data/expect dummy data and the code can be completed.

kunaldhondge commented 4 months ago

Implemented the category deletion functionality.

  1. Added validation to prevent deletion if expenses are associated with the category.
    • If any expense is already mapped with the category, deletion is not allowed.
    • Return an appropriate error response if deletion is attempted for a category with associated expenses.
  2. Tested the endpoint using Postman and ensured correct error handling.