Skip to content

feat(GAT-0000): add write endpoints for project grants and cancer type filters - #1892

Open
cocoon02 wants to merge 1 commit into
HDRUK:devfrom
cocoon02:feat/project-grant-cancer-type-filter-crud
Open

cocoon02 wants to merge 1 commit into
HDRUK:devfrom
cocoon02:feat/project-grant-cancer-type-filter-crud

Conversation

@cocoon02

Copy link
Copy Markdown
Collaborator

Allow custodians to update and delete these records, with cancer type filter changes gated by dedicated permissions.

Screenshots (if relevant)

Describe your changes

Project grants and cancer type filters can now be updated and deleted through the API, not only listed and created.

Project grants

PUT /api/v1/project_grants/{id} replaces the grant and stores a new version.
PATCH /api/v1/project_grants/{id} updates only the fields sent, on the latest version.
DELETE /api/v1/project_grants/{id} soft-deletes the grant and its versions.
Create, update, edit, and delete now go through ProjectGrantService.
Write routes use the existing project_grants.create, project_grants.update, and project_grants.delete permissions, and the controller still checks that the caller belongs to the grant's team.

Cancer type filters

POST, PUT, PATCH, and DELETE were added on /api/v1/cancer-type-filters.
level is derived from the parent. Moving a filter recalculates levels for its descendants, and a filter cannot be moved under itself or one of its descendants.
Deleting a filter also deletes its descendants.
New permissions cancer_type_filters.read, create, update, and delete are seeded and granted to custodian.team.admin, custodian.metadata.manager, and custodian.dar.manager. hdruk.superadmin already receives every permission. A migration adds the same permissions on existing databases.
GET list and show stay public.

Issue ticket link

Environment / Configuration changes (if applicable)

Requires migrations being run?

If not using the pre-push hook. Confirm tests pass:

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added appropriate unit tests
  • I have created mocks for unit tests (where appropriate)
  • I have added appropriate Behat tests to confirm AC (if applicable)
  • I have added Swagger annotations for new endpoints (if applicable)
  • I have added audit logs for new operation logic (if applicable)
  • I have added new environment variables to the .env.example file (if applicable)
  • I have added new environment variables to terraform repository (if applicable)

Allow custodians to update and delete these records, with cancer type filter changes gated by dedicated permissions.
@gh-actions-pipelines-app

Copy link
Copy Markdown

🎉 Great job! Your PR title follows the correct format. 🚀

@cocoon02
cocoon02 requested review from calmacx and spco October 28, 2026 13:15

This branch had an error being deployed

1 failed deployment
dev — 8002d17a Deployed Oct 28, 2026 by cocoon02 via test #6990
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.

1 participant