Skip to content

API changes to allow class deletion #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danhalson opened this issue Mar 18, 2025 · 1 comment
Open

API changes to allow class deletion #529

danhalson opened this issue Mar 18, 2025 · 1 comment
Labels

Comments

@danhalson
Copy link
Contributor

danhalson commented Mar 18, 2025

There is an existing destroy method on SchoolClassesController, but this does not meet our requirements so will need changing (along with the associated tests).

The following changes are needed to meet the requirements:

  • Add a migration inserting a deleted_at field with a timestamp to the school_classes table (see rejected_at on the schools table as an example)
  • Update SchoolClassesController:destroy to implement a soft (logical) delete, utilising the deleted_at field, this should be null by default
  • Update abilities:
    • Owners can delete a single class created by any user
    • Teachers can delete a single class that they have teacher permission for
    • Exclude classes where the deleted_at flag is non null, to prevent deleted classes being returned anywhere in the api
  • Tests
@danhalson danhalson added the API label Mar 18, 2025
@MFarringtonRPF
Copy link

@danhalson to break this backend sub-issue into 2 after refinement.

@danhalson danhalson changed the title Backend changes to allow class deletion API changes to allow class deletion Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants