Skip to content

API changes to allow class deletion #529

Open
@danhalson

Description

@danhalson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions