Skip to content

[9494] Add restriction to API for updating trainees who hold QTS/EYTS or withdrawn#6063

Merged
Reyko merged 8 commits intomainfrom
9494-add-restriction-to-api-for-updating-trainees-who-hold-qts-eyts
Apr 8, 2026
Merged

[9494] Add restriction to API for updating trainees who hold QTS/EYTS or withdrawn#6063
Reyko merged 8 commits intomainfrom
9494-add-restriction-to-api-for-updating-trainees-who-hold-qts-eyts

Conversation

@Reyko
Copy link
Copy Markdown
Contributor

@Reyko Reyko commented Apr 1, 2026

Context

9494-add-restriction-to-api-for-updating-trainees-who-hold-qts-eyts

Changes proposed in this pull request

Prevent updates if the trainee is in recommended_for_award, withdrawn or awarded state, via:

  • PUT|PATCH /trainees/{trainee_id}
  • PUT|PATCH /trainees/{trainee_id}/placements/{placement_id}
  • PUT|PATCH /trainees/{trainee_id}/degrees/{degree_id}
  • DELETE /trainees/{trainee_id}/placements/{placement_id}
  • DELETE /trainees/{trainee_id}/degrees/{degree_id}
  • POST /trainees/{trainee_id}/placements
  • POST /trainees/{trainee_id}/degrees

Guidance to review

Important business

  • Does this PR introduce any PII fields that need to be overwritten or deleted in db/scripts/sanitise.sql?
  • Does this PR change the database schema? If so, have you updated the config/analytics.yml file and considered whether you need to send 'import_entity' events?
  • Do we need to send any updates to TRS as part of the work in this PR?
  • Does this PR need an ADR?

NB: Please notify the #twd_data_insights team and ask for a review if new fields are being added to analytics.yml

@Reyko Reyko force-pushed the 9494-add-restriction-to-api-for-updating-trainees-who-hold-qts-eyts branch from 878715e to c887e26 Compare April 1, 2026 08:26
@Reyko Reyko added the deploy label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Review app for PR pr-6063 was deleted

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.54%. Comparing base (4b129e9) to head (c887e26).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6063   +/-   ##
=======================================
  Coverage   96.53%   96.54%           
=======================================
  Files         842      843    +1     
  Lines       18757    18774   +17     
=======================================
+ Hits        18108    18125   +17     
  Misses        649      649           
Flag Coverage Δ
unittests 96.54% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Reyko Reyko force-pushed the 9494-add-restriction-to-api-for-updating-trainees-who-hold-qts-eyts branch from c887e26 to 52610f9 Compare April 1, 2026 09:29
@Reyko Reyko marked this pull request as ready for review April 1, 2026 09:29
Copy link
Copy Markdown
Contributor

@tomtrentham tomtrentham left a comment

Choose a reason for hiding this comment

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

Nice implementation and tidy-up too. A couple of comments mostly around the docs 📜

Comment thread app/controllers/concerns/api/trainee_state_restriction.rb Outdated
Comment thread tech_docs/source/api-docs/release-notes.html.md Outdated
Comment thread tech_docs/source/api-docs/release-notes.html.md Outdated
@tomtrentham
Copy link
Copy Markdown
Contributor

@Reyko Reyko changed the title [9494] Add restriction to API for updating trainees who hold QTS/EYTS [9494] Add restriction to API for updating trainees who hold QTS/EYTS or withdrawn Apr 2, 2026
@Reyko Reyko force-pushed the 9494-add-restriction-to-api-for-updating-trainees-who-hold-qts-eyts branch from 2b1d890 to f96c390 Compare April 2, 2026 13:32
Copy link
Copy Markdown
Contributor

@tomtrentham tomtrentham left a comment

Choose a reason for hiding this comment

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

One minor markdown tweak, otherwise all good.

Comment thread tech_docs/source/api-docs/release-notes.html.md Outdated
@tomtrentham
Copy link
Copy Markdown
Contributor

Co-authored-by: Tom Trentham <1910056+tomtrentham@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@Reyko Reyko merged commit f548170 into main Apr 8, 2026
36 of 37 checks passed
@Reyko Reyko deleted the 9494-add-restriction-to-api-for-updating-trainees-who-hold-qts-eyts branch April 8, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants