Skip to content

implement removeById method to delete a task by ID, update related tests and swaps void to boolean from baseDAO.#32

Merged
pedr0limpio merged 1 commit intomainfrom
5-implement-the-deletebyidint-id-method-to-delete-a-task
Jun 27, 2025
Merged

implement removeById method to delete a task by ID, update related tests and swaps void to boolean from baseDAO.#32
pedr0limpio merged 1 commit intomainfrom
5-implement-the-deletebyidint-id-method-to-delete-a-task

Conversation

@silrenan
Copy link
Copy Markdown
Collaborator

@silrenan silrenan commented May 28, 2025

  • Added implementation for deleteById in TaskResource and MySQLDAO to allow deleting tasks by ID.
  • deleteById now returns a user-friendly message indicating if the task was deleted or not found.
  • Updated MySQLDAO.removeById to return a boolean indicating if a task was actually deleted.
  • Added and fixed unit tests in TaskResourceTest to cover successful deletion, not found, and exception scenarios.
  • Ensured structural austerity for said changes as Maintainability is enshrined as a first principle, thus being ultimate junior-friendly, for added quality predicate stewardship.
  • Closes Implement the deleteById(int id) method to delete a task. #5

@silrenan silrenan requested a review from pedr0limpio May 28, 2025 18:10
@silrenan silrenan linked an issue May 28, 2025 that may be closed by this pull request
@silrenan silrenan self-assigned this May 28, 2025
@silrenan
Copy link
Copy Markdown
Collaborator Author

silrenan commented May 28, 2025

✅ builds and passes tests
✅ deletes from database via insomnia

@silrenan
Copy link
Copy Markdown
Collaborator Author

linked to issue #5

@silrenan silrenan added the enhancement New feature or request label Jun 2, 2025
@silrenan silrenan force-pushed the 5-implement-the-deletebyidint-id-method-to-delete-a-task branch from 0a02195 to 03baca4 Compare June 4, 2025 13:42
@Mutation
@Transactional
public void deleteById(int id) { //TODO[#5]: Implement the deleteById(int id) method to delete a task.
public String deleteById(int id) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The String return type is an anti-pattern in this specific case. I'll approve it anyway. Everything else is fine. Let's create an issue to implement the best practices for API design with GraphQL later.

…sts and swaps void to boolean from baseDAO.

Signed-off-by: silrenan <75952546+silrenan@users.noreply.github.com>renan <75952546+silrenan@users.noreply.github.com>
@pedr0limpio pedr0limpio force-pushed the 5-implement-the-deletebyidint-id-method-to-delete-a-task branch from 03baca4 to 5a02351 Compare June 27, 2025 18:34
@pedr0limpio pedr0limpio merged commit b2713a2 into main Jun 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the deleteById(int id) method to delete a task.

2 participants