Skip to content

Conversation

@eiresendez
Copy link
Contributor

@eiresendez eiresendez commented Jan 9, 2026

Issue & Reproduction Steps

Admins need an API endpoint to delete Cases and their related Requests, as described in the product document. The absence of this endpoint forces manual cleanup and can leave inconsistent data.

Solution

  • Introduce a REST endpoint to delete a Case and all related Requests.
  • Ensure the operation removes dependent records tied to the case (core records first, dependencies later).
  • Enforce token-based access, and return proper HTTP statuses (204 success, 404 missing case, 401 unauthenticated, 409/500 on failures).
  • Keep the controller implementation clean and aligned with ProcessMaker API conventions.

How to Test

  • With a valid API token, call DELETE /api/1.0/cases/{case_number} for an existing case and verify it is no longer retrievable.
  • Call the same endpoint for a non-existent case and verify 404 is returned.
  • Verify that all requests linked to the case are removed and no orphaned records remain.

Related Tickets & Packages


Note

Adds a transactional case-deletion API and supporting cleanup across related data.

  • New DELETE /cases/{case_number} in CaseController@destroy delegates to Actions/Cases/DeleteCase
  • DeleteCase performs cascading deletes for process_requests, process_request_tokens, locks, scheduled tasks, inbox rules/logs, ABE tokens, task drafts and their media, request media, comments (soft delete), case_numbers, cases_started, cases_participated, and optional ellucian_ethos_sync_global_task_list
  • Route registered in routes/api.php; controller methods typehinted/return types added
  • InboxRule deletion now guards savedSearch() call with class_exists
  • New/updated factories to support testing; comprehensive feature tests validate 204/404 and data cleanup

Written by Cursor Bugbot for commit 350548b. This will update automatically on new commits. Configure here.

@eiresendez eiresendez marked this pull request as ready for review January 12, 2026 18:45
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 21

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link
Contributor

@mcraeteisha mcraeteisha left a comment

Choose a reason for hiding this comment

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

Approved! Endpoint behaves as expected; tests pass.

@eiresendez eiresendez merged commit 5172685 into epic/FOUR-28600 Jan 12, 2026
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants